freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [1/2] incubator-freemarker git commit: Bug #439: FileTemplateLoader with emulateCaseSensitiveFileSystem set to true (used for development) wasn't properly synchronized, leading to random NullPointerException-s or other misbehavior.
Date Fri, 25 Sep 2015 19:00:43 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/master 3c5985a88 -> 8fc50366b


Bug #439: FileTemplateLoader with emulateCaseSensitiveFileSystem set to true (used for development)
wasn't properly synchronized, leading to random NullPointerException-s or other misbehavior.


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/dfd07ec5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/dfd07ec5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/dfd07ec5

Branch: refs/heads/master
Commit: dfd07ec50f0f4b9fa9eedc17ddba0d65fc001f3f
Parents: f32a506
Author: ddekany <ddekany@apache.org>
Authored: Fri Sep 25 20:58:58 2015 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Fri Sep 25 20:58:58 2015 +0200

----------------------------------------------------------------------
 src/main/java/freemarker/cache/FileTemplateLoader.java |  6 ++++--
 src/manual/book.xml                                    | 11 +++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/dfd07ec5/src/main/java/freemarker/cache/FileTemplateLoader.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/cache/FileTemplateLoader.java b/src/main/java/freemarker/cache/FileTemplateLoader.java
index 0a88340..50108ff 100644
--- a/src/main/java/freemarker/cache/FileTemplateLoader.java
+++ b/src/main/java/freemarker/cache/FileTemplateLoader.java
@@ -225,8 +225,10 @@ public class FileTemplateLoader implements TemplateLoader {
      */
     private boolean isNameCaseCorrect(File source) throws IOException {
         final String sourcePath = source.getPath();
-        if (correctCasePaths.get(sourcePath) != null) {
-            return true;
+        synchronized (correctCasePaths) {
+            if (correctCasePaths.get(sourcePath) != null) {
+                return true;
+            }
         }
         
         final File parentDir = source.getParentFile();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/dfd07ec5/src/manual/book.xml
----------------------------------------------------------------------
diff --git a/src/manual/book.xml b/src/manual/book.xml
index cf1efb6..57cdd37 100644
--- a/src/manual/book.xml
+++ b/src/manual/book.xml
@@ -26121,6 +26121,17 @@ TemplateModel x = env.getVariable("x");  // get variable x</programlisting>
             </listitem>
 
             <listitem>
+              <para>Bug fixed [<link
+              xlink:href="https://sourceforge.net/p/freemarker/bugs/439/">439</link>]:
+              <literal>FileTemplateLoader</literal> with
+              <literal>emulateCaseSensitiveFileSystem</literal> set to
+              <literal>true</literal> (used for development) wasn't properly
+              synchronized, leading to random
+              <literal>NullPointerException</literal>-s or other
+              misbehavior.</para>
+            </listitem>
+
+            <listitem>
               <para>Bug fixed: The (rarely used) cause exception of
               <literal>ParseException</literal>-s wasn't set</para>
             </listitem>


Mime
View raw message