You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (Jira)" <ji...@apache.org> on 2020/04/17 22:58:00 UTC

[jira] [Resolved] (LOG4J2-2813) Questionable code in AbstractStringLayout.serializeToBytes()

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

Ralph Goers resolved LOG4J2-2813.
---------------------------------
    Fix Version/s: 2.13.2
       Resolution: Fixed

> Questionable code in AbstractStringLayout.serializeToBytes()
> ------------------------------------------------------------
>
>                 Key: LOG4J2-2813
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2813
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Layouts
>    Affects Versions: 2.13.1
>            Reporter: Keith D Gregory
>            Priority: Trivial
>             Fix For: 2.13.2
>
>
> Source from [current master|https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;a=blob;f=log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractStringLayout.java;h=76c00b235992e4316107c1727e0473e5043d565b;hb=HEAD#l280]:
> {code:java}
> protected byte[] serializeToBytes(final Serializer serializer, final byte[] defaultValue) {
>     final String serializable = serializeToString(serializer);
>     if (serializer == null) {
>         return defaultValue;
>     }
>     return StringEncoder.toBytes(serializable, getCharset());
> }
> {code}
> I believe the test should be on "{{serializable}}" not "{{serializer}}".
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)