Skip to content

Commit 8185714

Browse files
committed
better impl
1 parent 6530291 commit 8185714

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hibernate-core/src/main/java/org/hibernate/internal/util/ReflectHelper.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,8 @@ public static void verifyNoIsVariantExists(
577577
for ( Method declaredMethod : containerClass.getDeclaredMethods() ) {
578578
if ( declaredMethod.getParameterCount() == 0
579579
&& !Modifier.isStatic( declaredMethod.getModifiers() )
580-
&& Objects.equals( declaredMethod.getName(), "is" + stemName )
580+
&& declaredMethod.getName().startsWith("is")
581+
&& declaredMethod.getName().regionMatches(0, stemName, 0, stemName.length() )
581582
&& declaredMethod.getAnnotation( Transient.class ) == null ) {
582583
checkGetAndIsVariants( containerClass, propertyName, getMethod, declaredMethod );
583584
}
@@ -615,7 +616,8 @@ public static void verifyNoGetVariantExists(
615616
for ( Method declaredMethod : containerClass.getDeclaredMethods() ) {
616617
if ( declaredMethod.getParameterCount() == 0
617618
&& !Modifier.isStatic( declaredMethod.getModifiers() )
618-
&& Objects.equals( declaredMethod.getName(), "get" + stemName )
619+
&& declaredMethod.getName().startsWith("is")
620+
&& declaredMethod.getName().regionMatches(0, stemName, 0, stemName.length() )
619621
&& declaredMethod.getAnnotation( Transient.class ) == null ) {
620622
checkGetAndIsVariants( containerClass, propertyName, declaredMethod, isMethod );
621623
}

0 commit comments

Comments
 (0)