Use isEmpty method.

This commit is contained in:
reudismam 2018-02-02 12:28:25 -03:00
parent 7938dcd8c4
commit 7e380e5d98
5 changed files with 6 additions and 6 deletions

View File

@ -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;
}

View File

@ -158,7 +158,7 @@ public class MetricOptions {
MetricOptions build() {
if (opts.size() == 0) {
if (opts.isEmpty()) {
return emptyOptions();
}

View File

@ -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();
}
}

View File

@ -37,7 +37,7 @@ public class MetricFunction implements Function {
String metricKeyName = null;
if (args.size() == 0) {
if (args.isEmpty()) {
throw new IllegalArgumentException(badMetricKeyArgMessage());
}

View File

@ -304,7 +304,7 @@ public class MainDesignerController implements Initializable, SettingsOwner {
private void onFileMenuShowing() {
openRecentMenu.setDisable(recentFiles.size() == 0);
openRecentMenu.setDisable(recentFiles.isEmpty());
}