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

Bug 321655

Summary: Zip file references added to EAR are exported with extension .zip.jar
Product: [WebTools] WTP Java EE Tools Reporter: Aidyl Kareh <amkareh>
Component: jst.j2eeAssignee: Aidyl Kareh <amkareh>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: amkareh, ccc, jsholl
Version: 3.0.5Flags: cbridgha: review+
jsholl: review+
Target Milestone: 3.0.5 P   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed Patch
ccc: iplog+
Patch with missing changes ccc: iplog+

Description Aidyl Kareh CLA 2010-08-03 17:51:47 EDT
Build Identifier: WTP 3.0.5

If you add a class path variable pointing to a zip file to an EAR project(for example, file.zip), and then you export the EAR file, the EAR will contain a file named file.zip.jar). I also saw that if the file was named file.JAR, it would be exported as file.JAR.jar

Steps to recreate:
1. Create an EAR 5
2. Go to the Java EE module Dependencies page
3. Add a variable pointing to a zip file
4. Export the EAR
5. Review the content of the EAR. You will see the file with extension zip.jar

Reproducible: Always
Comment 1 Aidyl Kareh CLA 2010-08-03 17:57:19 EDT
Created attachment 175811 [details]
Proposed Patch

The attached patch modifies the getVirtualComponentNameWithExtension() method in AddModulestoEARPropertiesPage.java so that it doesn't add an additional extension if the file has a .zip extension and also adds code so that the compare for the extension is done in lowercase to avoid creating file name with duplicate extensions (i.e. .JAR.jar).
Comment 2 Chuck Bridgham CLA 2010-08-04 13:14:56 EDT
approved
Comment 3 Carl Anderson CLA 2010-08-05 13:33:29 EDT
Committed to R3_0_5_patches
Comment 4 Aidyl Kareh CLA 2010-08-10 12:42:34 EDT
Created attachment 176252 [details]
Patch with missing changes

Attached patch adds code so that the compare for the extension is done in lowercase to avoid creating file name with duplicate extensions (i.e. .JAR.jar). Changes to handle '.zip' extension correctly have already been checked in. The attached changes still need to be checked in.
Comment 5 Aidyl Kareh CLA 2010-08-10 12:45:05 EDT
Reopening since latest attached patch also needs to be checked in.
Comment 6 Carl Anderson CLA 2010-08-11 12:39:41 EDT
For the record, Aidyl's initial patch had a collision with another R3_0_5_patch.  I attempted to resolve the collision, but did not do so correctly.  Her second patch properly resolves the collision.