-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from vlastimil-dolejs/master
fix for issue #29 - Ognl.GetMethods does not return default methods from interfaces implemented by parent class
- Loading branch information
Showing
2 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,37 @@ | ||
package ognl; | ||
|
||
import java.util.List; | ||
|
||
import junit.framework.TestCase; | ||
|
||
import java.util.List; | ||
public class Java8Test extends TestCase { | ||
|
||
public class Java8Test extends TestCase /* implements InterfaceWithDefaults */ { | ||
public void testDefaultMethodOnClass() { | ||
/* defaultMethod(); */ | ||
List defaultMethod = OgnlRuntime.getMethods(ClassWithDefaults.class, "defaultMethod", false); | ||
assertNotNull(defaultMethod); | ||
} | ||
|
||
public void testDefaultMethod() { | ||
public void testDefaultMethodOnSubClass() { | ||
/* defaultMethod(); */ | ||
List defaultMethod = OgnlRuntime.getMethods(Java8Test.class, "defaultMethod", false); | ||
List defaultMethod = OgnlRuntime.getMethods(SubClassWithDefaults.class, "defaultMethod", false); | ||
assertNotNull(defaultMethod); | ||
} | ||
|
||
} | ||
|
||
class SubClassWithDefaults extends ClassWithDefaults { | ||
|
||
} | ||
|
||
class ClassWithDefaults /* implements InterfaceWithDefaults */ { | ||
|
||
} | ||
|
||
/** | ||
* This won't work till switching to Java 8 | ||
* | ||
interface InterfaceWithDefaults { | ||
default public void defaultMethod() { } | ||
} | ||
*/ | ||
*/ |