@@ -130,7 +130,7 @@ Stream<DynamicTest> testDefaultValues() {
130
130
return buildRelatedResourceTests (clazz -> {
131
131
// Try and find the no args constructor if there is any.
132
132
if (!Modifier .isInterface (clazz .getModifiers ())
133
- && !Modifier .isAbstract (clazz .getModifiers ())) {
133
+ && !Modifier .isAbstract (clazz .getModifiers ())) {
134
134
135
135
final Constructor <?>[] constructors = clazz .getDeclaredConstructors ();
136
136
Constructor <?> noArgsConstructor = null ;
@@ -164,7 +164,6 @@ Stream<DynamicTest> testDefaultValues() {
164
164
}
165
165
}
166
166
});
167
-
168
167
}
169
168
170
169
/**
@@ -181,7 +180,7 @@ Stream<DynamicTest> testNoComplexMaps() {
181
180
for (final Field field : fields ) {
182
181
// Don't care about static as they are not serialised.
183
182
if (Map .class .isAssignableFrom (field .getType ())
184
- && !Modifier .isStatic (field .getModifiers ())) {
183
+ && !Modifier .isStatic (field .getModifiers ())) {
185
184
final ParameterizedType parameterizedType = (ParameterizedType ) field .getGenericType ();
186
185
final Type keyType = parameterizedType .getActualTypeArguments ()[0 ];
187
186
if (!(keyType instanceof Class && ((Class <?>) keyType ).isEnum ())) {
@@ -286,8 +285,8 @@ Stream<DynamicTest> testJsonAnnotations() {
286
285
return buildRelatedResourceTests (clazz -> {
287
286
288
287
if (!Modifier .isInterface (clazz .getModifiers ())
289
- && !Modifier .isAbstract (clazz .getModifiers ())
290
- && !clazz .isEnum ()) {
288
+ && !Modifier .isAbstract (clazz .getModifiers ())
289
+ && !clazz .isEnum ()) {
291
290
final boolean hasJsonInclude = clazz .getAnnotation (JsonInclude .class ) != null ;
292
291
final boolean hasJsonPropertyOrder = clazz .getAnnotation (JsonPropertyOrder .class ) != null ;
293
292
final AtomicInteger jsonCreatorCount = new AtomicInteger (0 );
@@ -313,7 +312,7 @@ Stream<DynamicTest> testJsonAnnotations() {
313
312
314
313
fieldPropNames = getAllFields (clazz ).stream ()
315
314
.filter (field -> field .getDeclaredAnnotation (JsonIgnore .class ) == null
316
- && field .getDeclaredAnnotation (JsonProperty .class ) != null )
315
+ && field .getDeclaredAnnotation (JsonProperty .class ) != null )
317
316
.map (field -> {
318
317
final JsonProperty jsonProperty = field .getDeclaredAnnotation (JsonProperty .class );
319
318
if (!jsonProperty .value ().isEmpty ()) {
@@ -331,8 +330,8 @@ Stream<DynamicTest> testJsonAnnotations() {
331
330
final JsonIgnore jsonIgnore = field .getDeclaredAnnotation (JsonIgnore .class );
332
331
final JsonProperty jsonProperty = field .getDeclaredAnnotation (JsonProperty .class );
333
332
if (jsonIgnore == null
334
- && jsonProperty == null
335
- && !Modifier .isStatic (field .getModifiers ())) {
333
+ && jsonProperty == null
334
+ && !Modifier .isStatic (field .getModifiers ())) {
336
335
String fieldName = field .getName ();
337
336
fieldsWithoutAnnotations .add (fieldName );
338
337
}
@@ -349,7 +348,7 @@ Stream<DynamicTest> testJsonAnnotations() {
349
348
SoftAssertions .assertSoftly (softly -> {
350
349
softly .assertThat (constructorPropNames )
351
350
.describedAs ("%s - JsonProperties defined in the constructor must have a " +
352
- "corresponding JsonProperty on the field." , clazz .getName ())
351
+ "corresponding JsonProperty on the field." , clazz .getName ())
353
352
.containsExactlyInAnyOrderElementsOf (fieldPropNames );
354
353
355
354
softly .assertThat (hasJsonInclude )
@@ -506,16 +505,16 @@ private String normaliseFieldName(final String fieldName) {
506
505
507
506
private boolean isGetter (final Method method ) {
508
507
return !Modifier .isAbstract (method .getModifiers ()) &&
509
- Modifier .isPublic (method .getModifiers ()) &&
510
- method .getParameterCount () == 0 &&
511
- (method .getName ().startsWith ("is" ) || method .getName ().startsWith ("get" ));
508
+ Modifier .isPublic (method .getModifiers ()) &&
509
+ method .getParameterCount () == 0 &&
510
+ (method .getName ().startsWith ("is" ) || method .getName ().startsWith ("get" ));
512
511
}
513
512
514
513
private boolean isSetter (final Method method ) {
515
514
return !Modifier .isAbstract (method .getModifiers ()) &&
516
- Modifier .isPublic (method .getModifiers ()) &&
517
- method .getParameterCount () == 1 &&
518
- method .getName ().startsWith ("set" );
515
+ Modifier .isPublic (method .getModifiers ()) &&
516
+ method .getParameterCount () == 1 &&
517
+ method .getName ().startsWith ("set" );
519
518
}
520
519
521
520
private String convertMethodToFieldName (final String methodName ) {
@@ -589,7 +588,7 @@ private static void addClass(final Set<Class<?>> stroomClasses, final Class<?> c
589
588
}
590
589
591
590
} else if (clazz .getName ().startsWith (PACKAGE_START )
592
- && !clazz .getName ().contains ("StroomDuration" )) { // Non POJO
591
+ && !clazz .getName ().contains ("StroomDuration" )) { // Non POJO
593
592
// IF the class references sub classes then include those too.
594
593
final JsonSubTypes jsonSubTypes = clazz .getAnnotation (JsonSubTypes .class );
595
594
if (jsonSubTypes != null ) {
@@ -667,16 +666,16 @@ private List<Class<?>> getSharedClasses() {
667
666
// LOGGER.info("{}", routeClassInfo.getName());
668
667
final String name = routeClassInfo .getName ();
669
668
if (name .contains (".shared." ) &&
670
- !name .contains ("hadoopcommonshaded" ) &&
671
- !name .contains ("Util" ) &&
672
- !name .contains ("$" ) &&
673
- !name .contains ("_" )) {
669
+ !name .contains ("hadoopcommonshaded" ) &&
670
+ !name .contains ("Util" ) &&
671
+ !name .contains ("$" ) &&
672
+ !name .contains ("_" )) {
674
673
try {
675
674
final Class <?> clazz = routeClassInfo .loadClass ();
676
675
if (!Modifier .isInterface (clazz .getModifiers ()) &&
677
- !Modifier .isAbstract (clazz .getModifiers ()) &&
678
- !RestResource .class .isAssignableFrom (clazz ) &&
679
- !DirectRestService .class .isAssignableFrom (clazz )) {
676
+ !Modifier .isAbstract (clazz .getModifiers ()) &&
677
+ !RestResource .class .isAssignableFrom (clazz ) &&
678
+ !DirectRestService .class .isAssignableFrom (clazz )) {
680
679
stroomClasses .add (clazz );
681
680
}
682
681
} catch (final IllegalArgumentException e ) {
0 commit comments