You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We now analyze enum classes static initializers as many others - with a complete analysis of $VALUES array initialization, static fields for enum constants, ordinal, names, etc. But often this analysis is unnecessary - most of the enums do not have complex logic and could be just extracted from runtime. Such extraction can highly improve performance for methods with enum usage.
Actual behavior
Enum values are not processed concretely, and UtBotJava generate 0 executions for method useEnumInDifficultIf below:
publicintuseEnumInDifficultIf(Strings) {
if ("TRYIF".equalsIgnoreCase(s)) {
finalManyConstantsEnum[] values = ManyConstantsEnum.values();
returnfoo(values[0]);
} else {
finalManyConstantsEnumb = B;
returnfoo(b);
}
}
privateintfoo(ManyConstantsEnume) {
if (e.equals(A)) {
return1;
} else {
return2;
}
}
enumManyConstantsEnum {
A, B, C, D, E, F, G, H, I, J, K
}
Expected behavior:
Simple enums are processed concretely, and 2 executions with 1 and 2 returned values are generated for method useEnumInDifficultIf.
The text was updated successfully, but these errors were encountered:
We now analyze enum classes static initializers as many others - with a complete analysis of $VALUES array initialization, static fields for enum constants, ordinal, names, etc. But often this analysis is unnecessary - most of the enums do not have complex logic and could be just extracted from runtime. Such extraction can highly improve performance for methods with enum usage.
Actual behavior
Enum values are not processed concretely, and UtBotJava generate 0 executions for method
useEnumInDifficultIf
below:Expected behavior:
Simple enums are processed concretely, and 2 executions with 1 and 2 returned values are generated for method
useEnumInDifficultIf
.The text was updated successfully, but these errors were encountered: