I'm working on an enterprise application. It was working fine earlier when the system had JDK1.6.+. I upgraded my JDK to 1.7.+. After that, I'm getting the error:
Caused by: java.lang.ClassCastException: javax.swing.KeyStroke cannot be cast to java.lang.Comparable
at java.util.TreeMap.compare(Unknown Source)
at java.util.TreeMap.put(Unknown Source)
at java.util.TreeSet.add(Unknown Source)
Although I have solved my problem by switching between the JDK versions. I want to understand why the error is coming after upgrading to JDK 7. Obviously, there would be some changes in the implementation.But I want to understand that. I tried to check the Documentation of keystroke class. But I got nothing related to this.
Can someone explain this? Thanks in advance.