Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-382

Cast to int[] fails at runtime

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-5
    • 1.0-beta-10
    • class generator
    • None

    Description

      o = (Object)new int[]

      { 1, 2, 3 }

      ;
      a = (int[])o;
      println a.class.getName();

      fails at runtime (on line "a = ...") with:
      java.lang.NoClassDefFoundError: int
      at testing.run()Ljava.lang.Object;(testing.gr:3)
      at COM.jrockit.reflect.NativeMethodInvoker.invoke0(ILjava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Native Method)
      at COM.jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at COM.jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(Ljava.lang.Object;Lgroovy.lang.MetaMethod;[Ljava.lang.Object;)Ljava.lang.Object;(MetaClass.java:977)
      at groovy.lang.MetaClass.invokeMethod(Ljava.lang.Object;Ljava.lang.String;[Ljava.lang.Object;)Ljava.lang.Object;(MetaClass.java:285)
      at groovy.lang.MetaClass.invokeMethod(Ljava.lang.Object;Ljava.lang.String;Ljava.lang.Object;)Ljava.lang.Object;(MetaClass.java:262)

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            cpoirier Chris Poirier
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: