Skip to content

Commit

Permalink
Optimize SpoonTestMethod getters. (#75)
Browse files Browse the repository at this point in the history
Yields ~50% cpu time reduction in the flacoco process.

Signed-off-by: André Silva <[email protected]>
  • Loading branch information
andre15silva authored Aug 2, 2021
1 parent ddfef0a commit 3933f59
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ public class SpoonTestMethod implements TestMethod {

private CtType<?> testClassModel;

private String fullyQualifiedClassName;

private CtMethod<?> testMethodModel;

private String fullyQualifiedMethodName;

public SpoonTestMethod(CtType<?> testClassModel, CtMethod<?> testMethodModel) {
this.testClassModel = testClassModel;
this.testMethodModel = testMethodModel;
this.fullyQualifiedClassName = testClassModel.getQualifiedName();
this.fullyQualifiedMethodName = fullyQualifiedClassName + "#" + testMethodModel.getSimpleName();
}

public CtType<?> getTestClassModel() {
Expand All @@ -31,11 +37,11 @@ public CtMethod<?> getTestMethodModel() {
}

public String getFullyQualifiedClassName() {
return testClassModel.getQualifiedName();
return fullyQualifiedClassName;
}

public String getFullyQualifiedMethodName() {
return testClassModel.getQualifiedName() + "#" + testMethodModel.getSimpleName();
return fullyQualifiedMethodName;
}

@Override
Expand Down

0 comments on commit 3933f59

Please sign in to comment.