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

Bug 319770

Summary: Web fragment project name with spaces, XML validator complains
Product: [WebTools] WTP Java EE Tools Reporter: Hari Shankar <hshanka>
Component: jst.j2eeAssignee: Hari Shankar <hshanka>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: ccc, deboer, jsholl, neil.hauge
Version: 3.2Flags: hshanka: pmc_approved? (david_williams)
hshanka: pmc_approved? (raghunathan.srinivasan)
hshanka: pmc_approved? (naci.dai)
deboer: pmc_approved+
neil.hauge: pmc_approved+
hshanka: pmc_approved? (kaloyan)
cbridgha: review+
Target Milestone: 3.2.1   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved
Attachments:
Description Flags
patch
none
patch none

Description Hari Shankar CLA 2010-07-13 14:28:57 EDT
Build Identifier: 321

When you create a web fragment project with a name with between spaces, the wizard adds a space in the <name> tag in the DD, resulting in an XML validation error.

Reproducible: Always
Comment 1 Hari Shankar CLA 2010-07-13 14:30:12 EDT
Created attachment 174197 [details]
patch

Replaced the space if any in the <name> field with '_' during project creation. Patch attached for review.
Comment 2 Chuck Bridgham CLA 2010-07-13 14:53:59 EDT
approved
Comment 3 Hari Shankar CLA 2010-07-13 18:36:24 EDT
Created attachment 174241 [details]
patch

This patch expands on the previous patch to consider all the matching rules for special characters for the <name> field, and covers many additional scenarios over the previous patch.
Comment 4 Hari Shankar CLA 2010-07-14 10:55:16 EDT
Just wanted to add in a comment as to why I am comparing against the incrementally building string - there are 2 pieces to the regex in the form (A)(B). Its not sufficient to compare just individual characters since their place in the sequence will not be known, hence the incremental string compare.
Comment 5 Chuck Bridgham CLA 2010-07-14 10:58:42 EDT
Thanks Hari, this is a more complete fix...
Comment 6 Hari Shankar CLA 2010-07-14 12:23:38 EDT
    * Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 
This bug fixes an issue that causes user's web fragment DD to have errors (caused by incorrect handling of the <name> tag by tooling.

    * Is there a work-around? If so, why do you believe the work-around is insufficient? 
Manually edit the DD

    * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 
Tested by using the web fragment project creation wizard with various project names that need to be handled by the <name> field
    * Give a brief technical overview. Who has reviewed this fix? 
This fix has been reviewed by Chuck Bridgham.
    * What is the risk associated with this fix? 
No known risks.
Comment 7 Neil Hauge CLA 2010-07-14 15:23:41 EDT
Not sure this rises to the level of severity to be fixed at this point, but given the minimal risk, seems reasonable.
Comment 8 Jason Sholl CLA 2010-07-14 17:59:29 EDT
code checked into head for wtp 3.2.1