Error compiling in IntelliJ IDEA: “No MessageCollector”

Promoting the answer in the comments to an answer, because it’s the actual answer: This appears to be a bug in the IntelliJ Kotlin plugin v1.2.40 and how it interacts with Java 10. See here. The solution is to upgrade to v1.2.41. (Don’t switch your project to building with Gradle like the other answer suggests … Read more

Method in the type Map is not applicable

? extends Object You are using generic wildcard. You cannot perform add operation as class type is not determinate. You cannot add/put anything(except null). For more details on using wildcard you can refer oracle docs. Collection<?> c = new ArrayList<String>(); c.add(new Object()); // Compile time error Since we don’t know what the element type of … Read more

Java ternary operator influence on generics type inference

Compiles for me fine in java 8. Earlier versions of Java might need more help return retval == null ? Collections.<String>emptyList() : retval; should work. EDIT This is due to improvements in Java 8 type inference as explained here http://openjdk.java.net/jeps/101 And here’s a blog with the highlights: http://blog.jooq.org/2013/11/25/a-lesser-known-java-8-feature-generalized-target-type-inference/

Package conflicts with automatic modules in Java 9

Am I using the new module system correctly? Yes. What you are seeing is intended behavior, and this is because JPMS modules do not allow split packages. In case you are not familiar with the term “split packages” it essentially means two members of the same package coming from two different modules. For example: com.foo.A … Read more