Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4368664

VerifyError when using array of arrays

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      mantis
    • CPU:
      x86
    • OS:
      windows_98, windows_nt

      Description



      Name: tb29552 Date: 09/06/2000


      /*
      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      The "javac" compiler accept the following code, but "java" throws a VerifyError:

      */
      public class ArrayTest {
          public static void main(final String[] args) {
          }

          private static void neverCalled() {
              float[][] channels = null;
              channels[0] = resize(channels[0]);
          }

          private static float[] resize(final float[] array) {
              return null;
          }
      }
      /*

      When I try to run this code (with "java Test"), I get the following message:

      Exception in thread "main" java.lang.VerifyError: (class: Test, method:
      neverCalled signature: ()V) Incompatible types for storing into array of arrays
      or objects

      A work around is to replace "float[][] channels=null" by "float[][]
      channels=float[0][]". The problem is that in my complete class, "channels" was
      lazily created only when needed.

      Thanks,

      */

      (Review ID: 106837)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gafter Neal Gafter
              Reporter:
              tbell Tim Bell
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: