Skip to content

Commit 959d07f

Browse files
committed
Fixed Codacy violations
(10)
1 parent 07127a8 commit 959d07f

File tree

3 files changed

+15
-22
lines changed

3 files changed

+15
-22
lines changed

springfox-grails/src/main/java/springfox/documentation/grails/SynthesizedAnnotations.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88

99
@SuppressWarnings({"squid:S1188"})
1010
class SynthesizedAnnotations {
11-
static final RequestBody REQUEST_BODY_ANNOTATION = new RequestBody() {
11+
private SynthesizedAnnotations() {
12+
throw new UnsupportedOperationException();
13+
}
14+
15+
public static final RequestBody REQUEST_BODY_ANNOTATION = new RequestBody() {
1216
@Override
1317
public Class<? extends Annotation> annotationType() {
1418
return RequestBody.class;
@@ -20,11 +24,7 @@ public boolean required() {
2024
}
2125
};
2226

23-
private SynthesizedAnnotations() {
24-
throw new UnsupportedOperationException();
25-
}
26-
27-
static PathVariable pathVariable(final String name) {
27+
public static PathVariable pathVariable(final String name) {
2828
return new PathVariable() {
2929
@Override
3030
public Class<? extends Annotation> annotationType() {
@@ -48,7 +48,7 @@ public boolean required(){
4848
};
4949
}
5050

51-
static RequestParam requestParam(final String name, final String value, final boolean required, final String
51+
public static RequestParam requestParam(final String name, final String value, final boolean required, final String
5252
defaultValue) {
5353
return new RequestParam() {
5454

springfox-grails/src/main/java/springfox/documentation/grails/UrlMappings.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@ public static Map<String, String> pathParameters(UrlMapping mapping) {
4545
c -> String.format("{%s}", c.getPropertyName())));
4646
}
4747

48-
private static IntPredicate indicesToUse(UrlMapping mapping) {
49-
return index -> {
50-
ConstrainedProperty property = mapping.getConstraints()[index];
51-
return !property.getPropertyName().equals("controller")
52-
&& !property.getPropertyName().equals("action");
53-
};
54-
}
55-
5648
public static List<ResolvedMethodParameter> resolvedPathParameters(
5749
TypeResolver resolver,
5850
UrlMapping mapping,
@@ -74,6 +66,14 @@ public static List<ResolvedMethodParameter> resolvedPathParameters(
7466
return resolved;
7567
}
7668

69+
private static IntPredicate indicesToUse(UrlMapping mapping) {
70+
return index -> {
71+
ConstrainedProperty property = mapping.getConstraints()[index];
72+
return !property.getPropertyName().equals("controller")
73+
&& !property.getPropertyName().equals("action");
74+
};
75+
}
76+
7777
private static ResolvedType resolvedPropertyType(
7878
TypeResolver resolver,
7979
GrailsDomainClass domainClass,

springfox-grails/src/test/groovy/springfox/documentation/grails/UrlMappingsSpec.groovy

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)