Created
August 3, 2015 08:30
-
-
Save raphw/7d10ae082ace5886d601 to your computer and use it in GitHub Desktop.
FinalVisibilityBridge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package foo; | |
public class Foo extends Base { | |
} | |
class Base { | |
public final void foo() { | |
} | |
public void bar() { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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