I've just tried upgrading my project to Java 15, and now I get the following error:
both interface org.jooq.Record in org.jooq and class java.lang.Record in java.lang match
Does anybody have some experience resolving this issue?
I've just tried upgrading my project to Java 15, and now I get the following error:
both interface org.jooq.Record in org.jooq and class java.lang.Record in java.lang match
Does anybody have some experience resolving this issue?
On
Java 14 introduced records. java.lang.Record is a superclass of record which is conflicting with org.jooq.Record since every type in java.lang is auto imported. There are two solutions:
Record and remove the import. Eg: org.jooq.Record instead of Record. (Don't forget to remove the import statement).org.jooq.Record to something specific. (Which I believe is not possible in your case as it's a third-party library.)
In addition to what Aniket already said:
Import-on-demand no longer works for
RecordThe recommendation is to add an explicit import to your import-on-demand statement:
Or to stop using import-on-demand entirely. E.g. in Eclipse, you can use the "Organize Imports" feature to expand all your import-on-demand statements to explicit imports, depending on the types you're actually using.
Using type inference
Another way to prevent this problem if it happens with local variables is to use
var:Now you don't have to import the type. This doesn't work with member types, method parameter and return types, of course.
We'll try to better document this: https://github.com/jOOQ/jOOQ/issues/10646