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

Bug 363620

Summary: xml enum value invalid lexical value has a null text range
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: JAXBAssignee: Karen Butzke <karenfbutzke>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jolene.moffitt
Version: 3.1   
Target Milestone: 3.1 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Karen Butzke CLA 2011-11-11 15:19:46 EST
The following schema simple type and corresponding enum gives a validation error on the USState enum 'Invalid lexical value "CA" for schema type 'USState''. The validation error is correct, but it does not have a valid text range, so you don't see a marker in the java editor. In the error log:
java.lang.IllegalArgumentException: Null text range for message ID: XML_ENUM_VALUE__INVALID_LEXICAL_VALUE


<xsd:simpleType name="USState">
	<xsd:restriction base="xsd:NCName">
		<xsd:enumeration value="AK"/>
		<xsd:enumeration value="AL"/>
	</xsd:restriction>
</xsd:simpleType>

@XmlType(name = "USState")
@XmlEnum
public enum USState {

	   AK,
	   AL,
	   CA;

    public String value() {
        return name();
    }

    public static USState fromValue(String v) {
        return valueOf(v);
    }

}
Comment 1 Karen Butzke CLA 2011-11-14 08:11:00 EST
fixed for RC1
Comment 2 Jolene Moffitt CLA 2011-11-29 10:57:35 EST
Verified in Build S-3.1.0-20111117042513 

Verified when you add the above schema and class an error appears and an error marker appears but no error is error pane appears. See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.1_RC1