aboutsummaryrefslogtreecommitdiffstats
path: root/bcel-builder/src
diff options
context:
space:
mode:
authorAndrey Turbanov <turbanoff@gmail.com>2021-11-20 16:53:30 +0300
committerAndrey Turbanov <turbanoff@gmail.com>2021-11-20 16:53:30 +0300
commit793a015abbdf77e20052362db626d9aea855c16b (patch)
treefb01864e965e38f4f6f5c8fb0f78e4f5be4abef9 /bcel-builder/src
parent0f85ca109b9e6ab849e201e76f62d5023cbfcb98 (diff)
downloadaspectj-793a015abbdf77e20052362db626d9aea855c16b.tar.gz
aspectj-793a015abbdf77e20052362db626d9aea855c16b.zip
According to javadoc File.isDirectory 'true' if and only if the file denoted by this abstract pathname exists and is a directory.
It means that separate File.exists() check before File.isDirectory() check is redundant.
Diffstat (limited to 'bcel-builder/src')
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java
index 29f8f6d6d..c2f350d0c 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java
@@ -117,10 +117,10 @@ public class ClassPath implements Serializable {
File file = new File(path);
try {
- if (file.exists()) {
- if (file.isDirectory()) {
- vec.add(new Dir(path));
- } else if (file.getName().endsWith("jrt-fs.jar")) { // TODO a bit crude...
+ if (file.isDirectory()) {
+ vec.add(new Dir(path));
+ } else if (file.exists()) {
+ if (file.getName().endsWith("jrt-fs.jar")) { // TODO a bit crude...
vec.add(new JImage());
} else {
vec.add(new Zip(new ZipFile(file)));