Bug 73531 - VerifyError using generics and direct array access
Summary: VerifyError using generics and direct array access
Status: RESOLVED DUPLICATE of bug 73530
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-09 07:01 EDT by Christoph Lembeck CLA
Modified: 2004-09-09 07:02 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Lembeck CLA 2004-09-09 07:01:14 EDT
Accessing arrays directly after reading them out of a collection like a Vector 
leads to a VerifyError using Integration Build I20040907. The problem can be 
reproduced using the following code:

import java.util.Vector;
public class VMTest{
  public static void main(String[] args){
    Vector<Integer[]> v = new Vector<Integer[]>();
    Integer[] array1 = new Integer[5];
    array1[0] = new Integer(17);
    array1[1] = new Integer(42);
    v.add(array1);
    Integer twentyfour = v.get(0)[1];  // responsible for the crash
    System.out.println(twentyfour);
  }
}

Replacing the line
  Integer twentyfour = v.get(0)[1];
by the two lines
  Integer[] array2 = v.get(0);
  Integer twentyfour = array2[1];
will fix the problem, but i think the original code should work as well...

The error message is:
java.lang.VerifyError: (class: VMTest, method: main signature: 
([Ljava/lang/String;)V) Expecting to find array of objects or arrays on stack
Exception in thread "main"
Comment 1 Christoph Lembeck CLA 2004-09-09 07:02:44 EDT

*** This bug has been marked as a duplicate of 73530 ***