diff --git a/framework/src/main/java/org/checkerframework/framework/flow/CFAbstractTransfer.java b/framework/src/main/java/org/checkerframework/framework/flow/CFAbstractTransfer.java index 0c0e0e769f4..ba7465b7811 100644 --- a/framework/src/main/java/org/checkerframework/framework/flow/CFAbstractTransfer.java +++ b/framework/src/main/java/org/checkerframework/framework/flow/CFAbstractTransfer.java @@ -487,16 +487,14 @@ private boolean isExpressionOrStatementPure( * @param classTree the class that contains {@code methodTree} * @param methodTree the method or constructor tree */ - // TODO: should field visibility matter? An access from outside the class might observe - // the declared type instead of a refined type. Issue a warning to alert users? private void addInitialFieldValues(S store, ClassTree classTree, MethodTree methodTree) { boolean isConstructor = TreeUtils.isConstructor(methodTree); TypeElement classEle = TreeUtils.elementFromDeclaration(classTree); for (FieldInitialValue fieldInitialValue : analysis.getFieldInitialValues()) { VariableElement varEle = fieldInitialValue.fieldDecl.getField(); - // Insert the value from the initializer of private final fields. + // TODO: should field visibility matter? An access from outside the class might observe + // the declared type instead of a refined type. Issue a warning to alert users? if (fieldInitialValue.initializer != null - // && varEle.getModifiers().contains(Modifier.PRIVATE) && ElementUtils.isFinal(varEle) && analysis.atypeFactory.isImmutable(ElementUtils.getType(varEle))) { store.insertValue(fieldInitialValue.fieldDecl, fieldInitialValue.initializer);