-
Enhancement
-
Resolution: Unresolved
-
P4
-
24
4.10.1.9 contains a lot of discussion and code to accomplish something relatively simple: decide whether a referenced method would resolve to a protected method declared in a superclass, and if so, and ensure the type on the stack is assignable to the current class type.
A few potential simplifications to consider:
- Define a single rule for the relevancy test, and use negation ('\+ foo()') to trivially succeed when all the preconditions aren't met
- Get rid of the 'classesInOtherPkgWithProtectedMember' result list, which never gets used—it's just a search to see if there is at least one match
- Rename the check to something more descriptive, and simplify the inputs—e.g., it looks like 'Target' might be a better input than an entire StackFrame
A few potential simplifications to consider:
- Define a single rule for the relevancy test, and use negation ('\+ foo()') to trivially succeed when all the preconditions aren't met
- Get rid of the 'classesInOtherPkgWithProtectedMember' result list, which never gets used—it's just a search to see if there is at least one match
- Rename the check to something more descriptive, and simplify the inputs—e.g., it looks like 'Target' might be a better input than an entire StackFrame
- relates to
-
JDK-8323557 4.10.1: clarify distinction between types and classes
-
- In Progress
-