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 ) { this . compilationUnitSource = source ; <START_BUG> scanner . setSourceBuffer ( source ) ; <END_BUG> CompilationUnit compilationUnit = this . ast . newCompilationUnit ( ) ; if ( resolveBindings ) { recordNodes ( compilationUnit , unit ) ; } if ( ( unit . currentPackage ) != null ) { compilationUnit . setPackage ( convertPackage ( unit . currentPackage ) ) ; } ImportReference [ ] imports = unit . imports ; if ( imports != null ) { int importLength = imports . length ; for ( int i = 0 ; i < importLength ; i ++ ) { compilationUnit . imports ( ) . add ( convertImport ( imports [ i ] ) ) ; } } TypeDeclaration [ ] types = unit . types ; if ( types != null ) { int typesLength = types . length ; for ( int i = 0 ; i < typesLength ; i ++ ) { compilationUnit . types ( ) . add ( convert ( types [ i ] ) ) ; } } compilationUnit . setSourceRange ( unit . sourceStart , ( ( ( unit . sourceEnd ) - ( unit . sourceStart ) ) + 1 ) ) ; if ( ( unit . compilationResult . problemCount ) != 0 ) { propagateErrors ( compilationUnit , unit . compilationResult . problems , unit . compilationResult . problemCount ) ; } return compilationUnit ; } public PackageDeclaration convertPackage ( ImportReference importReference ) { } public ImportDeclaration convertImport ( ImportReference importReference ) { } public TypeDeclaration convert ( TypeDeclaration typeDeclaration ) { } private void buildBodyDeclarations ( 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 ) { } 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 ) { } public InfixExpression convert ( BinaryExpression expression ) { } public PrefixExpression convert ( UnaryExpression expression ) { } public InfixExpression convert ( InstanceOfExpression expression ) { } public ConditionalExpression convert ( org . eclipse . jdt . internal . compiler . ast . ConditionalExpression expression ) { } public Expression convert ( MessageSend expression ) { } public Expression convert ( AND_AND_Expression expression ) { } public Expression convert ( EqualExpression expression ) { } public Expression convert ( OR_OR_Expression expression ) { } public Statement convert ( Statement statement ) { } public AssertStatement convert ( org . eclipse . jdt . internal . compiler . ast . AssertStatement statement ) { } public Block convert ( org . eclipse . jdt . internal . compiler . ast . Block statement ) { }

Fix:
scanner . setSource ( source ) ;