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 14:53:28 UTC

[commons-bcel] 03/04: Reuse constant instead of magic number

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 08a313c0b79865297952b6714eaaf9a316983b73
Author: Gary David Gregory (Code signing key) <gg...@apache.org>
AuthorDate: Sat Nov 19 19:28:29 2022 -0500

    Reuse constant instead of magic number
---
 src/examples/Package.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/examples/Package.java b/src/examples/Package.java
index 5cf61ef3..5c6bafab 100644
--- a/src/examples/Package.java
+++ b/src/examples/Package.java
@@ -174,7 +174,7 @@ public class Package {
             }
             String clName = arg;
             if (clName.endsWith(JavaClass.EXTENSION)) {
-                clName = clName.substring(0, clName.length() - 6);
+                clName = clName.substring(0, clName.length() - JavaClass.EXTENSION.length());
             }
             clName = clName.replace('.', '/');
             try (final InputStream inputStream = classPath.getInputStream(clName)) {