Skip to content
Permalink
Browse files

Try Checker Framework instead of JSR 305

  • Loading branch information...
tlinkowski committed Aug 17, 2019
1 parent e0d22bd commit 36d6b894ffe4a011d9c508483bd92b2ab7a073eb
@@ -29,8 +29,7 @@ config {
}

dependencies {
// do NOT expose JSR 305 to library users
implementation(group = "com.google.code.findbugs", name = "jsr305", version = "3.0.2")
api(group = "org.checkerframework", name = "checker-qual", version = "2.10.0")

val kotlinVersion: String by project
api(group = "org.jetbrains.kotlin", name = "kotlin-annotations-jvm", version = kotlinVersion)
@@ -37,6 +37,6 @@
module pl.tlinkowski.annotation.basic {
exports pl.tlinkowski.annotation.basic;

requires jsr305;
requires transitive org.checkerframework.checker.qual;
requires transitive kotlin.annotations.jvm;
}

This file was deleted.

This file was deleted.

@@ -21,8 +21,7 @@

import kotlin.annotations.jvm.Mutable;
import kotlin.annotations.jvm.ReadOnly;

import pl.tlinkowski.annotation.basic.NullOr;
import org.checkerframework.checker.nullness.qual.Nullable;

/**
* @author Tomasz Linkowski
@@ -35,17 +34,17 @@
void setReadOnlyListOfObj(@ReadOnly List<Object> list);

@ReadOnly
List<@NullOr Object> getReadOnlyListOfObjOrNull();
List<@Nullable Object> getReadOnlyListOfObjOrNull();

void setReadOnlyListOfObjOrNull(@ReadOnly List<@NullOr Object> list);
void setReadOnlyListOfObjOrNull(@ReadOnly List<@Nullable Object> list);

@Mutable
List<Object> getMutableListOfObj();

void setMutableListOfObj(@Mutable List<Object> list);

@Mutable
List<@NullOr Object> getMutableListOfObjOrNull();
List<@Nullable Object> getMutableListOfObjOrNull();

void setMutableListOfObjOrNull(@Mutable List<@NullOr Object> list);
void setMutableListOfObjOrNull(@Mutable List<@Nullable Object> list);
}
@@ -15,7 +15,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@NonNullPackage
@DefaultQualifier(NonNull.class)
package pl.tlinkowski.sample.api.annotated.both;

import pl.tlinkowski.annotation.basic.NonNullPackage;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier;
@@ -19,7 +19,7 @@

import java.util.List;

import pl.tlinkowski.annotation.basic.NullOr;
import org.checkerframework.checker.nullness.qual.Nullable;

/**
* @author Tomasz Linkowski
@@ -30,15 +30,15 @@

void setObj(Object obj);

@NullOr Object getObjOrNull();
@Nullable Object getObjOrNull();

void setObjOrNull(@NullOr Object obj);
void setObjOrNull(@Nullable Object obj);

List<Object> getListOfObj();

void setListOfObj(List<Object> list);

List<@NullOr Object> getListOfObjOrNull();
List<@Nullable Object> getListOfObjOrNull();

void setListOfObjOrNull(List<@NullOr Object> list);
void setListOfObjOrNull(List<@Nullable Object> list);
}
@@ -15,7 +15,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@NonNullPackage
@DefaultQualifier(NonNull.class)
package pl.tlinkowski.sample.api.annotated.nullability;

import pl.tlinkowski.annotation.basic.NonNullPackage;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier;

0 comments on commit 36d6b89

Please sign in to comment.
You can’t perform that action at this time.