In " microbat.tracerecov.executionsimulator.ExecutionSimulator.estimateComplication( )", we have the input:
codeLine: ans.add(i + 1);
rootVar: { "java.util.ArrayList | ans" : "[0]" }
targetVarName: size
invokedMethods:
java.lang.Integer#valueOf(I)Ljava/lang/Integer;
java.util.List#add(Ljava/lang/Object;)Z
but it seems that this method (estimateComplication( )) only checks the first item of invokedMethods which is "java.lang.Integer#valueOf(I)Ljava/lang/Integer;" and return "GUARANTEE_NO_WRITE" after executing " candidateVarVerifier.getVarWriteStatus("size", "java.lang.Integer") ".
Besides, when we check the method "java.util.List#add(Ljava/lang/Object;)Z" ("List" instead of "ArrayList"), the cfg will not be constructed ( cfg == null ) and the method returns "NO_GUARANTEE".
Possible solutions
Consider all invoked methods
GUARANTEE_WRITE has the highest priority which means if there is a method leads to GUARANTEE_WRITE , the result is GUARANTEE_WRITE .
And probably GUARANTEE_WRITE > NO_GUARANTEE > GUARANTEE_NO_WRITE.
Transfer from base class to derived class to successfully construct cfg ("List" --> "ArrayList").
Observation
In " microbat.tracerecov.executionsimulator.ExecutionSimulator.estimateComplication( )", we have the input:
but it seems that this method (estimateComplication( )) only checks the first item of invokedMethods which is "java.lang.Integer#valueOf(I)Ljava/lang/Integer;" and return "GUARANTEE_NO_WRITE" after executing " candidateVarVerifier.getVarWriteStatus("size", "java.lang.Integer") ".
Besides, when we check the method "java.util.List#add(Ljava/lang/Object;)Z" ("List" instead of "ArrayList"), the cfg will not be constructed ( cfg == null ) and the method returns "NO_GUARANTEE".
Possible solutions