Community
Participate
Working Groups
Steps to reproduce : 1) Create a class (test) 2) type in the following: public void one() {} 3) Below that method type the following: public void two() {} 4) Below that method type the following: public void one() {} 5) Save the class. (There should be two errors) 6) Delete the top method. When you select the "one" method in outliner, there are no selection in editor. See : 1GE2Z8G: ITPJUI:ALL - Java Reconciler works strange on duplicate methods NOTES: OT (25/09/2001 5:35:27 PM) The problem seems to come from the occurrence count for the second method one(). The occurrence count is incremented to handle duplicate, but it is never decremented when one of the duplicates is removed. Then the select in the outliner view cannot retrieve the right method, because it is looking for a second method one(). Right now I have no idea where to add an update to adjust the occurrence count of the remaining duplicates. OT(26/09/2001 11:17:40 AM) The problem results from an inconsistency in the handles after the deletion. Ideally the Java model should get rid of all the handles related to the compilation unit after the deletion of a sourceRefElement, because all the occurrence counts are potentially inconsistent. But these handles seem to be persisted by the outliner. So for now there is no other solution than to refresh completely the outliner tree after an operation on the working copy (deletion, addition, etc.), which would make it very ugly. OT(27/09/2001 12:02:55 PM) A java element is created with an occurrence count. This occurrence count is used to handle duplicates inside the Java Model. The problem that this PR points to is that removing an element should update the occurrence count of all duplicates of this element. This is not done through the Delete operation. Then all the handles persisted by the outline are out of sync with the current content of the working copy and this leads to error in the localization of existing methods. I don't see an easy way to handle this case. Refreshing the UI would be one. Of course this doesn't solve the problem we have to maintain the consistency of existing handles.
*** This bug has been marked as a duplicate of 3274 ***
PRODUCT VERSION: build 0.122
New Gerrit change created: https://git.eclipse.org/r/146749
Gerrit change https://git.eclipse.org/r/146749 was merged to [master]. Commit: http://git.eclipse.org/c/www.eclipse.org/org.git/commit/?id=34b607de60abec69790d3a760f416f722e589391