Please note: Even though this question specifically addresses Netflix' Hystrix library, this is definitely a pure Groovy/JVM generics question at heart. Any battle-weary Java/Groovy veteran should be able to answer this, regardless of their knowledge/experience with Hystrix.
I want to build an abstract base HystrixCommand
to return Guava Optionals
as their generic RESULT
type:
import com.google.common.base.Optional
import com.netflix.hystrix.HystrixCommand
abstract class BaseHystrixCommand<Optional<RESULT>> extends HystrixCommand {
// My code here...
}
However this code produces the following compiler error:
Groovy:unexpected token: < @ line 23, column 42.
Line 23 column 42 is the inner opening angle bracket for RESULT
:
...BaseHystrixCommand<Optional<RESULT...
^ right here
Using Java 8, Groovy 2.4.3, Hystrix 1.4.18 and Guava 18.0 here. Any ideas what is causing this compiler error?