Community
Participate
Working Groups
HEAD, was OK in I20070418-1012; FUP to bug 183149 Package Explorer does not properly update when Java nature is added (which transforms an IProject into an IJavaProject). To reproduce, add <nature>org.eclipse.jdt.core.javanature</nature> to the .project file of a simple project.
Moving to core. We get a wrong delta when the Java nature is added. Was: FIRING POST_CHANGE Delta [Thread[main,6,main]]: Java Model[*]: {CHILDREN | CONTENT} P[+]: {} ResourceDelta(/P)[*] Expected: IProject should be removed, not changed: FIRING POST_CHANGE Delta [Thread[main,6,main]]: Java Model[*]: {CHILDREN | CONTENT} P[+]: {} ResourceDelta(/P)[-]
Same problem when nature is removed: Delta says ResourceDelta(/P)[*], should be ResourceDelta(/P)[+]. BTW: the "was OK in I20070418-1012" probably only applies to the visible effects of the fix for bug 182520. I have not checked if this has ever been correct.
Unfortunately we cannot change the platform delta (i.e. there is no API to create a REMOVED IResourceDelta). This would require a new API on our side (e.g. IJavaElementDelta#F_JAVA_NATURE_ADDED). This would have to be done post 3.3.
Created attachment 64478 [details] possible fix AFAICS, the Package Explorer used to be refreshed completely in this scenario before bug 182520 comment 13 has been released. In JDT/UI, we could either fix this in FilterUpdater with the attached patch, or move the updating code to PackageExplorerContentProvider.processDelta(..) and JavaBrowsingContentProvider.processDelta(..), where we could detect these special kinds of changes and remove the IProject / add the IJavaProject without refreshing the entire tree. Martin?
The effects of this bug have been fixed in PackageExplorerContentProvider.processDelta(..), see bug 184296. JavaBrowsingContentProvider does not seem to need any changes, because it only shows IJavaProjects and no IProjects.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Closing according to comment 5. *** This bug has been marked as a duplicate of bug 184296 ***