Summary: | Illegal Opcode Detected | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Umit VARDAR <vardaru> |
Component: | Compiler | Assignee: | Erik Hilsdale <eh-ajdev> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | blocker | ||
Priority: | P2 | CC: | adrian.colyer |
Version: | 1.1.1 | ||
Target Milestone: | 1.2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Umit VARDAR
2003-09-27 10:31:28 EDT
Moved to AspectJ project. Okay, this sure looks like a BCEL error. Looking at org.apache.bcel.generic.Instruction.className(short) they definitely use toUpperCase(), which was very helpfully suggested as a problem call in the Turkish locale. (as a side note, BCEL is using _reflection_ to instantiate its bytecode operations! What the hell happened to programmers' brains? Because reflection is available they should use it instead of a dispatch table with EXTREMELY well-specified entries? It took _effort_ to be that lazy! I wouldn't even use eval to accomplish this task in Scheme! Okay, rant over) We may have to check in our own patched version of BCEL to handle this problem. I'm investigating whether the BCEL folks know about this problem. Leaving as P2; we should definitely fix this before 1.2. Thanks very much to Umit Vardar for the bug report. -erik Submitted the bug to BCEL folks yesterday, and a test case (for BCEL) today: import java.io.IOException; import java.util.Locale; import org.apache.bcel.generic.Instruction; import org.apache.bcel.util.ByteSequence; public class LocaleTest { public static void main(String[] args) throws IOException { printBipush(); Locale.setDefault(new Locale("tr")); printBipush(); // this throws an exception! } static void printBipush() throws IOException { Instruction ix = Instruction.readInstruction( new ByteSequence(new byte[] { (byte)16, // bipush (byte) 3 // data for bipush })); System.err.println(ix); } } I'm going to give the BCEL folks a week to address the issue before exploring whether we need to include a patched BCEL version. I couldn't find a way to pass a locale specification to _our_ command-line compiler, so I don't have a test case for this bug checked into our tree. As a side note, the workaround for this problem is to avoid writing programs that use the bytecodes: bipush, sipush, iload*, istore*, iinc, if*, put/getstatic, put/getfield, invoke*, instanceof, multianewarray so as long as you're not using integers, bytes, shorts, or conditionals, fields, or methods, this problem won't affect you at all. *grin*. Okay, this is now fixed, and we're now using a patched version of BCEL for our project. BCEL folks were no help, but I contributed the fix I used as a patch to their bug system. Test case also checked in. updating target flag to indicate inclusion in 1.2 release. |