mustang = true;
List mask = new ArrayList(Arrays.asList(maskedPackages));
mask.add("javax.xml.bind.");
cl = new MaskingClassLoader(cl,mask);
URL apiUrl = cl.getResource("javax/xml/bind/annotation/XmlSeeAlso.class");
if(apiUrl==null)
throw new ClassNotFoundException("There's no JAXB 2.1 API in the classpath");
cl = new URLClassLoader(new URL[]{ParallelWorldClassLoader.toJarUrl(apiUrl)},cl);
}
//Leave XJC2 in the publicly visible place
// and then isolate XJC1 in a child class loader,
// then use a MaskingClassLoader
// so that the XJC2 classes in the parent class loader
// won't interfere with loading XJC1 classes in a child class loader
if (v.equals("1.0")) {
if(!mustang)
// if we haven't used Masking ClassLoader, do so now.
cl = new MaskingClassLoader(cl,toolPackages);
cl = new ParallelWorldClassLoader(cl,"1.0/");
} else {
if(mustang)
// the whole RI needs to be loaded in a separate class loader
cl = new ParallelWorldClassLoader(cl,"");