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