From a90524711b0899f8c0d3a52cbf26ad848ed25358 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?=
+ * The first time the Introspector sees a class it creates a class method map
+ * for the class in question. Basically the class method map is a Hastable where
+ * Method objects are keyed by a concatenation of the method name and the names
+@@ -324,4 +324,4 @@ public class IntrospectorBase {
+ return classMap;
+ }
+ }
+-}
+\ No newline at end of file
++}
+diff -up commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/introspection/MethodKey.java.javadoc commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/introspection/MethodKey.java
+--- commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/introspection/MethodKey.java.javadoc 2011-12-19 06:15:01.000000000 -0700
++++ commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/internal/introspection/MethodKey.java 2015-04-15 19:05:24.055352589 -0600
+@@ -40,7 +40,7 @@ import java.util.Arrays;
+ * Finding methods as well as property getters & setters. Finding methods as well as property getters & setters.
+ * A whitelist explicitly allows methods/properties for a class;
++ *
+ *
+- *
+ * A blacklist explicitly forbids methods/properties for a class; ++ *
+ *+ * Permissions are composed of three lists, read, write, execute, each being "white" or "black": ++ *
+ *+ * All arithmetic operators (+, - , *, /, %) follow the same rules regarding their arguments. ++ *
+ *+ * Creates and evaluates Expression and Script objects. +- * Determines the behavior of Expressions & Scripts during their evaluation with respect to: ++ * Determines the behavior of Expressions & Scripts during their evaluation with respect to: ++ *
+ *The setSilent
and setLenient
methods allow to fine-tune an engine instance behavior
+ * according to various error control needs. The lenient/strict flag tells the engine when and if null as operand is
+ * considered an error, the silent/verbose flag tells the engine what to do with the error
+@@ -68,7 +68,7 @@ import org.apache.commons.jexl2.parser.A
+ *
0 & null should be indicators of "default" values so that even in an case of error, ++ *
0 & null should be indicators of "default" values so that even in an case of error, + * something meaningfull can still be inferred; may be convenient for configurations. + *
+ *The finest error control grain is obtained; it is the closest to Java code - +- * still augmented by "script" capabilities regarding automated conversions & type matching. ++ * still augmented by "script" capabilities regarding automated conversions & type matching. + *
+ *
+- * Supports the following:
+- * File Extensions: ".jexl", ".jexl2"
++ * Supports the following:
++ * Language short names: "JEXL", "Jexl", "jexl", "JEXL2", "Jexl2", "jexl2"
++ * File Extensions: ".jexl", ".jexl2"
+ * "jexl2" etc. were added for engineVersion="2.0".
+ *
+diff -up commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/scripting/JexlScriptEngine.java.javadoc commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/scripting/JexlScriptEngine.java +--- commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/scripting/JexlScriptEngine.java.javadoc 2011-12-19 06:15:00.000000000 -0700 ++++ commons-jexl-2.1.1-src/src/main/java/org/apache/commons/jexl2/scripting/JexlScriptEngine.java 2015-04-15 19:33:18.303497441 -0600 +@@ -95,6 +95,7 @@ public class JexlScriptEngine extends Ab + * Those properties are allways bound to the default engine scope context. + *
+ * The following properties are defined: ++ *
+ *+ * An expression can mix immediate, deferred and nested sub-expressions as well as string constants; ++ *
+ *"...${jexl-expr}..."
"...#{jexl-expr}..."
"...#{...${jexl-expr0}...}..."
"...${jexl-expr0}... #{jexl-expr1}..."
+- * Deferred & immediate expression carry different intentions: ++ * Deferred & immediate expression carry different intentions: ++ *
+ *
+ * For instance: "Hello ${name}, now is #{time}"
is a composite "deferred" expression since one
+ * of its subexpressions is deferred. Furthermore, this (composite) expression intent is
+@@ -62,14 +62,14 @@ import org.apache.commons.jexl2.parser.S
+ *
+ * The API reflects this feature in 2 methods, prepare and evaluate. The prepare method + * will evaluate the immediate subexpression and return an expression that contains only +- * the deferred subexpressions (& constants), a prepared expression. Such a prepared expression ++ * the deferred subexpressions (& constants), a prepared expression. Such a prepared expression + * is suitable for a later phase evaluation that may occur with a different JexlContext. + * Note that it is valid to call evaluate without prepare in which case the same JexlContext + * is used for the 2 evaluation phases. + *
+ *+ * In the most common use-case where deferred expressions are to be kept around as properties of objects, +- * one should parse & prepare an expression before storing it and evaluate it each time ++ * one should parse & prepare an expression before storing it and evaluate it each time + * the property storing it is accessed. + *
+ *+@@ -339,7 +339,7 @@ public final class UnifiedJEXL { + *
+ * In effect, this binds the result of the immediate sub-expressions evaluation in the + * context, allowing to differ evaluation of the remaining (deferred) expression within another context. +- * This only has an effect to nested & composite expressions that contain differed & immediate sub-expressions. ++ * This only has an effect to nested & composite expressions that contain differed & immediate sub-expressions. + *
+ *+ * If the underlying JEXL engine is silent, errors will be logged through its logger as warning. +@@ -409,7 +409,7 @@ public final class UnifiedJEXL { + * Prepares a sub-expression for interpretation. + * @param interpreter a JEXL interpreter + * @return a prepared expression +- * @throws JexlException (only for nested & composite) ++ * @throws JexlException (only for nested & composite) + */ + protected Expression prepare(Interpreter interpreter) { + return this; +@@ -419,7 +419,7 @@ public final class UnifiedJEXL { + * Intreprets a sub-expression. + * @param interpreter a JEXL interpreter + * @return the result of interpretation +- * @throws JexlException (only for nested & composite) ++ * @throws JexlException (only for nested & composite) + */ + protected abstract Object evaluate(Interpreter interpreter); + } +@@ -734,7 +734,7 @@ public final class UnifiedJEXL { + } + + /** Creates a a {@link UnifiedJEXL.Expression} from an expression string. +- * Uses & fills up the expression cache if any. ++ * Uses & fills up the expression cache if any. + *
+ * If the underlying JEXL engine is silent, errors will be logged through its logger as warnings. + *
+@@ -1010,20 +1010,23 @@ public final class UnifiedJEXL { + * evaluation and their output gathered through a writer. + * It is thus possible to use looping or conditional construct "around" expressions generating output. + * +- * For instance: +- *++ *For instance: ++ *
++ *++ *+ * $$ for(var x : [1, 3, 5, 42, 169]) { + * $$ if (x == 42) { + * Life, the universe, and everything +- * $$ } else if (x > 42) { ++ * $$ } else if (x > 42) { + * The value $(x} is over fourty-two + * $$ } else { + * The value ${x} is under fourty-two + * $$ } + * $$ } + *+ * Will evaluate as: +- *
++ * ++ *+ * The value 1 is under fourty-two + * The value 3 is under fourty-two + * The value 5 is under fourty-two +@@ -1033,10 +1036,10 @@ public final class UnifiedJEXL { + *+ * During evaluation, the template context exposes its writer as '$jexl' which is safe to use in this case. + * This allows writing directly through the writer without adding new-lines as in: +- *
++ * ++ *+- * + *+ * $$ for(var cell : cells) { $jexl.print(cell); $jexl.print(';') } + *+ * A template is expanded as one JEXL script and a list of UnifiedJEXL expressions; each UnifiedJEXL expression + * being replace in the script by a call to jexl:print(expr) (the expr is in fact the expr number in the template). +@@ -1461,4 +1464,4 @@ public final class UnifiedJEXL { + public Template createTemplate(String source) { + return new Template("$$", new StringReader(source), (String[]) null); + } +-} +\ No newline at end of file ++} diff --git a/apache-commons-jexl.changes b/apache-commons-jexl.changes new file mode 100644 index 0000000..e7c83bd --- /dev/null +++ b/apache-commons-jexl.changes @@ -0,0 +1,10 @@ +------------------------------------------------------------------- +Wed Mar 23 23:06:29 UTC 2022 - Fridrich Strba
+ +- Build with java source and target levels 8 + +------------------------------------------------------------------- +Thu Feb 28 08:39:27 UTC 2019 - Fridrich Strba + +- Initial package based on Fedora rpm +- Generate and sanitize ant build files diff --git a/apache-commons-jexl.spec b/apache-commons-jexl.spec new file mode 100644 index 0000000..cbea10b --- /dev/null +++ b/apache-commons-jexl.spec @@ -0,0 +1,140 @@ +# +# spec file +# +# Copyright (c) 2022 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global compatver 2.1.0 +%define base_name jexl +%define short_name commons-%{base_name} +%bcond_with tests +Name: apache-%{short_name} +Version: 2.1.1 +Release: 0 +Summary: Java Expression Language (JEXL) +License: Apache-2.0 +Group: Development/Libraries/Java +URL: https://commons.apache.org/jexl +Source0: http://www.apache.org/dist/commons/jexl/source/%{short_name}-%{version}-src.tar.gz +Source1: %{short_name}-%{version}-build.tar.xz +# Patch to fix test failure with junit 4.11 +Patch0: 001-Fix-tests.patch +# Fix javadoc build +Patch1: apache-commons-jexl-javadoc.patch +Patch2: 0001-Port-to-current-javacc.patch +BuildRequires: ant +BuildRequires: apache-commons-logging +BuildRequires: fdupes +BuildRequires: java-devel >= 1.8 +BuildRequires: javacc +BuildRequires: javapackages-local +Requires: mvn(commons-logging:commons-logging) +Provides: %{short_name} = %{version}-%{release} +BuildArch: noarch +%if %{with tests} +BuildRequires: ant-junit +BuildConflicts: java-devel >= 9 +%endif + +%description +Java Expression Language (JEXL) is an expression language engine which can be +embedded in applications and frameworks. JEXL is inspired by Jakarta Velocity +and the Expression Language defined in the JavaServer Pages Standard Tag +Library version 1.1 (JSTL) and JavaServer Pages version 2.0 (JSP). While +inspired by JSTL EL, it must be noted that JEXL is not a compatible +implementation of EL as defined in JSTL 1.1 (JSR-052) or JSP 2.0 (JSR-152). +For a compatible implementation of these specifications, see the Commons EL +project. + +JEXL attempts to bring some of the lessons learned by the Velocity community +about expression languages in templating to a wider audience. Commons Jelly +needed Velocity-ish method access, it just had to have it. + +%package javadoc +Summary: Javadocs for %{name} +Group: Documentation/HTML +Provides: %{short_name}-javadoc = %{version}-%{release} + +%description javadoc +This package contains the API documentation for %{name}. + +%prep +%setup -q -n %{short_name}-%{version}-src -a1 +%patch0 -p1 -b .test +%patch1 -p1 -b .javadoc +%patch2 -p1 + +# Java 1.6 contains bsf 3.0, so we don't need the dependency in the pom.xml file +%pom_remove_dep org.apache.bsf:bsf-api +find \( -name '*.jar' -o -name '*.class' \) -delete +# Fix line endings +find -name '*.txt' -exec sed -i 's/\r//' '{}' + + +# Drop "-SNAPSHOT" from version +%pom_xpath_set "pom:project/pom:version" %{compatver} jexl2-compat +%pom_xpath_set "pom:dependency[pom:artifactId='commons-jexl']/pom:version" %{version} jexl2-compat + +%pom_remove_parent . jexl2-compat + +%build +mkdir -p lib +build-jar-repository -s lib commons-logging + +# commons-jexl +%{ant} \ +%if %{without tests} + -Dtest.skip=true \ +%endif + -Djavacc.home=%{_javadir} \ + jar javadoc +# commons-jexl-compat +%{ant} \ + -f jexl2-compat/build.xml \ + -Dproject.version=%{compatver} \ +%if %{without tests} + -Dtest.skip=true \ +%endif + jar javadoc + +%install +# jars +install -dm 0755 %{buildroot}%{_javadir}/%{name} +install -pm 0644 target/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{short_name}.jar +ln -sf %{name}/%{short_name}.jar %{buildroot}%{_javadir}/%{short_name}.jar +install -pm 0644 jexl2-compat/target/%{short_name}-compat-%{compatver}.jar %{buildroot}%{_javadir}/%{name}/%{short_name}-compat.jar +ln -sf %{name}/%{short_name}-compat.jar %{buildroot}%{_javadir}/%{short_name}-compat.jar +# poms +install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name} +install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{short_name}.pom +%add_maven_depmap %{name}/%{short_name}.pom %{name}/%{short_name}.jar +install -pm 0644 jexl2-compat/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{short_name}-compat.pom +%add_maven_depmap %{name}/%{short_name}-compat.pom %{name}/%{short_name}-compat.jar +# javadoc +install -dm 0755 %{buildroot}%{_javadocdir}/%{name}/jexl2-compat +cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/ +cp -pr jexl2-compat/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/jexl2-compat/ +%fdupes -s %{buildroot}%{_javadocdir} + +%files -f .mfiles +%license LICENSE.txt +%doc NOTICE.txt RELEASE-NOTES.txt +%{_javadir}/%{short_name}*.jar + +%files javadoc +%license LICENSE.txt +%doc NOTICE.txt +%{_javadocdir}/%{name} + +%changelog diff --git a/commons-jexl-2.1.1-build.tar.xz b/commons-jexl-2.1.1-build.tar.xz new file mode 100644 index 0000000..f68a533 --- /dev/null +++ b/commons-jexl-2.1.1-build.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47c66b7054092f2b125e6506ba52f79cada98a9001d224e58c724779f2469fc3 +size 3240 diff --git a/commons-jexl-2.1.1-src.tar.gz b/commons-jexl-2.1.1-src.tar.gz new file mode 100644 index 0000000..dcec6a7 --- /dev/null +++ b/commons-jexl-2.1.1-src.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f06cfec88f0ce1bc51958e9ec1410af7029f2a5eb2e0b167d5d71bec43027aa +size 208559