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

Narrow the type returned by LogEventFactory.getEvent

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • Log4j-Audit 1.0.0
    • Log4j-Audit 1.0.1
    • Log4j-Audit
    • None
    • Patch

    Description

      Seeing that the result of LogEventFactory.getEvent is always cast to AuditEvent, I think the definition of the return type can be narrowed like this:

      public static <T extends AuditEvent> T getEvent(Class<T> intrface)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              shadow Andrei Ivanov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: