[logback-dev] [JIRA] Created: (LBCORE-238) Small refactoring of ch.qos.logback.core.joran.action.PropertyAction#stringToScope

Sebastian Davids (JIRA) noreply-jira at qos.ch
Thu Dec 1 04:09:12 CET 2011


Small refactoring of ch.qos.logback.core.joran.action.PropertyAction#stringToScope
----------------------------------------------------------------------------------

                 Key: LBCORE-238
                 URL: http://jira.qos.ch/browse/LBCORE-238
             Project: logback-core
          Issue Type: Improvement
          Components: Joran
    Affects Versions: 1.0.0
            Reporter: Sebastian Davids
            Assignee: Logback dev list
            Priority: Minor


    private Scope stringToScope(String scopeStr) {
        for (Scope scope : Scope.values()) {
            if (scope.name().equalsIgnoreCase(scopeStr))
                return scope;
        }
        return Scope.LOCAL;
    }

/////

If you introduce further scopes down the road you do not have to modify this code again -- the current switch statement would have to be modified.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list