Skip to content

Commit

Permalink
Make private static classes final
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Oct 10, 2023
1 parent 79c79b9 commit a2ecaa2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/classfile/ConstantUtf8.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/apache/bcel/classfile/Utility.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public abstract class Utility {
/**
* Decode characters into bytes. Used by <a href="Utility.html#decode(java.lang.String, boolean)">decode()</a>
*/
private static class JavaReader extends FilterReader {
private static final class JavaReader extends FilterReader {

public JavaReader(final Reader in) {
super(in);
Expand Down Expand Up @@ -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
* <a href="Utility.html#encode(byte[], boolean)">encode()</a>
*/
private static class JavaWriter extends FilterWriter {
private static final class JavaWriter extends FilterWriter {

public JavaWriter(final Writer out) {
super(out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
public class InstructionFactory implements InstructionConstants {

private static class MethodObject {
private static final class MethodObject {

final Type[] argTypes;
final Type resultType;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/apache/bcel/util/ClassPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand All @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a2ecaa2

Please sign in to comment.