Buggy code:
ITypeBinding resolveWellKnownType ( String name ) { } ITypeBinding resolveType ( TypeDeclaration type ) { } IMethodBinding resolveMethod ( MethodDeclaration method ) { } IVariableBinding resolveVariable ( VariableDeclaration variable ) { } IVariableBinding resolveVariable ( FieldDeclaration variable ) { } ITypeBinding resolveExpressionType ( Expression expression ) { if ( expression instanceof ClassInstanceCreation ) { AstNode astNode = ( ( AstNode ) ( this . newAstToOldAst . get ( expression ) ) ) ; if ( astNode instanceof org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ) { org . eclipse . jdt . internal . compiler . ast . TypeDeclaration typeDeclaration = ( ( org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ) ( astNode ) ) ; if ( typeDeclaration != null ) { ITypeBinding typeBinding = this . getTypeBinding ( typeDeclaration . binding ) ; this . bindingsToAstNodes . put ( typeBinding , expression ) ; return typeBinding ; } } else { AllocationExpression allocationExpression = ( ( AllocationExpression ) ( astNode ) ) ; return this . getMethodBinding ( allocationExpression . binding ) . getDeclaringClass ( ) ; } } else if ( expression instanceof Name ) { IBinding binding = this . resolveName ( ( ( Name ) ( expression ) ) ) ; if ( binding == null ) { return null ; } switch ( binding . getKind ( ) ) { case IBinding . TYPE : return ( ( ITypeBinding ) ( binding ) ) ; case IBinding . VARIABLE : return ( ( IVariableBinding ) ( binding ) ) . getType ( ) ; } } else if ( expression instanceof ArrayInitializer ) { org . eclipse . jdt . internal . compiler . ast . ArrayInitializer oldAst = ( ( org . eclipse . jdt . internal . compiler . ast . ArrayInitializer ) ( this . newAstToOldAst . get ( expression ) ) ) ; if ( ( oldAst == null ) || ( ( oldAst . binding ) == null ) ) { return super . resolveExpressionType ( expression ) ; } return this . getTypeBinding ( oldAst . binding ) ; } else if ( expression instanceof ArrayCreation ) { ArrayAllocationExpression arrayAllocationExpression = ( ( ArrayAllocationExpression ) ( this . newAstToOldAst . get ( expression ) ) ) ; return this . getTypeBinding ( arrayAllocationExpression . arrayTb ) ; } else if ( expression instanceof Assignment ) { Assignment assignment = ( ( Assignment ) ( expression ) ) ; return this . resolveExpressionType ( assignment . getLeftHandSide ( ) ) ; } else if ( expression instanceof PostfixExpression ) { PostfixExpression postFixExpression = ( ( PostfixExpression ) ( expression ) ) ; return this . resolveExpressionType ( postFixExpression . getOperand ( ) ) ; } else if ( expression instanceof PrefixExpression ) { PrefixExpression preFixExpression = ( ( PrefixExpression ) ( expression ) ) ; return this . resolveExpressionType ( preFixExpression . getOperand ( ) ) ; } else if ( expression instanceof CastExpression ) { org . eclipse . jdt . internal . compiler . ast . CastExpression castExpression = ( ( org . eclipse . jdt . internal . compiler . ast . CastExpression ) ( this . newAstToOldAst . get ( expression ) ) ) ; return this . getTypeBinding ( castExpression . castTb ) ; } else if ( expression instanceof StringLiteral ) { org . eclipse . jdt . internal . compiler . ast . StringLiteral stringLiteral = ( ( org . eclipse . jdt . internal . compiler . ast . StringLiteral ) ( this . newAstToOldAst . get ( expression ) ) ) ; return this . getTypeBinding ( stringLiteral . literalType ( this . retrieveEnclosingScope ( expression ) ) ) ; } else if ( expression instanceof TypeLiteral ) { ClassLiteralAccess classLiteralAccess = ( ( ClassLiteralAccess ) ( this . newAstToOldAst . get ( expression ) ) ) ; <START_BUG> return this . getTypeBinding ( classLiteralAccess . targetType ) ; <END_BUG> } else if ( expression instanceof BooleanLiteral ) { BooleanLiteral booleanLiteral = ( ( BooleanLiteral ) ( expression ) ) ; if ( booleanLiteral . booleanValue ( ) ) { TrueLiteral trueLiteral = ( ( TrueLiteral ) ( this . newAstToOldAst . get ( booleanLiteral ) ) ) ; return this . getTypeBinding ( trueLiteral . literalType ( null ) ) ; } else { FalseLiteral falseLiteral = ( ( FalseLiteral ) ( this . newAstToOldAst . get ( booleanLiteral ) ) ) ; return this . getTypeBinding ( falseLiteral . literalType ( null ) ) ; } } else if ( expression instanceof NullLiteral ) { org . eclipse . jdt . internal . compiler . ast . NullLiteral nullLiteral = ( ( org . eclipse . jdt . internal . compiler . ast . NullLiteral ) ( this . newAstToOldAst . get ( expression ) ) ) ; return this . getTypeBinding ( nullLiteral . literalType ( null ) ) ; } else if ( expression instanceof CharacterLiteral ) { CharLiteral charLiteral = ( ( CharLiteral ) ( this . newAstToOldAst . get ( expression ) ) ) ; return this . getTypeBinding ( charLiteral . literalType ( null ) ) ; } else if ( expression instanceof NumberLiteral ) { Literal literal = ( ( Literal ) ( this . newAstToOldAst . get ( expression ) ) ) ; return this . getTypeBinding ( literal . literalType ( null ) ) ; } else if ( expression instanceof InfixExpression ) { OperatorExpression operatorExpression = ( ( OperatorExpression ) ( this . newAstToOldAst . get ( expression ) ) ) ; return this . getTypeBinding ( operatorExpression . typeBinding ) ; } else if ( expression instanceof FieldAccess ) { FieldReference fieldReference = ( ( FieldReference ) ( this . newAstToOldAst . get ( expression ) ) ) ; return this . getVariableBinding ( fieldReference . binding ) . getType ( ) ; }

Fix:
return this . getTypeBinding ( retrieveCompilationUnitScope ( expression ) . getJavaLangClass ( ) ) ;