Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 394480 - [patch] ProjectRegistryRefreshJob refreshes duplicated project
Summary: [patch] ProjectRegistryRefreshJob refreshes duplicated project
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-16 11:27 EST by Chandler Zhang CLA
Modified: 2021-04-19 13:25 EDT (History)
1 user (show)

See Also:


Attachments
Code change (3.19 KB, application/octet-stream)
2012-11-16 11:27 EST, Chandler Zhang CLA
igor: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chandler Zhang CLA 2012-11-16 11:27:19 EST
Created attachment 223662 [details]
Code change

When I imported maven projects into workspace, I found that the 'Update Maven Dependencies' job took a long time.  When I debugged the code, I found one issue

In ProjectRegistryRefreshJob.java, all MavenUpdateRequests are stored in a List. However, a project may be added to the list more than once when importing into workspace, which means more than 1 MavenUpdateRequests for a project may exist in the list. 
To eliminate this scenario, I changed the type of the queue from List to LinkedHashSet and implemented equals and hashcode method in MavenUpdateRequest

I tested the patch on my workspace, which contained 23 projects. The duration of workspace setup(from importing projects to 'building workspace' and 'update maven dependencies' completing) reduced from 5 mins to 4.5 mins
Comment 1 Igor Fedorenko CLA 2012-11-16 13:16:28 EST
I had a brief look and the patch looks reasonable. Will try to find time for proper review before Kepler M4.
Comment 2 Igor Fedorenko CLA 2012-12-16 09:10:43 EST
pushed to master and will be included in 1.3M4 http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=78ec4981632aa8781f2924d72dee947bc3348fc8

fyi, there was a small problem with the patch, corrected by http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=05bb7cc24d7b69f7bd681f799457fb86866dbdc5
Comment 3 Denis Roy CLA 2021-04-19 13:25:10 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/