Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363620 - xml enum value invalid lexical value has a null text range
Summary: xml enum value invalid lexical value has a null text range
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JAXB (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC1   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-11 15:19 EST by Karen Butzke CLA
Modified: 2011-11-29 10:57 EST (History)
1 user (show)

See Also:


Attachments

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