You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting with more recent JDKs, we'll be in an unfortunate situation where one of our main types org.jooq.Record will be in conflict with a new type from the java.lang package: java.lang.Record. The types in java.lang are auto-imported in Java, which leads to even more confusion.
So far, we haven't had this situation. Maybe, it is not a problem - this issue is to collect feedback from the community to assess whether we need to take action. There are several options:
Rename the type (and subtypes) incompatibly. We could call it Rec (and Rec1, Rec2, UpdatableRec, etc.). This is thorough, but not very desireable.
Add a super type Rec with Record <: Rec that users could reference instead. All the Record API would go to Rec. All the receiving ends of the jOOQ API would use Rec instead of Record (e.g. Result<R extends Rec>). Methods would continue to return the more specific Record. This would be mostly source compatible (probably, some occasional invariance would get in the way), but a bit confusing.
Add a sub type Rec with Rec <: Record that users could reference instead. All the Record API would remain in Record. All the receiving ends of jOOQ API would continue using Record. Methods would now return Rec instead. This would be mostly source compatible (probably, some occasional invariance would get in the way), and perhaps a bit less confusing.
Perhaps, other options exist.
The text was updated successfully, but these errors were encountered:
…mped up to Java 11.
* Minimum allowed Gradle version is 6.3.
* The Quantum Leap project won't compile on Java 14 and newer, until jOOQ problem with conflicting class names is resolved: jOOQ/jOOQ#9988
vkuzel
added a commit
to vkuzel/Quantum-Leap-Gradle-Plugin
that referenced
this issue
Nov 28, 2021
… import of conflicting classes (java.lang.Record vs org.jooq.Record) class, without optimizing it out if an import-on-demand ("wildcard import") from the same package is applied.
See the details:
* jOOQ/jOOQ#9988
* https://youtrack.jetbrains.com/issue/IDEA-251602
Very rarely, the JDK adds stuff to the java.lang package, which can break user code when users use * imports. Typically, this isn't the case as IDEs tend to expand these imports, and they keep learning about such changes, including this one. I think this is now no longer a problem in IntelliJ? Also, as var becomes more popular, it might become less of a problem as users will assign their records to a var local variable rather than declaring it explicitly.
Renaming such an ubiquitous type is almost impossible in jOOQ. It would break every piece of jOOQ code out there. This problem here can be solved quickly after upgrading to Java 14+ by using an IDE to re-organise imports.
If Java had type aliases, then a solution would be possible. But unfortunately, it doesn't.
Starting with more recent JDKs, we'll be in an unfortunate situation where one of our main types
org.jooq.Record
will be in conflict with a new type from thejava.lang
package:java.lang.Record
. The types injava.lang
are auto-imported in Java, which leads to even more confusion.So far, we haven't had this situation. Maybe, it is not a problem - this issue is to collect feedback from the community to assess whether we need to take action. There are several options:
Rec
(andRec1
,Rec2
,UpdatableRec
, etc.). This is thorough, but not very desireable.Rec
withRecord <: Rec
that users could reference instead. All theRecord
API would go toRec
. All the receiving ends of the jOOQ API would useRec
instead ofRecord
(e.g.Result<R extends Rec>
). Methods would continue to return the more specificRecord
. This would be mostly source compatible (probably, some occasional invariance would get in the way), but a bit confusing.Rec
withRec <: Record
that users could reference instead. All theRecord
API would remain inRecord
. All the receiving ends of jOOQ API would continue usingRecord
. Methods would now returnRec
instead. This would be mostly source compatible (probably, some occasional invariance would get in the way), and perhaps a bit less confusing.Perhaps, other options exist.
The text was updated successfully, but these errors were encountered: