From c39057e90303e6705acd7af2f0d4913bc423e09e Mon Sep 17 00:00:00 2001 From: Nima Karimipour Date: Tue, 19 Nov 2024 11:32:06 -0800 Subject: [PATCH 1/2] Update README.md Add package statement to Annotator expected output --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b41004c0e..d12436edb 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ The final output of Annotator is a source code that passes NullAway checks with In the code below, `NullAway` reports five warnings. ```java +package com.example; class Test{ Object f1 = null; // warning: assigning @Nullable expression to @NonNull field Object f2 = null; // warning: assigning @Nullable expression to @NonNull field @@ -49,6 +50,7 @@ For unresolved errors, suppression annotations are injected. The output below shows the result of running `Annotator` on the code above. ```java +package com.example; import javax.annotation.Nullable; // added by Annotator import org.jspecify.annotations.NullUnmarked; // added by Annotator From 812ca06a4e0f1964670473de139736255e7ea67a Mon Sep 17 00:00:00 2001 From: nimakarimipour Date: Tue, 19 Nov 2024 11:35:48 -0800 Subject: [PATCH 2/2] update sample as well --- sample/build.gradle | 2 +- .../src/main/java/edu/ucr/cs/riple/annotator/sample/Test.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sample/build.gradle b/sample/build.gradle index df2fe935d..b6b2a9539 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -57,7 +57,7 @@ tasks.withType(JavaCompile).configureEach { options.errorprone { check("NullAway", CheckSeverity.ERROR) check("AnnotatorScanner", CheckSeverity.ERROR) - option("NullAway:AnnotatedPackages", "edu.ucr.cs.riple") + option("NullAway:AnnotatedPackages", "com.example") option("NullAway:SerializeFixMetadata", "true") option("NullAway:FixSerializationConfigPath", nullaway_config_path) option("AnnotatorScanner:ConfigPath", scanner_config_path) diff --git a/sample/src/main/java/edu/ucr/cs/riple/annotator/sample/Test.java b/sample/src/main/java/edu/ucr/cs/riple/annotator/sample/Test.java index 2dbf12aa1..a9c3edf21 100644 --- a/sample/src/main/java/edu/ucr/cs/riple/annotator/sample/Test.java +++ b/sample/src/main/java/edu/ucr/cs/riple/annotator/sample/Test.java @@ -22,7 +22,7 @@ * THE SOFTWARE. */ -package edu.ucr.cs.riple.annotator.sample; +package com.example; public class Test { Object f1 = null;