You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Claude Brisson (JIRA)" <ji...@apache.org> on 2016/07/17 08:00:31 UTC

[jira] [Closed] (VELOCITY-761) Can not reference a property declared in a super-interface and implemented in a non-public class

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

Claude Brisson closed VELOCITY-761.
-----------------------------------
    Resolution: Not A Bug

> Can not reference a property declared in a super-interface and implemented in a non-public class
> ------------------------------------------------------------------------------------------------
>
>                 Key: VELOCITY-761
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-761
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.3
>            Reporter: Charles Miller
>
> Consider the following:
> public interface MyUser extends java.security.Principal { 
>      String getEmailAddress();
>  }
> class MyUserImpl implements MyUser {
>     public String getName() { ... }
>     public String getEmailAddress() { ... }
> }
> If I put a MyUserImpl in my Velocity context, $user.emailAddress will resolve, but $user.name will not.
> This is a problem with ClassMap#createMethodCache(). It ignores methods declared on the MyUserImpl class because the class is non-public, and it only looks up one level in the Interface hierarchy for methods defined on interfaces: so it will go up as far as the MyUser interface but not as far as the Principal interface.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org