From d7f9dabf1240e40484ce2b3c1c6e9feecaabe29c Mon Sep 17 00:00:00 2001 From: Florian Lanzinger Date: Tue, 28 Nov 2023 05:56:26 +0100 Subject: [PATCH] Generalize improvement of initialization type frames (#642) Co-authored-by: Werner Dietl --- .../InitializationAnnotatedTypeFactory.java | 60 ++++ .../initialization/InitializationVisitor.java | 141 -------- .../nullness-extra/issue5174/Issue5174.out | 308 +++++++++--------- .../FinalClassLambda.java | 101 ++++++ docs/CHANGELOG.md | 2 +- 5 files changed, 316 insertions(+), 296 deletions(-) create mode 100644 checker/tests/nullness-initialization/FinalClassLambda.java diff --git a/checker/src/main/java/org/checkerframework/checker/initialization/InitializationAnnotatedTypeFactory.java b/checker/src/main/java/org/checkerframework/checker/initialization/InitializationAnnotatedTypeFactory.java index 9af52ffae64..13b1c96ee37 100644 --- a/checker/src/main/java/org/checkerframework/checker/initialization/InitializationAnnotatedTypeFactory.java +++ b/checker/src/main/java/org/checkerframework/checker/initialization/InitializationAnnotatedTypeFactory.java @@ -5,6 +5,8 @@ import com.sun.source.tree.Tree; import com.sun.source.tree.VariableTree; import com.sun.source.util.TreePath; +import com.sun.tools.javac.code.Type; +import com.sun.tools.javac.tree.JCTree; import org.checkerframework.checker.initialization.qual.HoldsForDefaultValue; import org.checkerframework.checker.nullness.qual.Nullable; @@ -33,6 +35,7 @@ import java.lang.annotation.Annotation; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.Set; @@ -113,6 +116,63 @@ public InitializationStore getExceptionalExitStore(Tree tree) { return getFieldAccessFactory().getReturnStatementStores(methodTree); } + /** + * {@inheritDoc} + * + *

This implementaiton also takes the target checker into account. + * + * @see #getUninitializedFields(InitializationStore, CFAbstractStore, TreePath, boolean, + * Collection) + */ + @Override + protected void setSelfTypeInInitializationCode( + Tree tree, AnnotatedTypeMirror.AnnotatedDeclaredType selfType, TreePath path) { + ClassTree enclosingClass = TreePathUtil.enclosingClass(path); + Type classType = ((JCTree) enclosingClass).type; + AnnotationMirror annotation; + + // If all fields are initialized-only, and they are all initialized, + // then: + // - if the class is final, this is @Initialized + // - otherwise, this is @UnderInitialization(CurrentClass) as + // there might still be subclasses that need initialization. + if (areAllFieldsInitializedOnly(enclosingClass)) { + GenericAnnotatedTypeFactory targetFactory = + checker.getTypeFactoryOfSubcheckerOrNull( + ((InitializationChecker) checker).getTargetCheckerClass()); + InitializationStore initStore = getStoreBefore(tree); + CFAbstractStore targetStore = targetFactory.getStoreBefore(tree); + if (initStore != null + && targetStore != null + && getUninitializedFields( + initStore, targetStore, path, false, Collections.emptyList()) + .isEmpty()) { + if (classType.isFinal()) { + annotation = INITIALIZED; + } else { + annotation = createUnderInitializationAnnotation(classType); + } + } else if (initStore != null + && getUninitializedFields(initStore, path, false, Collections.emptyList()) + .isEmpty()) { + if (classType.isFinal()) { + annotation = INITIALIZED; + } else { + annotation = createUnderInitializationAnnotation(classType); + } + } else { + annotation = null; + } + } else { + annotation = null; + } + + if (annotation == null) { + annotation = getUnderInitializationAnnotationOfSuperType(classType); + } + selfType.replaceAnnotation(annotation); + } + /** * Returns the fields that are not yet initialized in a given store, taking into account the * target checker. diff --git a/checker/src/main/java/org/checkerframework/checker/initialization/InitializationVisitor.java b/checker/src/main/java/org/checkerframework/checker/initialization/InitializationVisitor.java index d0de3ce2bca..4bc2327b643 100644 --- a/checker/src/main/java/org/checkerframework/checker/initialization/InitializationVisitor.java +++ b/checker/src/main/java/org/checkerframework/checker/initialization/InitializationVisitor.java @@ -14,9 +14,6 @@ import com.sun.source.util.TreePath; import org.checkerframework.checker.compilermsgs.qual.CompilerMessageKey; -import org.checkerframework.checker.initialization.qual.Initialized; -import org.checkerframework.checker.initialization.qual.UnderInitialization; -import org.checkerframework.checker.initialization.qual.UnknownInitialization; import org.checkerframework.checker.nullness.NullnessChecker; import org.checkerframework.common.basetype.BaseTypeChecker; import org.checkerframework.common.basetype.BaseTypeVisitor; @@ -31,8 +28,6 @@ import org.checkerframework.javacutil.AnnotationUtils; import org.checkerframework.javacutil.ElementUtils; import org.checkerframework.javacutil.TreeUtils; -import org.checkerframework.javacutil.TypesUtils; -import org.plumelib.util.ArraysPlume; import java.lang.annotation.Annotation; import java.util.ArrayList; @@ -45,7 +40,6 @@ import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.VariableElement; -import javax.lang.model.type.TypeMirror; /* NO-AFU import org.checkerframework.common.wholeprograminference.WholeProgramInference; @@ -298,141 +292,6 @@ public Void visitMethodInvocation(MethodInvocationTree node, Void p) { return null; } - @Override - protected void reportCommonAssignmentError( - AnnotatedTypeMirror varType, - AnnotatedTypeMirror valueType, - Tree valueTree, - @CompilerMessageKey String errorKey, - Object... extraArgs) { - FoundRequired pair = FoundRequired.of(valueType, varType); - String valueTypeString = pair.found; - String varTypeString = pair.required; - - // If the stored value of valueTree is wrong, we still do not report an error - // if all necessary fields of valueTree are initialized in the store before the assignment. - - InitializationStore initStoreBefore = atypeFactory.getStoreBefore(commonAssignmentTree); - - // We can't check if all necessary fields are initialized without a store. - if (initStoreBefore == null) { - super.reportCommonAssignmentError(varType, valueType, valueTree, errorKey, extraArgs); - return; - } - - // We only track field initialization for the current receiver. - if (!valueTree.toString().equals("this")) { - super.reportCommonAssignmentError(varType, valueType, valueTree, errorKey, extraArgs); - return; - } - - // If the required type is @Initialized and the value type is not final, - // we always need to report an error. - if (varType.getAnnotation(Initialized.class) != null - && !ElementUtils.isFinal( - TypesUtils.getTypeElement(valueType.getUnderlyingType()))) { - super.reportCommonAssignmentError(varType, valueType, valueTree, errorKey, extraArgs); - return; - } - - // Otherwise, we check if there are any uninitialized fields and only report the error - // if this is the case. - GenericAnnotatedTypeFactory targetFactory = - checker.getTypeFactoryOfSubcheckerOrNull( - ((InitializationChecker) checker).getTargetCheckerClass()); - List uninitializedFields = - atypeFactory.getUninitializedFields( - initStoreBefore, - targetFactory.getStoreBefore(commonAssignmentTree), - getCurrentPath(), - false, - Collections.emptyList()); - uninitializedFields.removeAll(initializedFields); - - if (!uninitializedFields.isEmpty()) { - StringJoiner fieldsString = new StringJoiner(", "); - for (VariableTree f : uninitializedFields) { - fieldsString.add(f.getName()); - } - checker.reportError( - commonAssignmentTree, - errorKey, - ArraysPlume.concatenate(extraArgs, valueTypeString, varTypeString)); - } - } - - @Override - protected void reportMethodInvocabilityError( - MethodInvocationTree node, AnnotatedTypeMirror found, AnnotatedTypeMirror expected) { - // We only track field initialization for the current receiver. - if (!TreeUtils.isSelfAccess(node)) { - super.reportMethodInvocabilityError(node, found, expected); - return; - } - - AnnotationMirror init = expected.getAnnotation(Initialized.class); - AnnotationMirror unknownInit = expected.getAnnotation(UnknownInitialization.class); - AnnotationMirror underInit = expected.getAnnotation(UnderInitialization.class); - - // If the actual receiver type (found) is not a subtype of expected, - // we still do not report an error if all necessary fields are initialized in the store - // before the method call. - - // Find the frame for which the receiver must be initialized to discharge this error: - // * If the expected type is @UnknownInitialization(A) or @UnderInitialization(A), the frame - // is A. - // * If the expected type is @Initialized and the receiver type is final, the frame - // is the receiver type. - // * Otherwise, this error cannot be discharged and is reported by the super method. - TypeMirror frame; - if (unknownInit != null) { - frame = atypeFactory.getTypeFrameFromAnnotation(unknownInit); - } else if (underInit != null) { - frame = atypeFactory.getTypeFrameFromAnnotation(underInit); - } else if (init != null - && ElementUtils.isFinal(TypesUtils.getTypeElement(expected.getUnderlyingType()))) { - frame = expected.getUnderlyingType(); - } else { - super.reportMethodInvocabilityError(node, found, expected); - return; - } - - TypeMirror underlyingReceiverType = atypeFactory.getReceiverType(node).getUnderlyingType(); - if (!atypeFactory - .getProcessingEnv() - .getTypeUtils() - .isSubtype(frame, underlyingReceiverType)) { - super.reportMethodInvocabilityError(node, found, expected); - return; - } - - GenericAnnotatedTypeFactory targetFactory = - checker.getTypeFactoryOfSubcheckerOrNull( - ((InitializationChecker) checker).getTargetCheckerClass()); - List uninitializedFields = - atypeFactory.getUninitializedFields( - atypeFactory.getStoreBefore(node), - targetFactory.getStoreBefore(node), - getCurrentPath(), - false, - Collections.emptyList()); - uninitializedFields.removeAll(initializedFields); - - if (!uninitializedFields.isEmpty()) { - // TODO: improve the error message by showing the uninitialized fields - // StringJoiner fieldsString = new StringJoiner(", "); - // for (VariableTree f : uninitializedFields) { - // fieldsString.add(f.getName()); - // } - checker.reportError( - node, - "method.invocation.invalid", - TreeUtils.elementFromUse(node), - found.toString(), - expected.toString()); - } - } - /** * Returns the full list of annotations on the receiver. * diff --git a/checker/tests/nullness-extra/issue5174/Issue5174.out b/checker/tests/nullness-extra/issue5174/Issue5174.out index 2a5dc8decff..d4144a111ab 100644 --- a/checker/tests/nullness-extra/issue5174/Issue5174.out +++ b/checker/tests/nullness-extra/issue5174/Issue5174.out @@ -252,14 +252,14 @@ Before: NullnessNoInitStore#43( 23 -> 18 20: -Before: InitializationStore#52( +Before: InitializationStore#53( f > CFAV{, T} initialized fields = []) ~~~~~~~~~ 21: -Before: InitializationStore#52( +Before: InitializationStore#53( f > CFAV{, T} initialized fields = []) ~~~~~~~~~ @@ -268,28 +268,28 @@ Before: InitializationStore#52( f [ LocalVariable ] > CFAV{, T} 22: -Before: InitializationStore#53( +Before: InitializationStore#54( f > CFAV{, T} initialized fields = []) ~~~~~~~~~ (this).(f) [ MethodInvocation ] > CFAV{@UnderInitialization, Issue5174Super} 23: -Before: InitializationStore#54( +Before: InitializationStore#55( f > CFAV{, T} initialized fields = [f, sf]) ~~~~~~~~~ expression statement super(f) [ ExpressionStatement ] 19: -Before: InitializationStore#57( +Before: InitializationStore#58( f > CFAV{, T} initialized fields = []) ~~~~~~~~~ 18: -Before: InitializationStore#60( +Before: InitializationStore#61( f > CFAV{, T} initialized fields = [f, sf]) ~~~~~~~~~ @@ -302,14 +302,14 @@ Before: InitializationStore#60( 30 -> 25 27: -Before: InitializationStore#67( +Before: InitializationStore#68( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ 28: -Before: InitializationStore#67( +Before: InitializationStore#68( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ @@ -319,28 +319,28 @@ o [ VariableDeclaration ] in [ LocalVariable ] > CFAV{, T} 29: -Before: InitializationStore#68( +Before: InitializationStore#69( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ (this).methodInner(in) [ MethodInvocation ] > CFAV{, T} 30: -Before: InitializationStore#69( +Before: InitializationStore#70( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ o = (this).methodInner(in) [ Assignment ] > CFAV{, T} 26: -Before: InitializationStore#70( +Before: InitializationStore#71( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ 25: -Before: InitializationStore#73( +Before: InitializationStore#74( in > CFAV{, T} o > CFAV{, T} initialized fields = []) @@ -354,14 +354,14 @@ Before: InitializationStore#73( 37 -> 32 34: -Before: InitializationStore#80( +Before: InitializationStore#81( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ 35: -Before: InitializationStore#80( +Before: InitializationStore#81( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ @@ -371,28 +371,28 @@ this.methodInner [ MethodAccess ] in [ LocalVariable ] > CFAV{, T} 36: -Before: InitializationStore#81( +Before: InitializationStore#82( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ this.methodInner(in) [ MethodInvocation ] > CFAV{, T} 37: -Before: InitializationStore#82( +Before: InitializationStore#83( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ o = this.methodInner(in) [ Assignment ] > CFAV{, T} 33: -Before: InitializationStore#83( +Before: InitializationStore#84( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ 32: -Before: InitializationStore#86( +Before: InitializationStore#87( in > CFAV{, T} o > CFAV{, T} initialized fields = []) @@ -402,13 +402,13 @@ Before: InitializationStore#86( 42 -> 39 41: -Before: InitializationStore#93( +Before: InitializationStore#94( initialized fields = []) ~~~~~~~~~ 42: -Before: InitializationStore#93( +Before: InitializationStore#94( initialized fields = []) ~~~~~~~~~ o [ VariableDeclaration ] @@ -417,7 +417,7 @@ o [ VariableDeclaration ] o = (this).f [ Assignment ] > CFAV{, T} 39: -Before: InitializationStore#94( +Before: InitializationStore#95( o > CFAV{, T} initialized fields = []) ~~~~~~~~~ @@ -426,13 +426,13 @@ Before: InitializationStore#94( 47 -> 44 46: -Before: InitializationStore#98( +Before: InitializationStore#99( initialized fields = []) ~~~~~~~~~ 47: -Before: InitializationStore#98( +Before: InitializationStore#99( initialized fields = []) ~~~~~~~~~ o [ VariableDeclaration ] @@ -441,7 +441,7 @@ this.f [ FieldAccess ] > CFAV{, T} o = this.f [ Assignment ] > CFAV{, T} 44: -Before: InitializationStore#99( +Before: InitializationStore#100( o > CFAV{, T} initialized fields = []) ~~~~~~~~~ @@ -468,26 +468,26 @@ Before: InitializationStore#99( 58 -> 49 51: -Before: InitializationStore#103( +Before: InitializationStore#104( initialized fields = []) ~~~~~~~~~ 52: -Before: InitializationStore#103( +Before: InitializationStore#104( initialized fields = []) ~~~~~~~~~ o [ VariableDeclaration ] o [ LocalVariable ] 53: -Before: InitializationStore#104( +Before: InitializationStore#105( initialized fields = []) ~~~~~~~~~ Issue5174Super [ ClassName ] 54: -Before: InitializationStore#105( +Before: InitializationStore#106( initialized fields = []) ~~~~~~~~~ Issue5174Super.sf [ FieldAccess ] > CFAV{@Initialized, Object} @@ -496,20 +496,20 @@ expression statement o = sf [ ExpressionStatement ] o [ LocalVariable ] 50: -Before: InitializationStore#106( +Before: InitializationStore#107( initialized fields = []) ~~~~~~~~~ 55: -Before: InitializationStore#113( +Before: InitializationStore#114( o > CFAV{@Initialized, Object} initialized fields = []) ~~~~~~~~~ Issue5174Sub [ ClassName ] > CFAV{@Initialized, Issue5174Sub} 56: -Before: InitializationStore#114( +Before: InitializationStore#115( o > CFAV{@Initialized, Object} initialized fields = []) ~~~~~~~~~ @@ -519,14 +519,14 @@ expression statement o = Issue5174Sub.sf [ ExpressionStatement ] o [ LocalVariable ] 57: -Before: InitializationStore#123( +Before: InitializationStore#124( o > CFAV{@Initialized, Object} initialized fields = []) ~~~~~~~~~ Issue5174Super [ ClassName ] > CFAV{@Initialized, Issue5174Super} 58: -Before: InitializationStore#124( +Before: InitializationStore#125( o > CFAV{@Initialized, Object} initialized fields = []) ~~~~~~~~~ @@ -535,7 +535,7 @@ o = Issue5174Super.sf [ Assignment ] > CFAV{@Initialized, Object} expression statement o = Issue5174Super.sf [ ExpressionStatement ] 49: -Before: InitializationStore#133( +Before: InitializationStore#134( o > CFAV{@Initialized, Object} initialized fields = []) ~~~~~~~~~ @@ -548,39 +548,39 @@ Before: InitializationStore#133( 65 -> 60 62: -Before: InitializationStore#144( +Before: InitializationStore#145( initialized fields = []) ~~~~~~~~~ 63: -Before: InitializationStore#144( +Before: InitializationStore#145( initialized fields = []) ~~~~~~~~~ (this) [ ImplicitThis ] (this). [ MethodAccess ] > CFAV{@UnderInitialization(Issue5174Sub.SubNested.class), SubNested} 64: -Before: InitializationStore#145( +Before: InitializationStore#146( initialized fields = []) ~~~~~~~~~ (this).() [ MethodInvocation ] > CFAV{@UnderInitialization, Object} 65: -Before: InitializationStore#146( +Before: InitializationStore#147( this.() > CFAV{@UnderInitialization, Object} initialized fields = []) ~~~~~~~~~ expression statement super() [ ExpressionStatement ] 61: -Before: InitializationStore#147( +Before: InitializationStore#148( initialized fields = []) ~~~~~~~~~ 60: -Before: InitializationStore#150( +Before: InitializationStore#151( this.() > CFAV{@UnderInitialization, Object} initialized fields = []) ~~~~~~~~~ @@ -593,14 +593,14 @@ Before: InitializationStore#150( 72 -> 67 69: -Before: InitializationStore#157( +Before: InitializationStore#158( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ 70: -Before: InitializationStore#157( +Before: InitializationStore#158( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ @@ -610,28 +610,28 @@ o [ VariableDeclaration ] in [ LocalVariable ] > CFAV{, T} 71: -Before: InitializationStore#158( +Before: InitializationStore#159( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ (this).methodInner(in) [ MethodInvocation ] > CFAV{, T} 72: -Before: InitializationStore#159( +Before: InitializationStore#160( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ o = (this).methodInner(in) [ Assignment ] > CFAV{, T} 68: -Before: InitializationStore#160( +Before: InitializationStore#161( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ 67: -Before: InitializationStore#163( +Before: InitializationStore#164( in > CFAV{, T} o > CFAV{, T} initialized fields = []) @@ -655,70 +655,70 @@ Before: InitializationStore#163( 85 -> 74 76: -Before: InitializationStore#170( +Before: InitializationStore#171( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ 77: -Before: InitializationStore#170( +Before: InitializationStore#171( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ o [ VariableDeclaration ] 78: -Before: InitializationStore#171( +Before: InitializationStore#172( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ Issue5174Sub [ ClassName ] > CFAV{@Initialized, Issue5174Sub} 80: -Before: InitializationStore#172( +Before: InitializationStore#173( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ Issue5174Sub.this [ FieldAccess ] > CFAV{@Initialized, Issue5174Sub} 75: -Before: InitializationStore#173( +Before: InitializationStore#174( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ 82: -Before: InitializationStore#180( +Before: InitializationStore#181( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ Issue5174Sub.this.methodInner [ MethodAccess ] 83: -Before: InitializationStore#183( +Before: InitializationStore#184( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ in [ LocalVariable ] > CFAV{, T} 84: -Before: InitializationStore#186( +Before: InitializationStore#187( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ Issue5174Sub.this.methodInner(in) [ MethodInvocation ] > CFAV{, T} 85: -Before: InitializationStore#187( +Before: InitializationStore#188( in > CFAV{, T} initialized fields = []) ~~~~~~~~~ o = Issue5174Sub.this.methodInner(in) [ Assignment ] > CFAV{, T} 74: -Before: InitializationStore#192( +Before: InitializationStore#193( in > CFAV{, T} o > CFAV{, T} initialized fields = []) @@ -728,13 +728,13 @@ Before: InitializationStore#192( 90 -> 87 89: -Before: InitializationStore#203( +Before: InitializationStore#204( initialized fields = []) ~~~~~~~~~ 90: -Before: InitializationStore#203( +Before: InitializationStore#204( initialized fields = []) ~~~~~~~~~ o [ VariableDeclaration ] @@ -743,7 +743,7 @@ o [ VariableDeclaration ] o = (this).f [ Assignment ] > CFAV{, T} 87: -Before: InitializationStore#204( +Before: InitializationStore#205( o > CFAV{, T} initialized fields = []) ~~~~~~~~~ @@ -762,49 +762,49 @@ Before: InitializationStore#204( 101 -> 92 94: -Before: InitializationStore#208( +Before: InitializationStore#209( initialized fields = []) ~~~~~~~~~ 95: -Before: InitializationStore#208( +Before: InitializationStore#209( initialized fields = []) ~~~~~~~~~ o [ VariableDeclaration ] 96: -Before: InitializationStore#209( +Before: InitializationStore#210( initialized fields = []) ~~~~~~~~~ Issue5174Sub [ ClassName ] > CFAV{@Initialized, Issue5174Sub} 98: -Before: InitializationStore#210( +Before: InitializationStore#211( initialized fields = []) ~~~~~~~~~ Issue5174Sub.this [ FieldAccess ] > CFAV{@Initialized, Issue5174Sub} 93: -Before: InitializationStore#211( +Before: InitializationStore#212( initialized fields = []) ~~~~~~~~~ 100: -Before: InitializationStore#218( +Before: InitializationStore#219( initialized fields = []) ~~~~~~~~~ Issue5174Sub.this.f [ FieldAccess ] > CFAV{, T} 101: -Before: InitializationStore#221( +Before: InitializationStore#222( initialized fields = []) ~~~~~~~~~ o = Issue5174Sub.this.f [ Assignment ] > CFAV{, T} 92: -Before: InitializationStore#224( +Before: InitializationStore#225( o > CFAV{, T} initialized fields = []) ~~~~~~~~~ @@ -831,26 +831,26 @@ Before: InitializationStore#224( 112 -> 103 105: -Before: InitializationStore#233( +Before: InitializationStore#234( initialized fields = []) ~~~~~~~~~ 106: -Before: InitializationStore#233( +Before: InitializationStore#234( initialized fields = []) ~~~~~~~~~ o [ VariableDeclaration ] o [ LocalVariable ] 107: -Before: InitializationStore#234( +Before: InitializationStore#235( initialized fields = []) ~~~~~~~~~ Issue5174Super [ ClassName ] 108: -Before: InitializationStore#235( +Before: InitializationStore#236( initialized fields = []) ~~~~~~~~~ Issue5174Super.sf [ FieldAccess ] > CFAV{@Initialized, Object} @@ -859,20 +859,20 @@ expression statement o = sf [ ExpressionStatement ] o [ LocalVariable ] 104: -Before: InitializationStore#236( +Before: InitializationStore#237( initialized fields = []) ~~~~~~~~~ 109: -Before: InitializationStore#243( +Before: InitializationStore#244( o > CFAV{@Initialized, Object} initialized fields = []) ~~~~~~~~~ Issue5174Sub [ ClassName ] > CFAV{@Initialized, Issue5174Sub} 110: -Before: InitializationStore#244( +Before: InitializationStore#245( o > CFAV{@Initialized, Object} initialized fields = []) ~~~~~~~~~ @@ -882,14 +882,14 @@ expression statement o = Issue5174Sub.sf [ ExpressionStatement ] o [ LocalVariable ] 111: -Before: InitializationStore#253( +Before: InitializationStore#254( o > CFAV{@Initialized, Object} initialized fields = []) ~~~~~~~~~ Issue5174Super [ ClassName ] > CFAV{@Initialized, Issue5174Super} 112: -Before: InitializationStore#254( +Before: InitializationStore#255( o > CFAV{@Initialized, Object} initialized fields = []) ~~~~~~~~~ @@ -898,7 +898,7 @@ o = Issue5174Super.sf [ Assignment ] > CFAV{@Initialized, Object} expression statement o = Issue5174Super.sf [ ExpressionStatement ] 103: -Before: InitializationStore#263( +Before: InitializationStore#264( o > CFAV{@Initialized, Object} initialized fields = []) ~~~~~~~~~ @@ -911,7 +911,7 @@ Before: InitializationStore#263( 23 -> 18 20: -Before: NullnessNoInitStore#274( +Before: NullnessNoInitStore#275( f > NV{, T, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -919,7 +919,7 @@ Before: NullnessNoInitStore#274( 21: -Before: NullnessNoInitStore#274( +Before: NullnessNoInitStore#275( f > NV{, T, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -929,7 +929,7 @@ Before: NullnessNoInitStore#274( f [ LocalVariable ] > NV{, T, poly nn/n=f/f} 22: -Before: NullnessNoInitStore#275( +Before: NullnessNoInitStore#276( f > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -938,7 +938,7 @@ Before: NullnessNoInitStore#275( (this).(f) [ MethodInvocation ] > NV{@NonNull, Issue5174Super, poly nn/n=f/f} 23: -Before: NullnessNoInitStore#276( +Before: NullnessNoInitStore#277( f > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -947,7 +947,7 @@ Before: NullnessNoInitStore#276( expression statement super(f) [ ExpressionStatement ] 19: -Before: NullnessNoInitStore#277( +Before: NullnessNoInitStore#278( f > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -956,7 +956,7 @@ Before: NullnessNoInitStore#277( 18: -Before: NullnessNoInitStore#280( +Before: NullnessNoInitStore#281( f > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -971,7 +971,7 @@ Before: NullnessNoInitStore#280( 30 -> 25 27: -Before: NullnessNoInitStore#287( +Before: NullnessNoInitStore#288( in > NV{, T, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -979,7 +979,7 @@ Before: NullnessNoInitStore#287( 28: -Before: NullnessNoInitStore#287( +Before: NullnessNoInitStore#288( in > NV{, T, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -990,7 +990,7 @@ o [ VariableDeclaration ] in [ LocalVariable ] > NV{, T, poly nn/n=f/f} 29: -Before: NullnessNoInitStore#288( +Before: NullnessNoInitStore#289( in > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -999,7 +999,7 @@ Before: NullnessNoInitStore#288( (this).methodInner(in) [ MethodInvocation ] > NV{, T, poly nn/n=f/f} 30: -Before: NullnessNoInitStore#289( +Before: NullnessNoInitStore#290( in > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1008,7 +1008,7 @@ Before: NullnessNoInitStore#289( o = (this).methodInner(in) [ Assignment ] > NV{, T, poly nn/n=f/f} 26: -Before: NullnessNoInitStore#290( +Before: NullnessNoInitStore#291( in > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1017,7 +1017,7 @@ Before: NullnessNoInitStore#290( 25: -Before: NullnessNoInitStore#293( +Before: NullnessNoInitStore#294( in > NV{, T, poly nn/n=f/f} o > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} @@ -1033,7 +1033,7 @@ Before: NullnessNoInitStore#293( 37 -> 32 34: -Before: NullnessNoInitStore#300( +Before: NullnessNoInitStore#301( in > NV{, T, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1041,7 +1041,7 @@ Before: NullnessNoInitStore#300( 35: -Before: NullnessNoInitStore#300( +Before: NullnessNoInitStore#301( in > NV{, T, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1052,7 +1052,7 @@ this.methodInner [ MethodAccess ] in [ LocalVariable ] > NV{, T, poly nn/n=f/f} 36: -Before: NullnessNoInitStore#301( +Before: NullnessNoInitStore#302( in > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1061,7 +1061,7 @@ Before: NullnessNoInitStore#301( this.methodInner(in) [ MethodInvocation ] > NV{, T, poly nn/n=f/f} 37: -Before: NullnessNoInitStore#302( +Before: NullnessNoInitStore#303( in > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1070,7 +1070,7 @@ Before: NullnessNoInitStore#302( o = this.methodInner(in) [ Assignment ] > NV{, T, poly nn/n=f/f} 33: -Before: NullnessNoInitStore#303( +Before: NullnessNoInitStore#304( in > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1079,7 +1079,7 @@ Before: NullnessNoInitStore#303( 32: -Before: NullnessNoInitStore#306( +Before: NullnessNoInitStore#307( in > NV{, T, poly nn/n=f/f} o > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} @@ -1091,7 +1091,7 @@ Before: NullnessNoInitStore#306( 42 -> 39 41: -Before: NullnessNoInitStore#313( +Before: NullnessNoInitStore#314( isPolyNullNonNull = false isPolyNullNull = false) @@ -1099,7 +1099,7 @@ Before: NullnessNoInitStore#313( 42: -Before: NullnessNoInitStore#313( +Before: NullnessNoInitStore#314( isPolyNullNonNull = false isPolyNullNull = false) @@ -1110,7 +1110,7 @@ o [ VariableDeclaration ] o = (this).f [ Assignment ] > NV{, T, poly nn/n=f/f} 39: -Before: NullnessNoInitStore#314( +Before: NullnessNoInitStore#315( o > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1121,7 +1121,7 @@ Before: NullnessNoInitStore#314( 47 -> 44 46: -Before: NullnessNoInitStore#318( +Before: NullnessNoInitStore#319( isPolyNullNonNull = false isPolyNullNull = false) @@ -1129,7 +1129,7 @@ Before: NullnessNoInitStore#318( 47: -Before: NullnessNoInitStore#318( +Before: NullnessNoInitStore#319( isPolyNullNonNull = false isPolyNullNull = false) @@ -1140,7 +1140,7 @@ this.f [ FieldAccess ] > NV{, T, poly nn/n=f/f} o = this.f [ Assignment ] > NV{, T, poly nn/n=f/f} 44: -Before: NullnessNoInitStore#319( +Before: NullnessNoInitStore#320( o > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1169,7 +1169,7 @@ Before: NullnessNoInitStore#319( 58 -> 49 51: -Before: NullnessNoInitStore#323( +Before: NullnessNoInitStore#324( isPolyNullNonNull = false isPolyNullNull = false) @@ -1177,7 +1177,7 @@ Before: NullnessNoInitStore#323( 52: -Before: NullnessNoInitStore#323( +Before: NullnessNoInitStore#324( isPolyNullNonNull = false isPolyNullNull = false) @@ -1186,7 +1186,7 @@ o [ VariableDeclaration ] o [ LocalVariable ] 53: -Before: NullnessNoInitStore#324( +Before: NullnessNoInitStore#325( isPolyNullNonNull = false isPolyNullNull = false) @@ -1194,7 +1194,7 @@ Before: NullnessNoInitStore#324( Issue5174Super [ ClassName ] 54: -Before: NullnessNoInitStore#325( +Before: NullnessNoInitStore#326( isPolyNullNonNull = false isPolyNullNull = false) @@ -1205,7 +1205,7 @@ expression statement o = sf [ ExpressionStatement ] o [ LocalVariable ] 50: -Before: NullnessNoInitStore#326( +Before: NullnessNoInitStore#327( isPolyNullNonNull = false isPolyNullNull = false) @@ -1213,7 +1213,7 @@ Before: NullnessNoInitStore#326( 55: -Before: NullnessNoInitStore#333( +Before: NullnessNoInitStore#334( o > NV{@NonNull, Object, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1221,7 +1221,7 @@ Before: NullnessNoInitStore#333( Issue5174Sub [ ClassName ] > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} 56: -Before: NullnessNoInitStore#334( +Before: NullnessNoInitStore#335( o > NV{@NonNull, Object, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1232,7 +1232,7 @@ expression statement o = Issue5174Sub.sf [ ExpressionStatement ] o [ LocalVariable ] 57: -Before: NullnessNoInitStore#343( +Before: NullnessNoInitStore#344( o > NV{@NonNull, Object, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1240,7 +1240,7 @@ Before: NullnessNoInitStore#343( Issue5174Super [ ClassName ] > NV{@NonNull, Issue5174Super, poly nn/n=f/f} 58: -Before: NullnessNoInitStore#344( +Before: NullnessNoInitStore#345( o > NV{@NonNull, Object, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1250,7 +1250,7 @@ o = Issue5174Super.sf [ Assignment ] > NV{@NonNull, Object, poly nn/n=f/f} expression statement o = Issue5174Super.sf [ ExpressionStatement ] 49: -Before: NullnessNoInitStore#353( +Before: NullnessNoInitStore#354( o > NV{@NonNull, Object, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1264,7 +1264,7 @@ Before: NullnessNoInitStore#353( 65 -> 60 62: -Before: NullnessNoInitStore#364( +Before: NullnessNoInitStore#365( isPolyNullNonNull = false isPolyNullNull = false) @@ -1272,7 +1272,7 @@ Before: NullnessNoInitStore#364( 63: -Before: NullnessNoInitStore#364( +Before: NullnessNoInitStore#365( isPolyNullNonNull = false isPolyNullNull = false) @@ -1281,7 +1281,7 @@ Before: NullnessNoInitStore#364( (this). [ MethodAccess ] > NV{@NonNull, SubNested, poly nn/n=f/f} 64: -Before: NullnessNoInitStore#365( +Before: NullnessNoInitStore#366( this > NV{@NonNull, SubNested, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1289,7 +1289,7 @@ Before: NullnessNoInitStore#365( (this).() [ MethodInvocation ] > NV{@NonNull, Object, poly nn/n=f/f} 65: -Before: NullnessNoInitStore#366( +Before: NullnessNoInitStore#367( this > NV{@NonNull, SubNested, poly nn/n=f/f} this.() > NV{@NonNull, Object, poly nn/n=f/f} isPolyNullNonNull = false @@ -1298,7 +1298,7 @@ Before: NullnessNoInitStore#366( expression statement super() [ ExpressionStatement ] 61: -Before: NullnessNoInitStore#367( +Before: NullnessNoInitStore#368( this > NV{@NonNull, SubNested, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1306,7 +1306,7 @@ Before: NullnessNoInitStore#367( 60: -Before: NullnessNoInitStore#370( +Before: NullnessNoInitStore#371( this > NV{@NonNull, SubNested, poly nn/n=f/f} this.() > NV{@NonNull, Object, poly nn/n=f/f} isPolyNullNonNull = false @@ -1321,7 +1321,7 @@ Before: NullnessNoInitStore#370( 72 -> 67 69: -Before: NullnessNoInitStore#377( +Before: NullnessNoInitStore#378( in > NV{, T, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1329,7 +1329,7 @@ Before: NullnessNoInitStore#377( 70: -Before: NullnessNoInitStore#377( +Before: NullnessNoInitStore#378( in > NV{, T, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1340,7 +1340,7 @@ o [ VariableDeclaration ] in [ LocalVariable ] > NV{, T, poly nn/n=f/f} 71: -Before: NullnessNoInitStore#378( +Before: NullnessNoInitStore#379( in > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1349,7 +1349,7 @@ Before: NullnessNoInitStore#378( (this).methodInner(in) [ MethodInvocation ] > NV{, T, poly nn/n=f/f} 72: -Before: NullnessNoInitStore#379( +Before: NullnessNoInitStore#380( in > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1358,7 +1358,7 @@ Before: NullnessNoInitStore#379( o = (this).methodInner(in) [ Assignment ] > NV{, T, poly nn/n=f/f} 68: -Before: NullnessNoInitStore#380( +Before: NullnessNoInitStore#381( in > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1367,7 +1367,7 @@ Before: NullnessNoInitStore#380( 67: -Before: NullnessNoInitStore#383( +Before: NullnessNoInitStore#384( in > NV{, T, poly nn/n=f/f} o > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} @@ -1393,7 +1393,7 @@ Before: NullnessNoInitStore#383( 85 -> 74 76: -Before: NullnessNoInitStore#390( +Before: NullnessNoInitStore#391( in > NV{, T, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1401,7 +1401,7 @@ Before: NullnessNoInitStore#390( 77: -Before: NullnessNoInitStore#390( +Before: NullnessNoInitStore#391( in > NV{, T, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1409,7 +1409,7 @@ Before: NullnessNoInitStore#390( o [ VariableDeclaration ] 78: -Before: NullnessNoInitStore#391( +Before: NullnessNoInitStore#392( in > NV{, T, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1417,7 +1417,7 @@ Before: NullnessNoInitStore#391( Issue5174Sub [ ClassName ] > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} 80: -Before: NullnessNoInitStore#392( +Before: NullnessNoInitStore#393( in > NV{, T, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1425,7 +1425,7 @@ Before: NullnessNoInitStore#392( Issue5174Sub.this [ FieldAccess ] > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} 75: -Before: NullnessNoInitStore#409( +Before: NullnessNoInitStore#410( in > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1434,7 +1434,7 @@ Before: NullnessNoInitStore#409( 82: -Before: NullnessNoInitStore#400( +Before: NullnessNoInitStore#401( in > NV{, T, poly nn/n=f/f} Issue5174Sub.class > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1443,7 +1443,7 @@ Before: NullnessNoInitStore#400( Issue5174Sub.this.methodInner [ MethodAccess ] 83: -Before: NullnessNoInitStore#403( +Before: NullnessNoInitStore#404( in > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} Issue5174Sub.class > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} @@ -1453,7 +1453,7 @@ Before: NullnessNoInitStore#403( in [ LocalVariable ] > NV{, T, poly nn/n=f/f} 84: -Before: NullnessNoInitStore#406( +Before: NullnessNoInitStore#407( in > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} Issue5174Sub.class > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} @@ -1463,7 +1463,7 @@ Before: NullnessNoInitStore#406( Issue5174Sub.this.methodInner(in) [ MethodInvocation ] > NV{, T, poly nn/n=f/f} 85: -Before: NullnessNoInitStore#407( +Before: NullnessNoInitStore#408( in > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} Issue5174Sub.class > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} @@ -1473,7 +1473,7 @@ Before: NullnessNoInitStore#407( o = Issue5174Sub.this.methodInner(in) [ Assignment ] > NV{, T, poly nn/n=f/f} 74: -Before: NullnessNoInitStore#412( +Before: NullnessNoInitStore#413( in > NV{, T, poly nn/n=f/f} o > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} @@ -1486,7 +1486,7 @@ Before: NullnessNoInitStore#412( 90 -> 87 89: -Before: NullnessNoInitStore#423( +Before: NullnessNoInitStore#424( isPolyNullNonNull = false isPolyNullNull = false) @@ -1494,7 +1494,7 @@ Before: NullnessNoInitStore#423( 90: -Before: NullnessNoInitStore#423( +Before: NullnessNoInitStore#424( isPolyNullNonNull = false isPolyNullNull = false) @@ -1505,7 +1505,7 @@ o [ VariableDeclaration ] o = (this).f [ Assignment ] > NV{, T, poly nn/n=f/f} 87: -Before: NullnessNoInitStore#424( +Before: NullnessNoInitStore#425( o > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1526,7 +1526,7 @@ Before: NullnessNoInitStore#424( 101 -> 92 94: -Before: NullnessNoInitStore#428( +Before: NullnessNoInitStore#429( isPolyNullNonNull = false isPolyNullNull = false) @@ -1534,7 +1534,7 @@ Before: NullnessNoInitStore#428( 95: -Before: NullnessNoInitStore#428( +Before: NullnessNoInitStore#429( isPolyNullNonNull = false isPolyNullNull = false) @@ -1542,7 +1542,7 @@ Before: NullnessNoInitStore#428( o [ VariableDeclaration ] 96: -Before: NullnessNoInitStore#429( +Before: NullnessNoInitStore#430( isPolyNullNonNull = false isPolyNullNull = false) @@ -1550,7 +1550,7 @@ Before: NullnessNoInitStore#429( Issue5174Sub [ ClassName ] > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} 98: -Before: NullnessNoInitStore#430( +Before: NullnessNoInitStore#431( isPolyNullNonNull = false isPolyNullNull = false) @@ -1558,7 +1558,7 @@ Before: NullnessNoInitStore#430( Issue5174Sub.this [ FieldAccess ] > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} 93: -Before: NullnessNoInitStore#431( +Before: NullnessNoInitStore#432( isPolyNullNonNull = false isPolyNullNull = false) @@ -1566,7 +1566,7 @@ Before: NullnessNoInitStore#431( 100: -Before: NullnessNoInitStore#438( +Before: NullnessNoInitStore#439( Issue5174Sub.class > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1574,7 +1574,7 @@ Before: NullnessNoInitStore#438( Issue5174Sub.this.f [ FieldAccess ] > NV{, T, poly nn/n=f/f} 101: -Before: NullnessNoInitStore#441( +Before: NullnessNoInitStore#442( this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} Issue5174Sub.class > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} isPolyNullNonNull = false @@ -1583,7 +1583,7 @@ Before: NullnessNoInitStore#441( o = Issue5174Sub.this.f [ Assignment ] > NV{, T, poly nn/n=f/f} 92: -Before: NullnessNoInitStore#444( +Before: NullnessNoInitStore#445( o > NV{, T, poly nn/n=f/f} this > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} Issue5174Sub.class > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} @@ -1613,7 +1613,7 @@ Before: NullnessNoInitStore#444( 112 -> 103 105: -Before: NullnessNoInitStore#453( +Before: NullnessNoInitStore#454( isPolyNullNonNull = false isPolyNullNull = false) @@ -1621,7 +1621,7 @@ Before: NullnessNoInitStore#453( 106: -Before: NullnessNoInitStore#453( +Before: NullnessNoInitStore#454( isPolyNullNonNull = false isPolyNullNull = false) @@ -1630,7 +1630,7 @@ o [ VariableDeclaration ] o [ LocalVariable ] 107: -Before: NullnessNoInitStore#454( +Before: NullnessNoInitStore#455( isPolyNullNonNull = false isPolyNullNull = false) @@ -1638,7 +1638,7 @@ Before: NullnessNoInitStore#454( Issue5174Super [ ClassName ] 108: -Before: NullnessNoInitStore#455( +Before: NullnessNoInitStore#456( isPolyNullNonNull = false isPolyNullNull = false) @@ -1649,7 +1649,7 @@ expression statement o = sf [ ExpressionStatement ] o [ LocalVariable ] 104: -Before: NullnessNoInitStore#456( +Before: NullnessNoInitStore#457( isPolyNullNonNull = false isPolyNullNull = false) @@ -1657,7 +1657,7 @@ Before: NullnessNoInitStore#456( 109: -Before: NullnessNoInitStore#463( +Before: NullnessNoInitStore#464( o > NV{@NonNull, Object, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1665,7 +1665,7 @@ Before: NullnessNoInitStore#463( Issue5174Sub [ ClassName ] > NV{@NonNull, Issue5174Sub, poly nn/n=f/f} 110: -Before: NullnessNoInitStore#464( +Before: NullnessNoInitStore#465( o > NV{@NonNull, Object, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1676,7 +1676,7 @@ expression statement o = Issue5174Sub.sf [ ExpressionStatement ] o [ LocalVariable ] 111: -Before: NullnessNoInitStore#473( +Before: NullnessNoInitStore#474( o > NV{@NonNull, Object, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1684,7 +1684,7 @@ Before: NullnessNoInitStore#473( Issue5174Super [ ClassName ] > NV{@NonNull, Issue5174Super, poly nn/n=f/f} 112: -Before: NullnessNoInitStore#474( +Before: NullnessNoInitStore#475( o > NV{@NonNull, Object, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) @@ -1694,7 +1694,7 @@ o = Issue5174Super.sf [ Assignment ] > NV{@NonNull, Object, poly nn/n=f/f} expression statement o = Issue5174Super.sf [ ExpressionStatement ] 103: -Before: NullnessNoInitStore#483( +Before: NullnessNoInitStore#484( o > NV{@NonNull, Object, poly nn/n=f/f} isPolyNullNonNull = false isPolyNullNull = false) diff --git a/checker/tests/nullness-initialization/FinalClassLambda.java b/checker/tests/nullness-initialization/FinalClassLambda.java new file mode 100644 index 00000000000..f5f6afc4cd3 --- /dev/null +++ b/checker/tests/nullness-initialization/FinalClassLambda.java @@ -0,0 +1,101 @@ +// Test case for EISOP issues #640 and #641: +// https://github.com/eisop/checker-framework/issues/640 +// https://github.com/eisop/checker-framework/issues/641 + +import org.checkerframework.checker.nullness.qual.Nullable; + +final class FinalClassLambda1 { + @Nullable String s; + + FinalClassLambda1() { + use(this::init); + } + + void init() {} + + static void use(Runnable r) {} +} + +final class FinalClassLambda2 extends FinalClassLambda2Base { + @Nullable String s; + + FinalClassLambda2() { + use(() -> init()); + use( + new Runnable() { + @Override + public void run() { + init(); + } + }); + } + + void init() {} +} + +class FinalClassLambda2Base { + void use(Runnable r) {} +} + +final class FinalClassLambda3 { + String s; + + FinalClassLambda3() { + s = "hello"; + use(this::init); + } + + void init() {} + + static void use(Runnable r) {} +} + +final class FinalClassLambda4 extends FinalClassLambda2Base { + String s; + + FinalClassLambda4() { + s = "world"; + use(() -> init()); + use( + new Runnable() { + @Override + public void run() { + init(); + } + }); + } + + void init() {} +} + +// Not a final class, but uses same name for consistency. +class FinalClassLambda5 extends FinalClassLambda2Base { + String s; + + FinalClassLambda5() { + s = "hello"; + // :: error: (method.invocation.invalid) + use( + // :: error: (methodref.receiver.bound.invalid) + this::init); + } + + FinalClassLambda5(int dummy) { + s = "world"; + // :: error: (method.invocation.invalid) + use( + // :: error: (method.invocation.invalid) + () -> init()); + // :: error: (method.invocation.invalid) + use( + new Runnable() { + @Override + public void run() { + // :: error: (method.invocation.invalid) + init(); + } + }); + } + + void init() {} +} diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 6e9f0d4a6a2..4154369dad5 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -7,7 +7,7 @@ Version 3.40.0-eisop3 (November ??, 2023) **Closed issues:** -eisop#635. +eisop#635, eisop#640, eisop#641. Version 3.40.0-eisop2 (November 24, 2023)