Subj : Re: Rhino1_5R41 class name creation To : Tomita Tomohiro From : Igor Bukanov Date : Thu May 29 2003 03:12 pm Tomita Tomohiro wrote: > 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? You are right about it but I am currious how long it took to trigger the overflow? > And I suggest that globalSerial value would be reset to 1 before > over-flow. > Does this measure cause any problem? It should not. Regards, Igor .