Buggy code:
if ( ( memberTypes [ ( ( memberTypeCount ) - 1 ) ] . typeDeclaration . declarationSourceEnd ) == 0 ) { int bodyEndValue = bodyEnd ( ) ; memberTypes [ ( ( memberTypeCount ) - 1 ) ] . typeDeclaration . declarationSourceEnd = bodyEndValue ; memberTypes [ ( ( memberTypeCount ) - 1 ) ] . typeDeclaration . bodyEnd = bodyEndValue ; } for ( int i = 0 ; i < ( memberTypeCount ) ; i ++ ) { memberTypeDeclarations [ ( existingCount + i ) ] = ( ( MemberTypeDeclaration ) ( memberTypes [ i ] . updatedTypeDeclaration ( ) ) ) ; } typeDeclaration . memberTypes = memberTypeDeclarations ; } if ( ( fieldCount ) > 0 ) { int existingCount = ( ( typeDeclaration . fields ) == null ) ? 0 : typeDeclaration . fields . length ; FieldDeclaration [ ] fieldDeclarations = new FieldDeclaration [ existingCount + ( fieldCount ) ] ; if ( existingCount > 0 ) { System . arraycopy ( typeDeclaration . fields , 0 , fieldDeclarations , 0 , existingCount ) ; } if ( ( fields [ ( ( fieldCount ) - 1 ) ] . fieldDeclaration . declarationSourceEnd ) == 0 ) { int temp = bodyEnd ( ) ; fields [ ( ( fieldCount ) - 1 ) ] . fieldDeclaration . declarationSourceEnd = temp ; fields [ ( ( fieldCount ) - 1 ) ] . fieldDeclaration . declarationEnd = temp ; } for ( int i = 0 ; i < ( fieldCount ) ; i ++ ) { fieldDeclarations [ ( existingCount + i ) ] = fields [ i ] . updatedFieldDeclaration ( ) ; } typeDeclaration . fields = fieldDeclarations ; } int existingCount = ( ( typeDeclaration . methods ) == null ) ? 0 : typeDeclaration . methods . length ; boolean hasConstructor = false ; boolean hasRecoveredConstructor = false ; int defaultConstructorIndex = - 1 ; if ( ( methodCount ) > 0 ) { AbstractMethodDeclaration [ ] methodDeclarations = new AbstractMethodDeclaration [ existingCount + ( methodCount ) ] ; for ( int i = 0 ; i < existingCount ; i ++ ) { AbstractMethodDeclaration m = typeDeclaration . methods [ i ] ; if ( m . isDefaultConstructor ( ) ) defaultConstructorIndex = i ; methodDeclarations [ i ] = m ; } if ( ( methods [ ( ( methodCount ) - 1 ) ] . methodDeclaration . declarationSourceEnd ) == 0 ) { int bodyEndValue = bodyEnd ( ) ; methods [ ( ( methodCount ) - 1 ) ] . methodDeclaration . declarationSourceEnd = bodyEndValue ; methods [ ( ( methodCount ) - 1 ) ] . methodDeclaration . bodyEnd = bodyEndValue ; } for ( int i = 0 ; i < ( methodCount ) ; i ++ ) { AbstractMethodDeclaration updatedMethod = methods [ i ] . updatedMethodDeclaration ( ) ; if ( updatedMethod . isConstructor ( ) ) hasRecoveredConstructor = true ; methodDeclarations [ ( existingCount + i ) ] = updatedMethod ; } typeDeclaration . methods = methodDeclarations ; hasConstructor = typeDeclaration . checkConstructors ( this . parser ( ) ) ; } else { for ( int i = 0 ; i < existingCount ; i ++ ) { if ( typeDeclaration . methods [ i ] . isConstructor ( ) ) hasConstructor = true ; } } if ( typeDeclaration . needClassInitMethod ( ) ) { boolean alreadyHasClinit = false ; for ( int i = 0 ; i < existingCount ; i ++ ) { if ( typeDeclaration . methods [ i ] . isClinit ( ) ) { alreadyHasClinit = true ; break ; } } if ( ! alreadyHasClinit ) typeDeclaration . addClinit ( ) ; } if ( ( defaultConstructorIndex >= 0 ) && hasRecoveredConstructor ) { AbstractMethodDeclaration [ ] methodDeclarations = new AbstractMethodDeclaration [ ( typeDeclaration . methods . length ) - 1 ] ; if ( defaultConstructorIndex != 0 ) { System . arraycopy ( typeDeclaration . methods , 0 , methodDeclarations , 0 , defaultConstructorIndex ) ; } if ( defaultConstructorIndex != ( ( typeDeclaration . methods . length ) - 1 ) ) { System . arraycopy ( typeDeclaration . methods , ( defaultConstructorIndex + 1 ) , methodDeclarations , defaultConstructorIndex , ( ( ( typeDeclaration . methods . length ) - defaultConstructorIndex ) - 1 ) ) ; } typeDeclaration . methods = methodDeclarations ; } else { <START_BUG> if ( ! hasConstructor ) { <END_BUG> boolean insideFieldInitializer = false ; RecoveredElement parentElement = this . parent ; while ( parentElement != null ) { if ( parentElement instanceof RecoveredField ) { insideFieldInitializer = true ; break ; } parentElement = parentElement . parent ; } typeDeclaration . createsInternalConstructor ( ( ( ! ( parser ( ) . diet ) ) || insideFieldInitializer ) , true ) ; } } TypeDeclaration newTypeDeclaration = null ; if ( ( parent ) instanceof RecoveredType ) { newTypeDeclaration = new MemberTypeDeclaration ( typeDeclaration . compilationResult ) ; } else { if ( ( parent ) instanceof RecoveredMethod ) { newTypeDeclaration = new LocalTypeDeclaration ( typeDeclaration . compilationResult ) ; } } if ( newTypeDeclaration != null ) { newTypeDeclaration . modifiers = typeDeclaration . modifiers ; newTypeDeclaration . modifiersSourceStart = typeDeclaration . modifiersSourceStart ; newTypeDeclaration . name = typeDeclaration . name ; newTypeDeclaration . superclass = typeDeclaration . superclass ; newTypeDeclaration . superInterfaces = typeDeclaration . superInterfaces ; newTypeDeclaration . fields = typeDeclaration . fields ; newTypeDeclaration . methods = typeDeclaration . methods ; newTypeDeclaration . memberTypes = typeDeclaration . memberTypes ; newTypeDeclaration . ignoreFurtherInvestigation = typeDeclaration . ignoreFurtherInvestigation ; newTypeDeclaration . maxFieldCount = typeDeclaration . maxFieldCount ; newTypeDeclaration . declarationSourceStart = typeDeclaration . declarationSourceStart ; newTypeDeclaration . declarationSourceEnd = typeDeclaration . declarationSourceEnd ; newTypeDeclaration . bodyEnd = typeDeclaration . bodyEnd ; newTypeDeclaration . bodyStart = typeDeclaration . bodyStart ; typeDeclaration = newTypeDeclaration ; } return typeDeclaration ; }

Fix:
if ( ( ! hasConstructor ) && ( ! ( typeDeclaration . isInterface ( ) ) ) ) {