Skip to content

Commit

Permalink
isEmpty instead of size
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Nov 17, 2023
1 parent ff0fc30 commit c53fd03
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ public boolean save(Resource resource) throws IOException {
}

protected boolean precondition(Resource resource) {
return validationRunner.validate(resource, issueReporter).size() == 0;
return validationRunner.validate(resource, issueReporter).isEmpty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class DialogErrorReporter implements IssueReporter {
public List<Diagnostic> report(Diagnostic diagnostic) {
List<Diagnostic> errors = Lists.newArrayList(diagnosticUtil.errors(diagnostic));

if (errors.size() > 0) {
if (!errors.isEmpty()) {
DiagnosticDialog.open(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Validation Errors",
"Problems encountered during validation", diagnostic, Diagnostic.ERROR);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected String eventsToString() {

public void assertEmpty() {
Assert.assertTrue("Found messages: " + eventsToString(),
logListener.getEvents().size() == 0
logListener.getEvents().isEmpty()
);
}

Expand Down

0 comments on commit c53fd03

Please sign in to comment.