[ 
https://issues.apache.org/jira/browse/LOG4J2-2431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16603051#comment-16603051
 ] 

ASF GitHub Bot commented on LOG4J2-2431:
----------------------------------------

GitHub user andrei-ivanov opened a pull request:

    https://github.com/apache/logging-log4j-audit/pull/3

    [LOG4J2-2431] Narrow the return type of getEvent

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/andrei-ivanov/logging-log4j-audit LOG4J2-2431

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/logging-log4j-audit/pull/3.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3
    
----
commit 6d4fcf3356231b7cb6cd25f3b3ea93f35ca49687
Author: Andrei Ivanov <andrei.ivanov@...>
Date:   2018-09-04T13:18:05Z

    [LOG4J2-2431] Narrow the return type of getEvent

----


> 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
>
> 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)

Reply via email to