freemarker-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Dekany <ddek...@apache.org>
Subject Re: Please test/review FreeMarker 2.3.28
Date Sat, 24 Mar 2018 07:21:20 GMT
Saturday, March 24, 2018, 3:13:06 AM, Woonsan Ko wrote:

> When I tested with freemarker-2.3.28-incubating-SNAPSHOT.jar, which I
> built and install it to my local maven repo from the latest "2.3"
> branch myself, in my applications, I haven't found any regressions.
> My applications are rather simpler probably than others as they simply
> render model objects passed from request attributes through
> FreeMarkerServlet.
> But when I tried the new features and bug fixes [1], I think I found
> somethings (perhaps there could be my misunderstandings):
>
> 1. The template example in
> https://freemarker.apache.org/builds/fm2.3.28/ref_specvar.html#ref_specvar_get_optional_template
>
>   <#assign optTemp = .get_optional_template('some.ftl')>
>   <#if optTemp.exists>
>
>   But if the 'some.ftl' doesn't exist, optTemp.exists fails as it's
> null. So I ended up changing it to this:
>
>   <#assign optTemp = .get_optional_template('some.ftl')>
>   <#if optTemp?? && optTemp.exists>

That's bizarre. It works for me. Also for the test suite... that
passes there, right? (It can't even be explained by accidentally using
2.3.27, as there .get_optional_template is parsing (syntax) error.)

> 2. Square bracket syntax through ftl directive
>
> It reads, "This directive also determines if the template uses angle
> bracket syntax (e.g. <#include 'foo.ftl'>) or square bracket syntax
> (e.g. [#include 'foo.ftl']). Simply, the syntax used for this
> directive will be the syntax used for the whole template, regardless
> of the FreeMarker configuration settings." [2]
>
> I applied it to an included .ftl template like this:
>
> [#ftl output_format="HTML"]
> [="Hello"]
> ${"Hello"}
>
> It prints: [="Hello"] Hello,
> not: Hello ${"Hello"}

There are two independent settings here: tag syntax and interpolation
syntax. It's mere coincidence that both has "square bracket" in their
names. [#ftl] only sets the first. I will clarify that in the
documentation. Or, it's a warning sign that we should rather use
{{exp}}, as that doesn't have "square brackets" in it.

> 3. split with an empty string
>
> It says, "Bug fixed: When string?split(separator) is called with "" as
> the argument, the string will be split to characters now. Earlier it
> has thrown an IllegalArgumentException (unless the r flag was
> specified)."
> But when I tried it, it throws an IllegalArgumentException:
>
> <#assign a="hello"?split("l")>
==>>
> java.lang.IllegalArgumentException: The separator string has 0 length
> at freemarker.template.utility.StringUtil.split(StringUtil.java:752)

Huh? "l" isn't even 0 long! Or you meant to copy-paste `?split("")`
there? And yet again, it works for me here. Though this at least can
be that you are accidentally using 2.3.27 (try ${.version}).

> Please let me know if I miss or misinterpret somethings.
>
> Cheers,
>
> Woonsan
>
> [1] https://freemarker.apache.org/builds/fm2.3.28/versions_2_3_28.html
> [2]
> https://freemarker.apache.org/builds/fm2.3.28/ref_directive_ftl.html
>
> On Fri, Mar 23, 2018 at 4:08 AM, Daniel Dekany <ddekany@apache.org> wrote:
>> Friday, March 23, 2018, 3:33:39 AM, Woonsan Ko wrote:
>>
>>> Great to see the real release without "incubating" mark soon!
>>
>> In theory it was decided 2 days ago, but I saw nothing about the board
>> meeting so far. I guess they are overburdened with the May elections
>> and all that.
>>
>>> Also ! I've just read the Change log and everything is awesome!
>>> I'll just try out the snapshot binary tomorrow in our applications to
>>> see if there's any regression just in case.
>>
>> Great, thanks!
>>
>>> Cheers,
>>>
>>> Woonsan
>>>
>>>
>>> On Tue, Mar 20, 2018 at 6:39 PM, Daniel Dekany <ddekany@apache.org> wrote:
>>>> Before we start a VOTE on releasing 2.3.28, it would be good if more
>>>> of you can test it, or otherwise review the upcoming 2.3.28! The main
>>>> point in this phase is to catch technical issues.
>>>>
>>>> If you intend to help, but won't have time for it in the coming few
>>>> days, please indicate that, so that I know that I should wait!
>>>>
>>>> Change log (so far, but I don't plan to add more):
>>>> https://freemarker.apache.org/builds/fm2.3.28/versions_2_3_28.html
>>>>
>>>> Binary release artifacts:
>>>> https://dist.apache.org/repos/dist/dev/incubator/freemarker/engine/2.3.28-incubating-SNAPSHOT/binaries/
>>>>
>>>> Source release artifacts:
>>>> https://dist.apache.org/repos/dist/dev/incubator/freemarker/engine/2.3.28-incubating-SNAPSHOT/source/
>>>>
>>>> The Maven artifacts are available from the Apache snaphsot repository:
>>>>
>>>>   <repository>
>>>>     <id>apache-snapshot-repository</id>
>>>>     <url>https://repository.apache.org/content/repositories/snapshots/</url>
>>>>     <releases><enabled>false</enabled></releases>
>>>>     <snapshots><enabled>true</enabled></snapshots>
>>>>   </repository>
>>>>
>>>> under the coordinates:
>>>>
>>>>   <groupId>org.freemarker</groupId>
>>>>   <artifactId>freemarker</artifactId>
>>>>   <version>2.3.28-incubating-SNAPSHOT</version>
>>>>
>>>> and for the Google App Engine compatible (GAE) version:
>>>>
>>>>   <groupId>org.freemarker</groupId>
>>>>   <artifactId>freemarker-gae</artifactId>
>>>>   <version>2.3.28-incubating-SNAPSHOT</version>
>>>>
>>>> The ASF Board will decide tomorrow (21th) if FreeMarker can graduate.
>>>> If everything goes well, this release won't have "incubating" in its
>>>> version number. This will be the first such release since mid 2015
>>>> (2.3.23).
>>>>
>>>> --
>>>> Thanks,
>>>>  Daniel Dekany
>>>>
>>>
>>
>> --
>> Thanks,
>>  Daniel Dekany
>>
>

-- 
Thanks,
 Daniel Dekany


Mime
View raw message