[jira] [Created] (SLING-6226) substVars not properly handling unknown properties

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (SLING-6226) substVars not properly handling unknown properties

Oliver Lietz (Jira)
Felix Meschberger created SLING-6226:
----------------------------------------

             Summary: substVars not properly handling unknown properties
                 Key: SLING-6226
                 URL: https://issues.apache.org/jira/browse/SLING-6226
             Project: Sling
          Issue Type: Bug
    Affects Versions: Launchpad Base 2.6.14
            Reporter: Felix Meschberger
             Fix For: Launchpad Base 2.6.16


Assuming a property in {{sling.properties}} of the form

{code}
org.apache.sling.commons.log.pattern=%d{yyyy-MM-dd HH:mm:ss.SSSXXX} *%level* [%thread] %logger %msg%n
{code}

This will break during Sling startup as the date format of this {{log.pattern}} ends with a curly brace but is not matched with a {{ $\{ }}. This is a but in the {{substVars}} method.

Another problem is that this method is duplicate in the {{Sling}} and {{SlingServlet}} classes where the latter is in the web app class loader while the former already is in the launcher class loader.

Proposing a patch taking the latest Felix Framework's Util class creating a new {{Util}} class in the shared package.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Reply | Threaded
Open this post in threaded view
|

Re: [jira] [Created] (SLING-6226) substVars not properly handling unknown properties

Felix Meschberger-3
Hi all

I think this works as in „works on my machine“.

Can I have someone please review this patch ?

Thanks
Felix

> Am 01.11.2016 um 16:54 schrieb Felix Meschberger (JIRA) <[hidden email]>:
>
> Felix Meschberger created SLING-6226:
> ----------------------------------------
>
>             Summary: substVars not properly handling unknown properties
>                 Key: SLING-6226
>                 URL: https://issues.apache.org/jira/browse/SLING-6226
>             Project: Sling
>          Issue Type: Bug
>    Affects Versions: Launchpad Base 2.6.14
>            Reporter: Felix Meschberger
>             Fix For: Launchpad Base 2.6.16
>
>
> Assuming a property in {{sling.properties}} of the form
>
> {code}
> org.apache.sling.commons.log.pattern=%d{yyyy-MM-dd HH:mm:ss.SSSXXX} *%level* [%thread] %logger %msg%n
> {code}
>
> This will break during Sling startup as the date format of this {{log.pattern}} ends with a curly brace but is not matched with a {{ $\{ }}. This is a but in the {{substVars}} method.
>
> Another problem is that this method is duplicate in the {{Sling}} and {{SlingServlet}} classes where the latter is in the web app class loader while the former already is in the launcher class loader.
>
> Proposing a patch taking the latest Felix Framework's Util class creating a new {{Util}} class in the shared package.
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.3.4#6332)