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

BaseConfiguration class does not properly implement Configuration interface

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0-beta9
    • None
    • Configurators
    • 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

            rpopma Remko Popma
            emblemparade Tal Liron
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: