Skip to content
New issue

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

Update README.md - Annotator example #261

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* THE SOFTWARE.
*/

package edu.ucr.cs.riple.annotator.sample;
package com.example;

public class Test {
Object f1 = null;
Expand Down
Loading