[CONJ-1120] MariaDB Connector/J 3.3.0 compatibility with java8 Created: 2023-11-11 Updated: 2023-11-23 Resolved: 2023-11-21 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | java8 |
| Affects Version/s: | 3.3.0 |
| Fix Version/s: | 3.3.1 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Andreas Dangel | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
https://mariadb.com/kb/en/about-mariadb-connector-j/ says, that minimum Java is Java8. When using MariaDB Connector/J with Java8, the following exception is thrown:
The reason is, that String.repeat is only available in Java11+, but not in Java8. It is used here: One way to avoid such incompatibilities is, to use the "release" flag in maven-compiler-plugin instead of source/target. However, that requires to use e.g. a Java11 JDK for building - but thanks to the release flag, the compiled code is still java8 compatible (both binary compatible and API level compatible). But that seems to be ok, since you already use Java17 for building (according to travis.yml). Problem seems to have been introduced with https://github.com/mariadb-corporation/mariadb-connector-j/commit/2acd4376742bcb17322cfb5d98b159c6bd6502d9#diff-6d3a1153c463711756ad718e88ae89c3f12458576e928305ae428ea10bd72b2a ( |
| Comments |
| Comment by Diego Dupin [ 2023-11-13 ] | |||||||||||||||
|
that's right, there will be a correction soon, and CI will be modified to avoid this kind of error in the future. btw, there is another place where java 8+ code is used : Statement.enquoteLiteral but that's less a problem since this method is JDBC 4.3 (java 9) new features, but to be correted at the same time. | |||||||||||||||
| Comment by Diego Dupin [ 2023-11-21 ] | |||||||||||||||
|
CI now test java 8 to ensure not having those kind of issue.
| |||||||||||||||
| Comment by Andreas Dangel [ 2023-11-23 ] | |||||||||||||||
|
Thanks for fixing! I can confirm, in 3.3.1-SNAPSHOT, this issue is solved. |