-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#438 Upgrade to support jdk17 #477
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -27,8 +27,14 @@ jobs: | |||
with: | ||||
languages: java | ||||
|
||||
- name: Setup Java 17 | ||||
uses: actions/setup-java@v1 | ||||
with: | ||||
java-version: 17 | ||||
|
||||
- name: Autobuild | ||||
uses: github/codeql-action/autobuild@v2 | ||||
|
||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: one empty line is enough 😛
Suggested change
|
||||
- name: Perform CodeQL Analysis | ||||
uses: github/codeql-action/analyze@v2 |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -12,6 +12,7 @@ | |||
<packaging>pom</packaging> | ||||
|
||||
<properties> | ||||
<maven.compiler.release>17</maven.compiler.release> | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Irrelevant compiler setting for a BOM.
Suggested change
|
||||
<signAndStage.skip>true</signAndStage.skip> | ||||
</properties> | ||||
|
||||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -134,10 +134,10 @@ | |||||||
<properties> | ||||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||||||||
<file.encoding>UTF-8</file.encoding> | ||||||||
<maven.compiler.source>1.8</maven.compiler.source> | ||||||||
<maven.compiler.target>1.8</maven.compiler.target> | ||||||||
<maven.compiler.source>17</maven.compiler.source> | ||||||||
<maven.compiler.target>17</maven.compiler.target> | ||||||||
Comment on lines
+137
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Changing these settings and then not using them feels somewhat pointless.
Suggested change
|
||||||||
<!-- maven plugins --> | ||||||||
<maven.plugin.version.checkstyle>3.3.1</maven.plugin.version.checkstyle> | ||||||||
<maven.plugin.version.checkstyle>3.5.0</maven.plugin.version.checkstyle> | ||||||||
<version.checkstyle>10.14.1</version.checkstyle> | ||||||||
<maven.plugin.version.compiler>3.10.1</maven.plugin.version.compiler> | ||||||||
<maven.plugin.version.enforcer>3.2.1</maven.plugin.version.enforcer> | ||||||||
|
@@ -277,9 +277,8 @@ | |||||||
<artifactId>maven-compiler-plugin</artifactId> | ||||||||
<version>${maven.plugin.version.compiler}</version> | ||||||||
<configuration> | ||||||||
<source>${maven.compiler.source}</source> | ||||||||
<target>${maven.compiler.target}</target> | ||||||||
<showDeprecation>true</showDeprecation> | ||||||||
<release>17</release> | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Let's please continue using the respective property here.
Suggested change
|
||||||||
</configuration> | ||||||||
</plugin> | ||||||||
<plugin> | ||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -379,21 +379,21 @@ public AttributeCollector setEnum(ObjectNode node, Collection<?> enumValues, Sch | |||||||||||||||||||||||||
|
||||||||||||||||||||||||||
private void addRawPropertyValue(ObjectNode node, String propertyName, Object value) { | ||||||||||||||||||||||||||
// need to specifically add simple/primitive values by type | ||||||||||||||||||||||||||
if (value instanceof String) { | ||||||||||||||||||||||||||
if (value instanceof String string) { | ||||||||||||||||||||||||||
// explicit inclusion as string results in wrapping quote symbols | ||||||||||||||||||||||||||
node.put(propertyName, (String) value); | ||||||||||||||||||||||||||
} else if (value instanceof BigDecimal) { | ||||||||||||||||||||||||||
node.put(propertyName, (BigDecimal) value); | ||||||||||||||||||||||||||
} else if (value instanceof BigInteger) { | ||||||||||||||||||||||||||
node.put(propertyName, (BigInteger) value); | ||||||||||||||||||||||||||
} else if (value instanceof Boolean) { | ||||||||||||||||||||||||||
node.put(propertyName, (Boolean) value); | ||||||||||||||||||||||||||
} else if (value instanceof Double) { | ||||||||||||||||||||||||||
node.put(propertyName, (Double) value); | ||||||||||||||||||||||||||
} else if (value instanceof Float) { | ||||||||||||||||||||||||||
node.put(propertyName, (Float) value); | ||||||||||||||||||||||||||
} else if (value instanceof Integer) { | ||||||||||||||||||||||||||
node.put(propertyName, (Integer) value); | ||||||||||||||||||||||||||
node.put(propertyName, string); | ||||||||||||||||||||||||||
} else if (value instanceof BigDecimal decimal) { | ||||||||||||||||||||||||||
node.put(propertyName, decimal); | ||||||||||||||||||||||||||
} else if (value instanceof BigInteger integer) { | ||||||||||||||||||||||||||
node.put(propertyName, integer); | ||||||||||||||||||||||||||
} else if (value instanceof Boolean boolean1) { | ||||||||||||||||||||||||||
node.put(propertyName, boolean1); | ||||||||||||||||||||||||||
} else if (value instanceof Double double1) { | ||||||||||||||||||||||||||
node.put(propertyName, double1); | ||||||||||||||||||||||||||
} else if (value instanceof Float float1) { | ||||||||||||||||||||||||||
node.put(propertyName, float1); | ||||||||||||||||||||||||||
} else if (value instanceof Integer integer) { | ||||||||||||||||||||||||||
node.put(propertyName, integer); | ||||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||||
// everything else is simply forwarded as-is to the JSON Schema, it's up to the configurator to ensure the value's correctness | ||||||||||||||||||||||||||
node.putPOJO(propertyName, value); | ||||||||||||||||||||||||||
|
@@ -402,21 +402,21 @@ private void addRawPropertyValue(ObjectNode node, String propertyName, Object va | |||||||||||||||||||||||||
|
||||||||||||||||||||||||||
private void addRawArrayItem(ArrayNode node, Object value) { | ||||||||||||||||||||||||||
// need to specifically add simple/primitive values by type | ||||||||||||||||||||||||||
if (value instanceof String) { | ||||||||||||||||||||||||||
if (value instanceof String string) { | ||||||||||||||||||||||||||
// explicit inclusion as string results in wrapping quote symbols | ||||||||||||||||||||||||||
node.add((String) value); | ||||||||||||||||||||||||||
} else if (value instanceof BigDecimal) { | ||||||||||||||||||||||||||
node.add((BigDecimal) value); | ||||||||||||||||||||||||||
} else if (value instanceof BigInteger) { | ||||||||||||||||||||||||||
node.add((BigInteger) value); | ||||||||||||||||||||||||||
} else if (value instanceof Boolean) { | ||||||||||||||||||||||||||
node.add((Boolean) value); | ||||||||||||||||||||||||||
} else if (value instanceof Double) { | ||||||||||||||||||||||||||
node.add((Double) value); | ||||||||||||||||||||||||||
} else if (value instanceof Float) { | ||||||||||||||||||||||||||
node.add((Float) value); | ||||||||||||||||||||||||||
} else if (value instanceof Integer) { | ||||||||||||||||||||||||||
node.add((Integer) value); | ||||||||||||||||||||||||||
node.add(string); | ||||||||||||||||||||||||||
} else if (value instanceof BigDecimal decimal) { | ||||||||||||||||||||||||||
node.add(decimal); | ||||||||||||||||||||||||||
} else if (value instanceof BigInteger integer) { | ||||||||||||||||||||||||||
node.add(integer); | ||||||||||||||||||||||||||
} else if (value instanceof Boolean boolean1) { | ||||||||||||||||||||||||||
node.add(boolean1); | ||||||||||||||||||||||||||
} else if (value instanceof Double double1) { | ||||||||||||||||||||||||||
node.add(double1); | ||||||||||||||||||||||||||
} else if (value instanceof Float float1) { | ||||||||||||||||||||||||||
node.add(float1); | ||||||||||||||||||||||||||
Comment on lines
+412
to
+417
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Let's please avoid ambiguous naming wherever possible, including not assigning numbered variable name, even for such short-lived ones.
Suggested change
|
||||||||||||||||||||||||||
} else if (value instanceof Integer integer) { | ||||||||||||||||||||||||||
node.add(integer); | ||||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||||
// everything else is simply forwarded as-is to the JSON Schema, it's up to the configurator to ensure the value's correctness | ||||||||||||||||||||||||||
node.addPOJO(value); | ||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -435,11 +435,11 @@ private void generateArrayDefinition(GenericTypeDetails typeDetails, ObjectNode | |||||||||
} | ||||||||||
|
||||||||||
private JsonNode populateItemMemberSchema(TypeScope targetScope) { | ||||||||||
if (targetScope instanceof FieldScope && !((FieldScope) targetScope).isFakeContainerItemScope()) { | ||||||||||
return this.populateFieldSchema(((FieldScope) targetScope).asFakeContainerItemScope()); | ||||||||||
if (targetScope instanceof FieldScope scope && !scope.isFakeContainerItemScope()) { | ||||||||||
return this.populateFieldSchema(scope.asFakeContainerItemScope()); | ||||||||||
Comment on lines
+438
to
+439
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: A less ambiguous variable would be nice.
Suggested change
|
||||||||||
} | ||||||||||
if (targetScope instanceof MethodScope && !((MethodScope) targetScope).isFakeContainerItemScope()) { | ||||||||||
return this.populateMethodSchema(((MethodScope) targetScope).asFakeContainerItemScope()); | ||||||||||
if (targetScope instanceof MethodScope scope && !scope.isFakeContainerItemScope()) { | ||||||||||
return this.populateMethodSchema(scope.asFakeContainerItemScope()); | ||||||||||
Comment on lines
+441
to
+442
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: Similarly here.
Suggested change
|
||||||||||
} | ||||||||||
ObjectNode arrayItemDefinition = this.generatorConfig.createObjectNode(); | ||||||||||
this.traverseGenericType(targetScope.getContainerItemType(), arrayItemDefinition, false); | ||||||||||
|
@@ -704,9 +704,7 @@ public ObjectNode makeNullable(ObjectNode node) { | |||||||||
private void extendTypeDeclarationToIncludeNull(ObjectNode node) { | ||||||||||
JsonNode fixedJsonSchemaType = node.get(this.getKeyword(SchemaKeyword.TAG_TYPE)); | ||||||||||
final String nullTypeName = this.getKeyword(SchemaKeyword.TAG_TYPE_NULL); | ||||||||||
if (fixedJsonSchemaType instanceof ArrayNode) { | ||||||||||
// there are already multiple "type" values | ||||||||||
ArrayNode arrayOfTypes = (ArrayNode) fixedJsonSchemaType; | ||||||||||
if (fixedJsonSchemaType instanceof ArrayNode arrayOfTypes) { | ||||||||||
// one of the existing "type" values could be null | ||||||||||
for (JsonNode arrayEntry : arrayOfTypes) { | ||||||||||
if (nullTypeName.equals(arrayEntry.textValue())) { | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Why is this needed for CodeQL now?