line number of bridge method

Mike Duigou openjdk at duigou.org
Tue Dec 9 22:55:04 UTC 2014


Would it be possible to have the debug line number of a bridge method be 
the line number of the method it is a bridge for rather than the first 
line of the class?

java.lang.ClassCastException: java.lang.Byte cannot be cast to 
java.lang.String
at com.foo.bar.MyHashMap.put(MyHashMap.java:18)

MyHashMap is declared as "extends HashMap<String,Object>" so there is a 
put(String, Object) bridge method in addition to the put(Object, Object) 
method.

Understandably if MyHashMap were to not override put(Object, Object) and 
just use HashMap's implementation it would probably be necessary to use 
the current "first line of the class" solution for the put(String, 
Object) bridge method.

Cheers,

Mike



More information about the compiler-dev mailing list