From a2ecaa221debaf123689bca4968f030080940ca2 Mon Sep 17 00:00:00 2001 From: "Gary David Gregory (Code signing key)" Date: Tue, 10 Oct 2023 15:59:52 -0400 Subject: [PATCH] Make private static classes final --- .../java/org/apache/bcel/classfile/ConstantUtf8.java | 2 +- src/main/java/org/apache/bcel/classfile/Utility.java | 4 ++-- .../org/apache/bcel/generic/InstructionFactory.java | 2 +- src/main/java/org/apache/bcel/util/ClassPath.java | 10 +++++----- .../apache/bcel/verifier/statics/Pass2Verifier.java | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java b/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java index e85705953c..51a843c861 100644 --- a/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java +++ b/src/main/java/org/apache/bcel/classfile/ConstantUtf8.java @@ -57,7 +57,7 @@ */ public final class ConstantUtf8 extends Constant { - private static class Cache { + private static final class Cache { private static final boolean BCEL_STATISTICS = Boolean.getBoolean(SYS_PROP_STATISTICS); private static final int MAX_ENTRIES = Integer.getInteger(SYS_PROP_CACHE_MAX_ENTRIES, 0).intValue(); diff --git a/src/main/java/org/apache/bcel/classfile/Utility.java b/src/main/java/org/apache/bcel/classfile/Utility.java index ccf348a51e..afefef8eed 100644 --- a/src/main/java/org/apache/bcel/classfile/Utility.java +++ b/src/main/java/org/apache/bcel/classfile/Utility.java @@ -48,7 +48,7 @@ public abstract class Utility { /** * Decode characters into bytes. Used by decode() */ - private static class JavaReader extends FilterReader { + private static final class JavaReader extends FilterReader { public JavaReader(final Reader in) { super(in); @@ -88,7 +88,7 @@ public int read(final char[] cbuf, final int off, final int len) throws IOExcept * Encode bytes into valid java identifier characters. Used by * encode() */ - private static class JavaWriter extends FilterWriter { + private static final class JavaWriter extends FilterWriter { public JavaWriter(final Writer out) { super(out); diff --git a/src/main/java/org/apache/bcel/generic/InstructionFactory.java b/src/main/java/org/apache/bcel/generic/InstructionFactory.java index 7f29f82133..2f1f91323b 100644 --- a/src/main/java/org/apache/bcel/generic/InstructionFactory.java +++ b/src/main/java/org/apache/bcel/generic/InstructionFactory.java @@ -30,7 +30,7 @@ */ public class InstructionFactory implements InstructionConstants { - private static class MethodObject { + private static final class MethodObject { final Type[] argTypes; final Type resultType; diff --git a/src/main/java/org/apache/bcel/util/ClassPath.java b/src/main/java/org/apache/bcel/util/ClassPath.java index d0061ad3be..63f67a3c46 100644 --- a/src/main/java/org/apache/bcel/util/ClassPath.java +++ b/src/main/java/org/apache/bcel/util/ClassPath.java @@ -172,7 +172,7 @@ public interface ClassFile { long getTime(); } - private static class Dir extends AbstractPathEntry { + private static final class Dir extends AbstractPathEntry { private final String dir; @@ -254,7 +254,7 @@ public String toString() { } } - private static class Jar extends AbstractZip { + private static final class Jar extends AbstractZip { Jar(final ZipFile zip) { super(zip); @@ -267,7 +267,7 @@ protected String toEntryName(final String name, final String suffix) { } - private static class JrtModule extends AbstractPathEntry { + private static final class JrtModule extends AbstractPathEntry { private final Path modulePath; @@ -350,7 +350,7 @@ public String toString() { } - private static class JrtModules extends AbstractPathEntry { + private static final class JrtModules extends AbstractPathEntry { private final ModularRuntimeImage modularRuntimeImage; private final JrtModule[] modules; @@ -416,7 +416,7 @@ public String toString() { } - private static class Module extends AbstractZip { + private static final class Module extends AbstractZip { Module(final ZipFile zip) { super(zip); 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 d9df124c71..810630eb74 100644 --- a/src/main/java/org/apache/bcel/verifier/statics/Pass2Verifier.java +++ b/src/main/java/org/apache/bcel/verifier/statics/Pass2Verifier.java @@ -1117,7 +1117,7 @@ public void visitConstantMethodref(final ConstantMethodref obj) { * called "XXX". JustIce cannot repair this; please note that existing verifiers at this time even fail to detect * missing InnerClasses attributes in pass 2. */ - private static class InnerClassDetector extends EmptyVisitor { + private static final class InnerClassDetector extends EmptyVisitor { private boolean hasInnerClass; private final JavaClass jc; private final ConstantPool cp;