Bug 6295 File "save as" bug, new file is read-only
Environment: 0.137 driver on Windows NT 4.0 SP6a 1. Create a Java project and package 2. Create a Java class called "Test" in the project/package created in '1.' above. 3. Edit the "Test" class by adding a comment. 4. Select the "Test" class, the 'File' menu, 'Save Test.java As...', and save as a different file name. You will receive an error dialog that states: "Save Problems x Could not save file Reason: File is read-only" The file will be created but it will be 'read-only' and not read-write.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
IJavaElement element= JavaCore.create(folder);
			if (element instanceof IPackageFragment)
				return (IPackageFragment) element;
		}
		
		return null;
	}
	
	/*
	 * 1GEUSSR: ITPUI:ALL - User should never loose changes made in the editors.
	 * Changed behavior to make sure that if called inside a regular save (because
	 * of deletion of input element) there is a way to report back to the caller.
	 */	
	protected void performSaveAs(IProgressMonitor progressMonitor) {
		
		Shell shell= getSite().getShell();
		
		SaveAsDialog dialog= new SaveAsDialog(shell);
		IEditorInput input = getEditorInput();
		
		IFile original= null;
		if (input instanceof IFileEditorInput)
			original= ((IFileEditorInput) input).getFile();
			
		if (original != null)
			dialog.setOriginalFile(original);
			
		if (dialog.open() == Dialog.CANCEL) {
			if (progressMonitor != null)
				progressMonitor.setCanceled(true);