Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-761

Can not reference a property declared in a super-interface and implemented in a non-public class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • 1.6.3
    • None
    • Engine
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              carlfish Charles Miller
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: