Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    21
  • comments
    30
  • views
    12197

backlogged entry #1

Sign in to follow this  
pinacolada

299 views

I broke java! The following code:


class Test
{
static public void main(String[] args)
{
HashMap hashmap = new HashMap();
long useless_number = 0;
useless_number += hashmap.get(0);
}
}


gave me this error:

An exception has occurred in the compiler (1.5.0-beta). Please file a bug at the Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.ArrayIndexOutOfBoundsException: -1
at com.sun.tools.javac.jvm.Code$State.pop(Code.java:1509)
at com.sun.tools.javac.jvm.Code.emitop1w(Code.java:871)
at com.sun.tools.javac.jvm.Items$LocalItem.store(Items.java:387)
at com.sun.tools.javac.jvm.Items$AssignItem.drop(Items.java:665)
at com.sun.tools.javac.jvm.Gen.visitExec(Gen.java:1599)
at com.sun.tools.javac.tree.Tree$Exec.accept(Tree.java:734)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:651)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:686)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:672)
at com.sun.tools.javac.jvm.Gen.genStats(Gen.java:723)
at com.sun.tools.javac.jvm.Gen.visitBlock(Gen.java:970)
at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:540)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:651)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:686)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:672)
at com.sun.tools.javac.jvm.Gen.genLoop(Gen.java:1016)
at com.sun.tools.javac.jvm.Gen.visitForLoop(Gen.java:987)
at com.sun.tools.javac.tree.Tree$ForLoop.accept(Tree.java:586)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:651)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:686)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:672)
at com.sun.tools.javac.jvm.Gen.genStats(Gen.java:723)
at com.sun.tools.javac.jvm.Gen.visitBlock(Gen.java:970)
at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:540)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:651)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:686)
at com.sun.tools.javac.jvm.Gen.genMethod(Gen.java:908)
at com.sun.tools.javac.jvm.Gen.visitMethodDef(Gen.java:844)
at com.sun.tools.javac.tree.Tree$MethodDef.accept(Tree.java:482)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:651)
at com.sun.tools.javac.jvm.Gen.genClass(Gen.java:2177)
at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:325)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:467)
at com.sun.tools.javac.main.Main.compile(Main.java:593)
at com.sun.tools.javac.main.Main.compile(Main.java:545)
at com.sun.tools.javac.Main.compile(Main.java:44)
at com.sun.tools.javac.Main.main(Main.java:35)


WOO. Obviously it has something to do with the new unboxing stuff (the bug doesn't occur if I try to unbox to an int, only to a long). And I guess the compiler is technically a beta version. But still I feel proud.
Sign in to follow this  


2 Comments


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!