JDK-8006644 : Bridge testing framework
  • Type: Sub-task
  • Component: tools
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-01-21
  • Updated: 2013-01-28
  • Resolved: 2013-01-28
Related Reports
Cloners :  
Description
Create a tool which removes bridge method and injects an attribute.

------Description from email------

The problem we're trying to test is support for bridge method generation in the VM.  Recall that there are several cases where javac generates "bridge" methods:

interface Foo<T> {
    void accept(T t);
}

class Moo implements Foo<STring> {
    void accept(STring s) { ... }
}

Now, the erases signature for Foo.accept is accept(Object)V, so the compiler generates a bridge method:

    void accept(Object o) { accept((String) o); }

Similarly the compiler generates a bridge when there are covariant overrides.  Such methods (I believe) have the ACC_BRIDGE bit set.

Keith wrote support for enabling bridging all methods in the VM, which is triggered by the presence of a classfile attribute.  To test it, one way we can do this is to strip bridges out of classes and inject this attribute, and run regular tests.

So what we'd need is another mini-mangler to remove all methods tagged with ACC_BRIDGE, and add the "please bridge me" attribute into all classes.



Comments
Handed off to Karen
28-01-2013

Work is almost complete need spec for attribute, and need to add static instrumentation.
21-01-2013