Question sur l'implémentation
Bonjour a tous
J ai une question pour tous:
Ci-dessous un code extrait de JAXB:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
/**
* Makes sure that we are running with 2.1 JAXB API,
* and report an error if not.
*/
static {
try {
XmlSchema s = null;
s.location();
} catch (NullPointerException e) {
// as epxected
} catch (NoSuchMethodError e) {
// this is not a 2.1 API. Where is it being loaded from?
Messages res;
if(XmlSchema.class.getClassLoader()==null)
res = Messages.INCOMPATIBLE_API_VERSION_MUSTANG;
else
res = Messages.INCOMPATIBLE_API_VERSION;
throw new LinkageError( res.format(
Which.which(XmlSchema.class),
Which.which(ModelBuilder.class)
));
}
} |
dans quel cas peut on atterrir dans le second bloc d exception ?
--NoSuchMethodError
Merci ! :)