[velocity-tools] 01/04: Transition to the Servlet API 3.0 (Closes: #801008)

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Sat Apr 2 22:02:52 UTC 2016


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository velocity-tools.

commit fb79de7b4c15717589b5149f489c8160aa859aa9
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Sat Apr 2 23:58:36 2016 +0200

    Transition to the Servlet API 3.0 (Closes: #801008)
---
 debian/changelog                                 |  7 +++++++
 debian/control                                   |  2 +-
 debian/patches/03_servlet_api_compatibility.diff | 22 ++++++++++++++++++++++
 debian/patches/series                            |  1 +
 debian/rules                                     |  2 +-
 5 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 2e91e4f..9623462 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+velocity-tools (2.0-5) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Transition to the Servlet API 3.0 (Closes: #801008)
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Sat, 02 Apr 2016 23:54:28 +0200
+
 velocity-tools (2.0-4) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/control b/debian/control
index 0976465..0fefa7e 100644
--- a/debian/control
+++ b/debian/control
@@ -15,7 +15,7 @@ Build-Depends-Indep: ant-optional,
                      libcommons-validator-java,
                      libdom4j-java,
                      liboro-java,
-                     libservlet2.5-java,
+                     libservlet3.0-java,
                      maven-repo-helper,
                      velocity
 Standards-Version: 3.9.6
diff --git a/debian/patches/03_servlet_api_compatibility.diff b/debian/patches/03_servlet_api_compatibility.diff
new file mode 100644
index 0000000..5cda71a
--- /dev/null
+++ b/debian/patches/03_servlet_api_compatibility.diff
@@ -0,0 +1,22 @@
+Description: Fix the compatibility with the Servlet API 3.0
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: no
+--- a/src/main/java/org/apache/velocity/tools/view/ParameterTool.java
++++ b/src/main/java/org/apache/velocity/tools/view/ParameterTool.java
+@@ -195,13 +195,13 @@
+                 Array.getLength(value) == 1);
+     }
+ 
+-    private Map<String,Object> expandSingletonArrays(Map<String,Object> original)
++    private Map<String,Object> expandSingletonArrays(Map<String,String[]> original)
+     {
+         Map<String,Object> expanded = new HashMap<String,Object>(original);
+         for (Map.Entry<String,Object> entry : expanded.entrySet())
+         {
+-            Object value = entry.getValue();
+-            if (isSingletonArray(value))
++            String[] value = (String[]) entry.getValue();
++            if (value != null && value.length == 1)
+             {
+                 entry.setValue(Array.get(value, 0));
+             }
diff --git a/debian/patches/series b/debian/patches/series
index dae5e62..da71fc1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 01_dont_copy_test_lib.diff
 02_junit_45.diff
+03_servlet_api_compatibility.diff
diff --git a/debian/rules b/debian/rules
index d99d9c9..ecde94f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,7 +6,7 @@ include /usr/share/cdbs/1/class/ant.mk
 JAVA_HOME            := /usr/lib/jvm/default-java
 ANT_HOME             := /usr/share/ant
 
-DEB_JARS             := antlr commons-beanutils commons-collections3 commons-digester commons-lang commons-logging commons-validator oro servlet-api-2.5 jsp-api-2.1 velocity junit4 ant-junit dom4j
+DEB_JARS             := antlr commons-beanutils commons-collections3 commons-digester commons-lang commons-logging commons-validator oro servlet-api-3.0 jsp-api-2.2 velocity junit4 ant-junit dom4j
 
 DEB_ANT_BUILD_TARGET := jar.view jar.generic javadoc
 #DEB_ANT_CHECK_TARGET := test.generic

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/velocity-tools.git



More information about the pkg-java-commits mailing list