Project: JDT
Bug 265394 [implementation] Cannot save a Java file that is not in on the Java build path
Reported: 2009-02-18 20:06:34 | Status: verified fixed

Build id: I20090217-2200 1. File > New > Other... > General > Project 2. Give it a name, click 'Finish'. 3. File > New > Other... > General > File 4. Create a file called 'Test.java' in the project created in step 2. 5. Type something in the editor. 6. Hit Ctrl+S. 7. An error dialog appears. "Save could not be completed. Reason: Operation not supported for specified element type(s):Test.java [in <default> [in <project root> [in a]]]" This is causing (at least) UI's IWorkbenchPageTest's testOpenAndHideEditor9 test to hang because the workbench won't shut down because it is hung on a modal dialog asking for save confirmation with a dirty editor (that should not be dirty because we invoked a save).

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java