Bug 120586 [correction] Exceptions in log when renaming CU on quick fix
20051213-0010 1. add '*.foo' as new Java extension to the Java Source File content type (restart required, pending bug in platform) 2. create a Java project and package 'p', and create a file (use new file wizard) 'E.foo' 3. Set content to package p; public class F { } 4. use quick fix on the wrong type name: Choose to rename the CU 5. Works fine but messages logged: !ENTRY org.eclipse.jdt.core 4 969 2005-12-13 16:43:02.221 !MESSAGE F.foo [in p [in <project root> [in Test3]]] does not exist !ENTRY org.eclipse.jdt.core 4 969 2005-12-13 16:43:02.231 !MESSAGE F.foo [in p [in <project root> [in Test3]]] does not exist The problem is CompilationUnitEditor$RememberedOffset.getRememberedOffset(IJavaElement) line: 1002 fElement is the old element. Accessing it returns a JavaModelExeption. This the correct behaviour as it doesn't eist anymore (I checked on the file system) Interestingly, this doesn't happen if the file would be called E.java. There the Java model claims that E.java is still existing (tested using the debugger). This looks like a bug too, but seems to just cover the bug in the Java editor of accessing the old element.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
private final Object fReconcilerLock= new Object();
	/**
	 * Creates a new compilation unit editor.
	 */
	public CompilationUnitEditor() {
		super();
		setDocumentProvider(JavaPlugin.getDefault().getCompilationUnitDocumentProvider());
		setEditorContextMenuId("#CompilationUnitEditorContext"); 
		setRulerContextMenuId("#CompilationUnitRulerContext"); 
		setOutlinerContextMenuId("#CompilationUnitOutlinerContext"); 
		
		fSavePolicy= null;
		fJavaEditorErrorTickUpdater= new JavaEditorErrorTickUpdater(this);
		fCorrectionCommands= null;
	}
	/*
	 * @see AbstractTextEditor#createActions()
	 */
	protected void createActions() {
		super.createActions();
		Action action= new TextOperationAction(JavaEditorMessages.getBundleForConstructedKeys(), "CorrectionAssistProposal.", this, CORRECTIONASSIST_PROPOSALS); 
		action.setActionDefinitionId(IJavaEditorActionDefinitionIds.CORRECTION_ASSIST_PROPOSALS);
		setAction("CorrectionAssistProposal", action); 
		markAsStateDependentAction("CorrectionAssistProposal", true); 
		PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.QUICK_FIX_ACTION);
		action= new ContentAssistAction(JavaEditorMessages.getBundleForConstructedKeys(), "ContentAssistProposal.", this); 
		action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
		setAction("ContentAssistProposal", action); 
		markAsStateDependentAction("ContentAssistProposal", true); 
		PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.CONTENT_ASSIST_ACTION);