groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Schalk Cronjé <>
Subject Java does not see method implemented in Groovy
Date Mon, 23 Apr 2018 10:05:43 GMT
Hi all,

I have build an hierarchy that effectively looks like:

    Abstract Base #1 (Java)
    Abstract Base #2 (Groovy, CompileStatic)
    Abstract Base #3 (Groovy, CompileStatic)
    Abstract Base #4 (Groovy, CompileStatic) <- Implements methodA from
    Abstract Base #1
         ^                ^                 ^
         |                |                 |
    ExampleG (Groovy)    ExampleJ (Java)   ExampleK (Kotlin)

Finally there are three examples - one each in  Groovy, Java and otlin 
example. They extend #4 with concrete classes. The Groovy and Kotlin 
examples compile fine, but the Java complains that methodA is not 
implemented. The real signature of methodA is actually

    SeekableByteChannel newByteChannel(Path path, Set<? extends
    OpenOption> options, FileAttribute<?>[] attrs) throws IOException

This could be down to what the Groovy compiler (2.4.11) has done with 
the generics, but it has me me confused. I am even more surprised that 
only the Java compiler complains and not the Kotlin compiler.  In 
IntelliJ this is not flagged up as an issue either. It only occurs when 
compiling the project with Gradle.

I know my example is slightly vague, but it removes all of the noise. 
The actual code of the offending class is here ->

Now I'm hoping if anyone has seen issues like this before or have an 
idea where I can start diagnosing it.

Schalk W. Cronjé
Twitter / Ello / Toeter : @ysb33r

View raw message