You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Andrei Ivanov (JIRA)" <ji...@apache.org> on 2018/09/22 06:29:00 UTC

[jira] [Closed] (LOG4J2-2431) Narrow the type returned by LogEventFactory.getEvent

     [ https://issues.apache.org/jira/browse/LOG4J2-2431?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrei Ivanov closed LOG4J2-2431.
---------------------------------

> Narrow the type returned by LogEventFactory.getEvent
> ----------------------------------------------------
>
>                 Key: LOG4J2-2431
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2431
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Log4j-Audit
>    Affects Versions: Log4j-Audit 1.0.0
>            Reporter: Andrei Ivanov
>            Priority: Trivial
>             Fix For: Log4j-Audit 1.0.1
>
>
> Seeing that the result of [{{LogEventFactory.getEvent}}|https://github.com/apache/logging-log4j-audit/blob/master/log4j-audit/log4j-audit-api/src/main/java/org/apache/logging/log4j/audit/LogEventFactory.java#L90] is always cast to {{AuditEvent}}, I think the definition of the return type can be narrowed like this:
> {code:java}
> public static <T extends AuditEvent> T getEvent(Class<T> intrface)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)