Community
Participate
Working Groups
F1 on linux-gtk and w2k: 1) Select a CU from package view and delete it. 2) Choose 'Add from local history...' from the enclosing package. 3) Observe the message 'No deleted resources in local history for selected container.'
I just show what's in the local history. I don't control what goes into it. So this problem seems to be a problem of Core.
This works for me on Win2K with F1. What are your exact steps? I tried (all from within the packages view): 1) Create java project Foo 2) Create package org.foo directly under project 3) Create CU A.java in package org.foo 4) Delete A.java 5) Add from local history on org.foo, and it shows A.java in the list.
It seems to work if you create a new CU. My scenario was this: 1) I checked out JUnit (source) project from the repository (in Zurich). 2) Then removed a file, e.g. TestCase.java 3) 'Add from local history...' on junit.framework
Was able to reproduce this problem when loading from the repository but not when creating a new class from the New Class wizard. Will investigate.
Selecting a resource in the Packages view and hitting "del" produces the following methods calls. File(Resource).delete(int, IProgressMonitor) line: 414 File(Resource).delete(boolean, IProgressMonitor) line: 407 DeleteResourceElementsOperation(JavaModelOperation).deleteResource(IResource, boolean) line: 254 DeleteResourceElementsOperation.processElement(IJavaElement) line: 104 DeleteResourceElementsOperation(MultiOperation).processElements() line: 194 DeleteResourceElementsOperation(MultiOperation).executeOperation() line: 98 DeleteResourceElementsOperation(JavaModelOperation).execute() line: 292 DeleteResourceElementsOperation(JavaModelOperation).run(IProgressMonitor) line: 500 Workspace.run(IWorkspaceRunnable, IProgressMonitor) line: 1361 JavaModelManager.runOperation(JavaModelOperation, IProgressMonitor) line: 1186 JavaModel(JavaElement).runOperation(JavaModelOperation, IProgressMonitor) line: 576 JavaModel.delete(IJavaElement[], boolean, IProgressMonitor) line: 95 CompilationUnit.delete(boolean, IProgressMonitor) line: 211 DeleteSourceManipulationChange.doDelete(ChangeContext, IProgressMonitor) line: 55 DeleteSourceManipulationChange(AbstractDeleteChange).perform(ChangeContext, IProgressMonitor) line: 32 CompositeChange.createUndoList(ChangeContext, IProgressMonitor) line: 119 CompositeChange.perform(ChangeContext, IProgressMonitor) line: 144 PerformChangeOperation$1.execute(IProgressMonitor) line: 146 WorkspaceModifyOperation$1.run(IProgressMonitor) line: 64 Workspace.run(IWorkspaceRunnable, IProgressMonitor) line: 1361 IResource.delete is being called with force=TRUE but not keepHistory. It should be calling IResource.delete(int) or the other boolean method with true for keepHistory. Moving to JDT/Core for comment and adding EG to CC. (not sure which space this is in)
Agreed, actually there was other places where we did not keep any history. Fixed them all in the JavaModel.
Just as a reminder, when scrubbing the builder output folder these resources should not be put into local history. (not sure if this is done via IResource API or java.io.File)
Verified