Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
Scripting Sightly Engine 1.0.18
-
None
Description
If an HTL script with potential warnings is compiled on Windows, the compiler will fail with a NPE like:
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)
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.
Attachments
Issue Links
- links to