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

Bug 339307

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.0.5 P   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 339308    
Attachments:
Description Flags
Add the missing line of code none

Description Carl Anderson CLA 2011-03-08 22:12:02 EST
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:16:55 EST
Created attachment 190723 [details]
Add the missing line of code
Comment 2 Chuck Bridgham CLA 2011-03-08 22:19:56 EST
approved
Comment 3 Carl Anderson CLA 2011-03-17 23:06:14 EDT
Committed to R3_0_5_patches