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/05/01 12:45:38 UTC

[commons-bcel] 09/49: Refactor common code.

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 a4bc0ef8926802adbf5facaf31be8cbb45f800f2
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 1 08:18:38 2022 -0400

    Refactor common code.
---
 src/main/java/org/apache/bcel/generic/BranchInstruction.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/bcel/generic/BranchInstruction.java b/src/main/java/org/apache/bcel/generic/BranchInstruction.java
index 58a78768..0ff31ec6 100644
--- a/src/main/java/org/apache/bcel/generic/BranchInstruction.java
+++ b/src/main/java/org/apache/bcel/generic/BranchInstruction.java
@@ -140,8 +140,8 @@ public abstract class BranchInstruction extends Instruction implements Instructi
     public String toString( final boolean verbose ) {
         final String s = super.toString(verbose);
         String t = "null";
-        if (verbose) {
-            if (target != null) {
+        if (target != null) {
+            if (verbose) {
                 if (target.getInstruction() == this) {
                     t = "<points to itself>";
                 } else if (target.getInstruction() == null) {
@@ -152,9 +152,7 @@ public abstract class BranchInstruction extends Instruction implements Instructi
                     //t = target.getInstruction().toString(false); // Avoid circles
                     t = "" + target.getPosition();
                 }
-            }
-        } else {
-            if (target != null) {
+            } else {
                 index = target.getPosition();
                 // index = getTargetOffset();  crashes if positions haven't been set
                 // t = "" + (index + position);