[rfc][icedtea-web] Rewrite of MethodOverloadResolver

Adam Domurad adomurad at redhat.com
Fri Dec 14 12:43:26 PST 2012


Thought I'd do a simple patch to turn the test code embedded in 
MethodOverloadResolver into a a proper unit test ... unfortunately, my 
small look into this class lead me to find many subtle bugs -- and 
coincidentally decide to do it properly. Lots of corner cases covered, 
and it could probably use unit tests even still, but its a major 
improvement and I'm a bit tired of looking at it so I'm posting it.

Some broken things I uncovered included improper overloading order, 
method/argument situations that would error-out if they ever occurred 
(but were valid), and the fact that the JSObject used throughout the 
class was actually a dummy value used at the bottom of the class. The 
code was also made a lot cleaner in the process, in the interest of 
'doing it right' while fixing it.
ChangeLog:
2012-12-14  Adam Domurad  <adomurad at redhat.com>

     Rewrite of MethodOverloadResolver with detailed unittests.
     * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java:
     Rewritten to reduce duplicated code, fix very subtle bugs in
     never-tested codepaths, obey spec properly. Introduced new helper types
     where Object[] arrays with special-meaning positions were passed
     around.
     * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java:
     Updated to work with newly introduced types / refactored overload
     resolver.
     * tests/netx/unit/sun/applet/MethodOverloadResolverTest.java: In-depth
     unit tests of hairy details of method overloading in JS<->Java.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: method-overload-resolver.patch
Type: text/x-patch
Size: 62296 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121214/3ccffe3d/method-overload-resolver.patch 


More information about the distro-pkg-dev mailing list