-
ClassDescriptionWill be removed (main method in a library, often classified as CWE-489 "Leftover Debug Code").Will be removed, as Swing classes aren't accessible on Google App Engine.FMPP is a more complete solution.Use
GenericObjectModel
instead, which implementsMethodCallAwareTemplateHashModel
.Will be removed (main method in a library, often classified as CWE-489 "Leftover Debug Code").This feature is not supported anymore, also, it uses the deprecated defaultConfiguration
.UseNodeModel
instead.This feature is not supported anymore, also, it uses the deprecated defaultConfiguration
.UseIdentityHashMap
instead.UseNodeModel
instead.UseSimpleSequence
instead.Use block-assignments instead, like<assign x>...</assign>
.Not needed anymore, as FreeMarker now requires higher than Java 1.3UseNodeModel
insteadWill be removed (main method in a library, often classified as CWE-489 "Leftover Debug Code").
-
FieldDescriptionUse
Configurable.STRICT_BEAN_MODELS_KEY
instead.Will be remove without replacement in 2.4.Not used anymore; to enable/disable debug logging, just set the logging level of the logging library used byLogger
.Not used anymore; to enable/disable debug logging, just set the logging level of the logging library used byLogger
.Avalon LogKit support will be removed sometimes in the future.Avalon LogKit support will be removed sometimes in the future.UseConfigurable.AUTO_IMPORT_KEY_SNAKE_CASE
instead.UseConfigurable.AUTO_IMPORT_KEY_CAMEL_CASE
instead.UseConfigurable.AUTO_IMPORT_KEY_SNAKE_CASE
instead.UseConfiguration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS
instead.UseConfiguration.INCOMPATIBLE_IMPROVEMENTS_KEY
instead.UseConfiguration.INCOMPATIBLE_IMPROVEMENTS_KEY
instead.UseConfiguration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS
instead.UseBeansWrapperBuilder.build()
instead; this instance isn't read-only and thus can't be trusted.UseDefaultObjectWrapperBuilder.build()
instead; this instance isn't read-only and thus can't be trusted.No replacement as it was seldom if ever used by anyone; this instance isn't read-only and thus can't be trusted.
-
MethodDescriptionThe
TemplateLoader
should be always specified by the constructor caller.UseEnvironment.toFullTemplateName(String, String)
instead, as that can throwMalformedTemplateNameException
, and is on a more logical place anyway.UseTemplateCache.getTemplate(String, Locale, Object, String, boolean)
, which can return more detailed result when the template is missing.Use theTemplateCache(TemplateLoader, CacheStorage, Configuration)
constructor.It's not possible in general to convert setting values to string, and thus it's impossible to ensure thatConfigurable.setSetting(String, String)
will work with the returned value correctly.This method was always defective, and certainly it always will be. Don't use it. (Simply, it's hardly possible in general to convert setting values to text in a way that ensures thatConfigurable.setSettings(Properties)
will work with them correctly.)Set this on theObjectWrapper
itself.UseEnvironment.getCTemplateNumberFormat()
instead. This method can't return the format used when Incompatible Improvements is 2.3.32, or greater, and instead it will fall back to return the format that was used for 2.3.31. Also, as its described earlier, this method was inconsistent with?c
between Incompatible Improvements 2.3.21 and 2.3.30, whileEnvironment.getCTemplateNumberFormat()
behaves as?c
for all Incompatible Improvements value.UseEnvironment.getMainTemplate()
instead (orEnvironment.getCurrentNamespace()
and thenEnvironment.Namespace.getTemplate()
); the value returned by this method is often not what you expect when it comes to macro/function invocations.Should be internal APIThere's a typo in this method name, so useBeansWrapper.clearClassIntrospectionCache()
instead.UseBeansWrapper.setMethodAppearanceFineTuner(MethodAppearanceFineTuner)
; no need to extend this class anymore. Soon this method will be final, so trying to override it will break your app. Note that if themethodAppearanceFineTuner
property is set to non-null
, this method is not called anymore.UseBeansWrapperBuilder
instead. The instance returned here is not read-only, so it's dangerous to use.overrideBeansWrapper.getModelFactory(Class)
instead. Using this method will now bypass wrapper caching (if it's enabled) and always result in creation of a new wrapper. This method will be removed in 2.4Changing thenull
model can cause a lot of confusion; don't do it.It's a bad practice to change static fields, as if multiple independent components do that in the same JVM, they unintentionally affect each other. Therefore it's recommended to leave this static value at its default.It's a bad practice to change static fields, as if multiple independent components do that in the same JVM, they unintentionally affect each other. Therefore it's recommended to leave this static value at its default.Will be removed (main method in a library, often classified as CWE-489 "Leftover Debug Code").Not called by FreeMarker code, and there's no point to override this (unless to cause confusion).Will be removed (main method in a library, often classified as CWE-489 "Leftover Debug Code").Not called by FreeMarker code, and there's no point to override this (unless to cause confusion).This method isn't reliable, unless you can somehow ensure that you access the FreeMarker classes first; use the "org.freemarker.loggerLibrary" Java system property instead, likejava ... -Dorg.freemarker.loggerLibrary=slf4j
. SeeLogger.SYSTEM_PROPERTY_NAME_LOGGER_LIBRARY
for more.This wasn't reliable, unless you can somehow ensure that you access the FreeMarker classes first. As it's not known to be useful for users, consider it removed.The usage of the static singleton (the "default")Configuration
instance can easily cause erroneous, unpredictable behavior. This is because multiple independent software components may use FreeMarker internally inside the same application, so they will interfere because of the commonConfiguration
instance. Each such component should use its own privateConfiguration
object instead, that it typically creates withnew Configuration()
when the component is initialized.UseConfiguration.getIncompatibleImprovements()
instead.UseConfiguration.getIncompatibleImprovements()
instead.UseConfiguration.getVersion()
instead.Using the "default"Configuration
instance can easily lead to erroneous, unpredictable behaviour. See morehere...
.UseConfiguration(Version)
, or as last chance,Configuration.setIncompatibleImprovements(Version)
instead.UseConfiguration.setSharedVariables(Map)
instead.Onlytrue
(the default) value will be supported sometimes in the future.UseConfiguration.setTemplateUpdateDelayMilliseconds(long)
instead, because the time granularity of this method is often misunderstood to be milliseconds.UseSimpleSequence.add(Object)
instead, as this bypasses theObjectWrapper
.No replacement exists; not a reliable way of getting back the original list elemnts.Should only be used internally, and might will be removed later.Should only be used internally, and might will be removed later.Should only be used internally, and might will be removed later.Should only be used internally, and might will be removed later.Should only be used internally, and might will be removed later.Should only be used internally, and might will be removed later.Should only be used internally, and might will be removed later.Should only be used internally, and might will be removed later.Java 1.4 has introducedThrowable.getCause()
- use that instead, especially as this can't return runtime exceptions and errors as is.UseTemplateException.getTemplateSourceName()
instead, unless you are really sure that this is what you want. This method isn't really deprecated, it's just marked so to warn users about this.the name of this method is mistyped. UseDeepUnwrap.permissiveUnwrap(TemplateModel)
instead.UseStringUtil.XHTMLEnc(String)
instead, because it escapes apostrophe-quote too.Don't use this outside FreeMarker; it's name if misleading, and it doesn't follow the XML specs.Will be removed (main method in a library, often classified as CWE-489 "Leftover Debug Code").Will always returnnull
for the FreeMarker version, as we can't store the build date anymore in the jar, in order to have a reproducible build.Don't depend on this object, as it can be replace by anybody in the same JVM.This method has VM-wide effect, which makes it unsuitable for application where multiple components might use FreeMarker internally.
-
ConstructorDescriptionIt's a confusing constructor, and seldom useful; use
ClassTemplateLoader(Class, String)
instead.It's confusing that the base path is""
; useClassTemplateLoader(Class, String)
instead.Relying on what the current directory is is a bad practice; useFileTemplateLoader(File)
instead.UseTemplateCache(TemplateLoader)
instead. The default loader is useless in most applications, also it can mean a security risk.This shouldn't even be public; don't use it.Use a constructor to which you pass description, template, and positions.Use a constructor to which you can also pass the template, and the end positions.UseParseException(String, Template, int, int, int, int)
instead, as IDE-s need the end position of the error too.UseParseException(String, Template, int, int, int, int, Throwable)
instead, as IDE-s need the end position of the error too.UseBeansWrapperBuilder
or, in rare cases,BeansWrapper(Version)
instead.UseConfiguration(Version)
instead. Note that the version can be still modified later withConfiguration.setIncompatibleImprovements(Version)
(orConfigurable.setSettings(Properties)
).UseDefaultObjectWrapperBuilder
, or in rare cases,DefaultObjectWrapper(Version)
instead.UseSimpleCollection(Iterable, ObjectWrapper)
instead.UseSimpleCollection(Iterable, ObjectWrapper)
instead.UseSimpleObjectWrapper(Version)
instead.UseSimpleSequence(ObjectWrapper)
instead.This constructor uses the "default"Configuration
instance, which can easily lead to erroneous, unpredictable behavior. See morehere...
.UseWrappingTemplateModel(ObjectWrapper)
instead; this method uses the deprecated.
TemplateMethodModelEx
instead. This interface is from the old times when the only kind of value you could pass in was string.