Skip to content

Commit c30fa35

Browse files
committed
resolve OverridableMethodInConstructor violations
1 parent cbe970a commit c30fa35

File tree

6 files changed

+150
-152
lines changed

6 files changed

+150
-152
lines changed

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/config/ConfigProperty.java

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
public class ConfigProperty implements Comparable<ConfigProperty>, Cloneable {
2929

3030
/** The name of the property. */
31-
private String mName;
31+
private String name;
3232

3333
/** The value of the property. */
34-
private String mValue;
34+
private String value;
3535

3636
/** The meta data of the property. */
37-
private ConfigPropertyMetadata mMetaData;
37+
private ConfigPropertyMetadata metaData;
3838

3939
/** Signals that the property value is actually a ${}-like reference. */
40-
private boolean mPropertyReference;
40+
private boolean propertyReference;
4141

4242
/**
4343
* Constructor.
@@ -46,10 +46,9 @@ public class ConfigProperty implements Comparable<ConfigProperty>, Cloneable {
4646
* the property meta data
4747
*/
4848
public ConfigProperty(ConfigPropertyMetadata metaData) {
49-
5049
this(metaData.getName(), metaData.getOverrideDefault() != null ? metaData.getOverrideDefault()
5150
: metaData.getDefaultValue());
52-
setMetaData(metaData);
51+
this.metaData = metaData;
5352
}
5453

5554
/**
@@ -61,8 +60,8 @@ public ConfigProperty(ConfigPropertyMetadata metaData) {
6160
* Property value.
6261
*/
6362
public ConfigProperty(String name, String value) {
64-
setName(name);
65-
setValue(value);
63+
this.name = name;
64+
this.value = value;
6665
}
6766

6867
/**
@@ -71,7 +70,7 @@ public ConfigProperty(String name, String value) {
7170
* @return The name
7271
*/
7372
public String getName() {
74-
return mName;
73+
return name;
7574
}
7675

7776
/**
@@ -81,7 +80,7 @@ public String getName() {
8180
* The new name.
8281
*/
8382
public void setName(String name) {
84-
mName = name;
83+
this.name = name;
8584
}
8685

8786
/**
@@ -90,7 +89,7 @@ public void setName(String name) {
9089
* @return String
9190
*/
9291
public String getValue() {
93-
return mValue;
92+
return value;
9493
}
9594

9695
/**
@@ -100,7 +99,7 @@ public String getValue() {
10099
* The value to set
101100
*/
102101
public void setValue(String value) {
103-
mValue = value;
102+
this.value = value;
104103
}
105104

106105
/**
@@ -109,7 +108,7 @@ public void setValue(String value) {
109108
* @return the meta data
110109
*/
111110
public ConfigPropertyMetadata getMetaData() {
112-
return mMetaData;
111+
return metaData;
113112
}
114113

115114
/**
@@ -119,7 +118,7 @@ public ConfigPropertyMetadata getMetaData() {
119118
* the meta data
120119
*/
121120
public void setMetaData(ConfigPropertyMetadata metaData) {
122-
mMetaData = metaData;
121+
this.metaData = metaData;
123122
}
124123

125124
/**
@@ -128,7 +127,7 @@ public void setMetaData(ConfigPropertyMetadata metaData) {
128127
* @return <code>true</code> if the value is a property reference, <code>false</code> otherwise
129128
*/
130129
public boolean isPropertyReference() {
131-
return mPropertyReference;
130+
return propertyReference;
132131
}
133132

134133
/**
@@ -138,12 +137,12 @@ public boolean isPropertyReference() {
138137
* <code>true</code> if the value is a property reference, <code>false</code> otherwise
139138
*/
140139
public void setPropertyReference(boolean propertyReference) {
141-
this.mPropertyReference = propertyReference;
140+
this.propertyReference = propertyReference;
142141
}
143142

144143
@Override
145144
public int compareTo(ConfigProperty obj) {
146-
return this.mName.compareTo(obj.mName);
145+
return this.name.compareTo(obj.name);
147146
}
148147

149148
@Override

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/config/ResolvableProperty.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
public class ResolvableProperty implements Cloneable {
3434

3535
/** The name of the property. */
36-
private String mPropertyName;
36+
private String propertyName;
3737

3838
/** The property value. */
39-
private String mValue;
39+
private String value;
4040

4141
/**
4242
* Creates a resolvable property.
@@ -47,38 +47,38 @@ public class ResolvableProperty implements Cloneable {
4747
* the value of the property
4848
*/
4949
public ResolvableProperty(String propertyName, String value) {
50-
setPropertyName(propertyName);
51-
setValue(value);
50+
this.propertyName = propertyName;
51+
this.value = value;
5252
}
5353

5454
/**
5555
* @return The value of the property.
5656
*/
5757
public String getValue() {
58-
return mValue;
58+
return value;
5959
}
6060

6161
/**
6262
* @return The property's name.
6363
*/
6464
public String getPropertyName() {
65-
return mPropertyName;
65+
return propertyName;
6666
}
6767

6868
/**
69-
* @param string
69+
* @param value
7070
* Value for the property.
7171
*/
72-
public void setValue(String string) {
73-
mValue = string;
72+
public void setValue(String value) {
73+
this.value = value;
7474
}
7575

7676
/**
77-
* @param string
77+
* @param propertyName
7878
* The property's name.
7979
*/
80-
public void setPropertyName(String string) {
81-
mPropertyName = string;
80+
public void setPropertyName(String propertyName) {
81+
this.propertyName = propertyName;
8282
}
8383

8484
@Override
@@ -90,12 +90,12 @@ public boolean equals(Object obj) {
9090
return true;
9191
}
9292
ResolvableProperty rhs = (ResolvableProperty) obj;
93-
return Objects.equals(mPropertyName, rhs.mPropertyName) && Objects.equals(mValue, rhs.mValue);
93+
return Objects.equals(propertyName, rhs.propertyName) && Objects.equals(value, rhs.value);
9494
}
9595

9696
@Override
9797
public int hashCode() {
98-
return Objects.hash(mPropertyName, mValue);
98+
return Objects.hash(propertyName, value);
9999
}
100100

101101
@Override
@@ -111,7 +111,7 @@ public ResolvableProperty clone() {
111111

112112
@Override
113113
public String toString() {
114-
return MoreObjects.toStringHelper(this).add("propertyName", mPropertyName).add("value", mValue)
114+
return MoreObjects.toStringHelper(this).add("propertyName", propertyName).add("value", value)
115115
.toString();
116116
}
117117
}

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/projectconfig/FileMatchPattern.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
*/
3636
public class FileMatchPattern implements Cloneable {
3737

38-
private boolean mIsIncludePattern = true;
38+
private boolean isIncludePattern = true;
3939

40-
private Pattern mRegexPattern;
40+
private Pattern regexPattern;
4141

42-
private String mPatternString;
42+
private String patternString;
4343

4444
/**
4545
* Construct a new <code>FileMatchPattern</code>.
@@ -59,7 +59,7 @@ public FileMatchPattern(String pattern) throws CheckstylePluginException {
5959
* @return String
6060
*/
6161
public String getMatchPattern() {
62-
return mRegexPattern.pattern();
62+
return regexPattern.pattern();
6363
}
6464

6565
/**
@@ -70,13 +70,13 @@ public String getMatchPattern() {
7070
* @throws CheckstylePluginException
7171
* Error during processing
7272
*/
73-
public void setMatchPattern(String pattern) throws CheckstylePluginException {
73+
public final void setMatchPattern(String pattern) throws CheckstylePluginException {
7474
if ((pattern == null) || (pattern.trim().length() == 0)) {
7575
throw new CheckstylePluginException(Messages.errorEmptyPattern);
7676
}
7777
try {
78-
mRegexPattern = Pattern.compile(pattern);
79-
mPatternString = pattern;
78+
regexPattern = Pattern.compile(pattern);
79+
patternString = pattern;
8080
} catch (PatternSyntaxException ex) {
8181
// wrap the exception
8282
CheckstylePluginException.rethrow(ex);
@@ -93,7 +93,7 @@ public void setMatchPattern(String pattern) throws CheckstylePluginException {
9393
public boolean isMatch(String fileName) {
9494
boolean result = false;
9595

96-
Matcher matcher = mRegexPattern.matcher(fileName);
96+
Matcher matcher = regexPattern.matcher(fileName);
9797
result = matcher.find();
9898

9999
return result;
@@ -105,7 +105,7 @@ public boolean isMatch(String fileName) {
105105
* @return boolean
106106
*/
107107
public boolean isIncludePattern() {
108-
return mIsIncludePattern;
108+
return isIncludePattern;
109109
}
110110

111111
/**
@@ -115,7 +115,7 @@ public boolean isIncludePattern() {
115115
* The isIncludePattern to set
116116
*/
117117
public void setIsIncludePattern(boolean isIncludePattern) {
118-
mIsIncludePattern = isIncludePattern;
118+
this.isIncludePattern = isIncludePattern;
119119
}
120120

121121
/**
@@ -143,18 +143,18 @@ public boolean equals(Object obj) {
143143
}
144144

145145
FileMatchPattern rhs = (FileMatchPattern) obj;
146-
return Objects.equals(mIsIncludePattern, rhs.mIsIncludePattern)
147-
&& Objects.equals(mPatternString, rhs.mPatternString);
146+
return Objects.equals(isIncludePattern, rhs.isIncludePattern)
147+
&& Objects.equals(patternString, rhs.patternString);
148148
}
149149

150150
@Override
151151
public int hashCode() {
152-
return Objects.hash(mIsIncludePattern, mPatternString);
152+
return Objects.hash(isIncludePattern, patternString);
153153
}
154154

155155
@Override
156156
public String toString() {
157-
return MoreObjects.toStringHelper(this).add("patternString", mPatternString)
158-
.add("isIncludePattern", mIsIncludePattern).toString();
157+
return MoreObjects.toStringHelper(this).add("patternString", patternString)
158+
.add("isIncludePattern", isIncludePattern).toString();
159159
}
160160
}

0 commit comments

Comments
 (0)