diff --git a/src/main/java/javamop/GenerateAgent.java b/src/main/java/javamop/GenerateAgent.java index 68442767..fea9f917 100644 --- a/src/main/java/javamop/GenerateAgent.java +++ b/src/main/java/javamop/GenerateAgent.java @@ -19,7 +19,6 @@ import java.nio.file.attribute.BasicFileAttributes; import java.util.Arrays; import java.util.List; -import java.util.regex.Pattern; /** * Handles generating a complete Java agent after .mop files have been processed into .rvm files @@ -212,10 +211,8 @@ public static void generate(final File outputDir, final String aspectname, * @return Filename of the jar */ private static String getJarName(String pathToJar) { - String name; - String[] parts = pathToJar.split(Pattern.quote(File.separator)); - name = parts[parts.length - 1]; - return name; + File file = new File(pathToJar); + return file.getName(); } /**