JDK-6654481 : Bridge methods cause failures of JavaScript -> Java calls
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-01-24
  • Updated: 2010-09-08
  • Resolved: 2008-06-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u10 b12Fixed
Description
If a generic data type is returned from Java to JavaScript (for example, a subclass of one of the List implementations), and this subclass overrides a method causing a bridge method to be generated by javac, and this method is attempted to be invoked from JavaScript, then the new plug-in will report an ambiguous invocation because it appears that multiple methods all satisfy the incoming argument list.

This issue was reported on the java.net forum:

http://forums.java.net/jive/thread.jspa?threadID=35144&tstart=0

Comments
EVALUATION The reflective invocation path handling JavaScript-to-Java calls was substantially rewritten in the new Java Plug-In for better correctness and efficiency. However, a regression was discovered by a customer in the situation where so-called "bridge" methods exist. In this case, multiple methods in the Java class file match the incoming set of arguments, but all but one of these are synthetic "bridge" methods produced by javac. We can handle this case explicitly without reducing the precision of the new plug-in's error reporting by simply filtering out bridge methods from those we consider invoking during JavaScript-to-Java calls.
24-01-2008

SUGGESTED FIX http://sa.sfbay.sun.com/projects/deployment_data/6u10/6654481.0 testcase: http://j2se.east.sun.com/deployment/www/tests/1.6.0_10/6654481/
24-01-2008