Skip to content

Commit

Permalink
Update to JSpecify 0.3-alpha2 (#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
msridhar authored Nov 29, 2022
1 parent 36fd783 commit dafe8cb
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def build = [
checkerDataflow : "org.checkerframework:dataflow-nullaway:${versions.checkerFramework}",
guava : "com.google.guava:guava:24.1.1-jre",
javaxValidation : "javax.validation:validation-api:2.0.1.Final",
jspecify : "org.jspecify:jspecify:0.3.0-alpha-1",
jspecify : "org.jspecify:jspecify:0.3.0-alpha-2",
jsr305Annotations : "com.google.code.findbugs:jsr305:3.0.2",
commonsIO : "commons-io:commons-io:2.11.0",
wala : ["com.ibm.wala:com.ibm.wala.util:${versions.wala}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static CodeAnnotationInfo instance(Context context) {
/**
* Checks if a symbol comes from an annotated package, as determined by either configuration flags
* (e.g. {@code -XepOpt:NullAway::AnnotatedPackages}) or package level annotations (e.g. {@code
* org.jspecify.nullness.NullMarked}).
* org.jspecify.annotations.NullMarked}).
*
* @param outermostClassSymbol symbol for class (must be an outermost class)
* @param config NullAway config
Expand Down
2 changes: 1 addition & 1 deletion nullaway/src/main/java/com/uber/nullaway/NullAway.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private enum NullMarking {
FULLY_UNMARKED,
/**
* class has a mix of annotatedness, depending on presence of {@link
* org.jspecify.nullness.NullMarked} annotations
* org.jspecify.annotations.NullMarked} annotations
*/
PARTIALLY_MARKED
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ public void testMapComputeIfAbsent() {
"import java.util.Map;",
"import java.util.function.Function;",
// Need JSpecify (vs javax) for annotating generics
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"class Test {",
" Object testComputeIfAbsent(String key, Function<String, Object> f, Map<String, Object> m){",
" m.computeIfAbsent(key, f);",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public void basicTypeParamInstantiation() {
.addSourceLines(
"Test.java",
"package com.uber;",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"class Test {",
" static class NonNullTypeParam<E> {}",
" static class NullableTypeParam<E extends @Nullable Object> {}",
Expand All @@ -32,7 +32,7 @@ public void constructorTypeParamInstantiation() {
.addSourceLines(
"Test.java",
"package com.uber;",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"class Test {",
" static class NonNullTypeParam<E> {}",
" static class NullableTypeParam<E extends @Nullable Object> {}",
Expand Down Expand Up @@ -62,7 +62,7 @@ public void multipleTypeParametersInstantiation() {
.addSourceLines(
"Test.java",
"package com.uber;",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"class Test {",
" static class MixedTypeParam<E1, E2 extends @Nullable Object, E3 extends @Nullable Object, E4> {}",
" // BUG: Diagnostic contains: Generic type parameter",
Expand All @@ -82,7 +82,7 @@ public void subClassTypeParamInstantiation() {
.addSourceLines(
"Test.java",
"package com.uber;",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"class Test {",
" static class NonNullTypeParam<E> {}",
" static class NullableTypeParam<E extends @Nullable Object> {}",
Expand All @@ -101,7 +101,7 @@ public void interfaceImplementationTypeParamInstantiation() {
.addSourceLines(
"Test.java",
"package com.uber;",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"class Test {",
" static interface NonNullTypeParamInterface<E>{}",
" static interface NullableTypeParamInterface<E extends @Nullable Object>{}",
Expand All @@ -118,7 +118,7 @@ public void nestedTypeParams() {
.addSourceLines(
"Test.java",
"package com.uber;",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"class Test {",
" static class NonNullTypeParam<E> {}",
" static class NullableTypeParam<E extends @Nullable Object> {}",
Expand All @@ -141,7 +141,7 @@ public void returnTypeParamInstantiation() {
.addSourceLines(
"Test.java",
"package com.uber;",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"class Test {",
" static class NonNullTypeParam<E> {}",
" static class NullableTypeParam<E extends @Nullable Object> {}",
Expand All @@ -163,7 +163,7 @@ public void testOKNewClassInstantiationForOtherAnnotations() {
"Test.java",
"package com.uber;",
"import lombok.NonNull;",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"class Test {",
" static class NonNullTypeParam<E> {}",
" static class DifferentAnnotTypeParam1<E extends @NonNull Object> {}",
Expand All @@ -187,7 +187,7 @@ public void downcastInstantiation() {
.addSourceLines(
"Test.java",
"package com.uber;",
"import org.jspecify.nullness.Nullable;",
"import org.jspecify.annotations.Nullable;",
"class Test {",
" static class NonNullTypeParam<E> { }",
" static void instOf(Object o) {",
Expand Down
Loading

0 comments on commit dafe8cb

Please sign in to comment.