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/27 22:54:38 UTC
[commons-bcel] branch master updated: Use an inline comment
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 be4aec1b Use an inline comment
be4aec1b is described below
commit be4aec1b8f204ef51af208c92ac5dd1f14c3a936
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Nov 27 17:54:33 2022 -0500
Use an inline comment
Better internal name
Remove old comment
Javadoc
Camel case
---
.../org/apache/bcel/generic/InstructionHandle.java | 2 +-
.../org/apache/bcel/generic/InstructionList.java | 12 +++++-------
.../org/apache/bcel/generic/UnconditionalBranch.java | 1 -
.../verifier/structurals/InstConstraintVisitor.java | 20 ++++++++++----------
4 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/src/main/java/org/apache/bcel/generic/InstructionHandle.java b/src/main/java/org/apache/bcel/generic/InstructionHandle.java
index d4d0339a..0cacae5e 100644
--- a/src/main/java/org/apache/bcel/generic/InstructionHandle.java
+++ b/src/main/java/org/apache/bcel/generic/InstructionHandle.java
@@ -71,7 +71,7 @@ public class InstructionHandle {
private Map<Object, Object> attributes;
- /* private */protected InstructionHandle(final Instruction i) {
+ protected InstructionHandle(final Instruction i) {
setInstruction(i);
}
diff --git a/src/main/java/org/apache/bcel/generic/InstructionList.java b/src/main/java/org/apache/bcel/generic/InstructionList.java
index 096b18f4..86abcfa2 100644
--- a/src/main/java/org/apache/bcel/generic/InstructionList.java
+++ b/src/main/java/org/apache/bcel/generic/InstructionList.java
@@ -503,9 +503,7 @@ public class InstructionList implements Iterable<InstructionHandle> {
public void dispose() {
// Traverse in reverse order, because ih.next is overwritten
for (InstructionHandle ih = end; ih != null; ih = ih.getPrev()) {
- /*
- * Causes BranchInstructions to release target and targeters, because it calls dispose() on the contained instruction.
- */
+ // Causes BranchInstructions to release target and targeters, because it calls dispose() on the contained instruction.
ih.dispose();
}
clear();
@@ -1024,7 +1022,7 @@ public class InstructionList implements Iterable<InstructionHandle> {
}
first.setPrev(null); // Completely separated from rest of list
last.setNext(null);
- final List<InstructionHandle> targetVec = new ArrayList<>();
+ final List<InstructionHandle> targetList = new ArrayList<>();
for (InstructionHandle ih = first; ih != null; ih = ih.getNext()) {
ih.getInstruction().dispose(); // e.g. BranchInstructions release their targets
}
@@ -1033,7 +1031,7 @@ public class InstructionList implements Iterable<InstructionHandle> {
next = ih.getNext();
length--;
if (ih.hasTargeters()) { // Still got targeters?
- targetVec.add(ih);
+ targetList.add(ih);
buf.append(ih.toString(true)).append(" ");
ih.setNext(ih.setPrev(null));
} else {
@@ -1041,8 +1039,8 @@ public class InstructionList implements Iterable<InstructionHandle> {
}
}
buf.append("}");
- if (!targetVec.isEmpty()) {
- throw new TargetLostException(targetVec.toArray(InstructionHandle.EMPTY_ARRAY), buf.toString());
+ if (!targetList.isEmpty()) {
+ throw new TargetLostException(targetList.toArray(InstructionHandle.EMPTY_ARRAY), buf.toString());
}
}
diff --git a/src/main/java/org/apache/bcel/generic/UnconditionalBranch.java b/src/main/java/org/apache/bcel/generic/UnconditionalBranch.java
index 8b9af96e..e217a5b0 100644
--- a/src/main/java/org/apache/bcel/generic/UnconditionalBranch.java
+++ b/src/main/java/org/apache/bcel/generic/UnconditionalBranch.java
@@ -19,7 +19,6 @@ package org.apache.bcel.generic;
/**
* Denotes an instruction to perform an unconditional branch, i.e., GOTO, JSR.
*
- *
* @see GOTO
* @see JSR
*/
diff --git a/src/main/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java b/src/main/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java
index 485ce6b4..d4ec88b5 100644
--- a/src/main/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java
+++ b/src/main/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java
@@ -938,26 +938,26 @@ public class InstConstraintVisitor extends EmptyVisitor {
}
final Type value = stack().peek();
final Type t = Type.getType(f.getSignature());
- Type shouldbe = t;
- if (shouldbe == Type.BOOLEAN || shouldbe == Type.BYTE || shouldbe == Type.CHAR || shouldbe == Type.SHORT) {
- shouldbe = Type.INT;
+ Type shouldBe = t;
+ if (shouldBe == Type.BOOLEAN || shouldBe == Type.BYTE || shouldBe == Type.CHAR || shouldBe == Type.SHORT) {
+ shouldBe = Type.INT;
}
if (t instanceof ReferenceType) {
- ReferenceType rvalue = null;
+ ReferenceType rValue = null;
if (value instanceof ReferenceType) {
- rvalue = (ReferenceType) value;
- referenceTypeIsInitialized(o, rvalue);
+ rValue = (ReferenceType) value;
+ referenceTypeIsInitialized(o, rValue);
} else {
constraintViolated(o, "The stack top type '" + value + "' is not of a reference type as expected.");
}
// TODO: This can possibly only be checked using Staerk-et-al's "set-of-object types", not
// using "wider cast object types" created during verification.
// Comment it out if you encounter problems. See also the analogon at visitPUTFIELD|visitPUTSTATIC.
- if (!rvalue.isAssignmentCompatibleWith(shouldbe)) {
- constraintViolated(o, "The stack top type '" + value + "' is not assignment compatible with '" + shouldbe + "'.");
+ if (!rValue.isAssignmentCompatibleWith(shouldBe)) {
+ constraintViolated(o, "The stack top type '" + value + "' is not assignment compatible with '" + shouldBe + "'.");
}
- } else if (shouldbe != value) {
- constraintViolated(o, "The stack top type '" + value + "' is not of type '" + shouldbe + "' as expected.");
+ } else if (shouldBe != value) {
+ constraintViolated(o, "The stack top type '" + value + "' is not of type '" + shouldBe + "' as expected.");
}
return f;
}