Return-Path: Delivered-To: apmail-jakarta-bcel-user-archive@www.apache.org Received: (qmail 25043 invoked from network); 25 May 2009 17:50:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 May 2009 17:50:36 -0000 Received: (qmail 95635 invoked by uid 500); 25 May 2009 17:50:48 -0000 Delivered-To: apmail-jakarta-bcel-user-archive@jakarta.apache.org Received: (qmail 95589 invoked by uid 500); 25 May 2009 17:50:48 -0000 Mailing-List: contact bcel-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "BCEL Users List" Reply-To: "BCEL Users List" Delivered-To: mailing list bcel-user@jakarta.apache.org Received: (qmail 95579 invoked by uid 99); 25 May 2009 17:50:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 May 2009 17:50:48 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 May 2009 17:50:38 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1M8eJV-0006ti-0W for bcel-user@jakarta.apache.org; Mon, 25 May 2009 10:50:17 -0700 Message-ID: <23710707.post@talk.nabble.com> Date: Mon, 25 May 2009 10:50:17 -0700 (PDT) From: Razvanica To: bcel-user@jakarta.apache.org Subject: ArrayIndexOutOfBoundsException in generic.PUTFIELD MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: mos_februarie@yahoo.fr X-Virus-Checked: Checked by ClamAV on apache.org Hello all, Here's my problem. I am trying to make some network simulations using a tool called JiST/SWANS. This simulator has been written for Java 1.4 and, for my simulations, I would like to use some 1.5 features, like genericity. So what I am trying to do is to compile the original code with the "source -1.5" tag instead of the "source -1.4" tag. The problem is that the simulator uses bcel to rewrite the bytecode so that JVM could be used for simulations. The bcel library in the release doesn't work with the "source -1.5" tag so I replace it with bcel-5.2. I made 2 minor modifications to the original code : - I have added an implementation of getClassPath in a class that implements org.apache.bcel.util.Repository. This class just returns null, just like in org.apache.bcel.util.ClassLoaderRepository - In a class using org.apache.bcel.Repository.lookupClass() I am now throwing java.lang.ClassNotFoundException These 2 modifications shouldn't change anything as far as I understand the application. And when I compile the new code with the "-source 1.4" tag, it doesn,t change anything. Everything compiles and works just fine. However, when I compile the new code with the "-source 1.5" tag the compilation goes smoothly, but, at runtime, the rewriter throws an ArrayIndexOutOfBoundsException. This happens every time org.apache.bcel.generic.PUTFIELD.accept is called: java.lang.ArrayIndexOutOfBoundsException: -1 at java.util.ArrayList.remove(ArrayList.java:390) at org.apache.bcel.verifier.structurals.OperandStack.pop(OperandStack.java:135) at org.apache.bcel.verifier.structurals.ExecutionVisitor.visitPUTFIELD(ExecutionVisitor.java:1048) at org.apache.bcel.generic.PUTFIELD.accept(PUTFIELD.java:78) Does anybody have any idea what happens and if there's something I could do to fix this? Thank you. -- View this message in context: http://www.nabble.com/ArrayIndexOutOfBoundsException-in-generic.PUTFIELD-tp23710707p23710707.html Sent from the BCEL - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: bcel-user-help@jakarta.apache.org