-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
type: questionFurther information is requestedFurther information is requested
Description
Question
I have seen many recently pr change ==null to Objects.isNull. Can we consider using checkstyle to avoid? I tried it locally and found that there are quite a few areas that need to be modified.
checkstyle config as follows:
<module name="RegexpSinglelineJava">
<property name="format" value="==\s*null"/>
<property name="message" value="Use Objects.isNull() instead of == null"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="null\s*=="/>
<property name="message" value="Use Objects.isNull() instead of null =="/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="!=\s*null"/>
<property name="message" value="Use Objects.nonNull() instead of != null"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="null\s*!="/>
<property name="message" value="Use Objects.nonNull() instead of null !="/>
</module>Metadata
Metadata
Assignees
Labels
type: questionFurther information is requestedFurther information is requested