name = name.substring(name.length()-DOT_OBJECT_FACTORY.length())+IMPL_DOT_OBJECT_FACTORY;
try {
c = c.getClassLoader().loadClass(name);
} catch (ClassNotFoundException e) {
throw new JAXBException(e);
}
modified = true;
}
r[i] = c;
}
if(!modified) {
// if the class list doesn't contain any of our classes,
// this ContextFactory shouldn't have been called in the first place
// if we simply continue, we'll just end up with the infinite recursion.
// the only case that I can think of where this could happen is
// when the user puts additional classes into the JAXB-generated
// package and pass them to JAXBContext.newInstance().
// Under normal use, this shouldn't happen.
// anyway, bail out now.
// if you hit this problem and wondering how to get around the problem,
// subscribe and send a note to users@jaxb.dev.java.net (http://jaxb.dev.java.net/)
throw new JAXBException("Unable to find a JAXB implementation to delegate");
}
// delegate to the JAXB provider in the system
return JAXBContext.newInstance(r,properties);
}