Skip to content

Commit

Permalink
Fix JENKINS-11908
Browse files Browse the repository at this point in the history
  • Loading branch information
gboissinot committed Dec 1, 2011
1 parent 635ccc2 commit 85851de
Showing 1 changed file with 22 additions and 8 deletions.
Expand Up @@ -56,14 +56,6 @@ public String getFailureNewThreshold() {
return failureNewThreshold;
}

protected int convertToInteger(String threshold) {
return Integer.parseInt(threshold);
}

protected boolean isValid(String threshold) {
return true;
}

public abstract Result getResultThreshold(XUnitLog log,
AbstractBuild<?, ?> build,
TestResultAction testResultAction,
Expand Down Expand Up @@ -100,4 +92,26 @@ public Result getResultThreshold(XUnitLog log,
return Result.SUCCESS;

}

private int convertToInteger(String threshold) {
return Integer.parseInt(threshold);
}

private boolean isValid(String threshold) {
if (threshold == null) {
return false;
}

if (threshold.trim().length() == 0) {
return false;
}

try {
Integer.parseInt(threshold);
} catch (NumberFormatException nfe) {
return false;
}

return true;
}
}

0 comments on commit 85851de

Please sign in to comment.