IDEA 不想使用 javax 中的 NotNull,而是使用 org.jetbrains
IDEA doesnt want to use NotNull from javax, but instead use org.jetbrains
当我在我的 DTO 中的 @NotNull 注释上看到这个时,我正在设置我的项目
Not 'javax.validation.constraints.NotNull' but 'org.jetbrains.annotations.NotNull' would be used for code generation
我有导入 javax.validation.constraints.NotNull;
但还是看到这个警告。
为什么 IDEA 不想使用 javax NotNull,我应该怎么做才能强制使用它?
When you compile your project, the IDE adds assertions to all methods and parameters annotated with the @NotNull annotation. The assertions will fail if null is passed in code where @NotNull is expected. You can disable this option and configure the list of annotations in the Settings/Preferences dialog Ctrl+Alt+S. Go to Build, Execution, Deployment | Compiler.
https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html
也许这样就可以了。
当我在我的 DTO 中的 @NotNull 注释上看到这个时,我正在设置我的项目
Not 'javax.validation.constraints.NotNull' but 'org.jetbrains.annotations.NotNull' would be used for code generation
我有导入 javax.validation.constraints.NotNull;
但还是看到这个警告。
为什么 IDEA 不想使用 javax NotNull,我应该怎么做才能强制使用它?
When you compile your project, the IDE adds assertions to all methods and parameters annotated with the @NotNull annotation. The assertions will fail if null is passed in code where @NotNull is expected. You can disable this option and configure the list of annotations in the Settings/Preferences dialog Ctrl+Alt+S. Go to Build, Execution, Deployment | Compiler.
https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html
也许这样就可以了。