forked from phoedos/pmd
Use isEmpty method.
This commit is contained in:
parent
7938dcd8c4
commit
7e380e5d98
@ -68,7 +68,7 @@ public class CurrentPath implements Iterable<DataFlowNode> {
|
||||
}
|
||||
|
||||
public boolean isEndNode() {
|
||||
return this.getLast().getChildren().size() == 0;
|
||||
return this.getLast().getChildren().isEmpty();
|
||||
// return inode instanceof StartOrEndDataFlowNode;
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,7 @@ public class MetricOptions {
|
||||
|
||||
|
||||
MetricOptions build() {
|
||||
if (opts.size() == 0) {
|
||||
if (opts.isEmpty()) {
|
||||
return emptyOptions();
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ public class AvoidBranchingStatementAsLastInLoopRule extends AbstractJavaRule {
|
||||
|
||||
public boolean checksNothing() {
|
||||
|
||||
return getProperty(CHECK_BREAK_LOOP_TYPES).size() == 0 && getProperty(CHECK_CONTINUE_LOOP_TYPES).size() == 0
|
||||
&& getProperty(CHECK_RETURN_LOOP_TYPES).size() == 0;
|
||||
return getProperty(CHECK_BREAK_LOOP_TYPES).isEmpty() && getProperty(CHECK_CONTINUE_LOOP_TYPES).isEmpty()
|
||||
&& getProperty(CHECK_RETURN_LOOP_TYPES).isEmpty();
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class MetricFunction implements Function {
|
||||
|
||||
String metricKeyName = null;
|
||||
|
||||
if (args.size() == 0) {
|
||||
if (args.isEmpty()) {
|
||||
throw new IllegalArgumentException(badMetricKeyArgMessage());
|
||||
}
|
||||
|
||||
|
@ -304,7 +304,7 @@ public class MainDesignerController implements Initializable, SettingsOwner {
|
||||
|
||||
|
||||
private void onFileMenuShowing() {
|
||||
openRecentMenu.setDisable(recentFiles.size() == 0);
|
||||
openRecentMenu.setDisable(recentFiles.isEmpty());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user