Bug 17609 - deleting a resource results does not change local history
Summary: deleting a resource results does not change local history
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 2.0 F2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-24 08:44 EDT by Claude Knaus CLA
Modified: 2002-06-03 09:24 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Claude Knaus CLA 2002-05-24 08:44:55 EDT
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.'
Comment 1 Andre Weinand CLA 2002-05-24 10:01:21 EDT
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.
Comment 2 John Arthorne CLA 2002-05-24 15:02:20 EDT
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.
Comment 3 Claude Knaus CLA 2002-05-27 03:56:26 EDT
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
Comment 4 DJ Houghton CLA 2002-05-27 11:24:53 EDT
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.
Comment 5 DJ Houghton CLA 2002-05-27 13:03:28 EDT
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)
Comment 6 Philipe Mulet CLA 2002-05-28 07:25:50 EDT
Agreed, actually there was other places where we did not keep any history.
Fixed them all in the JavaModel.

Comment 7 DJ Houghton CLA 2002-05-28 08:46:05 EDT
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)
Comment 8 Jerome Lanneluc CLA 2002-06-03 09:24:02 EDT
Verified