Vlad Bailescu created SLING-6445:
------------------------------------

             Summary: HTL scripts do not compile on Windows if the compiler 
needs to generate any warnings
                 Key: SLING-6445
                 URL: https://issues.apache.org/jira/browse/SLING-6445
             Project: Sling
          Issue Type: Bug
          Components: Scripting
    Affects Versions: Scripting Sightly Engine 1.0.18
            Reporter: Vlad Bailescu
            Priority: Critical


If an HTL script with potential warnings is compiled on Windows, the compiler 
will fail with a NPE like:
{code}
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(Unknown Source)
        at 
org.apache.sling.scripting.sightly.compiler.SightlyCompiler.getScriptError(SightlyCompiler.java:170)
        at 
org.apache.sling.scripting.sightly.compiler.SightlyCompiler.compile(SightlyCompiler.java:149)
        at 
org.apache.sling.scripting.sightly.impl.engine.SightlyScriptEngine.internalCompile(SightlyScriptEngine.java:135)
        at 
org.apache.sling.scripting.sightly.impl.engine.SightlyScriptEngine.compile(SightlyScriptEngine.java:80)
        at 
org.apache.sling.scripting.sightly.impl.engine.extension.use.RenderUnitProvider.provide(RenderUnitProvider.java:126)
        at 
org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:72)
        at 
org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl.call(RenderContextImpl.java:75)
{code}

The compiler assumes that system line separators are being used in the files, 
which most of the times is not happening as the scripts might have been edited 
on another system.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to