Bug 19075 Rename Java file to non Java file causes most actions to crash
F2 - open Java file in editor - rename it so that it has the extension .txt Almost all Java relevant actions in Edit, Source, Refactor, Naviagte and context menu are still enabled. Executing them almost always leads to some sort of exceptions.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} catch (JavaModelException x) {
				JavaPlugin.getDefault().log(x.getStatus());
				
			}
		}
		
		return null;
	}
	
	/**
	 * Returns the offset of the given Java element.
	 */
	private int getOffset(IJavaElement element) {
		if (element instanceof ISourceReference) {
			ISourceReference sr= (ISourceReference) element;
			try {
				ISourceRange srcRange= sr.getSourceRange();
				if (srcRange != null)
					return srcRange.getOffset();
			} catch (JavaModelException e) {
			}
		}
		return -1;	
	}
	
	/*
	 * @see AbstractTextEditor#rememberSelection()
	 */
	protected void rememberSelection() {