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/16 15:40:24 UTC

[commons-bcel] branch master updated (44b85d93 -> d6caf2df)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git


    from 44b85d93 Add disabled tests for the verifier
     new 1a26bf24 Refactor and update banner to Apache
     new 2e4aac0c Javadoc
     new d6caf2df Javadoc use of ClassNotFoundException

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/main/java/org/apache/bcel/classfile/JavaClass.java       |  4 ++++
 src/main/java/org/apache/bcel/util/JavaWrapper.java          |  1 +
 src/main/java/org/apache/bcel/util/Repository.java           |  6 +++++-
 src/main/java/org/apache/bcel/verifier/Verifier.java         |  7 ++++++-
 src/main/java/org/apache/bcel/verifier/VerifierAppFrame.java | 10 +++-------
 5 files changed, 19 insertions(+), 9 deletions(-)


[commons-bcel] 02/03: Javadoc

Posted by gg...@apache.org.
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 2e4aac0c5ff3e588fac085f6e103b825d651adc5
Author: Gary David Gregory (Code signing key) <gg...@apache.org>
AuthorDate: Wed Nov 16 10:32:41 2022 -0500

    Javadoc
---
 src/main/java/org/apache/bcel/classfile/JavaClass.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/main/java/org/apache/bcel/classfile/JavaClass.java b/src/main/java/org/apache/bcel/classfile/JavaClass.java
