jaxb-ri
jaxb-ri copied to clipboard
JAXB throws NPE when wsgen from an object with <E extends Enum<E>
Run wsgen.sh (from javaee6u4_ri-3.1.2-b21.zip) the following classes , it throws NPE exception :
Caused by: java.lang.NullPointerException
at java.util.EnumMap.
Classes to reproduce this error:
--Service endpoint interface--
@javax.jws.WebService @XmlSeeAlso(Suit.class) public interface EnumTest { public <T extends Enum<T>> SomeObject<T> test2(SomeObject<T> o); }
---Service Endpoint Impl class-- @javax.jws.WebService(endpointInterface="foo.bar.EnumTest") public class EnumTestImpl implements EnumTest { public <T extends Enum<T>> SomeObject<T> test2(SomeObject<T> o)
{ return o; }
}
---SomeObject.class--
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType;
@XmlAccessorType(XmlAccessType.FIELD) public class SomeObject<E extends Enum<E>> { private AnotherObject<E> obj;
public AnotherObject<E> getAnotherObject()
{ return obj; }
public void setAnotherObject(AnotherObject<E> obj)
{ this.obj = obj; }
}
-----AnotherObject.class---- import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) public class AnotherObject<E extends Enum<E>> { private E myEnum;
public E getMyEnum()
{ return myEnum; }
public void setMyEnum(E myEnum)
{ this.myEnum = myEnum; }
}
Affected Versions
[2.2.5]
- Issue Imported From: https://github.com/javaee/jaxb-v2/issues/946
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @glassfishrobot
@glassfishrobot Commented Reported by jimmajaxb
@glassfishrobot Commented Was assigned to yaroska
@glassfishrobot Commented This issue was imported from java.net JIRA JAXB-946