Skip to content

Commit bd5ca6b

Browse files
wilcolnromani
authored andcommitted
minor: fix violations from RedundantThisCheck
1 parent 0f5ee7a commit bd5ca6b

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/annotation/RequiredParameterForAnnotationCheck.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public void setAnnotationName(String annotationName) {
129129
*/
130130
public void setRequiredParameters(String... requiredPropertiesParameter) {
131131
for (String item : requiredPropertiesParameter) {
132-
this.requiredParameters.add(item);
132+
requiredParameters.add(item);
133133
}
134134
}
135135

@@ -156,13 +156,13 @@ public int[] getAcceptableTokens() {
156156
public void visitToken(DetailAST annotationNode) {
157157
final String annotationNameCheck = getAnnotationName(annotationNode);
158158

159-
if (annotationNameCheck.equals(this.annotationName)) {
159+
if (annotationNameCheck.equals(annotationName)) {
160160
final Set<String> missingParameters =
161161
Sets.difference(requiredParameters, getAnnotationParameters(annotationNode));
162162

163163
if (!missingParameters.isEmpty()) {
164164
final String missingParametersAsString = Joiner.on(", ").join(missingParameters);
165-
log(annotationNode, MSG_KEY, this.annotationName, missingParametersAsString);
165+
log(annotationNode, MSG_KEY, annotationName, missingParametersAsString);
166166
}
167167
}
168168
}

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/AvoidDefaultSerializableInInnerClassesCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public class AvoidDefaultSerializableInInnerClassesCheck extends AbstractCheck {
5858
* of serializable interface.
5959
*/
6060
public void setAllowPartialImplementation(boolean allow) {
61-
this.allowPartialImplementation = allow;
61+
allowPartialImplementation = allow;
6262
}
6363

6464
@Override

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/CustomDeclarationOrderCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ public void setCompileFlags(final int compileFlags) {
12471247
private void updateRegexp(final String newFormat, final int compileFlags) {
12481248
try {
12491249
regExp = Pattern.compile(newFormat, compileFlags);
1250-
this.format = newFormat;
1250+
format = newFormat;
12511251
}
12521252
catch (final PatternSyntaxException ex) {
12531253
throw new IllegalArgumentException("unable to parse " + newFormat, ex);
@@ -1260,7 +1260,7 @@ private void updateRegexp(final String newFormat, final int compileFlags) {
12601260
* @return true if format matcher contains rule.
12611261
*/
12621262
public boolean hasRule(String ruleCheck) {
1263-
return this.rule.indexOf(ruleCheck) > -1;
1263+
return rule.indexOf(ruleCheck) > -1;
12641264
}
12651265

12661266
@Override

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/ForbidThrowAnonymousExceptionsCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public class ForbidThrowAnonymousExceptionsCheck extends AbstractCheck {
8181
* @param exceptionClassNameRegex The regular expression to set.
8282
*/
8383
public void setExceptionClassNameRegex(String exceptionClassNameRegex) {
84-
this.pattern = Pattern.compile(exceptionClassNameRegex);
84+
pattern = Pattern.compile(exceptionClassNameRegex);
8585
}
8686

8787
@Override

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ private enum NullnessAnnotation {
310310
*/
311311
NullnessAnnotation(final String annotationName, final String packageName) {
312312
this.annotationName = annotationName;
313-
this.fullyQualifiedClassName = packageName + "." + annotationName;
313+
fullyQualifiedClassName = packageName + "." + annotationName;
314314
}
315315

316316
}
@@ -397,7 +397,7 @@ public void setExcludePackages(final String... packageNames) {
397397
* true if yes
398398
*/
399399
public void setAllowOverridingReturnValue(final boolean newAllowOverridingReturnValue) {
400-
this.allowOverridingReturnValue = newAllowOverridingReturnValue;
400+
allowOverridingReturnValue = newAllowOverridingReturnValue;
401401
}
402402

403403
/**
@@ -406,7 +406,7 @@ public void setAllowOverridingReturnValue(final boolean newAllowOverridingReturn
406406
* true if yes
407407
*/
408408
public void setAllowOverridingParameter(final boolean newAllowOverridingParameter) {
409-
this.allowOverridingParameter = newAllowOverridingParameter;
409+
allowOverridingParameter = newAllowOverridingParameter;
410410
}
411411

412412
/**
@@ -865,7 +865,7 @@ public abstract class AbstractJsr305Handler {
865865
*/
866866
private AbstractJsr305Handler(final DetailAST ast) {
867867
this.ast = ast;
868-
this.violationFound = false;
868+
violationFound = false;
869869
annotations = findAnnotations(ast);
870870
}
871871

@@ -911,9 +911,9 @@ protected void checkContainsAny(final String msg, final NullnessAnnotation... se
911911
*/
912912
private boolean containsAny(final NullnessAnnotation... search) {
913913
boolean result = false;
914-
if (!this.annotations.isEmpty()) {
914+
if (!annotations.isEmpty()) {
915915
for (final NullnessAnnotation obj : search) {
916-
if (this.annotations.contains(obj)) {
916+
if (annotations.contains(obj)) {
917917
result = true;
918918
break;
919919
}
@@ -946,7 +946,7 @@ protected void checkRedundancyDueToClassLevelAnnotation(final String msg,
946946
final NullnessAnnotation... search) {
947947
if (!violationFound) {
948948
for (final NullnessAnnotation nullnessAnnotation : search) {
949-
final boolean thisIsAnnotated = this.annotations.contains(nullnessAnnotation);
949+
final boolean thisIsAnnotated = annotations.contains(nullnessAnnotation);
950950
final boolean parentIsAnnotated =
951951
getParentMethodOrClassAnnotation(nullnessAnnotation) != null;
952952
if (thisIsAnnotated && parentIsAnnotated) {
@@ -965,13 +965,13 @@ protected void checkRedundancyDueToClassLevelAnnotation(final String msg,
965965
*/
966966
private boolean containsAll(final NullnessAnnotation... search) {
967967
boolean result = true;
968-
if (this.annotations.isEmpty()) {
968+
if (annotations.isEmpty()) {
969969
// an empty list of annotations can never contain all
970970
result = false;
971971
}
972972
else {
973973
for (final NullnessAnnotation obj : search) {
974-
if (!this.annotations.contains(obj)) {
974+
if (!annotations.contains(obj)) {
975975
result = false;
976976
break;
977977
}

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/OverridableMethodInConstructorCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ private final class OverridableMetCall {
926926
*/
927927
/* package */ OverridableMetCall(DetailAST methodCallAST,
928928
String overridableMetName) {
929-
this.metCallAST = methodCallAST;
929+
metCallAST = methodCallAST;
930930
this.overridableMetName = overridableMetName;
931931
}
932932

sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/naming/UniformEnumConstantNameCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public UniformEnumConstantNameCheck() {
126126
* @param regexps format to check against
127127
*/
128128
public final void setFormats(String... regexps) {
129-
this.patterns = new ArrayList<>(regexps.length);
129+
patterns = new ArrayList<>(regexps.length);
130130
for (final String regexp: regexps) {
131131
final Pattern pattern = Pattern.compile(regexp, 0);
132132
patterns.add(pattern);

0 commit comments

Comments
 (0)