You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Müller Gonçalves <mu...@ciandt.com> on 2017/04/18 22:30:17 UTC
Re: Sightly warnings by GlobalShadowChecker
Hi Radu,
We have been noticing the same warn message on our application fairly often:
*WARN*
org.apache.sling.scripting.sightly.impl.compiler.util.GlobalShadowChecker
Global variable 'template' is being overridden in template
However, there is no 'template' variable being declared in our sightly
scripts like <data-sly-use.template>. Would there be somewhere else (outside
sightly context) we should look for?
Müller
Radu Cotescu-3 wrote
> Hi Konrad,
>
> The GlobalShadowChecker has not been changed at all since the Sightly Java
> implementation was donated to Apache Sling. Furthermore I believe the WARN
> messages are helpful when you accidentally overwrite a bindings value with
> a "local" script variable and things don't work as you expect.
>
> If you believe that the logger for that class is too noisy you can
> configure it and increase its level to "ERROR".
>
> Cheers,
> Radu
>
>
>
> On Fri, 14 Aug 2015 at 14:39 Konrad Windszus <
> konrad_w@
> > wrote:
>
>> In our code I see a lot of warnings like this one:
>> org.apache.sling.scripting.sightly.impl.compiler.util.GlobalShadowChecker
>> Global variable 'component' is being overridden in template
>> It seems that the Sightly compiler always emits that warning in case a
>> global variable name has been newly defined in a Sightly script like this
>>
> <sly data-sly-use.<someGlobalVariableName>
> =“
> <someClass>
> ”>…
> </sly>
>> While I do understand that this might lead to issues, I would rather make
>> that GlobalShadowChecker functionality configurable.
>> This is especially useful as previous versions of the Sightly compiler
>> didn’t have that feature.
>> WDYT?
>> Konrad
>>
>>
--
View this message in context: http://apache-sling.73963.n3.nabble.com/Sightly-warnings-by-GlobalShadowChecker-tp4053752p4072828.html
Sent from the Sling - Dev mailing list archive at Nabble.com.