United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6654481 Bridge methods cause failures of JavaScript -> Java calls
6654481 : Bridge methods cause failures of JavaScript -> Java calls

Details
Type:
Bug
Submit Date:
2008-01-24
Status:
Closed
Updated Date:
2010-09-08
Project Name:
JDK
Resolved Date:
2008-06-13
Component:
deploy
OS:
generic
Sub-Component:
plugin
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u10
Fixed Versions:
6u10

Related Reports

Sub Tasks

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
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/
                                     
2008-01-24
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.
                                     
2008-01-24



Hardware and Software, Engineered to Work Together