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

Narrow the type returned by LogEventFactory.getEvent

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: Log4j-Audit 1.0.0
    • Fix Version/s: Log4j-Audit 1.0.1
    • Component/s: Log4j-Audit
    • Labels:
      None
    • Flags:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: