Details
-
Enhancement
-
Resolution: Fixed
-
P5
-
17
-
None
-
b19
Description
Flipping arguments of 'equals' method, allows simplifying boolean expressions: now we can remove redundant null check before.
Example:
String parent = dir.getParent();
if (parent != null && parent.equals("/net")) {
return true;
}
Can be simplified to:
String parent = dir.getParent();
if ("/net".equals(parent)) {
return true;
}
Example:
String parent = dir.getParent();
if (parent != null && parent.equals("/net")) {
return true;
}
Can be simplified to:
String parent = dir.getParent();
if ("/net".equals(parent)) {
return true;
}