Make private elements final where possible.

This commit is contained in:
Gary Gregory 2021-01-17 16:48:52 -05:00
parent dddd8c4e26
commit 0b135af5a0
4 changed files with 6 additions and 6 deletions

View File

@ -225,7 +225,7 @@ abstract class FormatCache<F extends Format> {
}
private final Object[] keys;
private int hashCode;
private final int hashCode;
/**
* Constructs an instance of {@code MultipartKey} to hold the specified objects.

View File

@ -90,7 +90,7 @@ public class CompareToBuilderTest {
static class TestTransientSubObject extends TestObject {
@SuppressWarnings("unused")
private transient int t;
private final transient int t;
TestTransientSubObject(final int a, final int t) {
super(a);
this.t = t;

View File

@ -125,7 +125,7 @@ public class EqualsBuilderTest {
static class TestTSubObject extends TestObject {
@SuppressWarnings("unused")
private transient int t;
private final transient int t;
TestTSubObject(final int a, final int t) {
super(a);
@ -135,7 +135,7 @@ public class EqualsBuilderTest {
static class TestTTSubObject extends TestTSubObject {
@SuppressWarnings("unused")
private transient int tt;
private final transient int tt;
TestTTSubObject(final int a, final int t, final int tt) {
super(a, t);

View File

@ -357,14 +357,14 @@ public class ToStringBuilderTest {
@SuppressWarnings("unused")
private final char a='a';
@SuppressWarnings("unused")
private transient char transientA='t';
private final transient char transientA='t';
}
static class ReflectionTestFixtureB extends ReflectionTestFixtureA {
@SuppressWarnings("unused")
private final char b='b';
@SuppressWarnings("unused")
private transient char transientB='t';
private final transient char transientB='t';
}
@Test