Add final modifier to private fields.

This commit is contained in:
Gary Gregory 2016-10-23 10:54:34 -07:00
parent 4f82195afd
commit 607e3447c9
5 changed files with 9 additions and 9 deletions

View File

@ -71,7 +71,7 @@ public class MultilineRecursiveToStringStyle extends RecursiveToStringStyle {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** Indenting of inner lines. */ /** Indenting of inner lines. */
private int indent = 2; private final int indent = 2;
/** Current indenting. */ /** Current indenting. */
private int spaces = 2; private int spaces = 2;

View File

@ -2367,7 +2367,7 @@ public abstract class ToStringStyle implements Serializable {
/** /**
* The summary size text start <code>'&gt;'</code>. * The summary size text start <code>'&gt;'</code>.
*/ */
private String FIELD_NAME_PREFIX = "\""; private final String FIELD_NAME_PREFIX = "\"";
/** /**
* <p> * <p>

View File

@ -1150,8 +1150,8 @@ public class EqualsBuilderTest {
static class TestObjectEqualsExclude { static class TestObjectEqualsExclude {
@EqualsExclude @EqualsExclude
private int a; private final int a;
private int b; private final int b;
public TestObjectEqualsExclude(int a, int b) { public TestObjectEqualsExclude(int a, int b) {
this.a = a; this.a = a;

View File

@ -565,8 +565,8 @@ public class HashCodeBuilderTest {
static class TestObjectHashCodeExclude { static class TestObjectHashCodeExclude {
@HashCodeExclude @HashCodeExclude
private int a; private final int a;
private int b; private final int b;
public TestObjectHashCodeExclude(int a, int b) { public TestObjectHashCodeExclude(int a, int b) {
this.a = a; this.a = a;
@ -584,9 +584,9 @@ public class HashCodeBuilderTest {
static class TestObjectHashCodeExclude2 { static class TestObjectHashCodeExclude2 {
@HashCodeExclude @HashCodeExclude
private int a; private final int a;
@HashCodeExclude @HashCodeExclude
private int b; private final int b;
public TestObjectHashCodeExclude2(int a, int b) { public TestObjectHashCodeExclude2(int a, int b) {
this.a = a; this.a = a;

View File

@ -44,7 +44,7 @@ public class FastDatePrinterTimeZonesTest {
return timeZones; return timeZones;
} }
private TimeZone timeZone; private final TimeZone timeZone;
public FastDatePrinterTimeZonesTest(TimeZone timeZone) { public FastDatePrinterTimeZonesTest(TimeZone timeZone) {
this.timeZone = timeZone; this.timeZone = timeZone;