diff --git a/src/main/java/org/bench4q/agent/parameterization/impl/Para_IteratorNumber.java b/src/main/java/org/bench4q/agent/parameterization/impl/Para_IteratorNumber.java index a696f7d9..e4d42743 100644 --- a/src/main/java/org/bench4q/agent/parameterization/impl/Para_IteratorNumber.java +++ b/src/main/java/org/bench4q/agent/parameterization/impl/Para_IteratorNumber.java @@ -1,24 +1,29 @@ package org.bench4q.agent.parameterization.impl; +import java.util.Map; import java.util.UUID; public class Para_IteratorNumber { public Long iteratorNum = new Long(0); - - public String getIteratorNumber(UUID id) - { + + /** + * For all methods, they will has these two params + * + * @param id + * @param a + * @return + */ + public String getIteratorNumber(UUID id, Map a) { long result = 0; - synchronized(iteratorNum) - { + synchronized (iteratorNum) { iteratorNum++; result = iteratorNum; } String ret = String.valueOf(result); return ret; } - - public void unreg(UUID id) - { - + + public void unreg(UUID id) { + } } diff --git a/src/main/java/org/bench4q/agent/parameterization/impl/ParameterizationParser.java b/src/main/java/org/bench4q/agent/parameterization/impl/ParameterizationParser.java index 66a1837b..32e4d513 100644 --- a/src/main/java/org/bench4q/agent/parameterization/impl/ParameterizationParser.java +++ b/src/main/java/org/bench4q/agent/parameterization/impl/ParameterizationParser.java @@ -32,10 +32,10 @@ public class ParameterizationParser { result = insCon.getParameterByContext(name); if (result != null) return result; - if (type == "crossThread") { + if (type.equals("crossThread")) { result = insCon.getParameter(name, getCurrentPackageFullName() + "." + className, methodName, args); - } else if (type == "inThread") { + } else if (type.equals("inThread")) { result = insCon.instanceLevelGetParameter(name, className, methodName, args); } diff --git a/src/test/java/org/bench4q/agent/test/parameterization/Test_ParameterizationParser.java b/src/test/java/org/bench4q/agent/test/parameterization/Test_ParameterizationParser.java index 7e8d1531..f4140855 100644 --- a/src/test/java/org/bench4q/agent/test/parameterization/Test_ParameterizationParser.java +++ b/src/test/java/org/bench4q/agent/test/parameterization/Test_ParameterizationParser.java @@ -2,8 +2,6 @@ package org.bench4q.agent.test.parameterization; import static org.junit.Assert.assertEquals; -import java.util.UUID; - import org.bench4q.agent.parameterization.impl.InstanceControler; import org.bench4q.agent.parameterization.impl.ParameterizationParser; import org.bench4q.share.helper.TestHelper; @@ -22,9 +20,8 @@ public class Test_ParameterizationParser { public void testParse() { ParameterizationParser parameterParser = new ParameterizationParser(); String result = parameterParser.parse( - "", - new InstanceControler()); + "", new InstanceControler()); System.out.println(result); } }