summaryrefslogtreecommitdiff
path: root/java/junit-toolkit/src
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2010-09-12 22:40:40 +0000
committerRobert Godfrey <rgodfrey@apache.org>2010-09-12 22:40:40 +0000
commitb2121822d362463b22124da58f8c760d1149959f (patch)
tree2ddab287f32837766db005bc077f15cb6b608af7 /java/junit-toolkit/src
parent9240fc138b26b4d334f7f6000208924385e9463d (diff)
downloadqpid-python-b2121822d362463b22124da58f8c760d1149959f.tar.gz
QPID-2857 : Address issues found by running FindBugs against the Java codebase
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@996393 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/junit-toolkit/src')
-rw-r--r--java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestDecorator.java27
-rw-r--r--java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ParameterVariationTestDecorator.java27
2 files changed, 30 insertions, 24 deletions
diff --git a/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestDecorator.java b/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestDecorator.java
index 4faa58688f..8869d25be3 100644
--- a/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestDecorator.java
+++ b/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestDecorator.java
@@ -136,24 +136,27 @@ public class AsymptoticTestDecorator extends WrappedSuiteTestDecorator
log.debug("params = " + ((params == null) ? null : MathUtils.printArray(params)));
log.debug("repeat = " + repeat);
- for (int n : params)
+ if(params != null)
{
- for (int j = 0; j < repeat; j++)
+ for (int n : params)
{
- log.debug("n = " + n);
+ for (int j = 0; j < repeat; j++)
+ {
+ log.debug("n = " + n);
- // Set the integer parameter in the TKTestResult to be passed to the tests.
- tkResult.setN(n);
+ // Set the integer parameter in the TKTestResult to be passed to the tests.
+ tkResult.setN(n);
- if (tkResult.shouldStop())
- {
- log.debug("tkResult.shouldStop = " + true);
+ if (tkResult.shouldStop())
+ {
+ log.debug("tkResult.shouldStop = " + true);
- break;
- }
+ break;
+ }
- log.debug("Calling super#run");
- super.run(tkResult);
+ log.debug("Calling super#run");
+ super.run(tkResult);
+ }
}
}
}
diff --git a/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ParameterVariationTestDecorator.java b/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ParameterVariationTestDecorator.java
index 2c207635c7..7da4667928 100644
--- a/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ParameterVariationTestDecorator.java
+++ b/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ParameterVariationTestDecorator.java
@@ -138,24 +138,27 @@ public class ParameterVariationTestDecorator extends WrappedSuiteTestDecorator
log.debug("params = " + ((params == null) ? null : MathUtils.printArray(params)));
log.debug("repeat = " + repeat);
- for (int n : params)
+ if(params != null)
{
- for (int j = 0; j < repeat; j++)
+ for (int n : params)
{
- log.debug("n = " + n);
+ for (int j = 0; j < repeat; j++)
+ {
+ log.debug("n = " + n);
- // Set the integer parameter in the TKTestResult to be passed to the tests.
- tkResult.setN(n);
+ // Set the integer parameter in the TKTestResult to be passed to the tests.
+ tkResult.setN(n);
- if (tkResult.shouldStop())
- {
- log.debug("tkResult.shouldStop = " + true);
+ if (tkResult.shouldStop())
+ {
+ log.debug("tkResult.shouldStop = " + true);
- break;
- }
+ break;
+ }
- log.debug("Calling super#run");
- super.run(tkResult);
+ log.debug("Calling super#run");
+ super.run(tkResult);
+ }
}
}
}