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
Describe the bug
I'm trying to find and invoke methods that are defined within individual enum constants, but I'm unable to locate these methods.
To Reproduce
Steps to reproduce the behavior:
Try to access methods defined in the enum constants
Example code with ToNumberPolicy enum implementing ToNumberStrategy:
publicinterfaceToNumberStrategy {
publicNumberreadNumber(JsonReaderin) throwsIOException;
}
publicenumToNumberPolicyimplementsToNumberStrategy {
DOUBLE {
@OverridepublicDoublereadNumber(JsonReaderin) throwsIOException {
returnin.nextDouble();
}
},
LAZILY_PARSED_NUMBER {
@OverridepublicNumberreadNumber(JsonReaderin) throwsIOException {
returnnewLazilyParsedNumber(in.nextString());
}
},
// Other enum constants with their own implementations...
}
Expected behavior
I expect to be able to find the readNumber method for each enum constant via reflection, as each constant has its own implementation of the method.
Additional context
The issue appears to be that each enum constant is actually an anonymous inner class of ToNumberPolicy.
However, I need to access these methods with codeanalyzer.
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm trying to find and invoke methods that are defined within individual enum constants, but I'm unable to locate these methods.
To Reproduce
Steps to reproduce the behavior:
Example code with
ToNumberPolicy
enum implementingToNumberStrategy
:Expected behavior
I expect to be able to find the
readNumber
method for each enum constant via reflection, as each constant has its own implementation of the method.Additional context
The issue appears to be that each enum constant is actually an anonymous inner class of
ToNumberPolicy
.However, I need to access these methods with codeanalyzer.
The text was updated successfully, but these errors were encountered: