Skip to content

Commit 6805f6c

Browse files
committed
Fix PMD warnings
1 parent fe1d03c commit 6805f6c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

datamodel/openapi/openapi-generator/src/main/java/com/sap/cloud/sdk/datamodel/openapi/generator/GenerationConfigurationConverter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ private void useCreatorsForInterfaceSubtypes( @Nonnull final CodegenModel m )
123123
return;
124124
}
125125
boolean useCreators = false;
126-
for( Set<String> candidates : List.of(m.anyOf, m.oneOf) ) {
126+
for( final Set<String> candidates : List.of(m.anyOf, m.oneOf) ) {
127127
int nonPrimitives = 0;
128-
Set<String> candidatesSingle = new HashSet<>();
129-
Set<String> candidatesMultiple = new HashSet<>();
128+
final var candidatesSingle = new HashSet<String>();
129+
final var candidatesMultiple = new HashSet<String>();
130130

131-
for( String candidate : candidates ) {
131+
for( final String candidate : candidates ) {
132132
if( candidate.startsWith("List<") ) {
133-
var c1 = candidate.substring(5, candidate.length() - 1);
133+
final var c1 = candidate.substring(5, candidate.length() - 1);
134134
candidatesMultiple.add(c1);
135135
useCreators = true;
136136
} else {
@@ -148,7 +148,7 @@ private void useCreatorsForInterfaceSubtypes( @Nonnull final CodegenModel m )
148148
log.warn(msg, m.name);
149149
}
150150
candidates.clear();
151-
var monads = Map.of("single", candidatesSingle, "multiple", candidatesMultiple);
151+
final var monads = Map.of("single", candidatesSingle, "multiple", candidatesMultiple);
152152
m.vendorExtensions.put("x-monads", monads);
153153
m.vendorExtensions.put("x-is-one-of-interface", true); // enforce template usage
154154
}

0 commit comments

Comments
 (0)