A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/1218 below:

[java] LooseCoupling false-positive with methods only available on concrete collection class · Issue #1218 · pmd/pmd · GitHub

Not exactly sure if this is a false-positive, but it is strange.

private final LinkedList<String> list = new LinkedList<>();
...
Iterator<String> descendingIterator = list.descendingIterator();
String value = list.getLast();

Technically, the rule is correct. However, the List interface doesn't have descendingIterator, neither does it have getLast and some other useful methods. I guess that when such methods are used, this warning should be disabled? Or do you think that this is bad design nonetheless and people should try to use other methods that are in the interface to simulate those (that certainly is possible, however more inconvenient)? I'm interested on more opinions.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4