Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319770 - Web fragment project name with spaces, XML validator complains
Summary: Web fragment project name with spaces, XML validator complains
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: Hari Shankar CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-13 14:28 EDT by Hari Shankar CLA
Modified: 2010-07-20 11:22 EDT (History)
4 users (show)

See Also:
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+


Attachments
patch (2.12 KB, patch)
2010-07-13 14:30 EDT, Hari Shankar CLA
no flags Details | Diff
patch (3.07 KB, patch)
2010-07-13 18:36 EDT, Hari Shankar CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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