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:42 UTC
[commons-bcel] 13/49: Use final.
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 2456a2adaa4b88528a62032ba78a1c7bbcd017bd
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 1 08:20:17 2022 -0400
Use final.
---
src/main/java/org/apache/bcel/classfile/ConstantPool.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantPool.java b/src/main/java/org/apache/bcel/classfile/ConstantPool.java
index 993b50bf..5b36e8ab 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantPool.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantPool.java
@@ -239,7 +239,7 @@ public class ConstantPool implements Cloneable, Node {
throw new ClassFormatException("Invalid constant pool reference: " + index
+ ". Constant pool size is: " + constantPool.length);
}
- Constant ret = constantPool[index];
+ final Constant ret = constantPool[index];
if (ret == null) {
throw new ClassFormatException("Constant pool at index " + index + " is null.");
}
@@ -257,7 +257,7 @@ public class ConstantPool implements Cloneable, Node {
* @throws ClassFormatException if constant type does not match tag
*/
public Constant getConstant( final int index, final byte tag ) throws ClassFormatException {
- Constant c = getConstant(index);
+ final Constant c = getConstant(index);
if (c.getTag() != tag) {
throw new ClassFormatException("Expected class `" + Const.getConstantName(tag)
+ "' at index " + index + " and got " + c);