Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing squid:UselessParenthesesCheck-Useless parentheses around expressions should be removed to prevent any misunderstanding #36

Merged
merged 1 commit into from Feb 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/hudson/tasks/junit/CaseResult.java
Expand Up @@ -307,7 +307,7 @@ public float getDuration() {
if(!Character.isJavaIdentifierPart(ch))
buf.setCharAt(i,'_');
}
Collection<CaseResult> siblings = (classResult ==null ? Collections.<CaseResult>emptyList(): classResult.getChildren());
Collection<CaseResult> siblings = classResult ==null ? Collections.<CaseResult>emptyList(): classResult.getChildren();
return safeName = uniquifyName(siblings, buf.toString());
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/hudson/tasks/junit/ClassResult.java
Expand Up @@ -59,7 +59,7 @@ public final class ClassResult extends TabulatedResult implements Comparable<Cla

@Override
public Run<?, ?> getRun() {
return (parent==null ? null: parent.getRun());
return parent==null ? null: parent.getRun();
}

public PackageResult getParent() {
Expand Down Expand Up @@ -143,7 +143,7 @@ public List<CaseResult> getChildren() {
}

public boolean hasChildren() {
return ((cases != null) && (cases.size() > 0));
return (cases != null) && (cases.size() > 0);
}

// TODO: wait for stapler 1.60 @Exported
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/hudson/tasks/junit/PackageResult.java
Expand Up @@ -56,7 +56,7 @@ public final class PackageResult extends MetaTabulatedResult implements Comparab

@Override
public Run<?,?> getRun() {
return (parent == null ? null : parent.getRun());
return parent == null ? null : parent.getRun();
}

public hudson.tasks.junit.TestResult getParent() {
Expand All @@ -73,7 +73,7 @@ public synchronized String getSafeName() {
if (safeName != null) {
return safeName;
}
Collection<PackageResult> siblings = (parent == null ? Collections.EMPTY_LIST : parent.getChildren());
Collection<PackageResult> siblings = parent == null ? Collections.EMPTY_LIST : parent.getChildren();
return safeName = uniquifyName(
siblings,
safe(getName()));
Expand Down Expand Up @@ -167,7 +167,7 @@ public Collection<ClassResult> getChildren() {
@Override
public boolean hasChildren() {
int totalTests = passCount + failCount + skipCount;
return (totalTests != 0);
return totalTests != 0;
}

/**
Expand Down Expand Up @@ -254,7 +254,7 @@ public List<CaseResult> getSkippedTests() {
*/
@Override
public boolean isPassed() {
return (failCount == 0 && skipCount == 0);
return failCount == 0 && skipCount == 0;
}

void add(CaseResult r) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/hudson/tasks/junit/TestResult.java
Expand Up @@ -163,7 +163,7 @@ public void parse(long buildTime, File baseDir, String[] reportFiles) throws IOE
for (String value : reportFiles) {
File reportFile = new File(baseDir, value);
// only count files that were actually updated during this build
if ( (buildTime-3000/*error margin*/ <= reportFile.lastModified())) {
if (buildTime-3000/*error margin*/ <= reportFile.lastModified()) {
parsePossiblyEmpty(reportFile);
parsed = true;
}
Expand Down Expand Up @@ -197,7 +197,7 @@ public void parse(long buildTime, Iterable<File> reportFiles) throws IOException

for (File reportFile : reportFiles) {
// only count files that were actually updated during this build
if ( (buildTime-3000/*error margin*/ <= reportFile.lastModified())) {
if (buildTime-3000/*error margin*/ <= reportFile.lastModified()) {
parsePossiblyEmpty(reportFile);
parsed = true;
}
Expand Down Expand Up @@ -310,7 +310,7 @@ public String getDisplayName() {

@Override
public Run<?,?> getRun() {
return (parentAction == null? null: parentAction.run);
return parentAction == null? null: parentAction.run;
}

@Override
Expand Down Expand Up @@ -531,7 +531,7 @@ public String getErrorDetails() {
*/
@Override
public boolean isPassed() {
return (getFailCount() == 0);
return getFailCount() == 0;
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/hudson/tasks/test/TestObject.java
Expand Up @@ -104,7 +104,7 @@ public String getFullDisplayName() {
public hudson.tasks.junit.TestResult getTestResult() {
TestObject parent = getParent();

return (parent == null ? null : getParent().getTestResult());
return parent == null ? null : getParent().getTestResult();
}

/**
Expand All @@ -113,7 +113,7 @@ public hudson.tasks.junit.TestResult getTestResult() {
public TestResult getTopLevelTestResult() {
TestObject parent = getParent();

return (parent == null ? null : getParent().getTopLevelTestResult());
return parent == null ? null : getParent().getTopLevelTestResult();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/hudson/tasks/junit/JUnitParserTest.java
Expand Up @@ -73,7 +73,7 @@ public boolean perform(AbstractBuild<?, ?> build,
assertTrue("result should be a TestResult", result instanceof hudson.tasks.junit.TestResult);
System.out.println("We passed some assertions in the JUnitParserTestBuilder");
theResult = result;
return (result != null);
return result != null;
}
}

Expand Down