tested a bit perfs using AppClassLoader only (so it can be a bit different in a JavaEE or OSGi envrt)
single call: URLClassLoader => 654 vs getResources => 1130 (ms but the unit is not important) 1000 calls: 5503 vs 612621 i'll check our tests are still passing then commit the change if nobody shouts before *Romain Manni-Bucau* *Twitter: @rmannibucau <https://twitter.com/rmannibucau>* *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/25 Kevan Miller <[email protected]> > > On Apr 17, 2013, at 3:22 AM, Romain Manni-Bucau <[email protected]> > wrote: > > > Hi, > > > > in org.apache.xbean.finder.UrlSet#getUrls we rely on META-INF (or "") to > find jars. There are cases where it doesn't work at all (a common case > where i saw it is when you only have META-INF/MANIFEST.MF which is consider > for a single entry and not META-INF then MANIFEST.MF - depends the build > tool/zip format if i understood correctly) > > > > the question are: > > 1) do we getresources("META-INF/MANIFEST.MF") too > > 2) why not simply querying the classloader which is very very often an > URLClassLoader -> if (yes) return Arrays.asList(classLoader.getURLs()); > else currentImpl; > > > > The 2 seems less correct but in practise i think it is more efficient - > we can do both too (testing URLClassLoader and if not adding MANIFEST.MF > listing) > > > > wdyt? > > Hi Romain, > I'd be interested in some examples. What tools/jars don't contain a > META-INF? But contain META-INF/MANIFEST.MF? > > Anyway, given that they (tools/jars) evidently exist, I guess 2) is ok. As > you say, it may be faster. Concern will be about changing the behavior. But > if we get sufficient testing, should be ok… > > --kevan
