Make default value for -Xjsr305 flag to be WARN

This commit is contained in:
Denis Zharkov
2017-09-14 11:18:49 +03:00
parent 2ca220d442
commit 363d345752
7 changed files with 50 additions and 4 deletions
+4
View File
@@ -0,0 +1,4 @@
@javax.annotation.ParametersAreNonnullByDefault
public class A {
public void foo(String x) {}
}
@@ -0,0 +1,28 @@
package javax.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.annotation.meta.TypeQualifierDefault;
/**
* This annotation can be applied to a package, class or method to indicate that
* the method parameters in that element are nonnull by default unless there is:
* <ul>
* <li>An explicit nullness annotation
* <li>The method overrides a method in a superclass (in which case the
* annotation of the corresponding parameter in the superclass applies)
* <li>There is a default parameter annotation (like {@link ParametersAreNullableByDefault})
* applied to a more tightly nested element.
* </ul>
*
* @see Nonnull
*/
@Documented
@Nonnull
@TypeQualifierDefault(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface ParametersAreNonnullByDefault {
}
+4
View File
@@ -0,0 +1,4 @@
$TESTDATA_DIR$/jsr305Usage.kt
$TESTDATA_DIR$/jsr305
-d
$TEMP_DIR$
+4
View File
@@ -0,0 +1,4 @@
compiler/testData/cli/jvm/jsr305Usage.kt:2:11: warning: expected type does not accept nulls in Java, but the value may be null in Kotlin
a.foo(null)
^
OK