}
// Produce an updated token stream
CharacterReader reader = new CharSequenceReader(cache.getNewContents());
BooleanErrorListener errorListener = new BooleanErrorListener();
IncrementalScanner scanner = new IncrementalScanner(cache.getSource(), reader, errorListener);
scanner.rescan(
cache.getResolvedUnit().getBeginToken(),
cache.getOffset(),
cache.getOldLength(),
cache.getNewLength());
if (errorListener.getErrorReported()) {
return;
}
// Produce an updated AST
IncrementalParser parser = new IncrementalParser(
cache.getSource(),
scanner.getTokenMap(),
AnalysisErrorListener.NULL_LISTENER);
updatedUnit = parser.reparse(
cache.getResolvedUnit(),
scanner.getLeftToken(),
scanner.getRightToken(),
cache.getOffset(),
cache.getOffset() + cache.getOldLength());
// Update the resolution
TypeProvider typeProvider = getTypeProvider();