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

Bug 345486

Summary: JAXB Schemas Properties Page: Exception when editing a specified schema w/o target namespace
Product: [WebTools] Dali JPA Tools Reporter: Nan Li <nan.n.li>
Component: JAXBAssignee: Paul Fullbright <paul.fullbright>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jolene.moffitt, neil.hauge
Version: unspecifiedFlags: neil.hauge: pmc_approved? (david_williams)
neil.hauge: pmc_approved? (raghunathan.srinivasan)
neil.hauge: pmc_approved? (naci.dai)
neil.hauge: pmc_approved? (deboer)
neil.hauge: pmc_approved+
neil.hauge: pmc_approved? (kaloyan)
neil.hauge: pmc_approved? (cbridgha)
neil.hauge: review+
Target Milestone: 3.0 RC2   
Hardware: PC   
OS: Windows 7   
Whiteboard: PMC_approved
Attachments:
Description Flags
stack trace 1
none
stack trace 2
none
patch
none
patch retry
none
updated patch
none
updated patch none

Description Nan Li CLA 2011-05-11 14:46:03 EDT
Build Identifier: 

1. Right-click a JAXB project and select Properties
2. Expand JAXB and select Schemas
3. On the Schemas page, click Add button to open Add a new schema location page
4. Select a schema without target namespace and click OK button
5. On the Schema page, select the added schema and click Edit button

The attached exception 1 is thrown and the Edit page cannot be openned. At this point, the attached exception 2 would be thrown if trying to add more shcemas; however, clicking Apply button on the Schemas page will make the specified schemas with target namespace shown up in the list while the ones without target namespace go away. If schemas without target namespace are illegal, we should prevent them from being added to the list. 

In addition, the Edit and Remove buttons are still enabled even after removing all the schemas from the list.

Reproducible: Always
Comment 1 Nan Li CLA 2011-05-11 14:46:59 EDT
Created attachment 195410 [details]
stack trace 1
Comment 2 Nan Li CLA 2011-05-11 14:47:55 EDT
Created attachment 195411 [details]
stack trace 2
Comment 3 Paul Fullbright CLA 2011-05-18 10:15:27 EDT
Created attachment 195976 [details]
patch

this patch also fixes bug 345467
Comment 4 Paul Fullbright CLA 2011-05-18 14:21:05 EDT
Created attachment 196031 [details]
patch retry
Comment 5 Paul Fullbright CLA 2011-05-18 18:38:26 EDT
Created attachment 196057 [details]
updated patch

Adds empty namespace validation support
Comment 6 Paul Fullbright CLA 2011-05-18 18:40:55 EDT
Created attachment 196059 [details]
updated patch

(didn't actually *create* a new patch in eclipse before resubmitting)
Comment 7 Neil Hauge CLA 2011-05-18 22:54:30 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. 

Schemas that lacked a namespace are now able to be added to the schema repository.  Also, validation of schema with no namespace was resulting in invalid validation errors.  This patch fixes both of these issues.

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

Workaround is to lose schema validation and code completion for no-namespace schemas by not entering them in the schema repository.

    How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 

Paul and I have both tested the fix manually, and the JUnit tests have been run.

    Give a brief technical overview. Who has reviewed this fix? 

This patch makes sure that schemas with empty namespaces resolve to JAXB metadata where no namespace is specified.  The rest of the patch is basic UI work to ensure that these empty namespaces are handled correctly.  The path looks bigger due to some minor refactoring to prevent code duplication.  I have reviewed the fix.

    What is the risk associated with this fix? 

Low risk.
Comment 8 Neil Hauge CLA 2011-05-19 02:39:40 EDT
Approving so this can make it into Thursday's build.  We can roll back if there are any objections from the PMC.
Comment 9 Paul Fullbright CLA 2011-05-19 02:49:11 EDT
committed for rc2
Comment 10 Jolene Moffitt CLA 2011-06-13 11:09:40 EDT
Verified in Build I-3.3.0RC4-20110603221533

Verified no exception when you select a schema with no namespace.  See the link to view test steps for verification.  http://wiki.eclipse.org/Dali_3.0_RC2