Skip resources from sisu-inject-bean JAR as that is accidentally on execution path, contains annotation processor, but is not compiled with -target 1.6
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Mon, 21 Oct 2013 17:19:55 +0200
changeset 13835ebf214c2af3
parent 1382 7f4d603c46dd
child 1384 12a395b571c8
Skip resources from sisu-inject-bean JAR as that is accidentally on execution path, contains annotation processor, but is not compiled with -target 1.6
launcher/fx/src/main/java/org/apidesign/bck2brwsr/launcher/BaseHTTPLauncher.java
     1.1 --- a/launcher/fx/src/main/java/org/apidesign/bck2brwsr/launcher/BaseHTTPLauncher.java	Mon Oct 21 15:16:04 2013 +0200
     1.2 +++ b/launcher/fx/src/main/java/org/apidesign/bck2brwsr/launcher/BaseHTTPLauncher.java	Mon Oct 21 17:19:55 2013 +0200
     1.3 @@ -596,21 +596,21 @@
     1.4              throw new IOException("Can't find " + resource);
     1.5          }
     1.6          private InputStream getResource(String resource, int skip) throws IOException {
     1.7 -            URL u = null;
     1.8              for (ClassLoader l : loaders) {
     1.9                  Enumeration<URL> en = l.getResources(resource);
    1.10                  while (en.hasMoreElements()) {
    1.11                      final URL now = en.nextElement();
    1.12 +                    if (now.toExternalForm().contains("sisu-inject-bean")) {
    1.13 +                        // certainly we don't want this resource, as that
    1.14 +                        // module is not compiled with target 1.6, currently
    1.15 +                        continue;
    1.16 +                    }
    1.17                      if (--skip < 0) {
    1.18 -                        u = now;
    1.19 -                        break;
    1.20 +                        return now.openStream();
    1.21                      }
    1.22                  }
    1.23              }
    1.24 -            if (u != null) {
    1.25 -                return u.openStream();
    1.26 -            }
    1.27 -            return null;
    1.28 +            throw new IOException("Not found (anymore of) " + resource);
    1.29          }
    1.30      }
    1.31