-
Notifications
You must be signed in to change notification settings - Fork 425
Open
Description
There appears to be an odd interaction between NotOnlyInitialized and UnderInitialization.
Reading https://checkerframework.org/manual/#fig-initialization-hierarchy and the sections after it, I understand that an object is considered UnderInitialization for itself when all of the non-null fields have been assigned.
I have a class that has a NotOnlyInitialized field and a NonNull field. Once both fields are initialized I call a private method on the class. At this point I expect the state of this to be UnderInitialization(current class), however it's UnderInitialization(parent class).
Steps to reproduce:
- git clone https://github.com/jpschewe/checker-bugs.git
- cd checker-bugs
- git checkout notonlyinitialized-underinitialization
- ./gradlew clean; ./gradlew classes
Resulting error
/home/jpschewe/projects/checker-bugs/src/main/java/net/mtu/eggplant/checker/issue4613/SchedulerUI.java:25: error: [method.invocation] call to createMenubar() not allowed on the given receiver.
createMenubar();
^
found : @UnderInitialization(javax.swing.JFrame.class) @NonNull SchedulerUI
required: @UnderInitialization(net.mtu.eggplant.checker.issue4613.SchedulerUI.class) @NonNull SchedulerUI
1 error
Metadata
Metadata
Assignees
Labels
No labels