Uploaded image for project: 'Shiro'
  1. Shiro
  2. SHIRO-817

CommonsInterpolator does not follow javadoc

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Resolved
    • 1.7.1
    • 2.0.0-alpha
    • Configuration
    • None

    Description

      The stated behavior is not the observed.

      This is a complement to: apache/shiro-site#82

      Relevant code is

      The relevant section of the commons-configuration class is:

      After an instance has been created it does not contain any Lookup objects. The current set of lookup objects can be modified using the registerLookup() and deregisterLookup() methods. Default lookup objects (that are invoked for variables without a prefix) can be added or removed with the addDefaultLookup() and removeDefaultLookup() methods respectively. (When a ConfigurationInterpolator instance is created by a configuration object, a default lookup object is added pointing to the configuration itself, so that variables are resolved using the configuration's properties.)

      So, the correct behavior is that you can use ${const:java.awt.event.KeyEvent.VK_ENTER} but not ${env:EDITOR}. The current code accepts ${EDITOR}. If a system property with this name is found not null, it is used, if not, an environment variable is search and if not, the whole substitution ${EDITOR} is returned.

      As I suppose no one wants to break existing code with the correct behavior, I think it's better to just update the javadoc. I'll open a pull request with that.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              weltonrodrigo Welton Rodrigo Torres Nascimento
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m