private JMethod getMethodsMap ( MethodType type , JFieldVar field , ClassOutline co ) { String getterBody = "return " + field . name ( ) + ";" ; for ( JMethod method : co . implClass . methods ( ) ) { String name = method . name ( ) ; if ( method . type ( ) . isPrimitive ( ) ) { if ( MethodType . GETTER == type && ( name . startsWith ( "is" ) || name . startsWith ( "get" ) ) ) { JStatement o = ( JStatement ) method . body ( ) . getContents ( ) . get ( 0 ) ; String s = getterBody ( o ) ; if ( s . trim ( ) . equals ( getterBody ) ) { return method ; } } else if ( MethodType . SETTER == type && name . startsWith ( "set" ) ) { JStatement o = ( JStatement ) method . body ( ) . getContents ( ) . get ( 0 ) ; String s = setterBody ( o ) ; if ( s . startsWith ( "this." + field . name ( ) + " =" ) ) { return method ; } } } } throw new RuntimeException ( "Failed to find " + type + " for " + field . name ( ) + ", disable XReplacePrimitives and report a bug" ) ; }
I hate this shit