Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -573,16 +573,15 @@ public static void verifyNoIsVariantExists(
Method getMethod,
String stemName) {
// verify that the Class<?> does not also define a method with the same stem name with 'is'
try {
final Method isMethod = containerClass.getDeclaredMethod( "is" + stemName );
if ( !Modifier.isStatic( isMethod.getModifiers() ) && isMethod.getAnnotation( Transient.class ) == null ) {
// No such method should throw the caught exception. So if we get here, there was
// such a method.
checkGetAndIsVariants( containerClass, propertyName, getMethod, isMethod );
for ( Method declaredMethod : containerClass.getDeclaredMethods() ) {
if ( declaredMethod.getParameterCount() == 0
&& !Modifier.isStatic( declaredMethod.getModifiers() )
&& declaredMethod.getName().startsWith( "is" )
&& declaredMethod.getName().regionMatches( 2, stemName, 0, stemName.length() )
&& declaredMethod.getAnnotation( Transient.class ) == null ) {
checkGetAndIsVariants( containerClass, propertyName, getMethod, declaredMethod );
}
}
catch (NoSuchMethodException ignore) {
}
}


Expand Down Expand Up @@ -613,17 +612,15 @@ public static void verifyNoGetVariantExists(
Method isMethod,
String stemName) {
// verify that the Class<?> does not also define a method with the same stem name with 'is'
try {
final Method getMethod = containerClass.getDeclaredMethod( "get" + stemName );
// No such method should throw the caught exception. So if we get here, there was
// such a method.
if ( !Modifier.isStatic( getMethod.getModifiers() )
&& getMethod.getAnnotation( Transient.class ) == null ) {
checkGetAndIsVariants( containerClass, propertyName, getMethod, isMethod );
for ( Method declaredMethod : containerClass.getDeclaredMethods() ) {
if ( declaredMethod.getParameterCount() == 0
&& !Modifier.isStatic( declaredMethod.getModifiers() )
&& declaredMethod.getName().startsWith( "get" )
&& declaredMethod.getName().regionMatches( 3, stemName, 0, stemName.length() )
&& declaredMethod.getAnnotation( Transient.class ) == null ) {
checkGetAndIsVariants( containerClass, propertyName, declaredMethod, isMethod );
}
}
catch (NoSuchMethodException ignore) {
}
}

public static Method getterMethodOrNull(Class<?> containerJavaType, String propertyName) {
Expand Down
Loading