Bug 3307 - Outliner works strange on duplicate methods (1GF7GIF)
Summary: Outliner works strange on duplicate methods (1GF7GIF)
Status: RESOLVED DUPLICATE of bug 3274
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All Windows NT
: P4 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:52 EDT by David Audel CLA
Modified: 2019-07-29 14:25 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Audel CLA 2001-10-10 22:52:57 EDT
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.
Comment 1 Philipe Mulet CLA 2001-10-11 09:38:57 EDT

*** This bug has been marked as a duplicate of 3274 ***
Comment 2 DJ Houghton CLA 2001-10-29 17:08:21 EST
PRODUCT VERSION:
build 0.122

Comment 3 Eclipse Genie CLA 2019-07-29 14:24:19 EDT
New Gerrit change created: https://git.eclipse.org/r/146749