Symptoms
IntelliJ IDEA displays a false error or warning on valid Java ternary expressions. The code compiles and runs correctly, but the editor highlights it as an error.
import java.util.Objects;
public class TestInteger {
public static void main(String[] args) {
Integer mainstatus = Objects.equals(1, 2)
? (
Objects.equals(new Integer(4), 1) ? 2 : 3
)
: Objects.equals(1, 3) ? 0 : 4 + 2;
System.out.println(mainstatus);
}
}
Cause
This issue is caused by the third-party Manifold plugin (manifold-ij), which interferes with IntelliJ IDEA's built-in Java code analysis.
Resolution
-
Disable the Manifold plugin:
- Go to Settings | Plugins | Installed
- Find manifold-ij and uncheck it
- Restart IntelliJ IDEA
-
If you need the Manifold plugin functionality, report the issue to the plugin's issue tracker: https://github.com/manifold-systems/manifold/issues
Notes
- Invalidating caches (File | Invalidate Caches) does not resolve this issue since the root cause is the plugin, not corrupted caches.
- The issue was confirmed by examining IDE logs, which revealed the Manifold plugin as the source of the incorrect error highlighting.
Comments
0 comments
Please sign in to leave a comment.