This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
The following commit(s) were added to refs/heads/master by this push: new 3d95ee56 Make private instance variable final 3d95ee56 is described below commit 3d95ee560c7b132e30bfc51286b353155b0ccc2c Author: Gary David Gregory (Code signing key) <ggreg...@apache.org> AuthorDate: Sat Nov 19 15:57:12 2022 -0500 Make private instance variable final --- src/main/java/org/apache/bcel/util/ClassPath.java | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/apache/bcel/util/ClassPath.java b/src/main/java/org/apache/bcel/util/ClassPath.java index a0998105..4784353c 100644 --- a/src/main/java/org/apache/bcel/util/ClassPath.java +++ b/src/main/java/org/apache/bcel/util/ClassPath.java @@ -525,7 +525,7 @@ public class ClassPath implements Closeable { private final String classPath; - private ClassPath parent; + private final ClassPath parent; private final AbstractPathEntry[] paths; @@ -539,18 +539,9 @@ public class ClassPath implements Closeable { this(getClassPath()); } + @SuppressWarnings("resource") public ClassPath(final ClassPath parent, final String classPath) { - this(classPath); this.parent = parent; - } - - /** - * Search for classes in given path. - * - * @param classPath - */ - @SuppressWarnings("resource") - public ClassPath(final String classPath) { this.classPath = classPath; final List<AbstractPathEntry> list = new ArrayList<>(); for (final StringTokenizer tokenizer = new StringTokenizer(classPath, File.pathSeparator); tokenizer.hasMoreTokens();) { @@ -578,6 +569,16 @@ public class ClassPath implements Closeable { } paths = new AbstractPathEntry[list.size()]; list.toArray(paths); + + } + + /** + * Search for classes in given path. + * + * @param classPath + */ + public ClassPath(final String classPath) { + this(null, classPath); } @Override