Problem with Gradle 2.2 and Lombok 1.14.*???

518 views
Skip to first unread message

Deven Phillips

unread,
Dec 11, 2014, 10:44:45 AM12/11/14
to project...@googlegroups.com
After a while working on a different project, I came back to a Java/Gradle project I had worked on about 2 months ago. The problem I am seeing is that now when I try to compile using Gradle, I get errors everywhere I used the "val" notation for type inference.

Example:

UpdatesDAO.java:238: error: incompatible types: Field<?>[] cannot be converted to val
        val key = new Field<?>[] {


It compiles FINE in Eclipse, but when I try to compile using gradle it fails every time...

Any assistance would be greatly appreciated!

Deven

Deven Phillips

unread,
Dec 11, 2014, 12:58:59 PM12/11/14
to project...@googlegroups.com
Additional Details:

I have tried with OpenJDK 7 and Oracle Java 8

I have tried Gradle 2.2.0 and 2.2.1

I have tried Lombok versions 1.14.6 and 1.14.8

Deven Phillips

unread,
Dec 11, 2014, 1:20:59 PM12/11/14
to project...@googlegroups.com
I just tried to create a simple project to provide as an example, and I cannot reproduce the error with simple things like:

val myMap = HashMap<Integer, String>();

But in my real project, I am trying to assign from a jOOQ query DSL of type:


Map<Record, Result<Record14<String, Integer, String, String, String, String, String, String,Integer, String, Boolean, Boolean, Integer, Boolean>>>

So, it looks like the problem was nothing to do with gradle or lombok, but something to do with my imports!!! Once I imported the entire "Tables" class statically (A generated class from jOOQ) it was working again!

I hope that this helps someone in the future!

Deven

Deven Phillips

unread,
Dec 11, 2014, 1:25:51 PM12/11/14
to project...@googlegroups.com
Crap... Spoke too soon... Problem is back.. I had tried it from inside of Eclipse using the Gradle plugin and that worked, but it still doesn't work from the CLI with gradle..

Weird!

Deven

Deven Phillips

unread,
Dec 11, 2014, 1:40:22 PM12/11/14
to project...@googlegroups.com
Killing and disabling the gradle daemons had no effect. Also, clearing the gradle caches and redownloading all deps was ineffective.

DEven

Deven Phillips

unread,
Dec 16, 2014, 10:17:45 AM12/16/14
to project...@googlegroups.com
BUMP! Anyone have any ideas? PLEASE?!?!

Deven Phillips

unread,
Dec 16, 2014, 2:33:01 PM12/16/14
to project...@googlegroups.com

I have a Data Access Object written using jOOQ and it returns a rather complex type signature:

Map<Record, Result<Record14<String, Integer, String, String, String, String, String, String, Integer, String, Boolean, Boolean, Integer, Boolean>>> result = create....

I tried to replace with with Lombok's "val"

val result = create....

This works when I run/compile from Eclipse... When I try to compile within Gradle, I get:

UpdatesDAO.java:307: error: incompatible types
            .fetchGroups(key);
                        ^
  required: val
  found: Map<Record,Result<Record14<String,Integer,String,String,String,String,String,String,Integer,String,Boolean,Boolean,Integer,Boolean>>>

Can anyone tell me why it would work in Gradle for simpler types, but not for more complex types? I have other places in this same project which look something like:

val records = dao.getDatastoreById(id); // Returns a type of List<Datastore>

and they work just fine, even when compiled with Gradle... Am I missing something?

FYI: Lombok version = 1.14.8, Gradle version 2.2.1

I have tried lombok==1.14.6, Gradle version 2.2.0

I have also tried with both Java 8 and Java 7, both OpenJDK and Oracle JDK

Roel Spilker

unread,
Dec 19, 2014, 4:08:10 AM12/19/14
to project...@googlegroups.com
Hmm, I have no idea what's going on here. Can you report an issue at https://code.google.com/p/projectlombok/issues/list ?

--
You received this message because you are subscribed to the Google Groups "Project Lombok" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-lombo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Deven Phillips

unread,
Dec 19, 2014, 6:45:08 AM12/19/14
to project...@googlegroups.com
OK, I have submitted issue 762: Lombok "val" inference works when compiled by Eclipse but fails when compiled by Gradle

In the meantime, I have removed the "val" instances which are failing from my code so that it will compile in our CI/CD environment..

Cheers,

Deven

--
You received this message because you are subscribed to a topic in the Google Groups "Project Lombok" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/project-lombok/t7MM6uqmRy8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to project-lombo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages