Skip to content

Instantly share code, notes, and snippets.

@raphw
Created August 3, 2015 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raphw/7d10ae082ace5886d601 to your computer and use it in GitHub Desktop.
Save raphw/7d10ae082ace5886d601 to your computer and use it in GitHub Desktop.
FinalVisibilityBridge
package foo;
public class Foo extends Base {
}
class Base {
public final void foo() {
}
public void bar() {
}
}
package net.bytebuddy;
public class VisibilityBridgeTest {
@Test
public void testFinalMethod() throws Exception {
Foo.class.getMethod("foo").invoke(new Foo()); // fails
}
@Test
public void testNonFinalMethod() throws Exception {
Foo.class.getMethod("bar").invoke(new Foo()); // works
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment