Make private elements final where possible.
This commit is contained in:
parent
dddd8c4e26
commit
0b135af5a0
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue