-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
base: develop
Are you sure you want to change the base?
Conversation
@reinhapa Please could you have a look? |
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.
I added some suggestions...
exist-core/src/main/java/org/exist/security/internal/RealmImpl.java
Outdated
Show resolved
Hide resolved
exist-core/src/main/java/org/exist/xmldb/AbstractRemoteResource.java
Outdated
Show resolved
Hide resolved
exist-core/src/main/java/org/exist/xmldb/AbstractRemoteResource.java
Outdated
Show resolved
Hide resolved
exist-core/src/main/java/org/exist/xmldb/LocalBinaryResource.java
Outdated
Show resolved
Hide resolved
exist-core/src/main/java/org/exist/xquery/value/IntegerValue.java
Outdated
Show resolved
Hide resolved
exist-core/src/main/java/org/exist/xslt/TransformerFactoryAllocator.java
Outdated
Show resolved
Hide resolved
exist-core/src/main/java/org/exist/xquery/value/ItemComparator.java
Outdated
Show resolved
Hide resolved
exist-core/src/main/java/org/exist/xquery/value/DecimalValue.java
Outdated
Show resolved
Hide resolved
exist-core/src/main/java/org/exist/xquery/functions/util/ModuleInfo.java
Outdated
Show resolved
Hide resolved
@reinhapa Very valuable feedback! |
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.
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.
exist-core/src/main/java/org/exist/security/internal/AccountImpl.java
Outdated
Show resolved
Hide resolved
exist-core/src/main/java/org/exist/security/internal/Password.java
Outdated
Show resolved
Hide resolved
@@ -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); |
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.
Will this different method handle binary files as well?
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.
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
exist-core/src/main/java/org/exist/xmldb/LocalBinaryResource.java
Outdated
Show resolved
Hide resolved
exist-core/src/main/java/org/exist/xquery/functions/math/OneParamFunctions.java
Outdated
Show resolved
Hide resolved
exist-core/src/main/java/org/exist/xslt/TransformerFactoryAllocator.java
Show resolved
Hide resolved
...ons/indexes/range/src/main/java/org/exist/indexing/range/ComplexRangeIndexConfigElement.java
Show resolved
Hide resolved
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(", "); | ||
} | ||
|
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.
We could use a StringJoiner
instead of StringBuilder
here..
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.
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.
@dizzzz agreed to change the commit messages before this is pulled in |
8e27891
to
3062ed6
Compare
@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. |
@line-o I reworked the PR, good suggestions. |
Mostly mechanical changes done by Intellij, with some manual modifications.