I'm working on a maven project. The scenario is something like below...
class Test {
public void applyAll() {
....................
....................
Collection<Migratable> applicableUpdates = SomeOtherClass.getApplicableUpdates();
doUpdate(applicableUpdates);
}
@Benchmark
public void apply(Migratable m) {
....................
....................
}
private void doUpdate(Collection<Migratable> applicableUpdates) throws Exception {
for (Migratable m : applicableUpdates) {
try {
apply(m);
} catch (Exception e) {
logger.error("Falid to apply migration {}" + m, e);
throw e;
}
}
}
}
I need to compute how long it takes to execute each migration. Simply I need to compute the execution time of apply(Migratable m) method.
Now, when I build my project using "mvn clean install", build failed and it shows "Method parameters should be @State classes".
Here, parameter comes from another method doUpdate(Collection applicableUpdates) [see the scenario]. So how can I get rid of this error in given scenario?