diff options
author | aclement <aclement> | 2006-05-04 07:14:47 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-05-04 07:14:47 +0000 |
commit | 5a01932b9dbdf81fe41e029fa56ede17364a2c2e (patch) | |
tree | a2991f73f2b496670e3de21f00538fbae9da891d /weaver/src | |
parent | cb5dfe759852d4965c692934ed7e14c41f61b715 (diff) | |
download | aspectj-5a01932b9dbdf81fe41e029fa56ede17364a2c2e.tar.gz aspectj-5a01932b9dbdf81fe41e029fa56ede17364a2c2e.zip |
fixes for 137235 (contributed by Ron): more intelligent logic for determining if a path entry is a jar/zip (don't just rely on suffix, some new .bndl files seem to be becoming popular...)
Diffstat (limited to 'weaver/src')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java | 19 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java | 3 |
2 files changed, 11 insertions, 11 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java b/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java index 2b3b120e3..6876d0a50 100644 --- a/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java +++ b/weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java @@ -65,22 +65,23 @@ public class ClassPathManager { public void addPath (String name, IMessageHandler handler) { File f = new File(name); String lc = name.toLowerCase(); - if (lc.endsWith(".jar") || lc.endsWith(".zip")) { + if (!f.isDirectory()) { if (!f.isFile()) { - MessageUtil.info(handler, WeaverMessages.format(WeaverMessages.ZIPFILE_ENTRY_MISSING,name)); - return; + if (!lc.endsWith(".jar") || lc.endsWith(".zip")) { + // heuristic-only: ending with .jar or .zip means probably a zip file + MessageUtil.info(handler, WeaverMessages.format(WeaverMessages.ZIPFILE_ENTRY_MISSING,name)); + } else { + MessageUtil.info(handler, WeaverMessages.format(WeaverMessages.DIRECTORY_ENTRY_MISSING,name)); + } + return; } try { entries.add(new ZipFileEntry(f)); } catch (IOException ioe) { - MessageUtil.warn(handler, WeaverMessages.format(WeaverMessages.ZIPFILE_ENTRY_INVALID,name,ioe.getMessage())); - return; + MessageUtil.warn(handler, WeaverMessages.format(WeaverMessages.ZIPFILE_ENTRY_INVALID,name,ioe.getMessage())); + return; } } else { - if (!f.isDirectory()) { - MessageUtil.info(handler, WeaverMessages.format(WeaverMessages.DIRECTORY_ENTRY_MISSING,name)); - return; - } entries.add(new DirEntry(f)); } } diff --git a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java index 75ffc5de6..ff280aab9 100644 --- a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java +++ b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java @@ -317,8 +317,7 @@ public class WeavingAdaptor { private void addAspectLibrary(String aspectLibraryName) { File aspectLibrary = new File(aspectLibraryName); if (aspectLibrary.isDirectory() - || (aspectLibrary.isFile() - && FileUtil.hasZipSuffix(aspectLibraryName))) { + || (FileUtil.isZipFile(aspectLibrary))) { try { info("adding aspect library: '" + aspectLibrary + "'"); weaver.addLibraryJarFile(aspectLibrary); |