Skip to content

Commit

Permalink
Fix JANDEX-32 JarIndexer mishandles paths with the extension in multi…
Browse files Browse the repository at this point in the history
…ple elements
  • Loading branch information
n1hility committed Apr 20, 2015
1 parent 544a76c commit b3781f0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/jboss/jandex/JarIndexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ private static File getIndexFile(File jarFile, boolean newJar) {

// this method is here so we keep the naming details here, as impl detail
final String ext = name.substring(p);
String pattern = "\\" + ext + "$";

if (newJar)
return new File(jarFile.getAbsolutePath().replace(ext, "-jandex" + ext));
return new File(jarFile.getAbsolutePath().replaceAll(pattern, "-jandex" + ext));
else
return new File(jarFile.getAbsolutePath().replace(ext, "-" + ext.substring(1)) + ".idx");
return new File(jarFile.getAbsolutePath().replaceAll(pattern, "-" + ext.substring(1)) + ".idx");
}

/**
Expand Down

0 comments on commit b3781f0

Please sign in to comment.