We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An Invalid variable and element passed to extractAndApply occurs, at least in Java 11, when an annotated nested anonymous class is encountered.
Invalid variable and element passed to extractAndApply
import org.checkerframework.checker.tainting.qual.Tainted; class NestedAnonymous { Object o = new Outer.@Tainted Inner() {}; static class Outer { static class Inner {} } }
Running the Tainting Checker results in:
:-1: other: error: handleInvalid(this=org.checkerframework.framework.util.element.VariableApplier): Invalid variable and element passed to extractAndApply; type: Object element: o2 (kind: FIELD), invalid annotations: @org.checkerframework.checker.tainting.qual.Tainted ([CLASS_EXTENDS, type_index = 65535, pos = 228]) Targeted annotations: LOCAL_VARIABLE, RESOURCE_VARIABLE, EXCEPTION_PARAMETER, FIELD Valid annotations: NEW, CAST, INSTANCEOF, METHOD_INVOCATION_TYPE_ARGUMENT, CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT, METHOD_REFERENCE, CONSTRUCTOR_REFERENCE, METHOD_REFERENCE_TYPE_ARGUMENT, CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT, METHOD_FORMAL_PARAMETER ; The Checker Framework crashed. Please report the crash. Compilation unit: /home/wdietl/workspaces-server/eisop-cf/checker-framework/checker/tests/tainting/NestedAnonymous.java Last visited tree at line 4 column 1: class NestedAnonymous { Exception: java.lang.Throwable; java.lang.Throwable at org.checkerframework.javacutil.BugInCF.<init>(BugInCF.java:22) at org.checkerframework.framework.util.element.TargetedElementAnnotationApplier.handleInvalid(TargetedElementAnnotationApplier.java:150) at org.checkerframework.framework.util.element.TargetedElementAnnotationApplier.extractAndApply(TargetedElementAnnotationApplier.java:214) at org.checkerframework.framework.util.element.VariableApplier.extractAndApply(VariableApplier.java:112) ...
The text was updated successfully, but these errors were encountered:
Handle nested anonymous classes in field initializers. Fixes #210.
d6e0f26
Successfully merging a pull request may close this issue.
An
Invalid variable and element passed to extractAndApply
occurs, at least in Java 11, when an annotated nested anonymous class is encountered.Running the Tainting Checker results in:
The text was updated successfully, but these errors were encountered: