Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-JSR-2
-
None
-
None
-
WinXP
Description
I have build a subclass of java.lang.Exception which calls the super constructor of Exception with a String parameter.
When instanciating the class I get an class cast error.
class ExceptionSubclass extends Exception {
ExceptionSubclass(String s)
public static void main(String[] args) { println new ExceptionSubclass("s") }
}
I get the error: Caught: java.lang.ClassCastException: java.lang.String
If I create a java helper class which is a subclass of Exception everything works find:
public class JavaException extends Exception { //Java
public JavaException(String s) { super(s);}
}
class ExceptionSubclass extends JavaException { // Groovy
ExceptionSubclass(String s) { super(s) }
public static void main(String[] args)
{ println new ExceptionSubclass("s") }}