Buggy code:
JSchemaTypeInfo . addStaticProductionMethods ( typeMethods , getOwnersType ( ) , this ) ; typeMethods . add ( new MethodInfoBuilder ( ) . withName ( "write" ) . withReturnType ( JavaTypes . STRING ( ) ) . withCallHandler ( new IMethodCallHandler ( ) { @ Override public Object handleCall ( Object ctx , Object ... args ) { return JSchemaUtils . serializeJson ( ctx ) ; } } ) . build ( this ) ) ; typeMethods . add ( new MethodInfoBuilder ( ) . withName ( "prettyPrint" ) . withParameters ( new ParameterInfoBuilder ( ) . withType ( JavaTypes . INTEGER ( ) ) . withName ( "indent" ) . withDefValue ( GosuShop . getNullExpressionInstance ( ) ) ) . withReturnType ( JavaTypes . STRING ( ) ) . withStatic ( true ) . withCallHandler ( new IMethodCallHandler ( ) { @ Override public Object handleCall ( Object ctx , Object ... args ) { Integer indent = Integer . valueOf ( 2 ) ; if ( ( args [ 0 ] ) != null ) { indent = ( ( Integer ) ( args [ 0 ] ) ) ; } return JSchemaUtils . serializeJson ( ctx , indent ) ; } } ) . build ( this ) ) ; typeMethods . add ( new MethodInfoBuilder ( ) . withName ( "asJson" ) . withReturnType ( TypeSystem . get ( JsonMap . class ) ) . withCallHandler ( new IMethodCallHandler ( ) { @ Override public Object handleCall ( Object ctx , Object ... args ) { return ctx ; } } ) . build ( this ) ) ; ITypeVariableType typeVar = TypeSystem . getOrCreateTypeVariableType ( "T" , JavaTypes . OBJECT ( ) , getOwnersType ( ) ) ; IType typeVarType = TypeSystem . getTypeFromObject ( typeVar ) ; _convertToMethod = new MethodInfoBuilder ( ) . withName ( "convertTo" ) . withTypeVars ( typeVar . getTypeVarDef ( ) . getTypeVar ( ) ) . withParameters ( new ParameterInfoBuilder ( ) . withName ( "type" ) . withType ( typeVarType ) ) . withReturnType ( typeVar ) . withCallHandler ( new IMethodCallHandler ( ) { @ Override public Object handleCall ( Object ctx , Object ... args ) { JsonMap ctxMap = ( ( JsonMap ) ( ctx ) ) ; IType targetType = ( ( IType ) ( args [ 0 ] ) ) ; if ( ! ( targetType instanceof IJSchemaType ) ) { throw new IllegalArgumentException ( "Can<seq2seq4repair_space>only<seq2seq4repair_space>be<seq2seq4repair_space>converted<seq2seq4repair_space>to<seq2seq4repair_space>other<seq2seq4repair_space>JSchema<seq2seq4repair_space>types!" ) ; } return JSchemaUtils . cloneToType ( ( ( IJSchemaType ) ( targetType ) ) , ctxMap , getOwnersType ( ) ) ; } } ) . build ( this ) ; typeMethods . add ( _convertToMethod ) ; IType outerParent = TypeSystem . getByFullNameIfValid ( getOwnersType ( ) . getNamespace ( ) ) ; final IType parentType ; if ( ( outerParent instanceof IJSchemaType ) && ( ! ( thisIsTypedefFor ( ( ( IJSchemaType ) ( outerParent ) ) ) ) ) ) { parentType = outerParent ; } else { parentType = TypeSystem . get ( JsonMap . class ) ; } typeMethods . add ( new MethodInfoBuilder ( ) . withName ( "parent" ) . withReturnType ( parentType ) . withCallHandler ( new IMethodCallHandler ( ) { @ Override public Object handleCall ( Object ctx , Object ... args ) { JsonMap jsonMap = ( ( JsonMap ) ( ctx ) ) ; JsonObject parent = jsonMap . getParent ( ) ; while ( ( parent != null ) && ( ! ( isStronglyTypedMap ( parent ) ) ) ) { parent = parent . getParent ( ) ; } return parent ; } } ) . build ( this ) ) ; typeMethods . add ( new MethodInfoBuilder ( ) . withName ( "descendents" ) . withReturnType ( Iterable . class ) . withCallHandler ( new IMethodCallHandler ( ) { @ Override public Object handleCall ( Object ctx , Object ... args ) { JsonMap jsonMap = ( ( JsonMap ) ( ctx ) ) ; return jsonMap . getDescendents ( ) ; } } ) . build ( this ) ) ; <START_BUG> ITypeVariableType typeVar2 = TypeSystem . getOrCreateTypeVariableType ( "T" , JavaTypes . OBJECT ( ) , getOwnersType ( ) ) ; <END_BUG> IType typeVarType2 = TypeSystem . getTypeFromObject ( typeVar2 ) ; _findMethod = new MethodInfoBuilder ( ) . withName ( "find" ) . withTypeVars ( typeVar2 . getTypeVarDef ( ) . getTypeVar ( ) ) . withParameters ( new ParameterInfoBuilder ( ) . withName ( "type" ) . withType ( typeVarType2 ) ) . withReturnType ( JavaTypes . LIST ( ) . getParameterizedType ( typeVar2 ) ) . withCallHandler ( new IMethodCallHandler ( ) { @ Override public Object handleCall ( Object ctx , Object ... args ) { JsonMap ctxMap = ( ( JsonMap ) ( ctx ) ) ; return ctxMap . findDescendents ( ( ( IType ) ( args [ 0 ] ) ) ) ; } } ) . build ( this ) ; typeMethods . add ( _findMethod ) ; return typeMethods ; } } private static void addStaticProductionMethods ( List < IMethodInfo > typeMethods , final IType producedType , ITypeInfo owner ) { } private static MethodInfoBuilder parseMethod ( IType ownersType ) { } private static Map < String , String > fixArgs ( Map arg ) { } public JSchemaTypeInfo ( IJSchemaType owner , Object object ) { } protected void createProperties ( ) { } private boolean isJsonEnum ( ) { } private List < IPropertyInfo > createEnumProperties ( ) { } private List < IPropertyInfo > createStructProperties ( ) { } private IAnnotationInfo makeMapAutoCreateAnnotation ( final IType propType ) { } private IAnnotationInfo makeListAutoCreateAnnotation ( final IType propType ) { } private IAnnotationInfo makeListAutoInsertAnnotation ( ) { } private IAnnotationInfo makeAutocreateAnnotation ( Function0 function ) { } private boolean isStronglyTypedMap ( JsonObject parent ) { }

Fix:
ITypeVariableType typeVar2 = TypeSystem . getOrCreateTypeVariableType ( "T" , JavaTypes . OBJECT ( ) , TypeSystem . getTypeReference ( getOwnersType ( ) ) ) ;