JandexInventoryBuilder does call File constructor too early

If an index exists there is no need to use File constructor to create
new index.

223397

Change-Id: I4bc0c096be6a3134f1514151931f0420afb1e801
Reviewed-on: https://git.eclipse.org/r/118240
Tested-by: Hudson CI
Reviewed-by: Matthias Otterbach <matthias.otterbach@bsi-software.com>
diff --git a/org.eclipse.scout.rt.platform/src/main/java/org/eclipse/scout/rt/platform/inventory/internal/JandexInventoryBuilder.java b/org.eclipse.scout.rt.platform/src/main/java/org/eclipse/scout/rt/platform/inventory/internal/JandexInventoryBuilder.java
index 08c5097..0a3e12d 100644
--- a/org.eclipse.scout.rt.platform/src/main/java/org/eclipse/scout/rt/platform/inventory/internal/JandexInventoryBuilder.java
+++ b/org.eclipse.scout.rt.platform/src/main/java/org/eclipse/scout/rt/platform/inventory/internal/JandexInventoryBuilder.java
@@ -197,12 +197,12 @@
 
   protected Index scanJar(URI indexUri) throws URISyntaxException, IOException {
     String s = indexUri.getRawSchemeSpecificPart();
-    File jarFile = new File(new URI(s.substring(0, s.lastIndexOf("!"))));
     Index index = readIndex(indexUri);
     if (index != null) {
       return index;
     }
     LOG.info("Found no pre-built '{}'. Scanning location...", indexUri);
+    File jarFile = new File(new URI(s.substring(0, s.lastIndexOf("!"))));
     Indexer indexer = new Indexer();
     return JarIndexer.createJarIndex(jarFile, indexer, false, false, false).getIndex();
   }