You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/11/20 19:55:07 UTC

[commons-bcel] 02/02: Reuse Utility.pathToPackage()

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

commit 2a3b0eba675acb2755eee394ca4f7da8b23b2e09
Author: Gary David Gregory (Code signing key) <gg...@apache.org>
AuthorDate: Sun Nov 20 14:51:32 2022 -0500

    Reuse Utility.pathToPackage()
---
 src/examples/TransitiveHull.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/examples/TransitiveHull.java b/src/examples/TransitiveHull.java
index 6c34d3dc..9730eaef 100644
--- a/src/examples/TransitiveHull.java
+++ b/src/examples/TransitiveHull.java
@@ -18,6 +18,8 @@
 import java.util.Arrays;
 import java.util.regex.Pattern;
 
+import javax.swing.text.Utilities;
+
 import org.apache.bcel.Const;
 import org.apache.bcel.Repository;
 import org.apache.bcel.classfile.ClassParser;
@@ -29,6 +31,7 @@ import org.apache.bcel.classfile.ConstantMethodref;
 import org.apache.bcel.classfile.ConstantNameAndType;
 import org.apache.bcel.classfile.ConstantPool;
 import org.apache.bcel.classfile.JavaClass;
+import org.apache.bcel.classfile.Utility;
 import org.apache.bcel.generic.ArrayType;
 import org.apache.bcel.generic.ObjectType;
 import org.apache.bcel.generic.Type;
@@ -90,7 +93,7 @@ public class TransitiveHull extends org.apache.bcel.classfile.EmptyVisitor {
     }
 
     private void add(String className) {
-        className = className.replace('/', '.');
+        className = Utility.pathToPackage(className);
 
         for (final String anIgnored : ignored) {
             if (Pattern.matches(anIgnored, className)) {