]> source.dussan.org Git - aspectj.git/commitdiff
Fix for Bugzilla Bug 43792: Illegal Opcode Detected
authorehilsdal <ehilsdal>
Thu, 29 Jan 2004 12:24:02 +0000 (12:24 +0000)
committerehilsdal <ehilsdal>
Thu, 29 Jan 2004 12:24:02 +0000 (12:24 +0000)
weaver/testsrc/BcweaverModuleTests.java
weaver/testsrc/LocaleTest.java [new file with mode: 0644]

index 2544a545fac549418477e3f20f90017dc0fd8e7d..82ea4979f59d184e1786928657566ffe43616662 100644 (file)
@@ -22,6 +22,7 @@ public class BcweaverModuleTests extends TestCase {
         suite.addTest(org.aspectj.weaver.bcel.BcelTests.suite()); 
         suite.addTest(org.aspectj.weaver.BcweaverTests.suite()); 
         suite.addTest(org.aspectj.weaver.patterns.PatternsTests.suite()); 
+        suite.addTestSuite(LocaleTest.class);
         return suite;
     }
 
diff --git a/weaver/testsrc/LocaleTest.java b/weaver/testsrc/LocaleTest.java
new file mode 100644 (file)
index 0000000..1dba3f7
--- /dev/null
@@ -0,0 +1,41 @@
+import java.io.IOException;
+import java.util.Locale;
+
+import junit.framework.TestCase;
+
+import org.apache.bcel.generic.Instruction;
+import org.apache.bcel.util.ByteSequence;
+
+public class LocaleTest extends TestCase {
+
+       public LocaleTest(String name) {
+               super(name);
+       }
+
+       public void testNormalLocale() {
+               doBipush();             
+       }
+
+       public void testTurkishLocale() {
+               Locale def = Locale.getDefault();
+               Locale.setDefault(new Locale("tr"));
+               try {
+                       doBipush();
+               } finally {
+                       Locale.setDefault(def);
+               }
+       }
+       
+       private static void doBipush() {
+               try {
+                       Instruction.readInstruction(
+                                               new ByteSequence(new byte[] { 
+                                                       (byte)16, // bipush 
+                                                       (byte) 3  // data for bipush
+                                                       }));
+               } catch (IOException e) {
+                       throw new RuntimeException(e);
+               }
+       }
+}
+