Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

hbzhou
Copy link

@hbzhou hbzhou commented Sep 23, 2024

try to build with JDK17 since it's LTS version and widely used in organizations

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Quality Gates: OK

Change in average Code Health of affected files: -0.00 (9.77 -> 9.77)

View detailed results in CodeScene

Absence of Expected Change Pattern

  • jsonschema-generator/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/MethodScope.java is usually changed with: jsonschema-generator/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/FieldScope.java
  • jsonschema-generator/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/SchemaGeneratorConfigImpl.java is usually changed with: jsonschema-generator/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/SchemaGeneratorConfig.java

@hbzhou hbzhou changed the title Upgrade jdk17 #438 Upgrade jdk17 Sep 23, 2024
@hbzhou hbzhou marked this pull request as draft September 23, 2024 03:18
@hbzhou hbzhou closed this Sep 24, 2024
@hbzhou hbzhou reopened this Sep 24, 2024
@hbzhou hbzhou marked this pull request as ready for review September 24, 2024 06:55
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Quality Gates: OK

Change in average Code Health of affected files: -0.00 (9.77 -> 9.77)

View detailed results in CodeScene

Absence of Expected Change Pattern

  • jsonschema-generator/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/MethodScope.java is usually changed with: jsonschema-generator/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/FieldScope.java
  • jsonschema-generator/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/SchemaGeneratorConfigImpl.java is usually changed with: jsonschema-generator/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/SchemaGeneratorConfig.java

@hbzhou hbzhou changed the title #438 Upgrade jdk17 #438 Upgrade to support jdk17 Sep 24, 2024
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Quality Gates: OK

Change in average Code Health of affected files: -0.00 (9.77 -> 9.77)

View detailed results in CodeScene

Absence of Expected Change Pattern

  • jsonschema-generator/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/MethodScope.java is usually changed with: jsonschema-generator/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/FieldScope.java
  • jsonschema-generator/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/SchemaGeneratorConfigImpl.java is usually changed with: jsonschema-generator/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/SchemaGeneratorConfig.java

Copy link
Member

@CarstenWickner CarstenWickner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate all the work that went into this, I'm just not sure how to best approach abandoning JDK 11 support.
The library could be used in bigger applications, that might still be tied to JDK 11.

I'm pondering a separate branch to keep supporting both JDK versions or simply making this a new major version, that expects JDK 17+, since there aren't many changes being added anyway, that an application still on JDK 11 couldn't live without.

That's why I haven't acted upon your PR yet.
I'm undecided how to tackle it.

Comment on lines +30 to +33
- name: Setup Java 17
uses: actions/setup-java@v1
with:
java-version: 17
Copy link
Member

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?

- name: Autobuild
uses: github/codeql-action/autobuild@v2


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: one empty line is enough 😛

Suggested change

@@ -12,6 +12,7 @@
<packaging>pom</packaging>

<properties>
<maven.compiler.release>17</maven.compiler.release>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Irrelevant compiler setting for a BOM.

Suggested change
<maven.compiler.release>17</maven.compiler.release>

Comment on lines +137 to +138
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Changing these settings and then not using them feels somewhat pointless.
Fair enough to switch to the release, but then let's please introduce a property for that again to be consistent.

Suggested change
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.release>17</maven.compiler.release>

<showDeprecation>true</showDeprecation>
<release>17</release>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Let's please continue using the respective property here.

Suggested change
<release>17</release>
<release>${maven.compiler.release}</release>

Comment on lines +412 to +417
} 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);
Copy link
Member

Choose a reason for hiding this comment

The 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 Boolean boolean1) {
node.add(boolean1);
} else if (value instanceof Double double1) {
node.add(double1);
} else if (value instanceof Float float1) {
node.add(float1);
} else if (value instanceof Boolean booleanValue) {
node.add(booleanValue);
} else if (value instanceof Double doubleValue) {
node.add(doubleValue);
} else if (value instanceof Float floatValue) {
node.add(floatValue);

Comment on lines +438 to +439
if (targetScope instanceof FieldScope scope && !scope.isFakeContainerItemScope()) {
return this.populateFieldSchema(scope.asFakeContainerItemScope());
Copy link
Member

Choose a reason for hiding this comment

The 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 FieldScope scope && !scope.isFakeContainerItemScope()) {
return this.populateFieldSchema(scope.asFakeContainerItemScope());
if (targetScope instanceof FieldScope fieldScope && !fieldScope.isFakeContainerItemScope()) {
return this.populateFieldSchema(fieldScope.asFakeContainerItemScope());

Comment on lines +441 to +442
if (targetScope instanceof MethodScope scope && !scope.isFakeContainerItemScope()) {
return this.populateMethodSchema(scope.asFakeContainerItemScope());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Similarly here.

Suggested change
if (targetScope instanceof MethodScope scope && !scope.isFakeContainerItemScope()) {
return this.populateMethodSchema(scope.asFakeContainerItemScope());
if (targetScope instanceof MethodScope methodScope && !methodScope.isFakeContainerItemScope()) {
return this.populateMethodSchema(methodScope.asFakeContainerItemScope());

Comment on lines +12 to +14
<properties>
<maven.compiler.release>17</maven.compiler.release>
</properties>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Irrrelevant compiler setting in a reactor POM.

Suggested change
<properties>
<maven.compiler.release>17</maven.compiler.release>
</properties>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants