Subj : Rhino1_5R41 class name creation To : mozilla-jseng@mozilla.org From : tomi@osaka.niss.co.jp (Tomita Tomohiro) Date : Thu May 29 2003 08:32 am Hi There, I use Rhino1_5R41 and encountered exception as below: ----------------------------------------------------------------------- java.lang.RuntimeException: java.lang.ClassFormatError: org/mozilla/javascript/gen/c-2147483648 (Illegal Class name "org/mozilla/javascript/gen/c-2147483648") at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java:113) at org.mozilla.javascript.Context.compile(Context.java:2018) at org.mozilla.javascript.Context.compile(Context.java:1948) at org.mozilla.javascript.Context.compileReader(Context.java:899) at Rhino.compile(Test.java:65) at Test.main(Test.java:27) ----------------------------------------------------------------------- org.mozilla.javascript.optimizer.OptClassNameHelper#getJavaScriptClassName() is used to name the Java class compiled from javaScript. In the OptClassNameHelper#getJavaScriptClassName(), the globalSerial value is used, except function, to name the class to guarantee uniqueness of the class name. The globalSerial value type is int, and static defined, so if you continue to compile JavaScript and create JavaClass, you will reach the value of Integer.MAX_VALUE(2147483647) eventually. If you goes on, the globalSerial value turnes into Integer.MIN_VALUE (-2147483648) and compile would failed because of Java class name must not contain the '-' character. I think this is bug. Is it right? And I suggest that globalSerial value would be reset to 1 before over-flow. Does this measure cause any problem? Regards, Tomohiro _________________________ http://www.niss.co.jp/ _______________________________ Tomohiro Tomita Email:tomi@osaka.niss.co.jp EMBEDDED SOLUTION BUSINESS DIV NISSIN SOFTWARE CORP. CENTRAL SHIN-OSAKA BUILDING 4-5-36,MIYAHARA TEL:81-6-6350-3121 YODOGAWA-KU OSAKA 532-0003 JAPAN FAX:81-6-6350-3129 _________________________ http://www.niss.co.jp/ _______________________________ .