Skip to content

Commit 177af70

Browse files
danccdancc
dancc
authored and
dancc
committed
Eigth pass at enabling PMD.
1 parent 4c6a003 commit 177af70

22 files changed

+196
-71
lines changed

src/main/java/com/cdancy/bitbucket/rest/domain/activities/Activities.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,22 @@ public enum ActivitiesType {
8181
public abstract List<User> removedReviewers();
8282

8383
@SerializedNames({"id", "createdDate", "user", "action", "commentAction",
84-
"comment", "fromHash", "previousFromHash", "previousToHash",
85-
"toHash", "added", "removed", "addedReviewers", "removedReviewers"})
84+
"comment", "fromHash", "previousFromHash", "previousToHash",
85+
"toHash", "added", "removed", "addedReviewers", "removedReviewers"})
8686
public static Activities create(final long id,
8787
final long createdDate,
8888
final User user,
8989
final ActivitiesType action,
9090
final String commentAction,
9191
final Comments comment,
92-
final @Nullable String fromHash,
93-
final @Nullable String previousFromHash,
94-
final @Nullable String previousToHash,
95-
final @Nullable String toHash,
96-
final @Nullable ActivitiesCommit added,
97-
final @Nullable ActivitiesCommit removed,
98-
final @Nullable List<User> addedReviewers,
99-
final @Nullable List<User> removedReviewers) {
92+
@Nullable final String fromHash,
93+
@Nullable final String previousFromHash,
94+
@Nullable final String previousToHash,
95+
@Nullable final String toHash,
96+
@Nullable final ActivitiesCommit added,
97+
@Nullable final ActivitiesCommit removed,
98+
@Nullable final List<User> addedReviewers,
99+
@Nullable final List<User> removedReviewers) {
100100

101101
return new AutoValue_Activities(id,
102102
createdDate,

src/main/java/com/cdancy/bitbucket/rest/domain/branch/BranchRestriction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static BranchRestriction create(final Long id,
5858
final Matcher matcher,
5959
final List<User> users,
6060
final List<String> groups,
61-
final @Nullable List<AccessKey> accessKeys) {
61+
@Nullable final List<AccessKey> accessKeys) {
6262

6363
final List<Long> accessKeyId = new ArrayList<>();
6464
if (accessKeys != null) {

src/main/java/com/cdancy/bitbucket/rest/domain/branch/BranchRestrictionPage.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
public abstract class BranchRestrictionPage implements Page<BranchRestriction>, ErrorsHolder {
3232

3333
@SerializedNames({ "start", "limit", "size",
34-
"nextPageStart", "isLastPage", "values", "errors" })
34+
"nextPageStart", "isLastPage", "values", "errors" })
3535
public static BranchRestrictionPage create(final int start,
3636
final int limit,
3737
final int size,
3838
final int nextPageStart,
3939
final boolean isLastPage,
40-
final @Nullable List<BranchRestriction> values,
41-
final @Nullable List<Error> errors) {
40+
@Nullable final List<BranchRestriction> values,
41+
@Nullable final List<Error> errors) {
4242

4343
return new AutoValue_BranchRestrictionPage(start,
4444
limit,

src/main/java/com/cdancy/bitbucket/rest/domain/comment/MinimalAnchor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public abstract class MinimalAnchor {
2828
public abstract String type();
2929

3030
@SerializedNames({ "id", "type" })
31-
public static MinimalAnchor create(int id, String type) {
31+
public static MinimalAnchor create(final int id, final String type) {
3232
return new AutoValue_MinimalAnchor(id, type);
3333
}
3434
}

src/main/java/com/cdancy/bitbucket/rest/domain/comment/PermittedOperations.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public abstract class PermittedOperations {
3333
}
3434

3535
@SerializedNames({ "editable", "deletable", "transitionable" })
36-
public static PermittedOperations create(boolean editable,
37-
boolean deletable,
38-
boolean transitionable) {
36+
public static PermittedOperations create(final boolean editable,
37+
final boolean deletable,
38+
final boolean transitionable) {
3939
return new AutoValue_PermittedOperations(editable, deletable, transitionable);
4040
}
4141
}

src/main/java/com/cdancy/bitbucket/rest/domain/comment/Task.java

+17-5
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,22 @@ public abstract class Task implements ErrorsHolder {
5555

5656
@SerializedNames({ "anchor", "author", "createdDate", "id", "text",
5757
"state", "permittedOperations", "errors" })
58-
public static Task create(TaskAnchor anchor, Author author,
59-
long createdDate, int id, String text,
60-
String state, PermittedOperations permittedOperations, List<Error> errors) {
61-
return new AutoValue_Task(Utils.nullToEmpty(errors), anchor, author, createdDate,
62-
id, text, state, permittedOperations);
58+
public static Task create(final TaskAnchor anchor,
59+
final Author author,
60+
final long createdDate,
61+
final int id,
62+
final String text,
63+
final String state,
64+
final PermittedOperations permittedOperations,
65+
final List<Error> errors) {
66+
67+
return new AutoValue_Task(Utils.nullToEmpty(errors),
68+
anchor,
69+
author,
70+
createdDate,
71+
id,
72+
text,
73+
state,
74+
permittedOperations);
6375
}
6476
}

src/main/java/com/cdancy/bitbucket/rest/domain/comment/TaskAnchor.java

+19-5
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,24 @@ public abstract class TaskAnchor {
5353

5454
@SerializedNames({ "properties", "id", "version", "text",
5555
"author", "createdDate", "updatedDate", "permittedOperations", "type" })
56-
public static TaskAnchor create(Map<String, String> properties, int id, int version, String text,
57-
Author author, long createdDate, long updatedDate,
58-
PermittedOperations permittedOperations, String type) {
59-
return new AutoValue_TaskAnchor(Utils.nullToEmpty(properties), id, version, text,
60-
author, createdDate, updatedDate, permittedOperations, type);
56+
public static TaskAnchor create(final Map<String, String> properties,
57+
final int id,
58+
final int version,
59+
final String text,
60+
final Author author,
61+
final long createdDate,
62+
final long updatedDate,
63+
final PermittedOperations permittedOperations,
64+
final String type) {
65+
66+
return new AutoValue_TaskAnchor(Utils.nullToEmpty(properties),
67+
id,
68+
version,
69+
text,
70+
author,
71+
createdDate,
72+
updatedDate,
73+
permittedOperations,
74+
type);
6175
}
6276
}

src/main/java/com/cdancy/bitbucket/rest/domain/common/RequestStatus.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
public abstract class RequestStatus implements Value<Boolean>, ErrorsHolder {
3838

3939
@SerializedNames({ "value", "errors" })
40-
public static RequestStatus create(@Nullable Boolean value, List<Error> errors) {
41-
return new AutoValue_RequestStatus(value, Utils.nullToEmpty(errors));
40+
public static RequestStatus create(@Nullable final Boolean value,
41+
final List<Error> errors) {
42+
43+
return new AutoValue_RequestStatus(value,
44+
Utils.nullToEmpty(errors));
4245
}
4346
}

src/main/java/com/cdancy/bitbucket/rest/domain/defaultreviewers/Condition.java

+17-6
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,22 @@ public abstract class Condition implements ErrorsHolder {
4949
@Nullable
5050
public abstract Long requiredApprovals();
5151

52-
@SerializedNames({ "id", "scope", "sourceRefMatcher", "targetRefMatcher", "reviewers", "requiredApprovals", "errors"})
53-
public static Condition create(Long id, Scope scope, Matcher sourceRefMatcher,
54-
Matcher targetRefMatcher, List<User> reviewers, Long requiredApprovals,
55-
@Nullable List<Error> errors) {
56-
return new AutoValue_Condition(Utils.nullToEmpty(errors), id, scope, sourceRefMatcher, targetRefMatcher,
57-
reviewers, requiredApprovals);
52+
@SerializedNames({ "id", "scope", "sourceRefMatcher",
53+
"targetRefMatcher", "reviewers", "requiredApprovals", "errors"})
54+
public static Condition create(final Long id,
55+
final Scope scope,
56+
final Matcher sourceRefMatcher,
57+
final Matcher targetRefMatcher,
58+
final List<User> reviewers,
59+
final Long requiredApprovals,
60+
@Nullable final List<Error> errors) {
61+
62+
return new AutoValue_Condition(Utils.nullToEmpty(errors),
63+
id,
64+
scope,
65+
sourceRefMatcher,
66+
targetRefMatcher,
67+
reviewers,
68+
requiredApprovals);
5869
}
5970
}

src/main/java/com/cdancy/bitbucket/rest/domain/defaultreviewers/Scope.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public enum ScopeType {
3333
public abstract Long resourceId();
3434

3535
@SerializedNames({ "type", "resourceId"})
36-
public static Scope create(ScopeType type, Long resourceId) {
36+
public static Scope create(final ScopeType type, final Long resourceId) {
3737
return new AutoValue_Scope(type, resourceId);
3838
}
3939
}

src/main/java/com/cdancy/bitbucket/rest/domain/file/Blame.java

+19-6
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,24 @@ public abstract class Blame {
4949
@SerializedNames({ "author", "authorTimestamp", "commitHash",
5050
"displayCommitHash", "commitId", "commitDisplayId",
5151
"fileName", "lineNumber", "spannedLines" })
52-
public static Blame create(Author author, String authorTimestamp, String commitHash,
53-
String displayCommitHash, String commitId, String commitDisplayId,
54-
String fileName, int lineNumber, int spannedLines) {
55-
return new AutoValue_Blame(author, authorTimestamp, commitHash,
56-
displayCommitHash, commitId, commitDisplayId,
57-
fileName, lineNumber, spannedLines);
52+
public static Blame create(final Author author,
53+
final String authorTimestamp,
54+
final String commitHash,
55+
final String displayCommitHash,
56+
final String commitId,
57+
final String commitDisplayId,
58+
final String fileName,
59+
final int lineNumber,
60+
final int spannedLines) {
61+
62+
return new AutoValue_Blame(author,
63+
authorTimestamp,
64+
commitHash,
65+
displayCommitHash,
66+
commitId,
67+
commitDisplayId,
68+
fileName,
69+
lineNumber,
70+
spannedLines);
5871
}
5972
}

src/main/java/com/cdancy/bitbucket/rest/domain/file/Line.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public abstract class Line {
3535
}
3636

3737
@SerializedNames({ "text", "type" })
38-
public static Line create(String text, String type) {
38+
public static Line create(final String text, final String type) {
3939
return new AutoValue_Line(text, type);
4040
}
4141
}

src/main/java/com/cdancy/bitbucket/rest/domain/file/LinePage.java

+19-6
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,24 @@ public abstract class LinePage implements Page<Line>, ErrorsHolder {
3434
@Nullable
3535
public abstract List<Blame> blame();
3636

37-
@SerializedNames({ "start", "limit", "size", "nextPageStart", "isLastPage", "lines", "blame", "errors" })
38-
public static LinePage create(int start, int limit, int size, int nextPageStart,
39-
boolean isLastPage,@Nullable List<Line> lines,
40-
@Nullable List<Blame> blame, @Nullable List<Error> errors) {
41-
return new AutoValue_LinePage(start, limit, size, nextPageStart, isLastPage,
42-
Utils.nullToEmpty(lines), Utils.nullToEmpty(errors), Utils.nullToEmpty(blame));
37+
@SerializedNames({ "start", "limit", "size", "nextPageStart",
38+
"isLastPage", "lines", "blame", "errors" })
39+
public static LinePage create(final int start,
40+
final int limit,
41+
final int size,
42+
final int nextPageStart,
43+
final boolean isLastPage,
44+
@Nullable final List<Line> lines,
45+
@Nullable final List<Blame> blame,
46+
@Nullable final List<Error> errors) {
47+
48+
return new AutoValue_LinePage(start,
49+
limit,
50+
size,
51+
nextPageStart,
52+
isLastPage,
53+
Utils.nullToEmpty(lines),
54+
Utils.nullToEmpty(errors),
55+
Utils.nullToEmpty(blame));
4356
}
4457
}

src/main/java/com/cdancy/bitbucket/rest/domain/file/RawContent.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
public abstract class RawContent implements Value<String>, ErrorsHolder {
3333

3434
@SerializedNames({ "value", "errors" })
35-
public static RawContent create(@Nullable String value, List<Error> errors) {
36-
return new AutoValue_RawContent(value, Utils.nullToEmpty(errors));
35+
public static RawContent create(@Nullable final String value,
36+
final List<Error> errors) {
37+
38+
return new AutoValue_RawContent(value,
39+
Utils.nullToEmpty(errors));
3740
}
3841
}

0 commit comments

Comments
 (0)