Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.1-rc-3
-
None
-
None
Description
Try this Java Code with Java 1.4:
GString gstring = (GString) new GroovyShell().evaluate("\"${2*2}1\""); String string = "41"; System.out.println(gstring.compareTo(string)); // 0 System.out.println(string.compareTo(gstring)); // ClassCastException
With Java 1.5 you get a compile error for string.compareTo(gstring), as Comparable uses Generics in Java 5. But still the commutativity is destroyed and it gives you no runtime safety, as we all no.
This is part of the gstring – string equality discussion.