Buggy code:
class ASTConverter { private AST ast ; private char [ ] compilationUnitSource ; private Scanner scanner ; private boolean resolveBindings ; public ASTConverter ( boolean resolveBindings ) { } public void setAST ( AST ast ) { } public CompilationUnit convert ( CompilationUnitDeclaration unit , char [ ] source ) { } public PackageDeclaration convertPackage ( ImportReference importReference ) { } public ImportDeclaration convertImport ( ImportReference importReference ) { } public TypeDeclaration convert ( org . eclipse . jdt . internal . compiler . ast . TypeDeclaration typeDeclaration ) { } private void buildBodyDeclarations ( org . eclipse . jdt . internal . compiler . ast . TypeDeclaration typeDeclaration , TypeDeclaration typeDecl ) { } private void checkAndAddMultipleFieldDeclaration ( FieldDeclaration [ ] fields , int index , List bodyDeclarations ) { } private void checkAndAddMultipleLocalDeclaration ( Statement [ ] stmts , int index , List blockStatements ) { } public Name convert ( TypeReference typeReference ) { } public SimpleName convert ( SingleNameReference nameReference ) { } public Name convert ( QualifiedNameReference nameReference ) { } private QualifiedName setQualifiedNameNameAndSourceRanges ( char [ ] [ ] typeName , long [ ] positions , AstNode node ) { } public Expression convert ( ThisReference reference ) { } public ThisExpression convert ( QualifiedThisReference reference ) { } public Name convert ( QualifiedSuperReference reference ) { } public ArrayAccess convert ( ArrayReference reference ) { } public Expression convert ( FieldReference reference ) { } public Expression convert ( Reference reference ) { } public Name convert ( NameReference reference ) { } public TypeDeclaration convert ( MemberTypeDeclaration typeDeclaration ) { TypeDeclaration typeDecl = this . ast . newTypeDeclaration ( ) ; int modifiers = typeDeclaration . modifiers ; modifiers &= ~ ( CompilerModifiers . AccInterface ) ; modifiers &= CompilerModifiers . AccJustFlag ; try { typeDecl . setModifiers ( modifiers ) ; } catch ( IllegalArgumentException e ) { int legalModifiers = ( ( ( ( ( ( Modifier . PUBLIC ) | ( Modifier . PRIVATE ) ) | ( Modifier . PROTECTED ) ) | ( Modifier . STATIC ) ) | ( Modifier . FINAL ) ) | ( Modifier . ABSTRACT ) ) | ( Modifier . STRICTFP ) ; typeDecl . setModifiers ( ( modifiers & legalModifiers ) ) ; typeDecl . setFlags ( ASTNode . MALFORMED ) ; } typeDecl . setInterface ( typeDeclaration . isInterface ( ) ) ; SimpleName typeName = this . ast . newSimpleName ( new String ( typeDeclaration . name ) ) ; typeName . setSourceRange ( typeDeclaration . sourceStart , ( ( ( typeDeclaration . sourceEnd ) - ( typeDeclaration . sourceStart ) ) + 1 ) ) ; <START_BUG> typeDecl . setName ( this . ast . newSimpleName ( new String ( typeDeclaration . name ) ) ) ; <END_BUG> typeDecl . setSourceRange ( typeDeclaration . declarationSourceStart , ( ( ( typeDeclaration . bodyEnd ) - ( typeDeclaration . declarationSourceStart ) ) + 1 ) ) ; if ( ( typeDeclaration . superclass ) != null ) { typeDecl . setSuperclass ( convert ( typeDeclaration . superclass ) ) ; } TypeReference [ ] superInterfaces = typeDeclaration . superInterfaces ; if ( superInterfaces != null ) { for ( int index = 0 , length = superInterfaces . length ; index < length ; index ++ ) { typeDecl . superInterfaces ( ) . add ( convert ( superInterfaces [ index ] ) ) ; } } buildBodyDeclarations ( typeDeclaration , typeDecl ) ; setJavaDocComment ( typeDecl ) ; if ( this . resolveBindings ) { recordNodes ( typeDecl , typeDeclaration ) ; typeDecl . resolveBinding ( ) ; } return typeDecl ; } public Type convertType ( TypeReference typeReference ) { } public MethodDeclaration convert ( AbstractMethodDeclaration methodDeclaration ) { } public Expression convert ( org . eclipse . jdt . internal . compiler . ast . Expression expression ) { } public ParenthesizedExpression convertToParenthesizedExpression ( org . eclipse . jdt . internal . compiler . ast . Expression expression ) { } public ClassInstanceCreation convert ( AllocationExpression expression ) { } public ClassInstanceCreation convert ( AnonymousLocalTypeDeclaration expression ) { } private void buildBodyDeclarations ( AnonymousLocalTypeDeclaration expression , AnonymousClassDeclaration anonymousClassDeclaration ) { } public ArrayCreation convert ( ArrayAllocationExpression expression ) { } public SingleVariableDeclaration convert ( Argument argument ) { } public ArrayInitializer convert ( org . eclipse . jdt . internal . compiler . ast . ArrayInitializer expression ) { } public Expression convert ( QualifiedAllocationExpression expression ) { } public Assignment convert ( org . eclipse . jdt . internal . compiler . ast . Assignment expression ) { } public Assignment convert ( CompoundAssignment expression ) { } public PrefixExpression convert ( org . eclipse . jdt . internal . compiler . ast . PrefixExpression expression ) { } public PostfixExpression convert ( org . eclipse . jdt . internal . compiler . ast . PostfixExpression expression ) { } public CastExpression convert ( org . eclipse . jdt . internal . compiler . ast . CastExpression expression ) { } public Type convertToType ( NameReference reference ) { } public Expression convert ( ClassLiteralAccess expression ) { } public BooleanLiteral convert ( FalseLiteral expression ) { } public BooleanLiteral convert ( TrueLiteral expression ) { } public NullLiteral convert ( org . eclipse . jdt . internal . compiler . ast . NullLiteral expression ) { } public CharacterLiteral convert ( CharLiteral expression ) { } public NumberLiteral convert ( DoubleLiteral expression ) { } public NumberLiteral convert ( FloatLiteral expression ) { } public NumberLiteral convert ( IntLiteral expression ) { } public NumberLiteral convert ( IntLiteralMinValue expression ) { } public NumberLiteral convert ( LongLiteral expression ) { } public NumberLiteral convert ( LongLiteralMinValue expression ) { } public StringLiteral convert ( org . eclipse . jdt . internal . compiler . ast . StringLiteral expression ) { } public StringLiteral convert ( ExtendedStringLiteral expression ) { }

Fix:
typeDecl . setName ( typeName ) ;