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

Bug 346307

Summary: Invalid JAXB packages shown in project explorer when member classes are annotated
Product: [WebTools] Dali JPA Tools Reporter: Paul Fullbright <paul.fullbright>
Component: JAXBAssignee: Paul Fullbright <paul.fullbright>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jolene.moffitt, neil.hauge
Version: 3.0Flags: 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 Vista   
Whiteboard: PMC_approved
Attachments:
Description Flags
patch none

Description Paul Fullbright CLA 2011-05-18 13:19:47 EDT
The given persistent class(es):

package test;

@XmlType
public class Parent {

    @XmlType
    public static class Child {

    }
}


will result in the following in the project explorer:

-JAXB Content
  - test (package)
    - Parent (type)
    - Parent.Child (type)
  - test.Parent (invalid empty package)
Comment 1 Neil Hauge CLA 2011-05-18 16:16:25 EDT
This appears to be a problem with the validation running at the same time as our context model update.  There isn't enough time to fix this in RC2.
Comment 2 Neil Hauge CLA 2011-05-18 16:16:49 EDT
(In reply to comment #1)
> This appears to be a problem with the validation running at the same time as
> our context model update.  There isn't enough time to fix this in RC2.

Comment was meant for a different bug.
Comment 3 Paul Fullbright CLA 2011-05-18 18:39:24 EDT
Created attachment 196058 [details]
patch
Comment 4 Neil Hauge CLA 2011-05-19 01:01:46 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 patch fixes an ugly bug in the JAXB Content node in the Project Explorer when a class that holds an inner class will be incorrectly listed as a package.

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

No workaround

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

The fix has been tested by Paul and myself.

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

This is a very simple change (with slight refactoring to eliminate redundant code) that simply gets the patckage name from the jaxbType instead of trying to use ClassName.getPackageName().

    What is the risk associated with this fix? 
Very low.
Comment 5 Neil Hauge CLA 2011-05-19 02:39:13 EDT
Approving so this can make it into Thursday's build.  We can roll back if there are any objections from the PMC.
Comment 6 Paul Fullbright CLA 2011-05-19 02:49:31 EDT
committed for rc2
Comment 7 Jolene Moffitt CLA 2011-06-08 13:42:25 EDT
Verified in Build I-3.3.0RC4-20110603221533

Verified when you create a JaXB project and then a class per the bug, the invalid empty package does not appear.  Verify the other items still appear correctly in JAXB Content folder.  See the link to view test steps for verification.  http://wiki.eclipse.org/Dali_3.0_RC2