Illegal property "com.xxx.SomeEntity.isXxx", the method whose name starts with "is" return returns boolean type
异常情况
当返回值类型为 Java 基本类型,如 int 时,编译报错信息不友好,以 Maven 为例:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project xxx: Fatal error compiling: java.lang.NullPointerException: Cannot invoke "javax.lang.model.element.Element.toString()" because the return value of "javax.lang.model.util.Types.asElement(javax.lang.model.type.TypeMirror)" is null -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
正常情况
当
Entity
实体中isXxx()
的返回值类型为非boolean
/Boolean
的引用类型时,编译报错提示如下:异常情况
当返回值类型为 Java 基本类型,如
int
时,编译报错信息不友好,以 Maven 为例: