Search |
||
First Java SE 6 bug!Posted by mister__m on January 11, 2007 at 4:13 PM PST
As genesis 3.0 is approaching Release Candidate, I decided to test it using the newly released Java SE 6. I ran the test suite and a single test failed, one involving script evaluation (I've blogged about genesis script support almost two years ago).
Since JSR-223 was about to become part of Java SE 6, we've added support for it six months ago. By that time, either the test worked or it hadn't been written yet, but the genesis useradmin sample was running flawless. Well, I've filed a bug in genesis issue tracker and after some investigation, narrowed the problem to its real cause.
Basically, you cannot invoke a static method that overloads an instance method using
variable.method(arg0, arg1). The following test case demonstrates the problem:
This test output should be something like:
it actually is:test.FunctionsClass@14a9972 true true If you can change the script or the class being called, it is easy to work around this issue (by invoking the method on the class itself with, renaming it or rewriting it to become an instance method). However, if you cannot, you better use Rhino directly. When I run the same test using BSF over Rhino, it works. For future reference, this has been filed as bug # 6512123 (it might take one or two days for it to show up). Let's hope the fix make it to Java SE 6 Update 1. :-)test.FunctionsClass@14a9972 true Exception in thread "main" javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException: Can't find method java.lang.Object.equals(string,string). ( »
Related Topics >>
J2SE Comments
Comments are listed in date ascending order (oldest first)
|
||
|
|