Skip to content

Commit

Permalink
Merge branch 'master' into update-jspecify
Browse files Browse the repository at this point in the history
  • Loading branch information
msridhar committed Nov 9, 2022
2 parents e1ea7f6 + eb62d57 commit 60872c1
Show file tree
Hide file tree
Showing 38 changed files with 1,878 additions and 411 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ jobs:
epVersion: 2.4.0
- os: macos-latest
java: 11
epVersion: 2.15.0
epVersion: 2.16
- os: ubuntu-latest
java: 11
epVersion: 2.15.0
epVersion: 2.16
- os: windows-latest
java: 11
epVersion: 2.15.0
epVersion: 2.16
- os: ubuntu-latest
java: 17
epVersion: 2.15.0
epVersion: 2.16
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Check out NullAway sources
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: 'Set up JDK ${{ matrix.java }}'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
with:
arguments: coveralls
continue-on-error: true
if: runner.os == 'Linux' && matrix.java == '11' && matrix.epVersion == '2.15.0' && github.repository == 'uber/NullAway'
if: runner.os == 'Linux' && matrix.java == '11' && matrix.epVersion == '2.16' && github.repository == 'uber/NullAway'
- name: Check that Git tree is clean after build and test
run: ./.buildscript/check_git_clean.sh
publish_snapshot:
Expand All @@ -80,9 +80,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: 'Set up JDK 8'
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: 8
distribution: 'temurin'
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
Changelog
=========
Version 0.10.4
--------------
(Bug fix release)
* Fix LibraryModels recording of dataflow nullness for Map APs (#685)
* Proper checking of unboxing in binary trees (#684)
* Build / CI tooling for NullAway itself:
- Bump dependency versions in GitHub Actions config (#683)

Version 0.10.3
--------------
* Report an error when casting @Nullable expression to primitive type (#663)
* Fix an NPE in the optional emptiness handler (#678)
* Add support for boolean constraints (about nullness) in Contract annotations (#669)
* Support for specific libraries/APIs:
- PreconditionsHandler reflects Guava Preconditions exception types (#668)
- Handle Guava Verify functions (#682)
* Dependency Updates:
- checkerframework 3.26.0 (#671)
* Build / CI tooling for NullAway itself:
- Build and test against Error Prone 2.15.0 (#665)
- Bump Error Prone and EP plugin to 2.16 (#675)

Version 0.10.2
--------------
* Make AbstractConfig collection fields explicity Immutable (#601)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ plugins {
}
dependencies {
annotationProcessor "com.uber.nullaway:nullaway:0.10.2"
annotationProcessor "com.uber.nullaway:nullaway:0.10.4"
// Optional, some source of nullability annotations.
// Not required on Android if you use the support
Expand Down Expand Up @@ -75,7 +75,7 @@ The configuration for an Android project is very similar to the Java case, with

```gradle
dependencies {
annotationProcessor "com.uber.nullaway:nullaway:0.10.2"
annotationProcessor "com.uber.nullaway:nullaway:0.10.4"
errorprone "com.google.errorprone:error_prone_core:2.4.0"
errorproneJavac "com.google.errorprone:javac:9+181-r4173-1"
}
Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ buildscript {
}
plugins {
id "com.github.sherter.google-java-format" version "0.9"
id "net.ltgt.errorprone" version "2.0.2" apply false
id "net.ltgt.errorprone" version "3.0.1" apply false
id "com.github.johnrengelman.shadow" version "6.1.0" apply false
id "com.github.kt3k.coveralls" version "2.12.0" apply false
id "me.champeau.jmh" version "0.6.7" apply false
Expand All @@ -54,7 +54,6 @@ subprojects { project ->
project.apply plugin: "net.ltgt.errorprone"
project.dependencies {
errorprone deps.build.errorProneCore
errorproneJavac deps.build.errorProneJavac
}
project.tasks.withType(JavaCompile) {
dependsOn(installGitHooks)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ org.gradle.caching=true
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m

GROUP=com.uber.nullaway
VERSION_NAME=0.10.3-SNAPSHOT
VERSION_NAME=0.10.5-SNAPSHOT

POM_DESCRIPTION=A fast annotation-based null checker for Java

Expand Down
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import org.gradle.util.VersionNumber
// The oldest version of Error Prone that we support running on
def oldestErrorProneVersion = "2.4.0"
// Latest released Error Prone version that we've tested with
def latestErrorProneVersion = "2.15.0"
def latestErrorProneVersion = "2.16"
// Default to using latest tested Error Prone version, except on Java 8, where 2.10.0 is the last version
// that works
def defaultErrorProneVersion = JavaVersion.current() >= JavaVersion.VERSION_11 ? latestErrorProneVersion : "2.10.0"
Expand Down
11 changes: 7 additions & 4 deletions nullaway/src/main/java/com/uber/nullaway/CodeAnnotationInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,19 @@ public static CodeAnnotationInfo instance(Context context) {
private static boolean fromAnnotatedPackage(
Symbol.ClassSymbol outermostClassSymbol, Config config) {
final String className = outermostClassSymbol.getQualifiedName().toString();
Symbol.PackageSymbol enclosingPackage = ASTHelpers.enclosingPackage(outermostClassSymbol);
if (!config.fromExplicitlyAnnotatedPackage(className)
&& !ASTHelpers.hasDirectAnnotationWithSimpleName(
outermostClassSymbol.packge(), NullabilityUtil.NULLMARKED_SIMPLE_NAME)) {
&& !(enclosingPackage != null
&& ASTHelpers.hasDirectAnnotationWithSimpleName(
enclosingPackage, NullabilityUtil.NULLMARKED_SIMPLE_NAME))) {
// By default, unknown code is unannotated unless @NullMarked or configured as annotated by
// package name
return false;
}
if (config.fromExplicitlyUnannotatedPackage(className)
|| ASTHelpers.hasDirectAnnotationWithSimpleName(
outermostClassSymbol.packge(), NullabilityUtil.NULLUNMARKED_SIMPLE_NAME)) {
|| (enclosingPackage != null
&& ASTHelpers.hasDirectAnnotationWithSimpleName(
enclosingPackage, NullabilityUtil.NULLUNMARKED_SIMPLE_NAME))) {
// Any code explicitly marked as unannotated in our configuration is unannotated, no matter
// what. Similarly, any package annotated as @NullUnmarked is unannotated, even if
// explicitly passed to -XepOpt:NullAway::AnnotatedPackages
Expand Down
4 changes: 3 additions & 1 deletion nullaway/src/main/java/com/uber/nullaway/ErrorBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,9 @@ void reportInitErrorOnField(Symbol symbol, VisitorState state, Description.Build
fieldName = flatName.substring(index) + "." + fieldName;
}

if (symbol.isStatic()) {
@SuppressWarnings("ASTHelpersSuggestions") // remove once we require EP 2.16 or greater
boolean isStatic = symbol.isStatic();
if (isStatic) {
state.reportMatch(
createErrorDescription(
new ErrorMessage(
Expand Down
Loading

0 comments on commit 60872c1

Please sign in to comment.