forked from phoedos/pmd
[java] LawOfDemeter - remove reversed sorting
This commit is contained in:
@ -305,7 +305,7 @@ public class LawOfDemeterRule extends AbstractJavaRule {
|
|||||||
return reaching.getReaching().stream()
|
return reaching.getReaching().stream()
|
||||||
// sort the assignments to have a deterministic result. We need to call #foreignDegree always
|
// sort the assignments to have a deterministic result. We need to call #foreignDegree always
|
||||||
// in the same order, to get the same computed degrees.
|
// in the same order, to get the same computed degrees.
|
||||||
.sorted(Comparator.comparing(AssignmentEntry::getLocation, Node.COORDS_COMPARATOR).reversed())
|
.sorted(Comparator.comparing(AssignmentEntry::getLocation, Node.COORDS_COMPARATOR))
|
||||||
.mapToInt(this::foreignDegree).max().orElse(TRUSTED);
|
.mapToInt(this::foreignDegree).max().orElse(TRUSTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1194,8 +1194,8 @@ public final class ControlEvent {
|
|||||||
<expected-problems>2</expected-problems>
|
<expected-problems>2</expected-problems>
|
||||||
<expected-linenumbers>15,17</expected-linenumbers>
|
<expected-linenumbers>15,17</expected-linenumbers>
|
||||||
<expected-messages>
|
<expected-messages>
|
||||||
<message>Access to field `left` on foreign value `p` (degree 1)</message>
|
<message>Access to field `left` on foreign value `p` (degree 2)</message>
|
||||||
<message>Access to field `right` on foreign value `p` (degree 2)</message>
|
<message>Access to field `right` on foreign value `p` (degree 1)</message>
|
||||||
</expected-messages>
|
</expected-messages>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
class LawOfDemeterFields {
|
class LawOfDemeterFields {
|
||||||
|
Reference in New Issue
Block a user