This is an automated email from the ASF dual-hosted git repository.
ddekany pushed a commit to branch 2.3-gae
in repository https://gitbox.apache.org/repos/asf/freemarker.git
The following commit(s) were added to refs/heads/2.3-gae by this push:
new a10b762a Fixed broken dist classpath check, and the Java 7
compatibility issue that stay hidden because of that, till now.
a10b762a is described below
commit a10b762a810e2f7867732133803ae36172336904
Author: ddekany <[email protected]>
AuthorDate: Thu Jan 5 14:11:43 2023 +0100
Fixed broken dist classpath check, and the Java 7 compatibility issue that
stay hidden because of that, till now.
---
build.xml | 1 +
src/main/java/freemarker/core/PropertySetting.java | 2 +-
src/main/java/freemarker/core/_CoreStringUtils.java | 12 ++++++++++++
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/build.xml b/build.xml
index c219f480..85dc05d2 100644
--- a/build.xml
+++ b/build.xml
@@ -51,6 +51,7 @@
</condition>
<condition property="has.all.explicit.boot.classpaths">
<and>
+ <isset property="has.explicit.boot.classpath.j2se1.7"/>
<isset property="has.explicit.boot.classpath.j2se1.8"/>
</and>
</condition>
diff --git a/src/main/java/freemarker/core/PropertySetting.java
b/src/main/java/freemarker/core/PropertySetting.java
index 117a8c00..10b32b2b 100644
--- a/src/main/java/freemarker/core/PropertySetting.java
+++ b/src/main/java/freemarker/core/PropertySetting.java
@@ -122,7 +122,7 @@ final class PropertySetting extends TemplateElement {
}
throw new TemplateException("It's not allowed to set \"" +
key + "\" to "
+ StringUtil.jQuote(actualValue) + " in a
template. Use a standard c format name ("
- + String.join(", ",
StandardCFormats.STANDARD_C_FORMATS.keySet()) + "), " +
+ +
_CoreStringUtils.commaSeparatedJQuotedItems(StandardCFormats.STANDARD_C_FORMATS.keySet())
+ "), " +
"or registered custom c format name after a
\"@\".",
env);
}
diff --git a/src/main/java/freemarker/core/_CoreStringUtils.java
b/src/main/java/freemarker/core/_CoreStringUtils.java
index dc87b021..ce9fb9d1 100644
--- a/src/main/java/freemarker/core/_CoreStringUtils.java
+++ b/src/main/java/freemarker/core/_CoreStringUtils.java
@@ -19,6 +19,8 @@
package freemarker.core;
+import java.util.Collection;
+
import freemarker.template.Configuration;
import freemarker.template.utility.StringUtil;
@@ -142,4 +144,14 @@ public final class _CoreStringUtils {
return c >= 'A' && c <= 'Z';
}
+ public static String commaSeparatedJQuotedItems(Collection<String> items) {
+ StringBuilder sb = new StringBuilder();
+ for (String item : items) {
+ if (sb.length() != 0) {
+ sb.append(", ");
+ }
+ sb.append(StringUtil.jQuote(item));
+ }
+ return sb.toString();
+ }
}