I'm using the Vertx Service Gen annotation processor with Kotlin kapt.
Before the annotation processor kick in, my kapt failed with following exception message all over the place:
error: scoping construct cannot be annotated with type-use annotation: @org.jetbrains.annotations.NotNull
Example of such is as following:
e: C:\Users\...\build\tmp\kapt3\stubs\main\com\_masked_\objects\User.java:10: error: scoping construct cannot be annotated with type-use annotation: @org.jetbrains.annotations.NotNull
public abstract java.lang.String getUserName();
e: C:\Users\...\build\tmp\kapt3\stubs\main\com\_masked_\objects\User.java:13: error: scoping construct cannot be annotated with type-use annotation: @org.jetbrains.annotations.NotNull
public abstract java.lang.String getUrlKey();
^
e: C:\Users\...\build\tmp\kapt3\stubs\main\com\_masked_\objects\User.java:16: error: scoping construct cannot be annotated with type-use annotation: @org.jetbrains.annotations.NotNull
public abstract com._.objects.File getAvatar();
^
...
The source code generated by kapt:
public abstract interface User {
public static final com._.objects.User.Companion Companion = null;
@org.jetbrains.annotations.NotNull()
public abstract java.lang.String getUserName(); // line 10
@org.jetbrains.annotations.NotNull()
public abstract java.lang.String getUrlKey(); // line 13
@org.jetbrains.annotations.NotNull()
public abstract com._.objects.File getAvatar(); // line 16
...
}
Its source kotlin file looks like:
interface User {
val userName: String
val urlKey: String
val avatar: File
val signature: String
}
Through reading this thread, I kinda understand the situation right now, but how do I resolve this issue?