Buggy code:
public class SourceTypeConverter { static class AnonymousMemberFound extends RuntimeException { private static final long serialVersionUID = 1L ; } public static final int FIELD = 1 ; public static final int CONSTRUCTOR = 2 ; public static final int METHOD = 4 ; public static final int MEMBER_TYPE = 8 ; public static final int FIELD_INITIALIZATION = 16 ; public static final int FIELD_AND_METHOD = ( ( SourceTypeConverter . FIELD ) | ( SourceTypeConverter . CONSTRUCTOR ) ) | ( SourceTypeConverter . METHOD ) ; public static final int LOCAL_TYPE = 32 ; public static final int NONE = 0 ; private int flags ; private CompilationUnitDeclaration unit ; private Parser parser ; private ProblemReporter problemReporter ; private ICompilationUnit cu ; private char [ ] source ; private HashMap annotationPositions ; private boolean has1_5Compliance ; int namePos ; private SourceTypeConverter ( int flags , ProblemReporter problemReporter ) { } public static CompilationUnitDeclaration buildCompilationUnit ( ISourceType [ ] sourceTypes , int flags , ProblemReporter problemReporter , CompilationResult compilationResult ) { } private CompilationUnitDeclaration convert ( ISourceType [ ] sourceTypes , CompilationResult compilationResult ) throws JavaModelException { } private void addIdentifiers ( String typeSignature , int start , int endExclusive , int identCount , ArrayList fragments ) { } private Initializer convert ( InitializerElementInfo initializerInfo , CompilationResult compilationResult ) throws JavaModelException { } private FieldDeclaration convert ( SourceField fieldHandle , TypeDeclaration type , CompilationResult compilationResult ) throws JavaModelException { } private QualifiedAllocationExpression convert ( IJavaElement localType , FieldDeclaration enumConstant , CompilationResult compilationResult ) throws JavaModelException { } private AbstractMethodDeclaration convert ( SourceMethod methodHandle , SourceMethodElementInfo methodInfo , CompilationResult compilationResult ) throws JavaModelException { } private TypeDeclaration convert ( SourceType typeHandle , CompilationResult compilationResult ) throws JavaModelException { SourceTypeElementInfo typeInfo = ( ( SourceTypeElementInfo ) ( typeHandle . getElementInfo ( ) ) ) ; if ( typeInfo . isAnonymousMember ( ) ) throw new SourceTypeConverter . AnonymousMemberFound ( ) ; TypeDeclaration type = new TypeDeclaration ( compilationResult ) ; if ( ( typeInfo . getEnclosingType ( ) ) == null ) { if ( typeHandle . isAnonymous ( ) ) { <START_BUG> type . name = ANONYMOUS_EMPTY_NAME ; <END_BUG> type . bits |= ( ASTNode . IsAnonymousType ) | ( ASTNode . IsLocalType ) ; } else { if ( typeHandle . isLocal ( ) ) { type . bits |= ASTNode . IsLocalType ; } } } else { type . bits |= ASTNode . IsMemberType ; } if ( ( ( type . bits ) & ( ASTNode . IsAnonymousType ) ) == 0 ) { type . name = typeInfo . getName ( ) ; } type . name = typeInfo . getName ( ) ; int start ; int end ; type . sourceStart = start = typeInfo . getNameSourceStart ( ) ; type . sourceEnd = end = typeInfo . getNameSourceEnd ( ) ; type . modifiers = typeInfo . getModifiers ( ) ; type . declarationSourceStart = typeInfo . getDeclarationSourceStart ( ) ; type . declarationSourceEnd = typeInfo . getDeclarationSourceEnd ( ) ; type . bodyEnd = type . declarationSourceEnd ; if ( this . has1_5Compliance ) { type . annotations = convertAnnotations ( typeHandle ) ; char [ ] [ ] typeParameterNames = typeInfo . getTypeParameterNames ( ) ; if ( ( typeParameterNames . length ) > 0 ) { int parameterCount = typeParameterNames . length ; char [ ] [ ] [ ] typeParameterBounds = typeInfo . getTypeParameterBounds ( ) ; type . typeParameters = new TypeParameter [ parameterCount ] ; for ( int i = 0 ; i < parameterCount ; i ++ ) { type . typeParameters [ i ] = createTypeParameter ( typeParameterNames [ i ] , typeParameterBounds [ i ] , start , end ) ; } } } if ( ( typeInfo . getSuperclassName ( ) ) != null ) { type . superclass = createTypeReference ( typeInfo . getSuperclassName ( ) , start , end ) ; type . superclass . bits |= ASTNode . IsSuperType ; } char [ ] [ ] interfaceNames = typeInfo . getInterfaceNames ( ) ; int interfaceCount = ( interfaceNames == null ) ? 0 : interfaceNames . length ; if ( interfaceCount > 0 ) { type . superInterfaces = new TypeReference [ interfaceCount ] ; for ( int i = 0 ; i < interfaceCount ; i ++ ) { type . superInterfaces [ i ] = createTypeReference ( interfaceNames [ i ] , start , end ) ; type . superInterfaces [ i ] . bits |= ASTNode . IsSuperType ; } } if ( ( ( this . flags ) & ( SourceTypeConverter . MEMBER_TYPE ) ) != 0 ) { SourceType [ ] sourceMemberTypes = typeInfo . getMemberTypeHandles ( ) ; int sourceMemberTypeCount = sourceMemberTypes . length ; type . memberTypes = new TypeDeclaration [ sourceMemberTypeCount ] ; for ( int i = 0 ; i < sourceMemberTypeCount ; i ++ ) { type . memberTypes [ i ] = convert ( sourceMemberTypes [ i ] , compilationResult ) ; } } InitializerElementInfo [ ] initializers = null ; int initializerCount = 0 ; if ( ( ( this . flags ) & ( SourceTypeConverter . LOCAL_TYPE ) ) != 0 ) { initializers = typeInfo . getInitializers ( ) ; initializerCount = initializers . length ; } SourceField [ ] sourceFields = null ; int sourceFieldCount = 0 ; if ( ( ( this . flags ) & ( SourceTypeConverter . FIELD ) ) != 0 ) { sourceFields = typeInfo . getFieldHandles ( ) ; sourceFieldCount = sourceFields . length ; } int length = initializerCount + sourceFieldCount ; if ( length > 0 ) { type . fields = new FieldDeclaration [ length ] ; for ( int i = 0 ; i < initializerCount ; i ++ ) { type . fields [ i ] = convert ( initializers [ i ] , compilationResult ) ; } int index = 0 ;

Fix:
type . name = CharOperation . NO_CHAR ;