index 68b9bf59..14b41d0b 100644
--- a/src/main/java/org/apache/bcel/classfile/JavaClass.java
+++ b/src/main/java/org/apache/bcel/classfile/JavaClass.java
@@ -396,6 +396,8 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl
 
     /**
      * Get all interfaces implemented by this JavaClass (transitively).
+     *
+     * @throws ClassNotFoundException if any of the class's superclasses or interfaces can't be found.
      */
     public JavaClass[] getAllInterfaces() throws ClassNotFoundException {
         final ClassQueue queue = new ClassQueue();
@@ -501,6 +503,8 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl
 
     /**
      * Get interfaces directly implemented by this JavaClass.
+     *
+     * @throws ClassNotFoundException if any of the class's interfaces can't be found.
      */
     public JavaClass[] getInterfaces() throws ClassNotFoundException {
         final String[] interfaces = getInterfaceNames();


[commons-bcel] 01/03: Refactor and update banner to Apache

Posted by gg...@apache.org.
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 1a26bf24b313e820231ee0b69a0046ba09d917c4
Author: Gary David Gregory (Code signing key) <gg...@apache.org>
AuthorDate: Wed Nov 16 10:22:19 2022 -0500

    Refactor and update banner to Apache
---
 src/main/java/org/apache/bcel/verifier/Verifier.java         |  5 ++++-
 src/main/java/org/apache/bcel/verifier/VerifierAppFrame.java | 10 +++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/bcel/verifier/Verifier.java b/src/main/java/org/apache/bcel/verifier/Verifier.java
index 66bb7c4a..84de3859 100644
--- a/src/main/java/org/apache/bcel/verifier/Verifier.java
+++ b/src/main/java/org/apache/bcel/verifier/Verifier.java
@@ -43,6 +43,9 @@ import org.apache.commons.lang3.ArrayUtils;
  */
 public class Verifier {
 
+    static final String NAME = "Apache Commons BCEL";
+    static final String BANNER = NAME + "\nhttps://commons.apache.org/bcel\n";
+
     static final Verifier[] EMPTY_ARRAY = {};
 
     /**
@@ -52,7 +55,7 @@ public class Verifier {
      * put the classes into the BCEL Repository yourself (via 'addClass(JavaClass)').
      */
     public static void main(final String[] args) {
-        System.out.println("JustIce by Enver Haase, (C) 2001-2002.\n<http://bcel.sourceforge.net>\n<https://commons.apache.org/bcel>\n");
+        System.out.println(BANNER);
         for (int index = 0; index < args.length; index++) {
             try {
                 if (args[index].endsWith(JavaClass.EXTENSION)) {
diff --git a/src/main/java/org/apache/bcel/verifier/VerifierAppFrame.java b/src/main/java/org/apache/bcel/verifier/VerifierAppFrame.java
index 764150ec..e122a8be 100644
--- a/src/main/java/org/apache/bcel/verifier/VerifierAppFrame.java
+++ b/src/main/java/org/apache/bcel/verifier/VerifierAppFrame.java
@@ -52,8 +52,6 @@ import org.apache.commons.lang3.ArrayUtils;
 public class VerifierAppFrame extends JFrame {
 
     private static final long serialVersionUID = -542458133073307640L;
-    private static final String JUSTICE_VERSION = "JustIce by Enver Haase";
-
     private JPanel contentPane;
     private final JSplitPane jSplitPane1 = new JSplitPane();
     private final JPanel jPanel1 = new JPanel();
@@ -103,9 +101,7 @@ public class VerifierAppFrame extends JFrame {
     }
 
     void aboutMenuItem_actionPerformed(final ActionEvent e) {
-        JOptionPane.showMessageDialog(this,
-            "JustIce is a Java class file verifier.\n" + "It was implemented by Enver Haase in 2001, 2002.\n<https://commons.apache.org/bcel/>",
-            JUSTICE_VERSION, JOptionPane.INFORMATION_MESSAGE);
+        JOptionPane.showMessageDialog(this, Verifier.BANNER, Verifier.NAME, JOptionPane.INFORMATION_MESSAGE);
     }
 
     synchronized void classNamesJList_valueChanged(final ListSelectionEvent e) {
@@ -343,7 +339,7 @@ public class VerifierAppFrame extends JFrame {
             allmsgs.append(msgs[i]).append("\n\n");
         }
         messagesTextPane.setText(allmsgs.toString());
-        setTitle(currentClass + " - " + JUSTICE_VERSION);
+        setTitle(currentClass + " - " + Verifier.NAME);
     }
 
     void whatisMenuItem_actionPerformed(final ActionEvent e) {
@@ -352,7 +348,7 @@ public class VerifierAppFrame extends JFrame {
                 + " The Java Virtual Machine Specification.\nThese are (in that order):"
                 + " Pass one, Pass two, Pass three (before data flow analysis), Pass three (data flow analysis).\n"
                 + "The bottom box to the right shows (warning) messages; warnings do not cause a class to be rejected.",
-            JUSTICE_VERSION, JOptionPane.INFORMATION_MESSAGE);
+            Verifier.NAME, JOptionPane.INFORMATION_MESSAGE);
     }
 
 }


[commons-bcel] 03/03: Javadoc use of ClassNotFoundException

Posted by gg...@apache.org.
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 d6caf2df0d8be01195bc3500594480682e53badc
Author: Gary David Gregory (Code signing key) <gg...@apache.org>
AuthorDate: Wed Nov 16 10:39:21 2022 -0500

    Javadoc use of ClassNotFoundException
---
 src/main/java/org/apache/bcel/util/JavaWrapper.java  | 1 +
 src/main/java/org/apache/bcel/util/Repository.java   | 6 +++++-
 src/main/java/org/apache/bcel/verifier/Verifier.java | 2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/bcel/util/JavaWrapper.java b/src/main/java/org/apache/bcel/util/JavaWrapper.java
index c55afb61..38ebf189 100644
--- a/src/main/java/org/apache/bcel/util/JavaWrapper.java
+++ b/src/main/java/org/apache/bcel/util/JavaWrapper.java
@@ -87,6 +87,7 @@ public class JavaWrapper {
      *
      * @param className the fully qualified class name
      * @param argv the arguments just as you would pass them directly
+     * @throws ClassNotFoundException if {@code className} can't be found.
      */
     public void runMain(final String className, final String[] argv) throws ClassNotFoundException {
         final Class<?> cl = loader.loadClass(className);
diff --git a/src/main/java/org/apache/bcel/util/Repository.java b/src/main/java/org/apache/bcel/util/Repository.java
index 9407955c..89a28b71 100644
--- a/src/main/java/org/apache/bcel/util/Repository.java
+++ b/src/main/java/org/apache/bcel/util/Repository.java
@@ -42,12 +42,16 @@ public interface Repository {
     ClassPath getClassPath();
 
     /**
-     * Finds the JavaClass instance for the given run-time class object
+     * Finds the JavaClass instance for the given run-time class object.
+     *
+     * @throws ClassNotFoundException if the class can't be found.
      */
     JavaClass loadClass(Class<?> clazz) throws ClassNotFoundException;
 
     /**
      * Finds the class with the name provided, if the class isn't there, make an attempt to load it.
+     *
+     * @throws ClassNotFoundException if the class can't be found.
      */
     JavaClass loadClass(String className) throws ClassNotFoundException;
 
diff --git a/src/main/java/org/apache/bcel/verifier/Verifier.java b/src/main/java/org/apache/bcel/verifier/Verifier.java
index 84de3859..97392a68 100644
--- a/src/main/java/org/apache/bcel/verifier/Verifier.java
+++ b/src/main/java/org/apache/bcel/verifier/Verifier.java
@@ -191,6 +191,8 @@ public class Verifier {
     /**
      * This returns all the (warning) messages collected during verification. A prefix shows from which verifying pass a
      * message originates.
+     *
+     * @throws ClassNotFoundException if this class can't be found.
      */
     public String[] getMessages() throws ClassNotFoundException {
         final List<String> messages = new ArrayList<>();