Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 274496 - Duplicated java files shown in logical view of test navigator
Summary: Duplicated java files shown in logical view of test navigator
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Bozier jerome CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 164486 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-30 07:48 EDT by Ben Chen CLA
Modified: 2016-05-05 11:08 EDT (History)
3 users (show)

See Also:
paulslau: review+


Attachments
ss (14.98 KB, image/jpeg)
2009-04-30 07:48 EDT, Ben Chen CLA
no flags Details
Partial Patch. (3.27 KB, patch)
2009-07-30 10:47 EDT, Paul Slauenwhite CLA
no flags Details | Diff
patch add on (2.04 KB, patch)
2009-07-31 10:25 EDT, Bozier jerome CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Chen CLA 2009-04-30 07:48:14 EDT
Created attachment 133909 [details]
ss

Using the I2TP1 candidate Build: TPTP-4.6.0-200904260100

1: Create a regular JUnit Test Case
2: Swtich to logical view of test prospective
3: Expand the source folder containing the newly created JUnit test (.java)
4: Notice the duplicate, both of which point to the same object.

There are no error message in the error log during the above precedure
Comment 1 Paul Slauenwhite CLA 2009-04-30 08:58:33 EDT
Jerome, please triage and size.
Comment 2 Bozier jerome CLA 2009-05-27 13:26:22 EDT
i'd say 2 to 3 days
Comment 3 Paul Slauenwhite CLA 2009-06-09 08:30:41 EDT
*** Bug 164486 has been marked as a duplicate of this bug. ***
Comment 4 Paul Slauenwhite CLA 2009-06-23 09:58:46 EDT
After an initialize investigation, the org.eclipse.hyades.test.ui.internal.navigator.proxy.FileProxyNodeCache is caching two instances of the org.eclipse.hyades.test.tools.ui.java.internal.junit.navigator.JavaElementProxyNode since the IFile is a different object instance despite pointing to the same resource.  One solution could be to cache the absolute path of the resource, instead of the IFile object instance.
Comment 5 Ben Chen CLA 2009-06-26 05:34:57 EDT
Reproducible in TPTP-4.6.0-200906191311
Comment 6 Paul Slauenwhite CLA 2009-07-30 10:47:34 EDT
Created attachment 143019 [details]
Partial Patch.
Comment 7 Bozier jerome CLA 2009-07-31 09:29:20 EDT
some points to note :
.this bug do not always occur
.after some testing, it only occur on Regular JUnit test Case (and not on testsuite)
.when you close/reopen workspace, all is well displayed

to be sure to reproduce it, make theses steps :
. switch to test perspective
. switch to logical view and stay in it
. create a new test case, you will see it appear 2 times in tree viewer

it seems that proxy node cache is innocent (i made a special map to store them, indexed by full path : it changes nothing)
checking inside logical viewer to try to find what is really happening
Comment 8 Bozier jerome CLA 2009-07-31 10:25:48 EDT
Created attachment 143144 [details]
patch add on

this patch complete previous one

when you create a regular junit test case element, a .java file is created. 
at this moment, its proxy is created.
just after, this java file is updated and proxy is re-created
problem is that there is a particular mecanism to store children of java element proxy that was bugged : it was adding the updated proxy as a new child instead of updating the old version
fix = compare resource instead of compare proxy pointer to add new child. if resource is the same, update proxy if it is different.

with this fix, problem no longer occur
Comment 9 Bozier jerome CLA 2009-07-31 10:27:10 EDT
updating worked hours

Paul, could you review it please ?

thanks in advance
Comment 10 Paul Slauenwhite CLA 2009-07-31 10:40:07 EDT
Reviewed and approved.  Jerome, please create a new test case for this scenario (see comment #8).
Comment 11 Bozier jerome CLA 2009-08-10 08:07:49 EDT
patch and test case pushed under CVS after approval
Comment 12 Ben Chen CLA 2010-05-10 16:07:52 EDT
verified: duplication gone 
driver: TPTP-4.7.0M7-201005041505
Comment 13 Ben Chen CLA 2010-05-10 16:08:10 EDT
Closing after verification