checker-framework

Checker Framework initialization.fields.uninitialize false positive

蓝咒 提交于 2020-12-15 03:44:47
问题 Here's my error found : @Initialized @Nullable String required: @Initialized @NonNull String /Users/calebcushing/IdeaProjects/ppm/scaf/src/main/java/com/xenoterracide/scaf/Application.java:21: error: [initialization.fields.uninitialized] the constructor does not initialize fields: arg, args, dir public final class Application implements Runnable { ^ 3 errors These are initialized by picocli, so I added SuppressWarnings, not certain why it's still happening. @SuppressWarnings({ "NullAway.Init"

Checker Framework argument.type.incompatible false positive with commons-lang3

给你一囗甜甜゛ 提交于 2020-12-15 03:43:00
问题 Here's my error (and yes there is an open bug on commons-lang3 jira). found : @Initialized @Nullable Console required: @Initialized @NonNull Console /Users/calebcushing/IdeaProjects/ppm/scaf/src/main/java/com/xenoterracide/scaf/PebbleTemplateProcessor.java:96: error: [argument.type.incompatible] incompatible argument for parameter str of toBoolean. if ( BooleanUtils.toBoolean( line ) ) { I tried making this src/java/main/org/apache/commons/lang3/BooleanUtils.astub and I tried putting that

Checker Framework initialization.fields.uninitialize false positive

只谈情不闲聊 提交于 2020-12-15 03:42:22
问题 Here's my error found : @Initialized @Nullable String required: @Initialized @NonNull String /Users/calebcushing/IdeaProjects/ppm/scaf/src/main/java/com/xenoterracide/scaf/Application.java:21: error: [initialization.fields.uninitialized] the constructor does not initialize fields: arg, args, dir public final class Application implements Runnable { ^ 3 errors These are initialized by picocli, so I added SuppressWarnings, not certain why it's still happening. @SuppressWarnings({ "NullAway.Init"

Java scoping construct cannot be annotated with type-use

那年仲夏 提交于 2020-02-27 05:07:12
问题 I want to annotate a fully qualified class name with @Nullable -annotation (from the Java Checker Framework), e.g.: class Demo { private transient @Nullable org.apache.lucene.search.Query cached_results; // ... } However this results in the error: scoping construct cannot be annotated with type-use annotation: @checkers.nullness.quals.Nullable How can I annotate fully qualified class names? 回答1: The Java language specification (draft for version 8) §8.3 specifies a "UnannClassType" as

@Retention of Java type checker annotations

社会主义新天地 提交于 2019-12-14 01:40:38
问题 The Java 8 type annotations (JSR 308) allow type checkers to perform static code analysis. For example, The Checker Framework can check for possible nullness via @NonNull annotations. Various projects define their own NonNull annotations, for example: org.checkerframework.checker.nullness.qual.NonNull edu.umd.cs.findbugs.annotations.NonNull javax.annotation.Nonnull javax.validation.constraints.NotNull lombok.NonNull org.eclipse.jdt.annotation.NonNull etc. (see The Checker Framework Manual,

Passing the path to a Gradle dependency to the Java compiler

点点圈 提交于 2019-12-13 04:31:51
问题 I'm playing with the Checker Framework and its annotation processor requires the path to the "annotated JDK" jar to be passed to it so that it can add type annotations to the JDK classes. So, what I need Gradle to do is go get the path to the jar and pass it to the java compiler. Pretty simple, normally, in Gradle: // tried to keep this property in the project.extensions but wouldn't work final AtomicReference jarRef = new AtomicReference() task resolveAnnotatedJdk << { def jar =

NullnessChecker: how to disable only the Initialization checker?

假装没事ソ 提交于 2019-12-12 04:08:32
问题 I refer to the nullness-example in the docs (checker-framework version: 2.1.14 ) When I run the example as recommended to check NullnessExampleWithWarnings.java: javac -processor org.checkerframework.checker.nullness.NullnessChecker docs/examples/NullnessExampleWithWarnings.java I get the expected errors: ..\..\docs\examples\NullnessExampleWithWarnings.java:23: error: [assignment.type.incompatible] incompatible types in assignment. foo = bar; ^ found : @FBCBottom @Nullable String required:

How to suppress “unknown enum constant” warnings?

我怕爱的太早我们不能终老 提交于 2019-12-11 00:53:58
问题 The Checkers Framework references java.lang.annotation.ElementType.TYPE_USE which was added in JDK8. When I use it under JDK7, I get the following warning: unknown enum constant java.lang.annotation.ElementType.TYPE_USE This is a reasonable warning, but how do I suppress it for cases I believe are harmless ? 回答1: It turns out there is no such thing as a harmless unknown enum constant. Once I got past the compiler warnings, I ran into exceptions at runtime: java.lang.ArrayStoreException: sun