[
https://issues.apache.org/jira/browse/SLING-7581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16517003#comment-16517003
]
Radu Cotescu edited comment on SLING-7581 at 6/19/18 12:25 PM:
---------------------------------------------------------------
Grrr... Wish I had seen this issue earlier - I've just started a release
thread. Anyways, releases are cheap so expect a fix next week. :)
[~kwin], we don't generate servlets - in the HTL world we call them
{{RenderUnits}}. Luckily the code change is trivial:
[https://github.com/apache/sling-org-apache-sling-scripting-sightly-compiler-java/blob/org.apache.sling.scripting.sightly.compiler.java-1.0.24-1.4.0/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/ExpressionTranslator.java#L155]
was (Author: radu.cotescu):
Grrr... Wish I had seen this issue earlier - I've just started a release
thread. Anyways, releases are cheap so expect a fix next week. :)
[~kwin], we don't generate servlets - in the HTL world we call them
{{RenderUnits}}. Luckily the code change is trivial:
https://github.com/apache/sling-org-apache-sling-scripting-sightly-compiler-java/blob/org.apache.sling.scripting.sightly.compiler.java-1.0.24-1.4.0/src/main/java/org/apache/sling/scripting/sightly/java/compiler/impl/ExpressionTranslator.java#L155
> Using data-sly-use with two classes with same name will generate uncompilable
> code
> ----------------------------------------------------------------------------------
>
> Key: SLING-7581
> URL: https://issues.apache.org/jira/browse/SLING-7581
> Project: Sling
> Issue Type: Bug
> Components: Scripting
> Affects Versions: Scripting HTL Java Compiler 1.0.16
> Reporter: Santiago García Pimentel
> Assignee: Radu Cotescu
> Priority: Major
> Fix For: Scripting HTL Java Compiler 1.0.26-1.4.0
>
>
> If you have an HTL file with two data-sly-use with classes with the same name
> HTL will generate a java file which cannot be compiled.
> e.g.
> {code}
> data-sly-use.first="com.adobe.cq.wcm.core.components.models.Page"
> data-sly-use.second="com.client.project.Page"
> {code}
>
> Will generate
> {code}
> import com.client.project.Page;
> import com.adobe.cq.wcm.core.components.models.Page;
> ...
> ...
> _global_first= renderContext.call("use", Page.class.getName(), obj());
> _global_second = renderContext.call("use", Page.class.getName(), obj());
> {code}
> Causing a compilation error as Page is not fully qualified in the code and
> therefore an ambiguous reference (due to the two imports of same class names)
> This seems to have been introduced by SLING-7205 .
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)