Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-472

BaseConfiguration class does not properly implement Configuration interface

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta9
    • Fix Version/s: None
    • Component/s: Configurators
    • Labels:
      None

      Description

      The problem is the getComponent method. In Configuration, it's defined so:

      <T> T getComponent(String name);
      

      But in BaseConfiguration, it is overridden like this:

      @Override
      public Object getComponent(final String name)
      

      When I compile against log4j with lint, I get this warning:

             [javac] public class MyConfiguration extends BaseConfiguration
             [javac]        ^
             [javac]   return type requires unchecked conversion from Object to T
             [javac]   where T is a type-variable:
             [javac]     T extends Object declared in method <T>getComponent(String)
      

        Attachments

          Activity

            People

            • Assignee:
              remkop@yahoo.com Remko Popma
              Reporter:
              emblemparade Tal Liron
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: