[checkstyle-5.5] Unexpected token: type Unexpected token: <

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[checkstyle-5.5] Unexpected token: type Unexpected token: <

SpiX
This post was updated on .
Seems like there is a problem with check of this type of code with generics:

private someClass() {
        SomeType type = new SomeType () {
            public <T extends SomeOther> List<T> method(SomeOtherType type) {
                List<Other> somelist  = ClassType.getSomething();
                return (List<T>) somelist;
            }
        };

Exception is :
Unexpected token: type
Unexpected token: <

Bug was found in several different unconnected projects.