summaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java19
-rw-r--r--weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java3
-rw-r--r--weaver/testdata/WeavingURLClassLoaderTest/builtLibs/aspectNoExtbin0 -> 1379 bytes
-rw-r--r--weaver/testdata/WeavingURLClassLoaderTest/builtLibs/test.jar/main.filebin0 -> 698 bytes
4 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);
diff --git a/weaver/testdata/WeavingURLClassLoaderTest/builtLibs/aspectNoExt b/weaver/testdata/WeavingURLClassLoaderTest/builtLibs/aspectNoExt
new file mode 100644
index 000000000..77469d6f0
--- /dev/null
+++ b/weaver/testdata/WeavingURLClassLoaderTest/builtLibs/aspectNoExt
Binary files differ
diff --git a/weaver/testdata/WeavingURLClassLoaderTest/builtLibs/test.jar/main.file b/weaver/testdata/WeavingURLClassLoaderTest/builtLibs/test.jar/main.file
new file mode 100644
index 000000000..e0204709e
--- /dev/null
+++ b/weaver/testdata/WeavingURLClassLoaderTest/builtLibs/test.jar/main.file
Binary files differ