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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a version of JavaVersion#getMajorVersion(), which returns int instead of String #29176

Merged
merged 5 commits into from
May 28, 2024

Conversation

hegyibalint
Copy link
Member

The 馃У spawning this change: #28281 (comment)

When developing the problem reporting for the compiler, I've noticed that this useful method is missing.
Meanwhile we don't rely on this that much, I think it's a worthwhile addition for the users too.

@hegyibalint hegyibalint added a:feature A new functionality in:java-plugins java-library, java, java-base, java-platform, java-test-fixtures labels May 16, 2024
@hegyibalint hegyibalint added this to the 8.9 RC1 milestone May 16, 2024
@hegyibalint hegyibalint self-assigned this May 16, 2024
@hegyibalint hegyibalint requested review from a team as code owners May 16, 2024 09:38
@hegyibalint hegyibalint requested a review from ghale May 16, 2024 09:38
@jvandort
Copy link
Member

Can you check for our usages on the string version in the codebase to see if we are converting it to an int anywhere?

@hegyibalint
Copy link
Member Author

Can you check for our usages on the string version in the codebase to see if we are converting it to an int anywhere?

I already did; my use case is the first one. Most use cases are concerned about the compatibility of a version, and they don't need the version directly.

@@ -326,6 +326,15 @@ public String getMajorVersion() {
return String.valueOf(ordinal() + 1);
Copy link
Member

Choose a reason for hiding this comment

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

馃拝 should this line also use getMajorVersionNumber()?

Copy link
Member Author

Choose a reason for hiding this comment

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

Absolutely

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed!

Copy link
Member

@ghale ghale left a comment

Choose a reason for hiding this comment

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

Aside from the comment by @donat and @jvandort, this looks fine to me.

@hegyibalint hegyibalint requested review from a team and ldaley as code owners May 24, 2024 09:09
@hegyibalint
Copy link
Member Author

Can you check for our usages on the string version in the codebase to see if we are converting it to an int anywhere?

Yeah, I've significantly overlooked a lot of use-cases, as I've focused on the ordinal()-based approaches. Scanned through the codebase, and hopefully adopt all use-cases for this new method.

@hegyibalint hegyibalint added this pull request to the merge queue May 24, 2024
@bot-gradle
Copy link
Collaborator

WARN: Based on labels, this pull request addresses notable issue but no changes to release note found.

@bot-gradle
Copy link
Collaborator

The merge queue build has failed. Click here to see all failures.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 24, 2024
@cobexer cobexer removed the request for review from a team May 27, 2024 08:23
@hegyibalint hegyibalint force-pushed the bhegyi/add-major-version-int branch from e8fe2fc to c582e63 Compare May 27, 2024 13:03
@hegyibalint hegyibalint requested a review from donat May 27, 2024 13:04
@hegyibalint
Copy link
Member Author

@donat could you re-review JavaVersion.java?
Added some documentation and a missing @Incubating.

@hegyibalint hegyibalint added this pull request to the merge queue May 28, 2024
@bot-gradle
Copy link
Collaborator

WARN: Based on labels, this pull request addresses notable issue but no changes to release note found.

Merged via the queue into master with commit 8693e75 May 28, 2024
22 checks passed
@hegyibalint hegyibalint deleted the bhegyi/add-major-version-int branch May 28, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality in:java-plugins java-library, java, java-base, java-platform, java-test-fixtures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants