freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [10/11] incubator-freemarker git commit: Marked most static utility classes as internal, and renamed them to start with "_" (for example StringUtils was renamed to _StringUtil, thus people won't accidentally use it when they wanted to autocomplete to Apa
Date Fri, 17 Feb 2017 14:06:11 GMT
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/Environment.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Environment.java b/src/main/java/org/apache/freemarker/core/ast/Environment.java
index 8c1dbef..1400aad 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Environment.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Environment.java
@@ -71,10 +71,10 @@ import org.apache.freemarker.core.templateresolver.TemplateResolver;
 import org.apache.freemarker.core.templateresolver._CacheAPI;
 import org.apache.freemarker.core.templateresolver.impl.DefaultTemplateNameFormat;
 import org.apache.freemarker.core.templateresolver.impl.DefaultTemplateNameFormatFM2;
-import org.apache.freemarker.core.util.DateUtil;
-import org.apache.freemarker.core.util.DateUtil.DateToISO8601CalendarFactory;
-import org.apache.freemarker.core.util.NullWriter;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._DateUtil;
+import org.apache.freemarker.core.util._DateUtil.DateToISO8601CalendarFactory;
+import org.apache.freemarker.core.util._NullWriter;
+import org.apache.freemarker.core.util._StringUtil;
 import org.apache.freemarker.core.util.UndeclaredThrowableException;
 import org.slf4j.Logger;
 
@@ -1286,7 +1286,7 @@ public final class Environment extends Configurable {
             TemplateNumberFormatFactory formatFactory = getCustomNumberFormat(name);
             if (formatFactory == null) {
                 throw new UndefinedCustomFormatException(
-                        "No custom number format was defined with name " + StringUtil.jQuote(name));
+                        "No custom number format was defined with name " + _StringUtil.jQuote(name));
             }
 
             return formatFactory.get(params, locale, this);
@@ -1791,7 +1791,7 @@ public final class Environment extends Configurable {
             formatFactory = getCustomDateFormat(name);
             if (formatFactory == null) {
                 throw new UndefinedCustomFormatException(
-                        "No custom date format was defined with name " + StringUtil.jQuote(name));
+                        "No custom date format was defined with name " + _StringUtil.jQuote(name));
             }
         } else {
             formatParams = formatString;
@@ -1835,13 +1835,13 @@ public final class Environment extends Configurable {
     /**
      * Returns the {@link DateToISO8601CalendarFactory} used by the the "iso_" built-ins. Be careful when using this; it
      * should only by used with
-     * {@link DateUtil#dateToISO8601String(Date, boolean, boolean, boolean, int, TimeZone, DateToISO8601CalendarFactory)}
-     * and {@link DateUtil#dateToXSString(Date, boolean, boolean, boolean, int, TimeZone, DateToISO8601CalendarFactory)}
+     * {@link _DateUtil#dateToISO8601String(Date, boolean, boolean, boolean, int, TimeZone, DateToISO8601CalendarFactory)}
+     * and {@link _DateUtil#dateToXSString(Date, boolean, boolean, boolean, int, TimeZone, DateToISO8601CalendarFactory)}
      * .
      */
     DateToISO8601CalendarFactory getISOBuiltInCalendarFactory() {
         if (isoBuiltInCalendarFactory == null) {
-            isoBuiltInCalendarFactory = new DateUtil.TrivialDateToISO8601CalendarFactory();
+            isoBuiltInCalendarFactory = new _DateUtil.TrivialDateToISO8601CalendarFactory();
         }
         return isoBuiltInCalendarFactory;
     }
@@ -2666,7 +2666,7 @@ public final class Environment extends Configurable {
         Namespace prevNamespace = this.currentNamespace;
         this.currentNamespace = newNamespace;
         Writer prevOut = out;
-        this.out = NullWriter.INSTANCE;
+        this.out = _NullWriter.INSTANCE;
         try {
             include(loadedTemplate);
         } finally {
@@ -2867,7 +2867,7 @@ public final class Environment extends Configurable {
                 if (status == InitializationStatus.FAILED) {
                     throw new TemplateModelException(
                             "Lazy initialization of the imported namespace for "
-                            + StringUtil.jQuote(templateName)
+                            + _StringUtil.jQuote(templateName)
                             + " has already failed earlier; won't retry it.");
                 }
                 try {
@@ -2878,7 +2878,7 @@ public final class Environment extends Configurable {
                     // [FM3] Rethrow TemplateException-s as is
                     throw new TemplateModelException(
                             "Lazy initialization of the imported namespace for "
-                            + StringUtil.jQuote(templateName)
+                            + _StringUtil.jQuote(templateName)
                             + " has failed; see cause exception", e);
                 } finally {
                     if (status != InitializationStatus.INITIALIZED) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/EscapeBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/EscapeBlock.java b/src/main/java/org/apache/freemarker/core/ast/EscapeBlock.java
index 9169b0b..e87aa49 100644
--- a/src/main/java/org/apache/freemarker/core/ast/EscapeBlock.java
+++ b/src/main/java/org/apache/freemarker/core/ast/EscapeBlock.java
@@ -23,6 +23,7 @@ import java.io.IOException;
 
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.ast.Expression.ReplacemenetState;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * Representation of the compile-time #escape directive.
@@ -60,7 +61,7 @@ class EscapeBlock extends TemplateElement {
         StringBuilder sb = new StringBuilder();
         if (canonical) sb.append('<');
         sb.append(getNodeTypeSymbol())
-                .append(' ').append(_CoreStringUtils.toFTLTopLevelIdentifierReference(variable))
+                .append(' ').append(_StringUtil.toFTLTopLevelIdentifierReference(variable))
                 .append(" as ").append(expr.getCanonicalForm());
         if (canonical) {
             sb.append('>');

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/ExtendedDecimalFormatParser.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/ExtendedDecimalFormatParser.java b/src/main/java/org/apache/freemarker/core/ast/ExtendedDecimalFormatParser.java
index 1c29eb9..11eb4d4 100644
--- a/src/main/java/org/apache/freemarker/core/ast/ExtendedDecimalFormatParser.java
+++ b/src/main/java/org/apache/freemarker/core/ast/ExtendedDecimalFormatParser.java
@@ -28,7 +28,7 @@ import java.util.HashMap;
 import java.util.Locale;
 import java.util.Set;
 
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 class ExtendedDecimalFormatParser {
     
@@ -319,14 +319,14 @@ class ExtendedDecimalFormatParser {
     private ParseException newInvalidParameterValueException(String name, String value, int valuePos,
             InvalidParameterValueException e) {
         return new java.text.ParseException(
-                StringUtil.jQuote(value) + " is an invalid value for the \"" + name + "\" parameter: "
+                _StringUtil.jQuote(value) + " is an invalid value for the \"" + name + "\" parameter: "
                 + e.message,
                 valuePos);
     }
 
     private ParseException newUnknownParameterException(String name, int namePos) throws ParseException {
         StringBuilder sb = new StringBuilder(128);
-        sb.append("Unsupported parameter name, ").append(StringUtil.jQuote(name));
+        sb.append("Unsupported parameter name, ").append(_StringUtil.jQuote(name));
         sb.append(". The supported names are: ");
         Set<String> legalNames = PARAM_HANDLERS.keySet();
         String[] legalNameArr = legalNames.toArray(new String[legalNames.size()]);
@@ -422,7 +422,7 @@ class ExtendedDecimalFormatParser {
     }
 
     private String unescape(String s, char openedQuot) {
-        return openedQuot == '\'' ? StringUtil.replace(s, "\'\'", "\'") : StringUtil.replace(s, "\"\"", "\"");
+        return openedQuot == '\'' ? _StringUtil.replace(s, "\'\'", "\'") : _StringUtil.replace(s, "\"\"", "\"");
     }
 
     private String fetchStandardPattern() {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/HTMLOutputFormat.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/HTMLOutputFormat.java b/src/main/java/org/apache/freemarker/core/ast/HTMLOutputFormat.java
index e8bda42..ca0ae6d 100644
--- a/src/main/java/org/apache/freemarker/core/ast/HTMLOutputFormat.java
+++ b/src/main/java/org/apache/freemarker/core/ast/HTMLOutputFormat.java
@@ -22,11 +22,11 @@ import java.io.IOException;
 import java.io.Writer;
 
 import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * Represents the HTML output format (MIME type "text/html", name "HTML"). This format escapes by default (via
- * {@link StringUtil#XHTMLEnc(String)}). The {@code ?html}, {@code ?xhtml} and {@code ?xml} built-ins silently bypass
+ * {@link _StringUtil#XHTMLEnc(String)}). The {@code ?html}, {@code ?xhtml} and {@code ?xml} built-ins silently bypass
  * template output values of the type produced by this output format ({@link TemplateHTMLOutputModel}).
  * 
  * @since 2.3.24
@@ -54,12 +54,12 @@ public final class HTMLOutputFormat extends CommonMarkupOutputFormat<TemplateHTM
 
     @Override
     public void output(String textToEsc, Writer out) throws IOException, TemplateModelException {
-        StringUtil.XHTMLEnc(textToEsc, out);
+        _StringUtil.XHTMLEnc(textToEsc, out);
     }
 
     @Override
     public String escapePlainText(String plainTextContent) {
-        return StringUtil.XHTMLEnc(plainTextContent);
+        return _StringUtil.XHTMLEnc(plainTextContent);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/ISOLikeTemplateDateFormat.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/ISOLikeTemplateDateFormat.java b/src/main/java/org/apache/freemarker/core/ast/ISOLikeTemplateDateFormat.java
index 97038c1..ed94371 100644
--- a/src/main/java/org/apache/freemarker/core/ast/ISOLikeTemplateDateFormat.java
+++ b/src/main/java/org/apache/freemarker/core/ast/ISOLikeTemplateDateFormat.java
@@ -24,11 +24,11 @@ import java.util.TimeZone;
 
 import org.apache.freemarker.core.model.TemplateDateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.util.DateUtil;
-import org.apache.freemarker.core.util.StringUtil;
-import org.apache.freemarker.core.util.DateUtil.CalendarFieldsToDateConverter;
-import org.apache.freemarker.core.util.DateUtil.DateParseException;
-import org.apache.freemarker.core.util.DateUtil.DateToISO8601CalendarFactory;
+import org.apache.freemarker.core.util._DateUtil;
+import org.apache.freemarker.core.util._StringUtil;
+import org.apache.freemarker.core.util._DateUtil.CalendarFieldsToDateConverter;
+import org.apache.freemarker.core.util._DateUtil.DateParseException;
+import org.apache.freemarker.core.util._DateUtil.DateToISO8601CalendarFactory;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
@@ -68,7 +68,7 @@ abstract class ISOLikeTemplateDateFormat  extends TemplateDateFormat {
         final int ln = formatString.length();
         boolean afterSeparator = false;
         int i = parsingStart;
-        int accuracy = DateUtil.ACCURACY_MILLISECONDS;
+        int accuracy = _DateUtil.ACCURACY_MILLISECONDS;
         Boolean showZoneOffset = null;
         Boolean forceUTC = Boolean.FALSE;
         while (i < ln) {
@@ -85,7 +85,7 @@ abstract class ISOLikeTemplateDateFormat  extends TemplateDateFormat {
                 case 'h':
                 case 'm':
                 case 's':
-                    if (accuracy != DateUtil.ACCURACY_MILLISECONDS) {
+                    if (accuracy != _DateUtil.ACCURACY_MILLISECONDS) {
                         throw new InvalidFormatParametersException(
                                 "Character \"" + c + "\" is unexpected as accuracy was already specified earlier "
                                 + "(at char pos. " + i + ").");
@@ -96,22 +96,22 @@ abstract class ISOLikeTemplateDateFormat  extends TemplateDateFormat {
                             throw new InvalidFormatParametersException(
                                     XS_LESS_THAN_SECONDS_ACCURACY_ERROR_MESSAGE);
                         }
-                        accuracy = DateUtil.ACCURACY_HOURS;
+                        accuracy = _DateUtil.ACCURACY_HOURS;
                         break;
                     case 'm':
                         if (i < ln && formatString.charAt(i) == 's') {
                             i++;
-                            accuracy = DateUtil.ACCURACY_MILLISECONDS_FORCED;
+                            accuracy = _DateUtil.ACCURACY_MILLISECONDS_FORCED;
                         } else {
                             if (isXSMode()) {
                                 throw new InvalidFormatParametersException(
                                         XS_LESS_THAN_SECONDS_ACCURACY_ERROR_MESSAGE);
                             }
-                            accuracy = DateUtil.ACCURACY_MINUTES;
+                            accuracy = _DateUtil.ACCURACY_MINUTES;
                         }
                         break;
                     case 's':
-                        accuracy = DateUtil.ACCURACY_SECONDS;
+                        accuracy = _DateUtil.ACCURACY_SECONDS;
                         break;
                     }
                     break;
@@ -156,7 +156,7 @@ abstract class ISOLikeTemplateDateFormat  extends TemplateDateFormat {
                     break;
                 default:
                     throw new InvalidFormatParametersException(
-                            "Unexpected character, " + StringUtil.jQuote(String.valueOf(c))
+                            "Unexpected character, " + _StringUtil.jQuote(String.valueOf(c))
                             + ". Expected the beginning of one of: h, m, s, ms, nz, fz, u"
                             + " (at char pos. " + i + ").");
                 } // switch
@@ -188,7 +188,7 @@ abstract class ISOLikeTemplateDateFormat  extends TemplateDateFormat {
                         ? !zonelessInput
                         : showZoneOffset.booleanValue(),
                 accuracy,
-                (forceUTC == null ? !zonelessInput : forceUTC.booleanValue()) ? DateUtil.UTC : timeZone,
+                (forceUTC == null ? !zonelessInput : forceUTC.booleanValue()) ? _DateUtil.UTC : timeZone,
                 factory.getISOBuiltInCalendar(env));
     }
     
@@ -203,7 +203,7 @@ abstract class ISOLikeTemplateDateFormat  extends TemplateDateFormat {
             justification = "Known to use the singleton Boolean-s only")
     public final Date parse(String s, int dateType) throws UnparsableValueException {
         CalendarFieldsToDateConverter calToDateConverter = factory.getCalendarFieldsToDateCalculator(env);
-        TimeZone tz = forceUTC != Boolean.FALSE ? DateUtil.UTC : timeZone;
+        TimeZone tz = forceUTC != Boolean.FALSE ? _DateUtil.UTC : timeZone;
         try {
             if (dateType == TemplateDateModel.DATE) {
                 return parseDate(s, tz, calToDateConverter);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/ISOLikeTemplateDateFormatFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/ISOLikeTemplateDateFormatFactory.java b/src/main/java/org/apache/freemarker/core/ast/ISOLikeTemplateDateFormatFactory.java
index 43e3215..e51f2d0 100644
--- a/src/main/java/org/apache/freemarker/core/ast/ISOLikeTemplateDateFormatFactory.java
+++ b/src/main/java/org/apache/freemarker/core/ast/ISOLikeTemplateDateFormatFactory.java
@@ -19,10 +19,10 @@
 
 package org.apache.freemarker.core.ast;
 
-import org.apache.freemarker.core.util.DateUtil.CalendarFieldsToDateConverter;
-import org.apache.freemarker.core.util.DateUtil.DateToISO8601CalendarFactory;
-import org.apache.freemarker.core.util.DateUtil.TrivialCalendarFieldsToDateConverter;
-import org.apache.freemarker.core.util.DateUtil.TrivialDateToISO8601CalendarFactory;
+import org.apache.freemarker.core.util._DateUtil.CalendarFieldsToDateConverter;
+import org.apache.freemarker.core.util._DateUtil.DateToISO8601CalendarFactory;
+import org.apache.freemarker.core.util._DateUtil.TrivialCalendarFieldsToDateConverter;
+import org.apache.freemarker.core.util._DateUtil.TrivialDateToISO8601CalendarFactory;
 
 abstract class ISOLikeTemplateDateFormatFactory extends TemplateDateFormatFactory {
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/ISOTemplateDateFormat.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/ISOTemplateDateFormat.java b/src/main/java/org/apache/freemarker/core/ast/ISOTemplateDateFormat.java
index bb98077..7bff342 100644
--- a/src/main/java/org/apache/freemarker/core/ast/ISOTemplateDateFormat.java
+++ b/src/main/java/org/apache/freemarker/core/ast/ISOTemplateDateFormat.java
@@ -22,10 +22,10 @@ package org.apache.freemarker.core.ast;
 import java.util.Date;
 import java.util.TimeZone;
 
-import org.apache.freemarker.core.util.DateUtil;
-import org.apache.freemarker.core.util.DateUtil.CalendarFieldsToDateConverter;
-import org.apache.freemarker.core.util.DateUtil.DateParseException;
-import org.apache.freemarker.core.util.DateUtil.DateToISO8601CalendarFactory;
+import org.apache.freemarker.core.util._DateUtil;
+import org.apache.freemarker.core.util._DateUtil.CalendarFieldsToDateConverter;
+import org.apache.freemarker.core.util._DateUtil.DateParseException;
+import org.apache.freemarker.core.util._DateUtil.DateToISO8601CalendarFactory;
 
 final class ISOTemplateDateFormat extends ISOLikeTemplateDateFormat {
 
@@ -42,26 +42,26 @@ final class ISOTemplateDateFormat extends ISOLikeTemplateDateFormat {
     @Override
     protected String format(Date date, boolean datePart, boolean timePart, boolean offsetPart, int accuracy,
             TimeZone timeZone, DateToISO8601CalendarFactory calendarFactory) {
-        return DateUtil.dateToISO8601String(
+        return _DateUtil.dateToISO8601String(
                 date, datePart, timePart, timePart && offsetPart, accuracy, timeZone, calendarFactory);
     }
 
     @Override
     protected Date parseDate(String s, TimeZone tz, CalendarFieldsToDateConverter calToDateConverter)
             throws DateParseException {
-        return DateUtil.parseISO8601Date(s, tz, calToDateConverter);
+        return _DateUtil.parseISO8601Date(s, tz, calToDateConverter);
     }
 
     @Override
     protected Date parseTime(String s, TimeZone tz, CalendarFieldsToDateConverter calToDateConverter)
             throws DateParseException {
-        return DateUtil.parseISO8601Time(s, tz, calToDateConverter);
+        return _DateUtil.parseISO8601Time(s, tz, calToDateConverter);
     }
 
     @Override
     protected Date parseDateTime(String s, TimeZone tz,
             CalendarFieldsToDateConverter calToDateConverter) throws DateParseException {
-        return DateUtil.parseISO8601DateTime(s, tz, calToDateConverter);
+        return _DateUtil.parseISO8601DateTime(s, tz, calToDateConverter);
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/Identifier.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Identifier.java b/src/main/java/org/apache/freemarker/core/ast/Identifier.java
index d662fce..f2a955d 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Identifier.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Identifier.java
@@ -21,6 +21,7 @@ package org.apache.freemarker.core.ast;
 
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.TemplateModel;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * A reference to a top-level variable
@@ -50,7 +51,7 @@ final class Identifier extends Expression {
 
     @Override
     public String getCanonicalForm() {
-        return _CoreStringUtils.toFTLTopLevelIdentifierReference(name);
+        return _StringUtil.toFTLTopLevelIdentifierReference(name);
     }
     
     /**

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/Include.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Include.java b/src/main/java/org/apache/freemarker/core/ast/Include.java
index a966f97..9adeb38 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Include.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Include.java
@@ -26,7 +26,7 @@ import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateScalarModel;
 import org.apache.freemarker.core.templateresolver.MalformedTemplateNameException;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 
 /**
@@ -80,7 +80,7 @@ final class Include extends TemplateElement {
                 try {
                     if (parseExp instanceof StringLiteral) {
                         // Legacy
-                        parse = Boolean.valueOf(StringUtil.getYesNo(parseExp.evalAndCoerceToPlainText(null)));
+                        parse = Boolean.valueOf(_StringUtil.getYesNo(parseExp.evalAndCoerceToPlainText(null)));
                     } else {
                         try {
                             parse = Boolean.valueOf(parseExp.evalToBoolean(template.getConfiguration()));
@@ -232,7 +232,7 @@ final class Include extends TemplateElement {
 
     private boolean getYesNo(Expression exp, String s) throws TemplateException {
         try {
-           return StringUtil.getYesNo(s);
+           return _StringUtil.getYesNo(s);
         } catch (IllegalArgumentException iae) {
             throw new _MiscTemplateException(exp,
                      "Value must be boolean (or one of these strings: "

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/Items.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Items.java b/src/main/java/org/apache/freemarker/core/ast/Items.java
index 82842f5..6f9fa40 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Items.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Items.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.ast.IteratorBlock.IterationContext;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * An #items element.
@@ -66,10 +67,10 @@ class Items extends TemplateElement {
         if (canonical) sb.append('<');
         sb.append(getNodeTypeSymbol());
         sb.append(" as ");
-        sb.append(_CoreStringUtils.toFTLTopLevelIdentifierReference(loopVarName));
+        sb.append(_StringUtil.toFTLTopLevelIdentifierReference(loopVarName));
         if (loopVar2Name != null) {
             sb.append(", ");
-            sb.append(_CoreStringUtils.toFTLTopLevelIdentifierReference(loopVar2Name));
+            sb.append(_StringUtil.toFTLTopLevelIdentifierReference(loopVar2Name));
         }
         if (canonical) {
             sb.append('>');

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/IteratorBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/IteratorBlock.java b/src/main/java/org/apache/freemarker/core/ast/IteratorBlock.java
index f2bc9b7..206fe88 100644
--- a/src/main/java/org/apache/freemarker/core/ast/IteratorBlock.java
+++ b/src/main/java/org/apache/freemarker/core/ast/IteratorBlock.java
@@ -37,6 +37,7 @@ import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.model.TemplateHashModelEx2.KeyValuePair;
 import org.apache.freemarker.core.model.TemplateHashModelEx2.KeyValuePairIterator;
 import org.apache.freemarker.core.model.impl.SimpleNumber;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * A #list (or #foreach) element, or pre-#else section of it inside a {@link ListElseContainer}.
@@ -133,17 +134,17 @@ final class IteratorBlock extends TemplateElement {
         buf.append(getNodeTypeSymbol());
         buf.append(' ');
         if (forEach) {
-            buf.append(_CoreStringUtils.toFTLTopLevelIdentifierReference(loopVarName));
+            buf.append(_StringUtil.toFTLTopLevelIdentifierReference(loopVarName));
             buf.append(" in ");
             buf.append(listedExp.getCanonicalForm());
         } else {
             buf.append(listedExp.getCanonicalForm());
             if (loopVarName != null) {
                 buf.append(" as ");
-                buf.append(_CoreStringUtils.toFTLTopLevelIdentifierReference(loopVarName));
+                buf.append(_StringUtil.toFTLTopLevelIdentifierReference(loopVarName));
                 if (loopVar2Name != null) {
                     buf.append(", ");
-                    buf.append(_CoreStringUtils.toFTLTopLevelIdentifierReference(loopVar2Name));
+                    buf.append(_StringUtil.toFTLTopLevelIdentifierReference(loopVar2Name));
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/LibraryLoad.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/LibraryLoad.java b/src/main/java/org/apache/freemarker/core/ast/LibraryLoad.java
index 879f547..0143a08 100644
--- a/src/main/java/org/apache/freemarker/core/ast/LibraryLoad.java
+++ b/src/main/java/org/apache/freemarker/core/ast/LibraryLoad.java
@@ -24,6 +24,7 @@ import java.io.IOException;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.templateresolver.MalformedTemplateNameException;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * <b>Internal API - subject to change:</b> Represents an import via {@code #import}.
@@ -80,7 +81,7 @@ public final class LibraryLoad extends TemplateElement {
         buf.append(' ');
         buf.append(importedTemplateNameExp.getCanonicalForm());
         buf.append(" as ");
-        buf.append(_CoreStringUtils.toFTLTopLevelTragetIdentifier(targetNsVarName));
+        buf.append(_StringUtil.toFTLTopLevelTragetIdentifier(targetNsVarName));
         if (canonical) buf.append("/>");
         return buf.toString();
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/Macro.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Macro.java b/src/main/java/org/apache/freemarker/core/ast/Macro.java
index a3cb025..44d19c6 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Macro.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Macro.java
@@ -29,6 +29,7 @@ import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.model.TemplateModelIterator;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * An element representing a macro declaration.
@@ -99,7 +100,7 @@ public final class Macro extends TemplateElement implements TemplateModel {
         if (canonical) sb.append('<');
         sb.append(getNodeTypeSymbol());
         sb.append(' ');
-        sb.append(_CoreStringUtils.toFTLTopLevelTragetIdentifier(name));
+        sb.append(_StringUtil.toFTLTopLevelTragetIdentifier(name));
         if (function) sb.append('(');
         int argCnt = paramNames.length;
         for (int i = 0; i < argCnt; i++) {
@@ -111,7 +112,7 @@ public final class Macro extends TemplateElement implements TemplateModel {
                 sb.append(' ');
             }
             String argName = paramNames[i];
-            sb.append(_CoreStringUtils.toFTLTopLevelIdentifierReference(argName));
+            sb.append(_StringUtil.toFTLTopLevelIdentifierReference(argName));
             if (paramDefaults != null && paramDefaults.get(argName) != null) {
                 sb.append('=');
                 Expression defaultExpr = (Expression) paramDefaults.get(argName);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/MarkupOutputFormatBoundBuiltIn.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/MarkupOutputFormatBoundBuiltIn.java b/src/main/java/org/apache/freemarker/core/ast/MarkupOutputFormatBoundBuiltIn.java
index 497d030..d1c0dc5 100644
--- a/src/main/java/org/apache/freemarker/core/ast/MarkupOutputFormatBoundBuiltIn.java
+++ b/src/main/java/org/apache/freemarker/core/ast/MarkupOutputFormatBoundBuiltIn.java
@@ -20,14 +20,14 @@ package org.apache.freemarker.core.ast;
 
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.util.NullArgumentException;
+import org.apache.freemarker.core.util._NullArgumentException;
 
 abstract class MarkupOutputFormatBoundBuiltIn extends SpecialBuiltIn {
     
     protected MarkupOutputFormat outputFormat;
     
     void bindToMarkupOutputFormat(MarkupOutputFormat outputFormat) {
-        NullArgumentException.check(outputFormat);
+        _NullArgumentException.check(outputFormat);
         this.outputFormat = outputFormat;
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/MessageUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/MessageUtil.java b/src/main/java/org/apache/freemarker/core/ast/MessageUtil.java
index 3c38fdb..9436654 100644
--- a/src/main/java/org/apache/freemarker/core/ast/MessageUtil.java
+++ b/src/main/java/org/apache/freemarker/core/ast/MessageUtil.java
@@ -25,7 +25,7 @@ import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * Utilities for creating error messages (and other messages).
@@ -106,12 +106,12 @@ class MessageUtil {
             macroOrFuncName = null;
         } else { 
             templateDesc = templateSourceName != null
-                ? "template " + StringUtil.jQuoteNoXSS(templateSourceName)
+                ? "template " + _StringUtil.jQuoteNoXSS(templateSourceName)
                 : "nameless template";
         }
         return "in " + templateDesc
               + (macroOrFuncName != null
-                      ? " in " + (isFunction ? "function " : "macro ") + StringUtil.jQuote(macroOrFuncName)
+                      ? " in " + (isFunction ? "function " : "macro ") + _StringUtil.jQuote(macroOrFuncName)
                       : "")
               + " "
               + preposition + " " + formatPosition(line, column);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/MethodCall.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/MethodCall.java b/src/main/java/org/apache/freemarker/core/ast/MethodCall.java
index 167238d..802fcda 100644
--- a/src/main/java/org/apache/freemarker/core/ast/MethodCall.java
+++ b/src/main/java/org/apache/freemarker/core/ast/MethodCall.java
@@ -32,7 +32,7 @@ import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.TemplateMethodModel;
 import org.apache.freemarker.core.model.TemplateMethodModelEx;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.util.NullWriter;
+import org.apache.freemarker.core.util._NullWriter;
 
 
 /**
@@ -72,7 +72,7 @@ final class MethodCall extends Expression {
             }
             Writer prevOut = env.getOut();
             try {
-                env.setOut(NullWriter.INSTANCE);
+                env.setOut(_NullWriter.INSTANCE);
                 env.invoke(func, null, arguments.items, null, null);
             } catch (IOException e) {
                 // Should not occur

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/NestedContentNotSupportedException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/NestedContentNotSupportedException.java b/src/main/java/org/apache/freemarker/core/ast/NestedContentNotSupportedException.java
index 76017e2..6dc4de0 100644
--- a/src/main/java/org/apache/freemarker/core/ast/NestedContentNotSupportedException.java
+++ b/src/main/java/org/apache/freemarker/core/ast/NestedContentNotSupportedException.java
@@ -23,7 +23,7 @@ import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.ast.Environment.NestedElementTemplateDirectiveBody;
 import org.apache.freemarker.core.ast.ThreadInterruptionSupportTemplatePostProcessor.ThreadInterruptionCheck;
 import org.apache.freemarker.core.model.TemplateDirectiveBody;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * [2.4] Should become public somehow; this is more intelligent than a {@code null} check, for example, when the body
@@ -61,7 +61,7 @@ class NestedContentNotSupportedException extends TemplateException {
 
     private NestedContentNotSupportedException(String description, Exception cause, Environment env) {
         super( "Nested content (body) not supported."
-                + (description != null ? " " + StringUtil.jQuote(description) : ""),
+                + (description != null ? " " + _StringUtil.jQuote(description) : ""),
                 cause, env);
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/NonSequenceOrCollectionException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/NonSequenceOrCollectionException.java b/src/main/java/org/apache/freemarker/core/ast/NonSequenceOrCollectionException.java
index 329d957..813c403 100644
--- a/src/main/java/org/apache/freemarker/core/ast/NonSequenceOrCollectionException.java
+++ b/src/main/java/org/apache/freemarker/core/ast/NonSequenceOrCollectionException.java
@@ -23,7 +23,7 @@ import org.apache.freemarker.core.model.TemplateCollectionModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.model.WrapperTemplateModel;
-import org.apache.freemarker.core.util.CollectionUtils;
+import org.apache.freemarker.core.util._CollectionUtil;
 
 /**
  * Indicates that a {@link TemplateSequenceModel} or {@link TemplateCollectionModel} value was expected, but the value
@@ -55,7 +55,7 @@ public class NonSequenceOrCollectionException extends UnexpectedTypeException {
     NonSequenceOrCollectionException(
             Expression blamed, TemplateModel model, Environment env)
             throws InvalidReferenceException {
-        this(blamed, model, CollectionUtils.EMPTY_OBJECT_ARRAY, env);
+        this(blamed, model, _CollectionUtil.EMPTY_OBJECT_ARRAY, env);
     }
 
     NonSequenceOrCollectionException(

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/NumericalOutput.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/NumericalOutput.java b/src/main/java/org/apache/freemarker/core/ast/NumericalOutput.java
index 732f154..acaab86 100644
--- a/src/main/java/org/apache/freemarker/core/ast/NumericalOutput.java
+++ b/src/main/java/org/apache/freemarker/core/ast/NumericalOutput.java
@@ -25,7 +25,7 @@ import java.text.NumberFormat;
 import java.util.Locale;
 
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * An instruction that outputs the value of a numerical expression.
@@ -104,7 +104,7 @@ final class NumericalOutput extends Interpolation {
     protected String dump(boolean canonical, boolean inStringLiteral) {
         StringBuilder buf = new StringBuilder("#{");
         final String exprCF = expression.getCanonicalForm();
-        buf.append(inStringLiteral ? StringUtil.FTLStringLiteralEnc(exprCF, '"') : exprCF);
+        buf.append(inStringLiteral ? _StringUtil.FTLStringLiteralEnc(exprCF, '"') : exprCF);
         if (hasFormat) {
             buf.append(" ; ");
             buf.append("m");

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/OptInTemplateClassResolver.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/OptInTemplateClassResolver.java b/src/main/java/org/apache/freemarker/core/ast/OptInTemplateClassResolver.java
index fb6d928..41aa62d 100644
--- a/src/main/java/org/apache/freemarker/core/ast/OptInTemplateClassResolver.java
+++ b/src/main/java/org/apache/freemarker/core/ast/OptInTemplateClassResolver.java
@@ -28,8 +28,8 @@ import java.util.Set;
 
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.util.ClassUtil;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._ClassUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * A {@link TemplateClassResolver} that resolves only the classes whose name 
@@ -106,7 +106,7 @@ public class OptInTemplateClassResolver implements TemplateClassResolver {
                         "\" setting in the FreeMarker configuration.)");
             } else {
                 try {
-                    return ClassUtil.forName(className);
+                    return _ClassUtil.forName(className);
                 } catch (ClassNotFoundException e) {
                     throw new _MiscTemplateException(e, env);
                 }
@@ -127,12 +127,12 @@ public class OptInTemplateClassResolver implements TemplateClassResolver {
         // Detect exploits, return null if one is suspected:
         String decodedName = name;
         if (decodedName.indexOf('%') != -1) {
-            decodedName = StringUtil.replace(decodedName, "%2e", ".", false, false);
-            decodedName = StringUtil.replace(decodedName, "%2E", ".", false, false);
-            decodedName = StringUtil.replace(decodedName, "%2f", "/", false, false);
-            decodedName = StringUtil.replace(decodedName, "%2F", "/", false, false);
-            decodedName = StringUtil.replace(decodedName, "%5c", "\\", false, false);
-            decodedName = StringUtil.replace(decodedName, "%5C", "\\", false, false);
+            decodedName = _StringUtil.replace(decodedName, "%2e", ".", false, false);
+            decodedName = _StringUtil.replace(decodedName, "%2E", ".", false, false);
+            decodedName = _StringUtil.replace(decodedName, "%2f", "/", false, false);
+            decodedName = _StringUtil.replace(decodedName, "%2F", "/", false, false);
+            decodedName = _StringUtil.replace(decodedName, "%5c", "\\", false, false);
+            decodedName = _StringUtil.replace(decodedName, "%5C", "\\", false, false);
         }
         int dotDotIdx = decodedName.indexOf("..");
         if (dotDotIdx != -1) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/OutputFormat.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/OutputFormat.java b/src/main/java/org/apache/freemarker/core/ast/OutputFormat.java
index 5a2d9e6..506d4fa 100644
--- a/src/main/java/org/apache/freemarker/core/ast/OutputFormat.java
+++ b/src/main/java/org/apache/freemarker/core/ast/OutputFormat.java
@@ -19,8 +19,8 @@
 package org.apache.freemarker.core.ast;
 
 import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.util.ClassUtil;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._ClassUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * Represents an output format. If you need auto-escaping, see its subclass, {@link MarkupOutputFormat}. 
@@ -67,8 +67,8 @@ public abstract class OutputFormat {
     public final String toString() {
         String extras = toStringExtraProperties();
         return getName() + "("
-                + "mimeType=" + StringUtil.jQuote(getMimeType()) + ", "
-                + "class=" + ClassUtil.getShortClassNameOfObject(this, true)
+                + "mimeType=" + _StringUtil.jQuote(getMimeType()) + ", "
+                + "class=" + _ClassUtil.getShortClassNameOfObject(this, true)
                 + (extras.length() != 0 ? ", " : "") + extras
                 + ")";
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/OutputFormatBoundBuiltIn.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/OutputFormatBoundBuiltIn.java b/src/main/java/org/apache/freemarker/core/ast/OutputFormatBoundBuiltIn.java
index 67bb64b..92b0d89 100644
--- a/src/main/java/org/apache/freemarker/core/ast/OutputFormatBoundBuiltIn.java
+++ b/src/main/java/org/apache/freemarker/core/ast/OutputFormatBoundBuiltIn.java
@@ -20,7 +20,7 @@ package org.apache.freemarker.core.ast;
 
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.util.NullArgumentException;
+import org.apache.freemarker.core.util._NullArgumentException;
 
 abstract class OutputFormatBoundBuiltIn extends SpecialBuiltIn {
     
@@ -28,7 +28,7 @@ abstract class OutputFormatBoundBuiltIn extends SpecialBuiltIn {
     protected int autoEscapingPolicy;
     
     void bindToOutputFormat(OutputFormat outputFormat, int autoEscapingPolicy) {
-        NullArgumentException.check(outputFormat);
+        _NullArgumentException.check(outputFormat);
         this.outputFormat = outputFormat;
         this.autoEscapingPolicy = autoEscapingPolicy;
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/ParseException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/ParseException.java b/src/main/java/org/apache/freemarker/core/ast/ParseException.java
index 6b106fb..620fbe0 100644
--- a/src/main/java/org/apache/freemarker/core/ast/ParseException.java
+++ b/src/main/java/org/apache/freemarker/core/ast/ParseException.java
@@ -26,10 +26,8 @@ import java.util.Set;
 
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.ast.FMParserConstants;
-import org.apache.freemarker.core.ast.Token;
-import org.apache.freemarker.core.util.SecurityUtilities;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._SecurityUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * Parsing-time exception in a template (as opposed to a runtime exception, a {@link TemplateException}). This usually
@@ -79,7 +77,7 @@ public class ParseException extends IOException implements FMParserConstants {
     /**
      * The end of line string for this machine.
      */
-    protected String eol = SecurityUtilities.getSystemProperty("line.separator", "\n");
+    protected String eol = _SecurityUtil.getSystemProperty("line.separator", "\n");
 
     /** @deprecated Will be remove without replacement in 2.4. */
     @Deprecated
@@ -491,7 +489,7 @@ public class ParseException extends IOException implements FMParserConstants {
                     + "Check if you have a valid #if-#elseif-#else or #list-#else structure.";
         } else if (kind == END_IF || kind == ELSE_IF) {
             return "Unexpected directive, "
-                    + StringUtil.jQuote(nextToken)
+                    + _StringUtil.jQuote(nextToken)
                     + ". Check if you have a valid #if-#elseif-#else structure.";
         }
         return null;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/PropertySetting.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/PropertySetting.java b/src/main/java/org/apache/freemarker/core/ast/PropertySetting.java
index 7cea997..b31808a 100644
--- a/src/main/java/org/apache/freemarker/core/ast/PropertySetting.java
+++ b/src/main/java/org/apache/freemarker/core/ast/PropertySetting.java
@@ -30,7 +30,7 @@ import org.apache.freemarker.core.model.TemplateBooleanModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateNumberModel;
 import org.apache.freemarker.core.model.TemplateScalarModel;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * An instruction that sets a property of the template rendering
@@ -75,7 +75,7 @@ final class PropertySetting extends TemplateElement {
                         + "supported.");                
             } else {
                 sb.append("Unknown setting name: ");
-                sb.append(StringUtil.jQuote(key)).append(".");
+                sb.append(_StringUtil.jQuote(key)).append(".");
                 sb.append(" The allowed setting names are: ");
 
                 int shownNamingConvention;
@@ -88,7 +88,7 @@ final class PropertySetting extends TemplateElement {
                 boolean first = true;
                 for (int i = 0; i < SETTING_NAMES.length; i++) {
                     String correctName = SETTING_NAMES[i];
-                    int correctNameNamingConvetion = _CoreStringUtils.getIdentifierNamingConvention(correctName);
+                    int correctNameNamingConvetion = _StringUtil.getIdentifierNamingConvention(correctName);
                     if (shownNamingConvention == Configuration.CAMEL_CASE_NAMING_CONVENTION 
                             ? correctNameNamingConvetion != Configuration.LEGACY_NAMING_CONVENTION
                             : correctNameNamingConvetion != Configuration.CAMEL_CASE_NAMING_CONVENTION) {
@@ -132,7 +132,7 @@ final class PropertySetting extends TemplateElement {
         if (canonical) sb.append('<');
         sb.append(getNodeTypeSymbol());
         sb.append(' ');
-        sb.append(_CoreStringUtils.toFTLTopLevelTragetIdentifier(key));
+        sb.append(_StringUtil.toFTLTopLevelTragetIdentifier(key));
         sb.append('=');
         sb.append(value.getCanonicalForm());
         if (canonical) sb.append("/>");

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/RTFOutputFormat.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/RTFOutputFormat.java b/src/main/java/org/apache/freemarker/core/ast/RTFOutputFormat.java
index 81b921d..d8f2ae1 100644
--- a/src/main/java/org/apache/freemarker/core/ast/RTFOutputFormat.java
+++ b/src/main/java/org/apache/freemarker/core/ast/RTFOutputFormat.java
@@ -22,11 +22,11 @@ import java.io.IOException;
 import java.io.Writer;
 
 import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * Represents the Rich Text Format output format (MIME type "application/rtf", name "RTF"). This format escapes by
- * default (via {@link StringUtil#RTFEnc(String)}). The {@code ?rtf} built-in silently bypasses template output values
+ * default (via {@link _StringUtil#RTFEnc(String)}). The {@code ?rtf} built-in silently bypasses template output values
  * of the type produced by this output format ({@link TemplateRTFOutputModel}).
  * 
  * @since 2.3.24
@@ -54,12 +54,12 @@ public final class RTFOutputFormat extends CommonMarkupOutputFormat<TemplateRTFO
 
     @Override
     public void output(String textToEsc, Writer out) throws IOException, TemplateModelException {
-        StringUtil.RTFEnc(textToEsc, out);
+        _StringUtil.RTFEnc(textToEsc, out);
     }
 
     @Override
     public String escapePlainText(String plainTextContent) {
-        return StringUtil.RTFEnc(plainTextContent);
+        return _StringUtil.RTFEnc(plainTextContent);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/RegexpHelper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/RegexpHelper.java b/src/main/java/org/apache/freemarker/core/ast/RegexpHelper.java
index ba63583..8853f6b 100644
--- a/src/main/java/org/apache/freemarker/core/ast/RegexpHelper.java
+++ b/src/main/java/org/apache/freemarker/core/ast/RegexpHelper.java
@@ -25,7 +25,7 @@ import java.util.regex.PatternSyntaxException;
 import org.apache.freemarker.core._CoreLogs;
 import org.apache.freemarker.core.model.TemplateModelException;
 import org.apache.freemarker.core.templateresolver.impl.MruCacheStorage;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 import org.slf4j.Logger;
 
 /**
@@ -145,7 +145,7 @@ final class RegexpHelper {
                         // [FM3] Should be an error
                         RegexpHelper.logFlagWarning(
                                 "Unrecognized regular expression flag: "
-                                + StringUtil.jQuote(String.valueOf(c)) + ".");
+                                + _StringUtil.jQuote(String.valueOf(c)) + ".");
                     }
             }  // switch
         }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/StringLiteral.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/StringLiteral.java b/src/main/java/org/apache/freemarker/core/ast/StringLiteral.java
index e23f33e..4d98a26 100644
--- a/src/main/java/org/apache/freemarker/core/ast/StringLiteral.java
+++ b/src/main/java/org/apache/freemarker/core/ast/StringLiteral.java
@@ -30,7 +30,7 @@ import org.apache.freemarker.core.ast.SimpleCharStream;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateScalarModel;
 import org.apache.freemarker.core.model.impl.SimpleScalar;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 final class StringLiteral extends Expression implements TemplateScalarModel {
     
@@ -149,7 +149,7 @@ final class StringLiteral extends Expression implements TemplateScalarModel {
     @Override
     public String getCanonicalForm() {
         if (dynamicValue == null) {
-            return StringUtil.ftlQuote(value);
+            return _StringUtil.ftlQuote(value);
         } else {
             StringBuilder sb = new StringBuilder();
             sb.append('"');
@@ -157,7 +157,7 @@ final class StringLiteral extends Expression implements TemplateScalarModel {
                 if (child instanceof Interpolation) {
                     sb.append(((Interpolation) child).getCanonicalFormInStringLiteral());
                 } else {
-                    sb.append(StringUtil.FTLStringLiteralEnc((String) child, '"'));
+                    sb.append(_StringUtil.FTLStringLiteralEnc((String) child, '"'));
                 }
             }
             sb.append('"');

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/TemplateClassResolver.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/TemplateClassResolver.java b/src/main/java/org/apache/freemarker/core/ast/TemplateClassResolver.java
index 7518227..3b354d3 100644
--- a/src/main/java/org/apache/freemarker/core/ast/TemplateClassResolver.java
+++ b/src/main/java/org/apache/freemarker/core/ast/TemplateClassResolver.java
@@ -21,7 +21,7 @@ package org.apache.freemarker.core.ast;
 
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
-import org.apache.freemarker.core.util.ClassUtil;
+import org.apache.freemarker.core.util._ClassUtil;
 
 /**
  * Used by built-ins and other template language features that get a class
@@ -38,7 +38,7 @@ import org.apache.freemarker.core.util.ClassUtil;
 public interface TemplateClassResolver {
     
     /**
-     * Simply calls {@link ClassUtil#forName(String)}.
+     * Simply calls {@link _ClassUtil#forName(String)}.
      */
     TemplateClassResolver UNRESTRICTED_RESOLVER = new TemplateClassResolver() {
 
@@ -46,7 +46,7 @@ public interface TemplateClassResolver {
         public Class resolve(String className, Environment env, Template template)
         throws TemplateException {
             try {
-                return ClassUtil.forName(className);
+                return _ClassUtil.forName(className);
             } catch (ClassNotFoundException e) {
                 throw new _MiscTemplateException(e, env);
             }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java b/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java
index 99a18f8..78d7f44 100644
--- a/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java
+++ b/src/main/java/org/apache/freemarker/core/ast/TemplateConfiguration.java
@@ -29,7 +29,7 @@ import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.Version;
 import org.apache.freemarker.core._TemplateAPI;
 import org.apache.freemarker.core.templateresolver.impl.DefaultTemplateResolver;
-import org.apache.freemarker.core.util.NullArgumentException;
+import org.apache.freemarker.core.util._NullArgumentException;
 
 /**
  * Used for customizing the configuration settings for individual {@link Template}-s (or rather groups of templates),
@@ -100,7 +100,7 @@ public final class TemplateConfiguration extends Configurable implements ParserC
      */
     @Override
     void setParent(Configurable cfg) {
-        NullArgumentException.check("cfg", cfg);
+        _NullArgumentException.check("cfg", cfg);
         if (!(cfg instanceof Configuration)) {
             throw new IllegalArgumentException("The parent of a TemplateConfiguration can only be a Configuration");
         }
@@ -466,7 +466,7 @@ public final class TemplateConfiguration extends Configurable implements ParserC
      * Sets the output format of the template; see {@link Configuration#setOutputFormat(OutputFormat)} for more.
      */
     public void setOutputFormat(OutputFormat outputFormat) {
-        NullArgumentException.check("outputFormat", outputFormat);
+        _NullArgumentException.check("outputFormat", outputFormat);
         this.outputFormat = outputFormat;
     }
 
@@ -532,7 +532,7 @@ public final class TemplateConfiguration extends Configurable implements ParserC
      * {@code encoding} in the documentation of {@link #apply(Template)}.
      */
     public void setEncoding(String encoding) {
-        NullArgumentException.check("encoding", encoding);
+        _NullArgumentException.check("encoding", encoding);
         this.encoding = encoding;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/TemplateElement.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/TemplateElement.java b/src/main/java/org/apache/freemarker/core/ast/TemplateElement.java
index 7dcdb3c..a987874 100644
--- a/src/main/java/org/apache/freemarker/core/ast/TemplateElement.java
+++ b/src/main/java/org/apache/freemarker/core/ast/TemplateElement.java
@@ -27,6 +27,7 @@ import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core.model.TemplateNodeModel;
 import org.apache.freemarker.core.model.TemplateSequenceModel;
 import org.apache.freemarker.core.model.impl.SimpleSequence;
+import org.apache.freemarker.core.util._ArrayEnumeration;
 
 /**
  * <b>Internal API - subject to change:</b> Represent directive call, interpolation, text block, or other such

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/TemplateElementArrayBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/TemplateElementArrayBuilder.java b/src/main/java/org/apache/freemarker/core/ast/TemplateElementArrayBuilder.java
index 257f5f7..14c17eb 100644
--- a/src/main/java/org/apache/freemarker/core/ast/TemplateElementArrayBuilder.java
+++ b/src/main/java/org/apache/freemarker/core/ast/TemplateElementArrayBuilder.java
@@ -18,7 +18,7 @@
  */
 package org.apache.freemarker.core.ast;
 
-import org.apache.freemarker.core.util.CollectionUtils;
+import org.apache.freemarker.core.util._CollectionUtil;
 
 /**
  * Holds an buffer (array) of {@link TemplateElement}-s with the count of the utilized items in it. The un-utilized tail
@@ -72,7 +72,7 @@ class TemplateElements {
      */
     TemplateElement asSingleElement() {
         if (count == 0) {
-            return new TextBlock(CollectionUtils.EMPTY_CHAR_ARRAY, false); 
+            return new TextBlock(_CollectionUtil.EMPTY_CHAR_ARRAY, false);
         } else {
             TemplateElement first = buffer[0];
             if (count == 1) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/TextBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/TextBlock.java b/src/main/java/org/apache/freemarker/core/ast/TextBlock.java
index e3bb8a7..e6cd638 100644
--- a/src/main/java/org/apache/freemarker/core/ast/TextBlock.java
+++ b/src/main/java/org/apache/freemarker/core/ast/TextBlock.java
@@ -21,8 +21,8 @@ package org.apache.freemarker.core.ast;
 
 import java.io.IOException;
 
-import org.apache.freemarker.core.util.CollectionUtils;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._CollectionUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * A TemplateElement representing a block of plain text.
@@ -77,7 +77,7 @@ public final class TextBlock extends TemplateElement {
             }
             return text;
         } else {
-            return "text " + StringUtil.jQuote(new String(text));
+            return "text " + _StringUtil.jQuote(new String(text));
         }
     }
     
@@ -156,7 +156,7 @@ public final class TextBlock extends TemplateElement {
                     if (lastNewLineIndex >= 0  || beginColumn == 1) {
                         char[] firstPart = substring(text, 0, lastNewLineIndex + 1);
                         char[] lastLine = substring(text, 1 + lastNewLineIndex); 
-                        if (StringUtil.isTrimmableToEmpty(lastLine)) {
+                        if (_StringUtil.isTrimmableToEmpty(lastLine)) {
                             this.text = firstPart;
                             this.endColumn = 0;
                         } else {
@@ -201,7 +201,7 @@ public final class TextBlock extends TemplateElement {
                     }
                     char[] trailingPart = substring(text, firstLineIndex);
                     char[] openingPart = substring(text, 0, firstLineIndex);
-                    if (StringUtil.isTrimmableToEmpty(openingPart)) {
+                    if (_StringUtil.isTrimmableToEmpty(openingPart)) {
                         this.text = trailingPart;
                         this.beginLine++;
                         this.beginColumn = 1;
@@ -211,7 +211,7 @@ public final class TextBlock extends TemplateElement {
                             lastNonWS--;
                         }
                         char[] printablePart = substring(text, 0, lastNonWS + 1);
-                        if (StringUtil.isTrimmableToEmpty(trailingPart)) {
+                        if (_StringUtil.isTrimmableToEmpty(trailingPart)) {
                         // THIS BLOCK IS HEINOUS! THERE MUST BE A BETTER WAY! REVISIT (JR)
                             boolean trimTrailingPart = true;
                             for (TemplateElement te = this.nextTerminalNode(); 
@@ -225,7 +225,7 @@ public final class TextBlock extends TemplateElement {
                                     break;
                                 }
                             }
-                            if (trimTrailingPart) trailingPart = CollectionUtils.EMPTY_CHAR_ARRAY;
+                            if (trimTrailingPart) trailingPart = _CollectionUtil.EMPTY_CHAR_ARRAY;
                         }
                         this.text = concat(printablePart, trailingPart);
                     }
@@ -272,7 +272,7 @@ public final class TextBlock extends TemplateElement {
                 ++newlineIndex;
             }
         }
-        if (!StringUtil.isTrimmableToEmpty(text, 0, newlineIndex)) {
+        if (!_StringUtil.isTrimmableToEmpty(text, 0, newlineIndex)) {
             return 0;
         }
         // We look at the preceding elements on the line to see if we should
@@ -296,7 +296,7 @@ public final class TextBlock extends TemplateElement {
         if (lastNewlineIndex == -1 && beginColumn != 1) {
             return 0;
         }
-        if (!StringUtil.isTrimmableToEmpty(text, lastNewlineIndex + 1)) {
+        if (!_StringUtil.isTrimmableToEmpty(text, lastNewlineIndex + 1)) {
             return 0;
         }
         // We look at the elements afterward on the same line to see if we should
@@ -351,7 +351,7 @@ public final class TextBlock extends TemplateElement {
             return true;
         }
         if (stripWhitespace) {
-            if (!StringUtil.isTrimmableToEmpty(text)) {
+            if (!_StringUtil.isTrimmableToEmpty(text)) {
                 return false;
             }
             TemplateElement parentElement = getParentElement();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/UnifiedCall.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/UnifiedCall.java b/src/main/java/org/apache/freemarker/core/ast/UnifiedCall.java
index 95aab6c..da3d95f 100644
--- a/src/main/java/org/apache/freemarker/core/ast/UnifiedCall.java
+++ b/src/main/java/org/apache/freemarker/core/ast/UnifiedCall.java
@@ -33,7 +33,7 @@ import org.apache.freemarker.core.model.TemplateDirectiveModel;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateTransformModel;
 import org.apache.freemarker.core.util.ObjectFactory;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
@@ -134,7 +134,7 @@ final class UnifiedCall extends TemplateElement implements DirectiveCallPlace {
                 Map.Entry entry = (Map.Entry) entries.get(i);
                 Expression argExp = (Expression) entry.getValue();
                 sb.append(' ');
-                sb.append(_CoreStringUtils.toFTLTopLevelIdentifierReference((String) entry.getKey()));
+                sb.append(_StringUtil.toFTLTopLevelIdentifierReference((String) entry.getKey()));
                 sb.append('=');
                 MessageUtil.appendExpressionAsUntearable(sb, argExp);
             }
@@ -145,7 +145,7 @@ final class UnifiedCall extends TemplateElement implements DirectiveCallPlace {
                 if (i != 0) {
                     sb.append(", ");
                 }
-                sb.append(_CoreStringUtils.toFTLTopLevelIdentifierReference((String) bodyParameterNames.get(i)));
+                sb.append(_StringUtil.toFTLTopLevelIdentifierReference((String) bodyParameterNames.get(i)));
             }
         }
         if (canonical) {
@@ -290,8 +290,8 @@ final class UnifiedCall extends TemplateElement implements DirectiveCallPlace {
         } catch (Exception e) {
             throw new CallPlaceCustomDataInitializationException(
                     "Failed to initialize custom data for provider identity "
-                    + StringUtil.tryToString(provierIdentity) + " via factory "
-                    + StringUtil.tryToString(objectFactory), e);
+                    + _StringUtil.tryToString(provierIdentity) + " via factory "
+                    + _StringUtil.tryToString(objectFactory), e);
         }
         if (customData == null) {
             throw new NullPointerException("ObjectFactory.createObject() has returned null");

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/XHTMLOutputFormat.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/XHTMLOutputFormat.java b/src/main/java/org/apache/freemarker/core/ast/XHTMLOutputFormat.java
index f5396ef..73f9c81 100644
--- a/src/main/java/org/apache/freemarker/core/ast/XHTMLOutputFormat.java
+++ b/src/main/java/org/apache/freemarker/core/ast/XHTMLOutputFormat.java
@@ -22,11 +22,11 @@ import java.io.IOException;
 import java.io.Writer;
 
 import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * Represents the XML output format (MIME type "application/xhtml+xml", name "XHTML"). This format escapes by default
- * (via {@link StringUtil#XHTMLEnc(String)}). The {@code ?xml} built-in silently bypasses template output values of the
+ * (via {@link _StringUtil#XHTMLEnc(String)}). The {@code ?xml} built-in silently bypasses template output values of the
  * type produced by this output format ({@link TemplateXHTMLOutputModel}).
  * 
  * @since 2.3.24
@@ -54,12 +54,12 @@ public final class XHTMLOutputFormat extends CommonMarkupOutputFormat<TemplateXH
 
     @Override
     public void output(String textToEsc, Writer out) throws IOException, TemplateModelException {
-        StringUtil.XHTMLEnc(textToEsc, out);
+        _StringUtil.XHTMLEnc(textToEsc, out);
     }
 
     @Override
     public String escapePlainText(String plainTextContent) {
-        return StringUtil.XHTMLEnc(plainTextContent);
+        return _StringUtil.XHTMLEnc(plainTextContent);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/XMLOutputFormat.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/XMLOutputFormat.java b/src/main/java/org/apache/freemarker/core/ast/XMLOutputFormat.java
index 88fd798..59b1670 100644
--- a/src/main/java/org/apache/freemarker/core/ast/XMLOutputFormat.java
+++ b/src/main/java/org/apache/freemarker/core/ast/XMLOutputFormat.java
@@ -22,11 +22,11 @@ import java.io.IOException;
 import java.io.Writer;
 
 import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 /**
  * Represents the XML output format (MIME type "application/xml", name "XML"). This format escapes by default (via
- * {@link StringUtil#XMLEnc(String)}). The {@code ?html}, {@code ?xhtml} and {@code ?xml} built-ins silently bypass
+ * {@link _StringUtil#XMLEnc(String)}). The {@code ?html}, {@code ?xhtml} and {@code ?xml} built-ins silently bypass
  * template output values of the type produced by this output format ({@link TemplateXHTMLOutputModel}).
  * 
  * @since 2.3.24
@@ -54,12 +54,12 @@ public final class XMLOutputFormat extends CommonMarkupOutputFormat<TemplateXMLO
 
     @Override
     public void output(String textToEsc, Writer out) throws IOException, TemplateModelException {
-        StringUtil.XMLEnc(textToEsc, out);
+        _StringUtil.XMLEnc(textToEsc, out);
     }
 
     @Override
     public String escapePlainText(String plainTextContent) {
-        return StringUtil.XMLEnc(plainTextContent);
+        return _StringUtil.XMLEnc(plainTextContent);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/XSTemplateDateFormat.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/XSTemplateDateFormat.java b/src/main/java/org/apache/freemarker/core/ast/XSTemplateDateFormat.java
index d182714..230557b 100644
--- a/src/main/java/org/apache/freemarker/core/ast/XSTemplateDateFormat.java
+++ b/src/main/java/org/apache/freemarker/core/ast/XSTemplateDateFormat.java
@@ -22,10 +22,10 @@ package org.apache.freemarker.core.ast;
 import java.util.Date;
 import java.util.TimeZone;
 
-import org.apache.freemarker.core.util.DateUtil;
-import org.apache.freemarker.core.util.DateUtil.CalendarFieldsToDateConverter;
-import org.apache.freemarker.core.util.DateUtil.DateParseException;
-import org.apache.freemarker.core.util.DateUtil.DateToISO8601CalendarFactory;
+import org.apache.freemarker.core.util._DateUtil;
+import org.apache.freemarker.core.util._DateUtil.CalendarFieldsToDateConverter;
+import org.apache.freemarker.core.util._DateUtil.DateParseException;
+import org.apache.freemarker.core.util._DateUtil.DateToISO8601CalendarFactory;
 
 /**
  * XML Schema format.
@@ -46,26 +46,26 @@ final class XSTemplateDateFormat extends ISOLikeTemplateDateFormat {
     @Override
     protected String format(Date date, boolean datePart, boolean timePart, boolean offsetPart, int accuracy,
             TimeZone timeZone, DateToISO8601CalendarFactory calendarFactory) {
-        return DateUtil.dateToXSString(
+        return _DateUtil.dateToXSString(
                 date, datePart, timePart, offsetPart, accuracy, timeZone, calendarFactory);
     }
 
     @Override
     protected Date parseDate(String s, TimeZone tz, CalendarFieldsToDateConverter calToDateConverter)
             throws DateParseException {
-        return DateUtil.parseXSDate(s, tz, calToDateConverter);
+        return _DateUtil.parseXSDate(s, tz, calToDateConverter);
     }
 
     @Override
     protected Date parseTime(String s, TimeZone tz, CalendarFieldsToDateConverter calToDateConverter)
             throws DateParseException {
-        return DateUtil.parseXSTime(s, tz, calToDateConverter);
+        return _DateUtil.parseXSTime(s, tz, calToDateConverter);
     }
 
     @Override
     protected Date parseDateTime(String s, TimeZone tz,
             CalendarFieldsToDateConverter calToDateConverter) throws DateParseException {
-        return DateUtil.parseXSDateTime(s, tz, calToDateConverter);
+        return _DateUtil.parseXSDateTime(s, tz, calToDateConverter);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/_ArrayEnumeration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/_ArrayEnumeration.java b/src/main/java/org/apache/freemarker/core/ast/_ArrayEnumeration.java
deleted file mode 100644
index d6557ef..0000000
--- a/src/main/java/org/apache/freemarker/core/ast/_ArrayEnumeration.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.freemarker.core.ast;
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-
-/** Don't use this; used internally by FreeMarker, might changes without notice. */
-public class _ArrayEnumeration implements Enumeration {
-
-    private final Object[] array;
-    private final int size;
-    private int nextIndex;
-
-    public _ArrayEnumeration(Object[] array, int size) {
-        this.array = array;
-        this.size = size;
-        this.nextIndex = 0;
-    }
-
-    public boolean hasMoreElements() {
-        return nextIndex < size;
-    }
-
-    public Object nextElement() {
-        if (nextIndex >= size) {
-            throw new NoSuchElementException();
-        }
-        return array[nextIndex++];
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/_ArrayIterator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/_ArrayIterator.java b/src/main/java/org/apache/freemarker/core/ast/_ArrayIterator.java
deleted file mode 100644
index 55e047f..0000000
--- a/src/main/java/org/apache/freemarker/core/ast/_ArrayIterator.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.freemarker.core.ast;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/** Don't use this; used internally by FreeMarker, might changes without notice. */
-public class _ArrayIterator implements Iterator {
-
-    private final Object[] array;
-    private int nextIndex;
-
-    public _ArrayIterator(Object[] array) {
-        this.array = array;
-        this.nextIndex = 0;
-    }
-
-    public boolean hasNext() {
-        return nextIndex < array.length;
-    }
-
-    public Object next() {
-        if (nextIndex >= array.length) {
-            throw new NoSuchElementException();
-        }
-        return array[nextIndex++];
-    }
-
-    public void remove() {
-        throw new UnsupportedOperationException();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/_CoreAPI.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/_CoreAPI.java b/src/main/java/org/apache/freemarker/core/ast/_CoreAPI.java
index 6d70499..807abf3 100644
--- a/src/main/java/org/apache/freemarker/core/ast/_CoreAPI.java
+++ b/src/main/java/org/apache/freemarker/core/ast/_CoreAPI.java
@@ -30,11 +30,10 @@ import org.apache.freemarker.core.Configuration;
 import org.apache.freemarker.core.Template;
 import org.apache.freemarker.core.TemplateException;
 import org.apache.freemarker.core._TemplateAPI;
-import org.apache.freemarker.core.ast.FMParser;
 import org.apache.freemarker.core.model.TemplateDirectiveBody;
 import org.apache.freemarker.core.model.TemplateModel;
 import org.apache.freemarker.core.model.TemplateModelException;
-import org.apache.freemarker.core.util.ClassUtil;
+import org.apache.freemarker.core.util._ClassUtil;
 
 
 /**
@@ -189,8 +188,8 @@ public class _CoreAPI {
         for (Object value : values) {
             if (!expectedClass.isInstance(value)) {
                 throw new IllegalArgumentException(somethingsSentenceStart + " must be instances of "
-                        + ClassUtil.getShortClassName(expectedClass) + ", but one of them was a(n) "
-                        + ClassUtil.getShortClassNameOfObject(value) + ".");
+                        + _ClassUtil.getShortClassName(expectedClass) + ", but one of them was a(n) "
+                        + _ClassUtil.getShortClassNameOfObject(value) + ".");
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/_CoreLocaleUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/_CoreLocaleUtils.java b/src/main/java/org/apache/freemarker/core/ast/_CoreLocaleUtils.java
deleted file mode 100644
index 4bbdeb5..0000000
--- a/src/main/java/org/apache/freemarker/core/ast/_CoreLocaleUtils.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.freemarker.core.ast;
-
-import java.util.Locale;
-
-/**
- * For internal use only; don't depend on this, there's no backward compatibility guarantee at all!
- * This class is to work around the lack of module system in Java, i.e., so that other FreeMarker packages can
- * access things inside this package that users shouldn't. 
- */ 
-public class _CoreLocaleUtils {
-
-    /**
-     * Returns a locale that's one less specific, or {@code null} if there's no less specific locale.
-     */
-    public static Locale getLessSpecificLocale(Locale locale) {
-        String country = locale.getCountry();
-        if (locale.getVariant().length() != 0) {
-            String language = locale.getLanguage();
-            return country != null ? new Locale(language, country) : new Locale(language);
-        }
-        if (country.length() != 0) {
-            return new Locale(locale.getLanguage());
-        }
-        return null;
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/_CoreStringUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/_CoreStringUtils.java b/src/main/java/org/apache/freemarker/core/ast/_CoreStringUtils.java
deleted file mode 100644
index d209d20..0000000
--- a/src/main/java/org/apache/freemarker/core/ast/_CoreStringUtils.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.freemarker.core.ast;
-
-import org.apache.freemarker.core.Configuration;
-import org.apache.freemarker.core.util.StringUtil;
-
-/**
- * For internal use only; don't depend on this, there's no backward compatibility guarantee at all!
- * This class is to work around the lack of module system in Java, i.e., so that other FreeMarker packages can
- * access things inside this package that users shouldn't. 
- */ 
-public final class _CoreStringUtils {
-
-    private _CoreStringUtils() {
-        // No meant to be instantiated
-    }
-
-    public static String toFTLIdentifierReferenceAfterDot(String name) {
-        return backslashEscapeIdentifier(name);
-    }
-
-    public static String toFTLTopLevelIdentifierReference(String name) {
-        return backslashEscapeIdentifier(name);
-    }
-
-    public static String toFTLTopLevelTragetIdentifier(final String name) {
-        char quotationType = 0;
-        scanForQuotationType: for (int i = 0; i < name.length(); i++) {
-            final char c = name.charAt(i);
-            if (!(i == 0 ? StringUtil.isFTLIdentifierStart(c) : StringUtil.isFTLIdentifierPart(c)) && c != '@') {
-                if ((quotationType == 0 || quotationType == '\\') && (c == '-' || c == '.' || c == ':')) {
-                    quotationType = '\\';
-                } else {
-                    quotationType = '"';
-                    break scanForQuotationType;
-                }
-            }
-        }
-        switch (quotationType) {
-        case 0:
-            return name;
-        case '"':
-            return StringUtil.ftlQuote(name);
-        case '\\':
-            return backslashEscapeIdentifier(name);
-        default:
-            throw new BugException();
-        }
-    }
-
-    private static String backslashEscapeIdentifier(String name) {
-        return StringUtil.replace(StringUtil.replace(StringUtil.replace(name, "-", "\\-"), ".", "\\."), ":", "\\:");
-    }
-
-    /**
-     * @return {@link Configuration#CAMEL_CASE_NAMING_CONVENTION}, or {@link Configuration#LEGACY_NAMING_CONVENTION}
-     *         or, {@link Configuration#AUTO_DETECT_NAMING_CONVENTION} when undecidable.
-     */
-    public static int getIdentifierNamingConvention(String name) {
-        final int ln = name.length();
-        for (int i = 0; i < ln; i++) {
-            final char c = name.charAt(i);
-            if (c == '_') {
-                return Configuration.LEGACY_NAMING_CONVENTION;
-            }
-            if (isUpperUSASCII(c)) {
-                return Configuration.CAMEL_CASE_NAMING_CONVENTION;
-            }
-        }
-        return Configuration.AUTO_DETECT_NAMING_CONVENTION;
-    }
-    
-    // [2.4] Won't be needed anymore
-    /**
-     * A deliberately very inflexible camel case to underscored converter; it must not convert improper camel case
-     * names to a proper underscored name.
-     */
-    public static String camelCaseToUnderscored(String camelCaseName) {
-        int i = 0;
-        while (i < camelCaseName.length() && Character.isLowerCase(camelCaseName.charAt(i))) {
-            i++;
-        }
-        if (i == camelCaseName.length()) {
-            // No conversion needed
-            return camelCaseName;
-        }
-        
-        StringBuilder sb = new StringBuilder();
-        sb.append(camelCaseName.substring(0, i));
-        while (i < camelCaseName.length()) {
-            final char c = camelCaseName.charAt(i);
-            if (isUpperUSASCII(c)) {
-                sb.append('_');
-                sb.append(Character.toLowerCase(c));
-            } else {
-                sb.append(c);
-            }
-            i++;
-        }
-        return sb.toString();
-    }
-    
-    public static boolean isUpperUSASCII(char c) {
-        return c >= 'A' && c <= 'Z';
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/_DelayedFTLTypeDescription.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/_DelayedFTLTypeDescription.java b/src/main/java/org/apache/freemarker/core/ast/_DelayedFTLTypeDescription.java
index 1fde0cd..0bbc6cf 100644
--- a/src/main/java/org/apache/freemarker/core/ast/_DelayedFTLTypeDescription.java
+++ b/src/main/java/org/apache/freemarker/core/ast/_DelayedFTLTypeDescription.java
@@ -20,7 +20,7 @@
 package org.apache.freemarker.core.ast;
 
 import org.apache.freemarker.core.model.TemplateModel;
-import org.apache.freemarker.core.util.ClassUtil;
+import org.apache.freemarker.core.util._ClassUtil;
 
 /** Don't use this; used internally by FreeMarker, might changes without notice. */
 public class _DelayedFTLTypeDescription extends _DelayedConversionToString {
@@ -31,7 +31,7 @@ public class _DelayedFTLTypeDescription extends _DelayedConversionToString {
 
     @Override
     protected String doConversion(Object obj) {
-        return ClassUtil.getFTLTypeDescription((TemplateModel) obj);
+        return _ClassUtil.getFTLTypeDescription((TemplateModel) obj);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/a5d9575f/src/main/java/org/apache/freemarker/core/ast/_DelayedJQuote.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/_DelayedJQuote.java b/src/main/java/org/apache/freemarker/core/ast/_DelayedJQuote.java
index b5570b7..ba3218a 100644
--- a/src/main/java/org/apache/freemarker/core/ast/_DelayedJQuote.java
+++ b/src/main/java/org/apache/freemarker/core/ast/_DelayedJQuote.java
@@ -19,7 +19,7 @@
 
 package org.apache.freemarker.core.ast;
 
-import org.apache.freemarker.core.util.StringUtil;
+import org.apache.freemarker.core.util._StringUtil;
 
 /** Don't use this; used internally by FreeMarker, might changes without notice. */
 public class _DelayedJQuote extends _DelayedConversionToString {
@@ -30,7 +30,7 @@ public class _DelayedJQuote extends _DelayedConversionToString {
 
     @Override
     protected String doConversion(Object obj) {
-        return StringUtil.jQuote(_ErrorDescriptionBuilder.toString(obj));
+        return _StringUtil.jQuote(_ErrorDescriptionBuilder.toString(obj));
     }
 
 }



Mime
View raw message