Buggy code:
public class BinaryTypeConverter { public static TypeDeclaration buildTypeDeclaration ( IType type , CompilationUnitDeclaration compilationUnit , CompilationResult compilationResult ) throws JavaModelException { } private static FieldDeclaration convert ( IField field , IType type ) throws JavaModelException { } private static AbstractMethodDeclaration convert ( IMethod method , IType type , CompilationResult compilationResult ) throws JavaModelException { } private static TypeDeclaration convert ( IType type , IType alreadyComputedMember , TypeDeclaration alreadyComputedMemberDeclaration , CompilationResult compilationResult ) throws JavaModelException { TypeDeclaration typeDeclaration = new TypeDeclaration ( compilationResult ) ; if ( ( type . getDeclaringType ( ) ) != null ) { <START_BUG> typeDeclaration . bits |= IsMemberTypeMASK ; <END_BUG> } typeDeclaration . name = type . getElementName ( ) . toCharArray ( ) ; typeDeclaration . modifiers = type . getFlags ( ) ; if ( ( type . getSuperclassName ( ) ) != null ) { typeDeclaration . superclass = BinaryTypeConverter . createTypeReference ( type . getSuperclassName ( ) . toCharArray ( ) ) ; typeDeclaration . superclass . bits |= ASTNode . IsSuperType ; } String [ ] interfaceNames = type . getSuperInterfaceNames ( ) ; int interfaceCount = ( interfaceNames == null ) ? 0 : interfaceNames . length ; typeDeclaration . superInterfaces = new TypeReference [ interfaceCount ] ; for ( int i = 0 ; i < interfaceCount ; i ++ ) { typeDeclaration . superInterfaces [ i ] = BinaryTypeConverter . createTypeReference ( interfaceNames [ i ] . toCharArray ( ) ) ; typeDeclaration . superInterfaces [ i ] . bits |= ASTNode . IsSuperType ; } IType [ ] memberTypes = type . getTypes ( ) ; int memberTypeCount = ( memberTypes == null ) ? 0 : memberTypes . length ; typeDeclaration . memberTypes = new TypeDeclaration [ memberTypeCount ] ; for ( int i = 0 ; i < memberTypeCount ; i ++ ) { if ( ( alreadyComputedMember != null ) && ( alreadyComputedMember . getFullyQualifiedName ( ) . equals ( memberTypes [ i ] . getFullyQualifiedName ( ) ) ) ) { typeDeclaration . memberTypes [ i ] = alreadyComputedMemberDeclaration ; } else { typeDeclaration . memberTypes [ i ] = BinaryTypeConverter . convert ( memberTypes [ i ] , null , null , compilationResult ) ; } } IField [ ] fields = type . getFields ( ) ; int fieldCount = ( fields == null ) ? 0 : fields . length ; typeDeclaration . fields = new FieldDeclaration [ fieldCount ] ; for ( int i = 0 ; i < fieldCount ; i ++ ) { typeDeclaration . fields [ i ] = BinaryTypeConverter . convert ( fields [ i ] , type ) ; } IMethod [ ] methods = type . getMethods ( ) ; int methodCount = ( methods == null ) ? 0 : methods . length ; int neededCount = 1 ; for ( int i = 0 ; i < methodCount ; i ++ ) { if ( methods [ i ] . isConstructor ( ) ) { neededCount = 0 ; break ; } } boolean isInterface = type . isInterface ( ) ; neededCount = ( isInterface ) ? 0 : neededCount ; typeDeclaration . methods = new AbstractMethodDeclaration [ methodCount + neededCount ] ; if ( neededCount != 0 ) { typeDeclaration . methods [ 0 ] = typeDeclaration . createDefaultConstructor ( false , false ) ; } boolean hasAbstractMethods = false ; for ( int i = 0 ; i < methodCount ; i ++ ) { AbstractMethodDeclaration method = BinaryTypeConverter . convert ( methods [ i ] , type , compilationResult ) ; boolean isAbstract ; if ( ( isAbstract = method . isAbstract ( ) ) || isInterface ) { method . modifiers |= CompilerModifiers . AccSemicolonBody ; } if ( isAbstract ) { hasAbstractMethods = true ; } typeDeclaration . methods [ ( neededCount + i ) ] = method ; } if ( hasAbstractMethods ) { typeDeclaration . bits |= ASTNode . HasAbstractMethods ; } return typeDeclaration ; } private static TypeReference createTypeReference ( char [ ] type ) { } }

Fix:
typeDeclaration . bits |= ASTNode . IsMemberType ;