Home > Software design >  Cannot compile maven Spring Boot project after jOOQ version upgrade
Cannot compile maven Spring Boot project after jOOQ version upgrade

Time:08-06

After upgrading to the commercial 3.16.8 version of jOOQ (org.jooq.pro-java-8) my maven compile stage start to fail. Same result is noticeable when upgrading to java-11.

What I found out is that the new version does not work with the following structure.

Select sql = ....;
List<CustomTypeClass> result = sql.fetch(this::recordToCustomTypeClass);

where recordToCustomTypeClass is a function that takes Record and transform it to a CustomTypeClass.

Does anyone knows why this is no longer applicable?

The error with java 8 is general java error, with java 11 we have more direct message.

JAVA 8:

java: An exception has occurred in the compiler (1.8.0_251). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you. java: java.lang.AssertionError4

JAVA 11: functional interface not applicable

CodePudding user response:

You seem to be using raw types with the jOOQ API (i.e. Select rather than Select<?>, or some explicit type bound). This is rarely a good idea both with jOOQ or with Java in general. In the case of jOOQ, the API explicitly excludes maintaining raw type backwards compatibility, which would be exceptionally hard to achieve, see e.g.:

You should be able to fix this issue by avoiding raw types.

  • Related