• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uber / NullAway / #757
93%

Build:
DEFAULT BRANCH: master
Ran 09 Feb 2022 04:15AM UTC
Jobs 1
Files 69
Run time 13s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
#757

push

github-actions

web-flow
Serialization of Type Change Suggestions for Type Violations. (#517)

This PR enables ```NullAway``` to serialize information on code locations to resolve the reporting errors if they can be resolved via a type change. This information can be used by other tools such as [AutoFixer](https://github.com/nimakarimipour/NullAwayAutoFixer) to have an understanding of the source code, code points where violations occurred, and possible solutions. In the example below, ```NullAway``` will report the error: 
```assigning @Nullable null to @Nonnull bar```. 

```java
class Foo {
     Object bar = new Object();
     
     void baz(){
           this.bar = null;
     }
}
```
This PR enables ```NullAway``` to suggest ```bar``` type to be ```@Nullable``` to resolve the error and creates two output files. ```errors.tsv``` where all reporting errors are stored and ```fixes.tsv``` where all the type change suggestions are stored.

1. ```errors.tsv```: Every row represents a reporting error with the format: ```MESSAGE_TYPE, MESSAGE, ENCLOSING CLASS, ENCLOSING METHOD```
For instance: ```ASSIGN_FIELD_NULLABLE, assigning nullable null to field bar, Foo, baz```
2. ```fixes.tsv```: Every row represents a type change suggestion with the format: ```LOCATION, MESSAGE_TYPE, ANNOT```
For instance: ```Field bar of Foo, ASSIGN_FIELD_NULLABLE, @Nullable```

To activate the feature above the following flags must be passed to ```NullAway``` via ```ErrorProneFlags```:

```
"-XepOpt:NullAway:SerializeFixMetadata=true"
"-XepOpt:NullAway:FixSerializationConfigPath=configpath"
```

When ```-XepOpt:NullAway:SerializeFixMetadata=true``` is observed in the flags, ```NullAway``` will look for a file at ```FixSerializationConfigPath``` to activate/deactivate serialization features.

Below is the ```FixMetadataConfigPath``` format:

```xml
<serialization>
    <suggest activation="true" enclosing="true"/>
    <output>
           "outputdir"
    </output>
    <a... (continued)

4614 of 4991 relevant lines covered (92.45%)

0.92 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #757.1 09 Feb 2022 04:15AM UTC 0
92.45
Source Files on build #757
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #757
  • 9dbdd650 on github
  • Prev Build on master
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc