Bug 221229 - A module with linked resources should not be considered single root
Summary: A module with linked resources should not be considered single root
Status: VERIFIED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 1.5.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.5 M155   Edit
Assignee: Jason Sholl CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-03-03 16:47 EST by Troy Bishop CLA
Modified: 2008-07-30 12:49 EDT (History)
1 user (show)

See Also:


Attachments
Possible patch for J2EEFlexProjDeployable.java (3.84 KB, patch)
2008-03-03 16:48 EST, Troy Bishop CLA
no flags Details | Diff
revised patch (3.51 KB, patch)
2008-03-13 17:49 EDT, Jason Sholl CLA
no flags Details | Diff
patch (6.51 KB, text/plain)
2008-03-19 11:20 EDT, Jason Sholl CLA
no flags Details
Patch based on latest R1_5_5_patches (4.78 KB, patch)
2008-05-02 09:55 EDT, Troy Bishop CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Troy Bishop CLA 2008-03-03 16:47:48 EST
Build ID: WTP 1.5.5 patches

Steps To Reproduce:
1. Construct a module
2. Create a linked folder in this module that is not part of the source folder.  For example, in a web module's WebContent directory create a linked directory.


More information:
The directory created in step 2 should force the isSingleRootStructure() method to return false.  In the javadoc for this method it states:

"In a single root structure, all files that are contained within the root folder are part of the module, and are already in the correct module structure. No module resources exist outside of this single folder."

and in this scenario the linked resource may point to a resource outside of the root folder.  Therefore, this method should return false in this scenario.

I will attach a sample patch (based on 1.5.5 patches + the fix for bug 220958) that could be used.  There is one TODO in this patch with regards to error handling.
Comment 1 Troy Bishop CLA 2008-03-03 16:48:30 EST
Created attachment 91447 [details]
Possible patch for J2EEFlexProjDeployable.java
Comment 2 Jason Sholl CLA 2008-03-13 17:49:54 EDT
Created attachment 92523 [details]
revised patch

This patch is essentially the same as the previous one but avoids an instanceof check and variable setting & reading which should make it slightly faster.  This patch also contains the patch from bug 220958
Comment 3 Jason Sholl CLA 2008-03-19 11:20:47 EDT
Created attachment 92922 [details]
patch

This revised patch is from Troy.  It handles linked IFiles and the general case for all Component project types instead of only Web projects.
Comment 4 David Williams CLA 2008-05-01 22:41:16 EDT
This patch does not apply cleanly. Can you please provide a new one against the R1_5_5_patches branch? 

Comment 5 Troy Bishop CLA 2008-05-02 09:55:48 EDT
Created attachment 98418 [details]
Patch based on latest R1_5_5_patches
Comment 6 David Williams CLA 2008-05-02 10:46:55 EDT
Thanks Troy. 
patch applied to R1_5_5_patches branch. 
Comment 7 David Williams CLA 2008-05-02 10:47:49 EDT
Comment on attachment 92922 [details]
patch

marking this one as obsolete, since not used.
Comment 8 Jason Sholl CLA 2008-05-05 17:47:58 EDT
this still hasn't been put into 3.0.  Opened bug 230302
Comment 9 Troy Bishop CLA 2008-07-30 12:49:39 EDT
Thanks!