- String urlString = url.toString();
- if(urlString.startsWith("jar:file:")) {
- int exclam = urlString.lastIndexOf('!');
- JarFile jf = new JarFile(urlString.substring(9,exclam));
- try {
- Enumeration<JarEntry> jfe = jf.entries();
- while(jfe.hasMoreElements()) {
- String name = jfe.nextElement().getName();
- if(name.startsWith(path) && name.endsWith(".class")) {
- classNames.add(name.substring(0,name.length()-6).replace('/', '.'));
+ String urlString;
+ if (url != null) {
+ urlString = url.toString();
+ if (urlString.startsWith("jar:file:")) {
+ int exclam = urlString.lastIndexOf('!');
+ JarFile jf = new JarFile(urlString.substring(9, exclam));
+ try {
+ Enumeration<JarEntry> jfe = jf.entries();
+ while (jfe.hasMoreElements()) {
+ String name = jfe.nextElement().getName();
+ if (name.startsWith(path) && name.endsWith(".class")) {
+ classNames.add(name.substring(0, name.length() - 6).replace('/', '.'));
+ }