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

Java 20 breaks LexicalsTest.testSeparator #435

Closed
jcflack opened this issue May 29, 2023 · 3 comments
Closed

Java 20 breaks LexicalsTest.testSeparator #435

jcflack opened this issue May 29, 2023 · 3 comments

Comments

@jcflack
Copy link
Contributor

jcflack commented May 29, 2023

Until a solution for that, well, use Java 19 or earlier.

@jcflack
Copy link
Contributor Author

jcflack commented May 30, 2023

Also breaks the DDRProcessor. Looks like they've changed what regular expressions mean.

jcflack added a commit that referenced this issue May 30, 2023
Not with Java 20. Likely related to issue #435.
@jcflack
Copy link
Contributor Author

jcflack commented Jun 5, 2023

Submitted at bugreport.java.com as JI-9075361 published as JDK-8309515:

In addressing issue 8065554 (MatchResult should provide values of named-capturing groups), commit openjdk/jdk@ce85cac added a namedGroups field in Matcher to cache the map from parentPattern.namedGroups().

The map is lazily cached, only when the field is null and namedGroups() is called (which may be indirectly through a call of start(String), end(String), or group(String). The same cached value will then continue to be returned even if Matcher.usePattern is later called and the new Pattern has different named groups, or no named groups, or the same named groups mapped to different integers. Therefore, symptoms can include seeing the wrong results when retrieving by named groups, or spurious IllegalArgumentExceptions for groups that the new pattern provides, or exceptions not thrown for groups that the new pattern doesn't provide, or exceptions for an invalid group index when calling a method that takes a group name.

Could be fixed by eliminating the local copy and simply having Matcher.namedGroups() call parentPattern.namedGroups() unconditionally, or by having Matcher.usePattern simply null the field, so the correct map will be lazily cached when next needed.

jcflack added a commit that referenced this issue Jun 10, 2023
PL/Java builds and passes its tests on Java 20 this way.
Of course, this code relies on Java 20 API and can only
be built by bumping <release> to 20 in the pljava-api POM.
To do: make it reflective so it can build on earlier
versions, and apply the workaround only if needed.

Begins to address #435.
jcflack added a commit that referenced this issue Jun 10, 2023
PL/Java builds and passes its tests on Java 20 this way.
Of course, this code relies on Java 20 API and can only
be built by bumping <release> to 20 in the pljava-api POM.
To do: make it reflective so it can build on earlier
versions, and apply the workaround only if needed.

Begins to address #435.
jcflack added a commit that referenced this issue Jun 13, 2023
PR #446, #443, #442, #441, #445, #444.

Addresses issues:

Bug #416 crash with SQL_ASCII database and bad vmoptions
Doc #419 better document the use of --add-modules in vmoptions
Bug #425 install_jar from http URLs, add test to CI
Feature #426 allow functions declared on an interface as well as a class
Track PG #434 postgres/postgres@b9b21ac broke unpackaged ALTER UPDATE
Track JDK #435 check and reject Java 20 builds with JDK-8309515 bug
@jcflack
Copy link
Contributor Author

jcflack commented Jun 13, 2023

Resolved in 1.6.5 by detecting when affected by this bug and throwing an exception. The message advises to use either a version of Java earlier than 20, or a version recent enough to have JDK-8309515 fixed.

@jcflack jcflack closed this as completed Jun 13, 2023
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

No branches or pull requests

1 participant