This is an automated email from the ASF dual-hosted git repository.
ddekany pushed a commit to branch 2.3-gae
in repository https://gitbox.apache.org/repos/asf/freemarker.git
The following commit(s) were added to refs/heads/2.3-gae by this push:
new abebe99 BeansWrapper method clearClassIntrospecitonCache contains a
typo. Renamed to clearClassIntrospectionCache and kept the old name as
deprecated for backward compatibility
new 3f66d01 Merge pull request #57 from
ajbanck/fix-typo-clearClassIntrospecitonCache
abebe99 is described below
commit abebe999d8bb24cd43abf7248ba7edd96217411e
Author: Arent-Jan Banck <[email protected]>
AuthorDate: Fri Mar 29 19:57:53 2019 +0100
BeansWrapper method clearClassIntrospecitonCache contains a typo. Renamed
to clearClassIntrospectionCache and kept the old name as deprecated for
backward compatibility
---
src/main/java/freemarker/ext/beans/BeansWrapper.java | 20 ++++++++++++++++++--
.../java/freemarker/ext/beans/ClassIntrospector.java | 2 +-
src/main/java/freemarker/template/Configuration.java | 2 +-
.../ext/beans/AbstractParallelIntrospectionTest.java | 2 +-
.../java/freemarker/ext/beans/EnumModelsTest.java | 2 +-
.../java/freemarker/ext/beans/ModelCacheTest.java | 2 +-
.../java/freemarker/ext/beans/StaticModelsTest.java | 2 +-
7 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/src/main/java/freemarker/ext/beans/BeansWrapper.java
b/src/main/java/freemarker/ext/beans/BeansWrapper.java
index 4b1ec6c..5c645b4 100644
--- a/src/main/java/freemarker/ext/beans/BeansWrapper.java
+++ b/src/main/java/freemarker/ext/beans/BeansWrapper.java
@@ -673,7 +673,7 @@ public class BeansWrapper implements RichObjectWrapper,
WriteProtectable {
/**
* Tells if this instance acts like if its class introspection cache is
sharable with other {@link BeansWrapper}-s.
- * A restricted cache denies certain too "antisocial" operations, like
{@link #clearClassIntrospecitonCache()}.
+ * A restricted cache denies certain too "antisocial" operations, like
{@link #clearClassIntrospectionCache()}.
* The value depends on how the instance
* was created; with a public constructor (then this is {@code false}), or
with {@link BeansWrapperBuilder}
* (then it's {@code true}). Note that in the last case it's possible that
the introspection cache
@@ -1617,6 +1617,7 @@ public class BeansWrapper implements RichObjectWrapper,
WriteProtectable {
}
/**
+ * @deprecated Use {@link #clearClassIntrospectionCache()};
* Removes all class introspection data from the cache.
*
* <p>Use this if you want to free up memory on the expense of recreating
@@ -1626,10 +1627,25 @@ public class BeansWrapper implements RichObjectWrapper,
WriteProtectable {
*
* @since 2.3.20
*/
+ @Deprecated
public void clearClassIntrospecitonCache() {
classIntrospector.clearCache();
}
-
+
+ /**
+ * Removes all class introspection data from the cache.
+ *
+ * <p>Use this if you want to free up memory on the expense of recreating
+ * the cache entries for the classes that will be used later in templates.
+ *
+ * @throws IllegalStateException if {@link
#isClassIntrospectionCacheRestricted()} is {@code true}.
+ *
+ * @since 2.3.29
+ */
+ public void clearClassIntrospectionCache() {
+ classIntrospector.clearCache();
+ }
+
ClassIntrospector getClassIntrospector() {
return classIntrospector;
}
diff --git a/src/main/java/freemarker/ext/beans/ClassIntrospector.java
b/src/main/java/freemarker/ext/beans/ClassIntrospector.java
index 3b8f6ce..a31d430 100644
--- a/src/main/java/freemarker/ext/beans/ClassIntrospector.java
+++ b/src/main/java/freemarker/ext/beans/ClassIntrospector.java
@@ -860,7 +860,7 @@ class ClassIntrospector {
// Cache management:
/**
- * Corresponds to {@link BeansWrapper#clearClassIntrospecitonCache()}.
+ * Corresponds to {@link BeansWrapper#clearClassIntrospectionCache()}.
*
* @since 2.3.20
*/
diff --git a/src/main/java/freemarker/template/Configuration.java
b/src/main/java/freemarker/template/Configuration.java
index 2f19645..419332a 100644
--- a/src/main/java/freemarker/template/Configuration.java
+++ b/src/main/java/freemarker/template/Configuration.java
@@ -646,7 +646,7 @@ public class Configuration extends Configurable implements
Cloneable, ParserConf
* cache) because the singleton is modified after publishing to
other threads.)
* Furthermore the new default object wrapper shares class
introspection cache with other
* {@link BeansWrapper}-s created with {@link
BeansWrapperBuilder}, which has an impact as
- * {@link BeansWrapper#clearClassIntrospecitonCache()} will be
disallowed; see more about it there.
+ * {@link BeansWrapper#clearClassIntrospectionCache()} will be
disallowed; see more about it there.
* </li>
* <li><p>
* The {@code ?iso_...} built-ins won't show the time zone offset
for {@link java.sql.Time} values anymore,
diff --git
a/src/test/java/freemarker/ext/beans/AbstractParallelIntrospectionTest.java
b/src/test/java/freemarker/ext/beans/AbstractParallelIntrospectionTest.java
index 5d221e0..e6d8b01 100644
--- a/src/test/java/freemarker/ext/beans/AbstractParallelIntrospectionTest.java
+++ b/src/test/java/freemarker/ext/beans/AbstractParallelIntrospectionTest.java
@@ -83,7 +83,7 @@ public abstract class AbstractParallelIntrospectionTest
extends TestCase {
try {
for (int i = 0; i < iterations; i++) {
if (Math.random() < CACHE_CLEARING_CHANCE) {
- beansWrapper.clearClassIntrospecitonCache();
+ beansWrapper.clearClassIntrospectionCache();
}
int objIdx = (int) (Math.random() * NUM_ENTITYES);
TemplateHashModel h = getWrappedEntity(objIdx);
diff --git a/src/test/java/freemarker/ext/beans/EnumModelsTest.java
b/src/test/java/freemarker/ext/beans/EnumModelsTest.java
index 57d2076..0f03e23 100644
--- a/src/test/java/freemarker/ext/beans/EnumModelsTest.java
+++ b/src/test/java/freemarker/ext/beans/EnumModelsTest.java
@@ -63,7 +63,7 @@ public class EnumModelsTest {
assertSame(e, enums.get(E.class.getName()));
- bw.clearClassIntrospecitonCache();
+ bw.clearClassIntrospectionCache();
TemplateHashModel eAfterClean = (TemplateHashModel)
enums.get(E.class.getName());
assertNotSame(e, eAfterClean);
assertSame(eAfterClean, enums.get(E.class.getName()));
diff --git a/src/test/java/freemarker/ext/beans/ModelCacheTest.java
b/src/test/java/freemarker/ext/beans/ModelCacheTest.java
index cc89558..a8db6e5 100644
--- a/src/test/java/freemarker/ext/beans/ModelCacheTest.java
+++ b/src/test/java/freemarker/ext/beans/ModelCacheTest.java
@@ -56,7 +56,7 @@ public class ModelCacheTest {
TemplateModel wrappedC = bw.wrap(c);
assertSame(wrappedC, bw.wrap(c));
- bw.clearClassIntrospecitonCache();
+ bw.clearClassIntrospectionCache();
assertNotSame(wrappedC, bw.wrap(c));
assertSame(bw.wrap(c), bw.wrap(c));
}
diff --git a/src/test/java/freemarker/ext/beans/StaticModelsTest.java
b/src/test/java/freemarker/ext/beans/StaticModelsTest.java
index 8b72ffa..f074d23 100644
--- a/src/test/java/freemarker/ext/beans/StaticModelsTest.java
+++ b/src/test/java/freemarker/ext/beans/StaticModelsTest.java
@@ -70,7 +70,7 @@ public class StaticModelsTest {
assertSame(s, statics.get(S.class.getName()));
- bw.clearClassIntrospecitonCache();
+ bw.clearClassIntrospectionCache();
TemplateHashModel sAfterClean = (TemplateHashModel)
statics.get(S.class.getName());
assertNotSame(s, sAfterClean);
assertSame(sAfterClean, statics.get(S.class.getName()));