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

[Feature] Update syntax up to language level 21 #5652

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

dizzzz
Copy link
Member

@dizzzz dizzzz commented Mar 5, 2025

Mostly mechanical changes done by Intellij, with some manual modifications.

  • use since java8 added APIs
  • improve readability

@dizzzz
Copy link
Member Author

dizzzz commented Mar 6, 2025

@reinhapa Please could you have a look?

Copy link
Member

@reinhapa reinhapa left a comment

Choose a reason for hiding this comment

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

I added some suggestions...

@dizzzz
Copy link
Member Author

dizzzz commented Mar 7, 2025

@reinhapa Very valuable feedback!

@dizzzz dizzzz marked this pull request as ready for review March 9, 2025 20:22
@dizzzz dizzzz requested a review from a team as a code owner March 9, 2025 20:22
@dizzzz dizzzz requested review from line-o and a team March 10, 2025 11:38
Copy link
Member

@line-o line-o left a comment

Choose a reason for hiding this comment

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

Really great changes over all.
It was quite a grind to go through all of them ;)
The commit messages are all non-conformant, do you plan to squash all of them or reword them all?
Since some of the changes are quite complex I would rather be for rewording the commits.

@@ -103,7 +103,7 @@ public InputStream getInputStream() throws IOException {
@Override
public String getContent() throws IOException {
checkEncoding();
return new String(Files.readAllBytes(path), encoding);
return Files.readString(path, encoding);
Copy link
Member

Choose a reason for hiding this comment

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

Will this different method handle binary files as well?

Copy link
Member

Choose a reason for hiding this comment

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

I do not fully understand your question, but the new method does the same thing as the old invovation and was added with Java 11

Comment on lines 95 to 101
final StringBuilder builder = new StringBuilder();

for (int i = 0; i < strings.size(); i++) {
builder.append(strings.get(i));
for (String string : strings) {
builder.append(string);
builder.append(", ");
}

Copy link
Member

@reinhapa reinhapa Mar 10, 2025

Choose a reason for hiding this comment

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

We could use a StringJoiner instead of StringBuilder here..

Copy link
Member Author

@dizzzz dizzzz Mar 11, 2025

Choose a reason for hiding this comment

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

I am not sure, it is a benchmark (test) class. I guess it is/was used to test several options to join text parts. We should hunt these in the core code probably?

For now, i'd keep it.

@line-o
Copy link
Member

line-o commented Mar 10, 2025

@dizzzz agreed to change the commit messages before this is pulled in

@dizzzz dizzzz force-pushed the feature/java21_syntax branch from 8e27891 to 3062ed6 Compare March 11, 2025 12:01
@joewiz
Copy link
Member

joewiz commented Mar 11, 2025

@dizzzz Re: editing commit messages, you might find a tool like Tower Git useful. What I do in such circumstances is open my branch in Tower, edit the commit messages as needed, then force push the repository to the remote.

@dizzzz
Copy link
Member Author

dizzzz commented Mar 11, 2025

@line-o I reworked the PR, good suggestions.
again the hint is: check per commit what has changed, that is less bulky and the changes are typically identical.

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

Successfully merging this pull request may close these issues.

4 participants