You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2015/03/18 08:11:38 UTC

[jira] [Updated] (OGNL-249) Ognl.GetMethods does not return default methods in interfaces (new java 8 feature)

     [ https://issues.apache.org/jira/browse/OGNL-249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart updated OGNL-249:
-------------------------------
    Fix Version/s: 4.0

> Ognl.GetMethods does not return default methods in interfaces (new java 8 feature)
> ----------------------------------------------------------------------------------
>
>                 Key: OGNL-249
>                 URL: https://issues.apache.org/jira/browse/OGNL-249
>             Project: Commons OGNL
>          Issue Type: Bug
>          Components: Core Runtime
>    Affects Versions: 3.0
>         Environment: Java 8, OSX, likely all environments tho.
>            Reporter: Tim Wright
>             Fix For: 4.0
>
>
> Hi,
> I'm a contributor to an open source automated test framework called "Concordion". We use OGNL internally to evaulate test specifications. One of our users has reported a bug where Concordion cannot call default interface methods. We've traced the problem to OGNL - the OgnlRuntime.getMethods method is not returning default implementations of interface methods. We've verified the behaviour in OGNL versions 2.6.9 and 3.0.9.
> Consider the following interface and junit test file. The test fails. But it probably should not.
> // INTERFACE
> package org.concordion;
> public interface InterfaceWithDefaults {
>     default public void defaultMethod() { }
> }
> // TEST CLASS
> package org.concordion;
> import ognl.OgnlRuntime;
> import org.junit.Test;
> import static org.junit.Assert.assertNotNull;
> public class TestDefaultMethods implements InterfaceWithDefaults {
>     @Test
>     public void testDefaultMethod() {
>         defaultMethod();
>         assertNotNull(OgnlRuntime.getMethods(TestDefaultMethods.class, "defaultMethod", false));
>     }
> }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)