Quantcast
Viewing all articles
Browse latest Browse all 5661

IntelliJ 13 Java 8 Compilation issue

Hi,

 

after starting IntelliJ 13 the following Java 8 code wouldn't compile anymore. Works without issues in v12 (and runs in Unit-Tests as well):

 

    public<T> Validator validate(T object, Class<?>... groups) {        // ...        Set<Violation> violations = constraintViolations.stream().map(this::convertToResult).collect(Collectors.toSet());        // ...    }     private<T> Violation convertToResult(ConstraintViolation<T> violation) {        // ...        returnnew Violation();    }

 

The Problem seems to be related to generic type detection on the violations assignment. It says the right-hand-side would return a Set<Object>, and nothing I tried would convince it otherwise.


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>