You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2017/03/15 13:53:21 UTC

incubator-freemarker git commit: BeansWrapperConfiguration.classIntrospectorFactory is no more protected field, but private. Especially as the class of this field (ClassIntrospectorBuilder) was package private, it's pretty much sure that nobody depends o

Repository: incubator-freemarker
Updated Branches:
  refs/heads/2.3-gae 36305d0c5 -> 7f67e3d09


BeansWrapperConfiguration.classIntrospectorFactory is no more protected field, but private. Especially as the class of this field (ClassIntrospectorBuilder) was package private, it's pretty much sure that nobody depends on this field.


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

Branch: refs/heads/2.3-gae
Commit: 7f67e3d0974a4c86772809f47078bb1bb97ae08e
Parents: 36305d0
Author: ddekany <dd...@apache.org>
Authored: Wed Mar 15 14:53:15 2017 +0100
Committer: ddekany <dd...@apache.org>
Committed: Wed Mar 15 14:53:15 2017 +0100

----------------------------------------------------------------------
 src/main/java/freemarker/ext/beans/BeansWrapper.java         | 5 +++--
 .../java/freemarker/ext/beans/BeansWrapperConfiguration.java | 6 +++++-
 src/main/java/freemarker/ext/beans/_BeansAPI.java            | 4 ++++
 src/manual/en_US/book.xml                                    | 8 ++++++++
 4 files changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7f67e3d0/src/main/java/freemarker/ext/beans/BeansWrapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/ext/beans/BeansWrapper.java b/src/main/java/freemarker/ext/beans/BeansWrapper.java
index 1803684..93cdcb6 100644
--- a/src/main/java/freemarker/ext/beans/BeansWrapper.java
+++ b/src/main/java/freemarker/ext/beans/BeansWrapper.java
@@ -342,11 +342,12 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
             // but we need to use the same sharedInrospectionLock forever, because that's what the model factories
             // synchronize on, even during the classIntrospector is being replaced.
             sharedIntrospectionLock = new Object();
-            classIntrospector = new ClassIntrospector(bwConf.classIntrospectorBuilder, sharedIntrospectionLock);
+            classIntrospector = new ClassIntrospector(
+                    _BeansAPI.getClassIntrospectorBuilder(bwConf), sharedIntrospectionLock);
         } else {
             // As this is a read-only BeansWrapper, the classIntrospector is never replaced, and since it's shared by
             // other BeansWrapper instances, we use the lock belonging to the shared ClassIntrospector.
-            classIntrospector = bwConf.classIntrospectorBuilder.build();
+            classIntrospector = _BeansAPI.getClassIntrospectorBuilder(bwConf).build();
             sharedIntrospectionLock = classIntrospector.getSharedLock(); 
         }
         

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7f67e3d0/src/main/java/freemarker/ext/beans/BeansWrapperConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/ext/beans/BeansWrapperConfiguration.java b/src/main/java/freemarker/ext/beans/BeansWrapperConfiguration.java
index 26764e8..ba19633 100644
--- a/src/main/java/freemarker/ext/beans/BeansWrapperConfiguration.java
+++ b/src/main/java/freemarker/ext/beans/BeansWrapperConfiguration.java
@@ -42,7 +42,7 @@ public abstract class BeansWrapperConfiguration implements Cloneable {
 
     private final Version incompatibleImprovements;
     
-    protected ClassIntrospectorBuilder classIntrospectorBuilder;
+    private ClassIntrospectorBuilder classIntrospectorBuilder;
     
     // Properties and their *defaults*:
     private boolean simpleMapWrapper = false;
@@ -239,5 +239,9 @@ public abstract class BeansWrapperConfiguration implements Cloneable {
     void setMethodSorter(MethodSorter methodSorter) {
         classIntrospectorBuilder.setMethodSorter(methodSorter);
     }
+
+    ClassIntrospectorBuilder getClassIntrospectorBuilder() {
+        return classIntrospectorBuilder;
+    }
  
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7f67e3d0/src/main/java/freemarker/ext/beans/_BeansAPI.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/ext/beans/_BeansAPI.java b/src/main/java/freemarker/ext/beans/_BeansAPI.java
index f77a415..8b75893 100644
--- a/src/main/java/freemarker/ext/beans/_BeansAPI.java
+++ b/src/main/java/freemarker/ext/beans/_BeansAPI.java
@@ -223,4 +223,8 @@ public class _BeansAPI {
         BW create(BWC sa);
     }
     
+    public static ClassIntrospectorBuilder getClassIntrospectorBuilder(BeansWrapperConfiguration bwc) {
+        return bwc.getClassIntrospectorBuilder();
+    }
+    
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/7f67e3d0/src/manual/en_US/book.xml
----------------------------------------------------------------------
diff --git a/src/manual/en_US/book.xml b/src/manual/en_US/book.xml
index beab00d..69cd696 100644
--- a/src/manual/en_US/book.xml
+++ b/src/manual/en_US/book.xml
@@ -27048,6 +27048,14 @@ TemplateModel x = env.getVariable("x");  // get variable x</programlisting>
             </listitem>
 
             <listitem>
+              <para><literal>BeansWrapperConfiguration.classIntrospectorFactory</literal>
+              is no more protected field, but private. Especially as the class
+              of this field (<literal>ClassIntrospectorBuilder</literal>) was
+              package private, it's pretty much sure that nobody depends on
+              this field.</para>
+            </listitem>
+
+            <listitem>
               <para>Various smaller code cleanups.</para>
             </listitem>
           </itemizedlist>