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/09 19:57:13 UTC

[commons-bcel] branch master updated: No need to nest

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 6499d147 No need to nest
6499d147 is described below

commit 6499d147014d55500571adfc3444179fb096a84d
Author: Gary David Gregory (Code signing key) <gg...@apache.org>
AuthorDate: Wed Nov 9 14:57:08 2022 -0500

    No need to nest
---
 .../apache/bcel/verifier/statics/Pass2Verifier.java  | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/apache/bcel/verifier/statics/Pass2Verifier.java b/src/main/java/org/apache/bcel/verifier/statics/Pass2Verifier.java
index ba82c084..004c01fa 100644
--- a/src/main/java/org/apache/bcel/verifier/statics/Pass2Verifier.java
+++ b/src/main/java/org/apache/bcel/verifier/statics/Pass2Verifier.java
@@ -1411,19 +1411,15 @@ public final class Pass2Verifier extends PassVerifier implements Constants {
                 for (final Method method : methods) {
                     final String nameAndSig = method.getName() + method.getSignature();
 
-                    if (map.containsKey(nameAndSig)) {
-                        if (method.isFinal()) {
-                            if (!method.isPrivate()) {
-                                throw new ClassConstraintException("Method '" + nameAndSig + "' in class '" + map.get(nameAndSig)
-                                    + "' overrides the final (not-overridable) definition in class '" + jc.getClassName() + "'.");
-                            }
-                            addMessage("Method '" + nameAndSig + "' in class '" + map.get(nameAndSig)
-                                + "' overrides the final (not-overridable) definition in class '" + jc.getClassName()
-                                + "'. This is okay, as the original definition was private; however this constraint leverage"
-                                + " was introduced by JLS 8.4.6 (not vmspec2) and the behavior of the Sun verifiers.");
-                        } else if (!method.isStatic()) { // static methods don't inherit
-                            map.put(nameAndSig, jc.getClassName());
+                    if (map.containsKey(nameAndSig) && method.isFinal()) {
+                        if (!method.isPrivate()) {
+                            throw new ClassConstraintException("Method '" + nameAndSig + "' in class '" + map.get(nameAndSig)
+                                + "' overrides the final (not-overridable) definition in class '" + jc.getClassName() + "'.");
                         }
+                        addMessage("Method '" + nameAndSig + "' in class '" + map.get(nameAndSig)
+                            + "' overrides the final (not-overridable) definition in class '" + jc.getClassName()
+                            + "'. This is okay, as the original definition was private; however this constraint leverage"
+                            + " was introduced by JLS 8.4.6 (not vmspec2) and the behavior of the Sun verifiers.");
                     } else if (!method.isStatic()) { // static methods don't inherit
                         map.put(nameAndSig, jc.getClassName());
                     }