Skip to content

Commit 6df23c1

Browse files
committed
add checkstyle rules, fix RedundantModifier
1 parent 8049d61 commit 6df23c1

File tree

5 files changed

+29
-5
lines changed

5 files changed

+29
-5
lines changed

checkstyle.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,29 @@
6161
<module name="RedundantImport"/>
6262
<module name="UnusedImports"/>
6363
<module name="ArrayTypeStyle"/>
64+
<module name="CommentsIndentation"/>
65+
<!-- Comparing this with null (i.e. this == null and this != null): -->
66+
<module name="DescendantToken">
67+
<property name="tokens" value="EQUAL,NOT_EQUAL"/>
68+
<property name="limitedTokens" value="LITERAL_THIS,LITERAL_NULL"/>
69+
<property name="maximumNumber" value="1"/>
70+
<property name="maximumDepth" value="1"/>
71+
<property name="sumTokenCounts" value="true"/>
72+
</module>
73+
<!--The initialiser in for performs no setup (where a while statement could be used instead): -->
74+
<module name="DescendantToken">
75+
<property name="tokens" value="FOR_INIT"/>
76+
<property name="limitedTokens" value="EXPR"/>
77+
<property name="minimumNumber" value="1"/>
78+
</module>
79+
<module name="Indentation"/>
80+
<module name="OuterTypeFilename"/>
81+
<module name="UpperEll"/>
82+
<module name="ModifierOrder"/>
83+
<module name="RedundantModifier"/>
84+
</module>
85+
<module name="NewlineAtEndOfFile">
86+
<property name="lineSeparator" value="lf"/>
6487
</module>
88+
<module name="UniqueProperties"/>
6589
</module>

scribejava-core/src/main/java/com/github/scribejava/core/extractors/AccessTokenExtractor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ public interface AccessTokenExtractor {
1515
* @param response the contents of the response
1616
* @return OAuth access token
1717
*/
18-
public Token extract(String response);
18+
Token extract(String response);
1919
}

scribejava-core/src/main/java/com/github/scribejava/core/extractors/RequestTokenExtractor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ public interface RequestTokenExtractor {
1515
* @param response the contents of the response
1616
* @return OAuth access token
1717
*/
18-
public Token extract(String response);
18+
Token extract(String response);
1919
}

scribejava-core/src/main/java/com/github/scribejava/core/services/TimestampService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public interface TimestampService {
1414
*
1515
* @return timestamp
1616
*/
17-
public String getTimestampInSeconds();
17+
String getTimestampInSeconds();
1818

1919
/**
2020
* Returns a nonce (unique value for each request)
2121
*
2222
* @return nonce
2323
*/
24-
public String getNonce();
24+
String getNonce();
2525
}

scribejava-core/src/test/java/com/github/scribejava/core/model/ResponseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void shouldHandleAConnectionWithErrors() throws Exception {
4949

5050
private static class FaultyConnection extends ConnectionStub {
5151

52-
public FaultyConnection() throws Exception {
52+
private FaultyConnection() throws Exception {
5353
super();
5454
}
5555

0 commit comments

Comments
 (0)