Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339308

Summary: Name collisions not properly handled on EAR import
Product: [WebTools] WTP Java EE Tools Reporter: Carl Anderson <ccc>
Component: jst.j2eeAssignee: Carl Anderson <ccc>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 Flags: cbridgha: review+
Version: 3.0.5   
Target Milestone: 3.2.4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 339307    
Bug Blocks:    
Attachments:
Description Flags
Same fix as 339307 none

Description Carl Anderson CLA 2011-03-08 22:35:57 EST
This bug is to get the same change into WTP 3.2.4 and WTP 3.3

+++ This bug was initially created as a clone of Bug #339307 +++

EarComponentImportDataModelProvider has a lot of code to resolve name collisions.  However, due to one missing line, it only attempts to resolve collisions by appending the appropriate module-type suffix - it goes on to try 10 additional suffixes, but this is all ignored due to one missing line in getModuleModels():

defaultModuleNames.add(moduleName + suffix);

By not adding the "new" non-colliding module name into the defaultModuleNames list, the result is that it does not detect a collision if a second module with the same name and of the same type is encountered, and thus the 10 attempts are not made.
Comment 1 Carl Anderson CLA 2011-03-08 22:41:37 EST
Created attachment 190724 [details]
Same fix as 339307
Comment 2 Chuck Bridgham CLA 2011-03-09 12:54:58 EST
approved
Comment 3 Carl Anderson CLA 2011-03-09 14:21:57 EST
Committed to R3_2_maintenance and HEAD for WTP 3.2.4 and WTP 3.3