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) {
// ...
return new 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.
请先登录再写评论。
Please watch/vote http://youtrack.jetbrains.com/issue/IDEA-118437
Thanks