Replace isAssignableFrom() with isInstance() where feasible

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>

See gh-50750
This commit is contained in:
Yanming Zhou
2026-06-24 19:11:59 +01:00
committed by Andy Wilkinson
parent 65097a4652
commit 9d5c98b7e9
12 changed files with 32 additions and 26 deletions
+12
View File
@@ -88,6 +88,18 @@
value="Please use static AssertJ imports." />
<property name="ignoreComments" value="true" />
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
<property name="maximum" value="0"/>
<property name="format" value="\.isAssignableFrom\(.+\.getClass\(\)\)" />
<property name="message" value="Please use type.isInstance(object) instead." />
<property name="ignoreComments" value="true" />
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
<property name="maximum" value="0"/>
<property name="format" value="\w+\.class\.isInstance\(.+\)" />
<property name="message" value="Please use object instanceof type instead." />
<property name="ignoreComments" value="true" />
</module>
<module name="io.spring.javaformat.checkstyle.check.SpringJavadocCheck">
<property name="publicOnlySinceTags" value="true" />
<property name="requireSinceTag" value="true" />