Returns the canonical name of the underlying class as
defined by the Java Language Specification. Returns
null if the underlying class does not have a canonical name.
Change-Id: I3f7cd96eceb43f58e346297f01d09a431f99817d
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
private static JAXBContext getContext(Class<?> clazz) throws JaxbException {
try {
String qualifier = clazz.getCanonicalName();
+ if (qualifier == null) {
+ throw new JAXBException("underlying class does not have a canonical name");
+ }
+
int index = qualifier.lastIndexOf('.');
if (-1 != index) {
qualifier = qualifier.substring(0, index);