Bug 7070 - moved classes lost!
Summary: moved classes lost!
Status: RESOLVED DUPLICATE of bug 7033
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 7210 7462 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-12-18 16:10 EST by Jeff McAffer CLA
Modified: 2002-01-11 08:56 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff McAffer CLA 2001-12-18 16:10:02 EST
In a Packages view:

I had 10 classes in a package org.foo in project P.  I created a new package 
(using the new package wizard) called org.foo.bar.  I then selected four of the 
ten classes in org.foo and using the "move" menu entry, tried to move them to 
org.foo.bar.  The end result is that the files were moved (if I look at the 
filesystem they are there) and the package declarations in the files were 
updated but the Packages view still shows them in the org.foo package.  There 
is apparently nothing I can do to get them to show up in the correct spot.  Any 
attempt to open them or manipulate them further in the Packages view results in 
an error in the log as shown below.

I moved the files back to the org.foo package directory using the navigator and 
manually updated the package statements but then the files did not appear at 
all in the packages view!  The are in the filesystem in the org.foo dir with 
the correct package statements and they show up in the navigatore but not in 
the packages view.  Full build did not change the situation.

Finally I closed the project and reopened and the classes are back in the 
correct spot in the packages view.


Log: Tue Dec 18 15:55:06 EST 2001
4 org.eclipse.jdt.ui 1 An exception occurred while opening the type.
Java Model Exception: Java Model Status [Cvs.java does not exist.]
	at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException
(JavaElement.java(Compiled Code))
	at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource
(Openable.java(Compiled Code))
	at 
org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource
(CompilationUnit.java:277)
	at org.eclipse.jdt.internal.core.Openable.openWhenClosed(Openable.java
(Compiled Code))
	at org.eclipse.jdt.internal.core.JavaElement.openHierarchy
(JavaElement.java(Compiled Code))
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo
(JavaElement.java(Compiled Code))
	at org.eclipse.jdt.internal.core.JavaElement.getChildren
(JavaElement.java(Compiled Code))
	at org.eclipse.jdt.internal.core.JavaElement.getChildrenOfType
(JavaElement.java(Compiled Code))
	at org.eclipse.jdt.internal.core.CompilationUnit.getTypes
(CompilationUnit.java(Compiled Code))
	at org.eclipse.jdt.internal.core.CompilationUnit.getAllTypes
(CompilationUnit.java:228)
	at org.eclipse.jdt.internal.ui.search.JavaElementAction.findType
(JavaElementAction.java:220)
	at org.eclipse.jdt.internal.ui.search.JavaElementAction.getJavaElement
(JavaElementAction.java:97)
	at org.eclipse.jdt.internal.ui.search.JavaElementAction.getJavaElement
(JavaElementAction.java:124)
	at org.eclipse.jdt.internal.ui.search.JavaElementAction.getJavaElement
(JavaElementAction.java:143)
	at org.eclipse.jdt.internal.ui.search.JavaElementAction.getJavaElement
(JavaElementAction.java:118)
	at org.eclipse.jdt.internal.ui.search.JavaElementAction.canOperateOn
(JavaElementAction.java:68)
	at 
org.eclipse.jdt.internal.ui.search.FindImplementorsAction.canOperateOn
(FindImplementorsAction.java:29)
	at org.eclipse.jdt.internal.ui.search.JavaSearchSubGroup.fill
(JavaSearchSubGroup.java:33)
	at org.eclipse.jdt.internal.ui.search.JavaSearchGroup.fill
(JavaSearchGroup.java:51)
	at org.eclipse.jdt.internal.ui.actions.ContextMenuGroup.add
(ContextMenuGroup.java:25)
	at 
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart.menuAboutToShow
(PackageExplorerPart.java:498)
Comment 1 Jeff McAffer CLA 2001-12-18 16:10:53 EST
Doh, forgot to say that that was in in build 1206.
Comment 2 Erich Gamma CLA 2001-12-18 17:16:10 EST
smells like a dup of 7033 (which is fixed in 20011219)
moving to jdt-core for confirmation
Comment 3 Jerome Lanneluc CLA 2001-12-19 06:31:48 EST
Yes, this is a dup of 7033. But the fix didn't make it in build 20011218 (and 
it won't make it for a while as jdt core is changing a lot and we're not going 
to release it until it is considered stable).

For now, the workaround is to close and reopen the project after the move.

Note also that this happens only when moving from a package x.y.z to a package 
x.y (and the other way around).

*** This bug has been marked as a duplicate of 7033 ***
Comment 4 Erich Gamma CLA 2002-01-09 18:05:27 EST
*** Bug 7210 has been marked as a duplicate of this bug. ***
Comment 5 Erich Gamma CLA 2002-01-11 04:46:43 EST
*** Bug 7462 has been marked as a duplicate of this bug. ***