the problem is here in
CompilationUnitResolver$1Requestor.acceptAST(ICompilationUnit, CompilationUnit) line: 815
the problem is that here we DOMFInder.search is called
public ASTNode search() throws JavaModelException {
ISourceRange range = null;
if (this.element instanceof IMember && !(this.element instanceof IInitializer)
&& !(this.element instanceof LambdaMethod) && !(this.element instanceof org.eclipse.jdt.internal.core.LambdaExpression))
range = ((IMember) this.element).getNameRange();
else if (this.element instanceof ITypeParameter || this.element instanceof ILocalVariable)
range = this.element.getNameRange();
else
range = this.element.getSourceRange();
this.rangeStart = range.getOffset();
this.rangeLength = range.getLength();
this.ast.accept(this);
return this.foundNode;
}
here the
.getNameRange() on member will return the old element info
and so the range guard in
org.eclipse.jdt.internal.core.util.DOMFinder.found(ASTNode, ASTNode)
will return false and no resolving will take place
if
TypeDeclaration(AbstractTypeDeclaration).setName(SimpleName) line: 154
ASTConverter.convert(TypeDeclaration) line: 3293
ASTConverter.convert(CompilationUnitDeclaration, char[]) line: 1526
AST.convertCompilationUnit(int, CompilationUnitDeclaration, Map, boolean, CompilationUnit, int, IProgressMonitor) line: 501
CompilationUnit.buildStructure(OpenableElementInfo, IProgressMonitor, Map, IResource) line: 201
CompilationUnit(Openable).generateInfos(Object, HashMap, IProgressMonitor) line: 266
CompilationUnit(JavaElement).openWhenClosed(Object, boolean, IProgressMonitor) line: 597
CompilationUnit.makeConsistent(int, boolean, int, HashMap, IProgressMonitor) line: 1142
ReconcileWorkingCopyOperation.makeConsistent(CompilationUnit) line: 173
ReconcileWorkingCopyOperation.executeOperation() line: 94
ReconcileWorkingCopyOperation(JavaModelOperation).run(IProgressMonitor) line: 740
ReconcileWorkingCopyOperation(JavaModelOperation).runOperation(IProgressMonitor) line: 806
CompilationUnit.reconcile(int, int, WorkingCopyOwner, IProgressMonitor) line: 1319
JavaReconcilingStrategy.reconcile(ICompilationUnit, boolean) line: 131
JavaReconcilingStrategy$1.run() line: 93
SafeRunner.run(ISafeRunnable) line: 45
JavaReconcilingStrategy.reconcile(boolean) line: 90
JavaReconcilingStrategy.reconcile(IRegion) line: 157
JavaCompositeReconcilingStrategy(CompositeReconcilingStrategy).reconcile(IRegion) line: 94
JavaCompositeReconcilingStrategy.reconcile(IRegion) line: 107
JavaReconciler(MonoReconciler).process(DirtyRegion) line: 76
AbstractReconciler$BackgroundThread.run() line: 210
will run first/faster than our builder,
the we will see the NEW name position after the undo as expected.
why are the element infos not updated togther with the sources returned by search?
how can i avoid this problem?
Thanks and Regards
Christian
p.s.: