Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Why doesn't this code run?

843793May 13 2003 — edited May 14 2003
I'm just experimenting with the JSR14 generics release, but am having problems. The code below is abstracted from my application. It compiles ok, but gives a runtime error:

import java.util.*;
class A {
public static void main (String argv[]) {
ArrayList<Boolean> B = new ArrayList<Boolean>(10);
Iterator<Boolean> i = B.iterator();
boolean b = (i.next()).booleanValue();
}
}

The error is:

Exception in thread "main" java.lang.VerifyError: (class: A, method: main signature: ([Ljava/lang/String;)V) Incompatible object argument for function call


If I remove the generics code, and add the required cast, the error disappears. Anyone know what is causing this?

thanks,

Gareth

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 11 2003
Added on May 13 2003
5 comments
139 views