On Sun, 8 Apr 2018 19:03:14 +0200 Matthias Klose <d...@debian.org> wrote:
> Package: src:libcommons-lang3-java
> Version: 3.5-1
> Severity: important
> Tags: patch sid buster
>
> Please either apply the following patches for 10 and 11, or update to the
> upstream 3.6 release, and only apply the latter patch for 11 (which will be in
> 3.7 upstream).
>
> https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=commitdiff_plain;h=a618b844c5a261ced37385ab3947de6e215d46f7
>
> https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=patch;h=50ce8c44e1601acffa39f5568f0fc140aade0564
>

After applying the openjdk-10 patch libcommons-lang3-java will FTBFS
due to a NullPointerException in the surefire plugin:

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test
(default-test) on project commons-lang3: Execution default-test of
goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test
failed.: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test
(default-test) on project commons-lang3: Execution default-test of
goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test
failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:213)
    <snip>
    at org.codehaus.plexus.classworlds.launcher.Launcher.main
(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution
default-test of goal
org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
(DefaultBuildPluginManager.java:145)
    <snip>
    at org.codehaus.plexus.classworlds.launcher.Launcher.main
(Launcher.java:356)
Caused by: java.lang.NullPointerException
    at 
org.apache.maven.surefire.shade.org.apache.commons.lang3.SystemUtils.isJavaVersionAtLeast
(SystemUtils.java:1626)


and then another FTBFS due to a failing locale test as reported in bug #895583.

The current bug also affects libmaven-javadoc-plugin-java.

In order to get the build working some additional steps are required
due to the circular runtime dependency between libcommons-lang3-java,
libmaven-javadoc-plugin-java (doc generation), and libsurefire-java
(tests):
1) libcommons-lang3-java must be rebuild using openjdk-9 with docs and
tests disabled
2) rebuild with openjdk-10, keep doc and tests disabled
3) rebuild surefire with the new libcommons-lang3-java
4) rebuild libcommons-lang3-java with openjdk-10

I believe it is easier to do a binary upload after the last step than
trying to get the builds to do that correctly. Note that it can't be
rebuild with openjdk-8 in step #1 due to a "Method
flip()Ljava/nio/ByteBuffer" error in bnd.

Hopefully I described all the required steps above without missing any
- I got sidetracked checking the openjdk-8 failure and testing the fix
in a few other packages, so it took me a while to remember everything
I had to run and install.

Please consider the attached debdiff as it fixes both this bug as well
as bug #895583.

thanks
Tiago
diff -Nru libcommons-lang3-java-3.5/debian/changelog libcommons-lang3-java-3.5/debian/changelog
--- libcommons-lang3-java-3.5/debian/changelog	2016-10-20 15:08:15.000000000 -0200
+++ libcommons-lang3-java-3.5/debian/changelog	2018-04-12 10:14:49.000000000 -0300
@@ -1,3 +1,16 @@
+libcommons-lang3-java (3.5-2) UNRELEASED; urgency=medium
+
+  * debian/patches/fix-openjdk-10-nullpointer-lang-1365.diff: calls to
+    org.apache.commons.lang3.SystemUtils.isJavaVersionAtLeast cause
+    NullPointerException when running under openjdk-10 which in turn causes
+    other packages to FTBFS with the message "Execution default-cli of goal
+    groupId:artifactId:version:jar failed.: NullPointerException -> [Help 1]".
+    (Closes: #895234)
+  * debian/patches/fix-numeric-3-area-code-support-lang-1312.diff: pull
+    upstream fix for numeric-3 area code support. (Closes: #895583)
+
+ -- Tiago Stürmer Daitx <tiago.da...@ubuntu.com>  Thu, 12 Apr 2018 13:14:49 +0000
+
 libcommons-lang3-java (3.5-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru libcommons-lang3-java-3.5/debian/patches/fix-numeric-3-area-code-support-lang-1312.diff libcommons-lang3-java-3.5/debian/patches/fix-numeric-3-area-code-support-lang-1312.diff
--- libcommons-lang3-java-3.5/debian/patches/fix-numeric-3-area-code-support-lang-1312.diff	1969-12-31 21:00:00.000000000 -0300
+++ libcommons-lang3-java-3.5/debian/patches/fix-numeric-3-area-code-support-lang-1312.diff	2018-04-12 10:14:49.000000000 -0300
@@ -0,0 +1,65 @@
+Description: Fix UN M.49 numeric-3 area code support.
+ LocaleUtils#toLocale does not support language followed by UN M.49 numeric-3
+ area code. 
+Author: pascalschumacher <pascalschumac...@gmx.net>
+Origin: upstream, https://github.com/apache/commons-lang/pull/239
+Bug: https://issues.apache.org/jira/browse/LANG-1312
+Bug-Debian: https://bug.debian.org/
+Forwarded: not-needed
+Applied-Upstream: https://github.com/apache/commons-lang/commit/4bd982d1a1df87724682c17c39bf27b5cbe389be
+Reviewed-by: Tiago Stürmer Daitx <tiago.da...@ubuntu.com>
+Last-Update: 2018-04-13
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+
+From 4bd982d1a1df87724682c17c39bf27b5cbe389be Mon Sep 17 00:00:00 2001
+From: pascalschumacher <pascalschumac...@gmx.net>
+Date: Sun, 19 Feb 2017 20:39:05 +0100
+Subject: [PATCH] LANG-1312: LocaleUtils#toLocale does not support language
+ followed by UN M.49 numeric-3 area code (closes #239)
+
+---
+ src/main/java/org/apache/commons/lang3/LocaleUtils.java     | 4 +++-
+ src/test/java/org/apache/commons/lang3/LocaleUtilsTest.java | 7 +++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/src/main/java/org/apache/commons/lang3/LocaleUtils.java b/src/main/java/org/apache/commons/lang3/LocaleUtils.java
+index a3126ebf4..f13b52f38 100644
+--- a/src/main/java/org/apache/commons/lang3/LocaleUtils.java
++++ b/src/main/java/org/apache/commons/lang3/LocaleUtils.java
+@@ -67,6 +67,7 @@ public LocaleUtils() {
+      *   LocaleUtils.toLocale("")           = new Locale("", "")
+      *   LocaleUtils.toLocale("en")         = new Locale("en", "")
+      *   LocaleUtils.toLocale("en_GB")      = new Locale("en", "GB")
++     *   LocaleUtils.toLocale("en_001")     = new Locale("en", "001")
+      *   LocaleUtils.toLocale("en_GB_xxx")  = new Locale("en", "GB", "xxx")   (#)
+      * </pre>
+      *
+@@ -134,7 +135,8 @@ public static Locale toLocale(final String str) {
+             case 1:
+                 if (StringUtils.isAllLowerCase(split[0]) &&
+                     (split[0].length() == 2 || split[0].length() == 3) &&
+-                     split[1].length() == 2 && StringUtils.isAllUpperCase(split[1])) {
++                     (split[1].length() == 2 && StringUtils.isAllUpperCase(split[1])) ||
++                      (split[1].length() == 3 && StringUtils.isNumeric(split[1]))) {
+                     return new Locale(split[0], split[1]);
+                 }
+             throw new IllegalArgumentException("Invalid locale format: " + str);
+diff --git a/src/test/java/org/apache/commons/lang3/LocaleUtilsTest.java b/src/test/java/org/apache/commons/lang3/LocaleUtilsTest.java
+index 4a867bab1..79198af5b 100644
+--- a/src/test/java/org/apache/commons/lang3/LocaleUtilsTest.java
++++ b/src/test/java/org/apache/commons/lang3/LocaleUtilsTest.java
+@@ -505,6 +505,13 @@ public void testLang328() {
+         assertValidToLocale("fr__POSIX", "fr", "", "POSIX");
+     }
+ 
++    @Test
++    public void testLanguageAndUNM49Numeric3AreaCodeLang1312() {
++        assertValidToLocale("en_001", "en", "001");
++        assertValidToLocale("en_150", "en", "150");
++        assertValidToLocale("ar_001", "ar", "001");
++    }
++
+     /**
+      * Tests #LANG-865, strings starting with an underscore.
+      */
diff -Nru libcommons-lang3-java-3.5/debian/patches/fix-openjdk-10-nullpointer-lang-1365.diff libcommons-lang3-java-3.5/debian/patches/fix-openjdk-10-nullpointer-lang-1365.diff
--- libcommons-lang3-java-3.5/debian/patches/fix-openjdk-10-nullpointer-lang-1365.diff	1969-12-31 21:00:00.000000000 -0300
+++ libcommons-lang3-java-3.5/debian/patches/fix-openjdk-10-nullpointer-lang-1365.diff	2018-04-12 10:14:39.000000000 -0300
@@ -0,0 +1,201 @@
+Description: Fix missing openjdk-10 version
+ [LANG-1365] Fix NullPointerException in isJavaVersionAtLeast on Java 10,
+ add SystemUtils.IS_JAVA_10, add JavaVersion.JAVA_10.
+Author: Gary Gregory <ggreg...@apache.org>
+Origin: https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=patch;h=a618b844c5a261ced37385ab3947de6e215d46f7
+Bug: https://issues.apache.org/jira/browse/LANG-1365
+Bug-Debian: https://bugs.debian.org/895234
+Applied-Upstream: https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=commit;h=a618b844c5a261ced37385ab3947de6e215d46f7
+Reviewed-by: Tiago Stürmer Daitx <tiago.da...@ubuntu.com>
+Last-Update: 2018-04-12
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+
+From a618b844c5a261ced37385ab3947de6e215d46f7 Mon Sep 17 00:00:00 2001
+From: Gary Gregory <ggreg...@apache.org>
+Date: Fri, 3 Nov 2017 11:33:34 -0600
+Subject: [PATCH] [LANG-1365] Fix NullPointerException in isJavaVersionAtLeast
+ on Java 10, add SystemUtils.IS_JAVA_10, add JavaVersion.JAVA_10.
+
+---
+ src/changes/changes.xml                            |  3 +-
+ .../java/org/apache/commons/lang3/JavaVersion.java | 11 ++++++++
+ .../java/org/apache/commons/lang3/SystemUtils.java | 12 ++++++++
+ .../org/apache/commons/lang3/JavaVersionTest.java  |  2 ++
+ .../org/apache/commons/lang3/SystemUtilsTest.java  | 33 +++++++++++++++++++++-
+ 5 files changed, 59 insertions(+), 2 deletions(-)
+
+--- a/src/changes/changes.xml
++++ b/src/changes/changes.xml
+@@ -45,7 +45,8 @@ The <action> type attribute can be add,u
+   </properties>
+   <body>
+ 
+-  <release version="3.5" date="2014-10-13" description="New features including Java 9 detection">
++  <release version="3.5" date="2017-MM-DD" description="New features and bug fixes. Requires Java 7, supports Java 8, 9, 10.">
++    <action issue="LANG-1365" type="fix" dev="ggregory" due-to="Gary Gregory">Fix NullPointerException in isJavaVersionAtLeast on Java 10, add SystemUtils.IS_JAVA_10, add JavaVersion.JAVA_10</action>
+     <action issue="LANG-1275" type="add" dev="oheger">Added a tryAcquire() method to TimedSemaphore.</action>
+     <action issue="LANG-1273" type="add" dev="ebourg" due-to="Jake Wang">Added a new property IS_OS_MAC_OSX_EL_CAPITAN in SystemUtils</action>
+     <action issue="LANG-1255" type="add" dev="britter" due-to="Kaiyuan Wang">Add DateUtils.toCalendar(Date, TimeZone)</action>
+--- a/src/main/java/org/apache/commons/lang3/JavaVersion.java
++++ b/src/main/java/org/apache/commons/lang3/JavaVersion.java
+@@ -81,10 +81,19 @@ public enum JavaVersion {
+ 
+     /**
+      * Java 9
++     * 
++     * @since 3.5
+      */
+     JAVA_9(9.0f, "9"),
+ 
+     /**
++     * Java 10
++     * 
++     * @since 3.7
++     */
++    JAVA_10(10.0f, "10"),
++
++    /**
+      * The most recent java version. Mainly introduced to avoid to break when a new version of Java is used.
+      */
+     JAVA_RECENT(maxVersion(), Float.toString(maxVersion()));
+@@ -167,6 +176,8 @@ public enum JavaVersion {
+             return JAVA_1_8;
+         } else if ("9".equals(nom)) {
+             return JAVA_9;
++        } else if ("10".equals(nom)) {
++            return JAVA_10;
+         }
+         if (nom == null) {
+             return null;
+--- a/src/main/java/org/apache/commons/lang3/SystemUtils.java
++++ b/src/main/java/org/apache/commons/lang3/SystemUtils.java
+@@ -971,6 +971,18 @@ public class SystemUtils {
+      */
+     public static final boolean IS_JAVA_9 = getJavaVersionMatches("9");
+ 
++    /**
++     * <p>
++     * Is {@code true} if this is Java version 10 (also 10.x versions).
++     * </p>
++     * <p>
++     * The field will return {@code false} if {@link #JAVA_VERSION} is {@code null}.
++     * </p>
++     *
++     * @since 3.7
++     */
++    public static final boolean IS_JAVA_10 = getJavaVersionMatches("10");
++
+     // Operating system checks
+     // -----------------------------------------------------------------------
+     // These MUST be declared after those above as they depend on the
+--- a/src/test/java/org/apache/commons/lang3/JavaVersionTest.java
++++ b/src/test/java/org/apache/commons/lang3/JavaVersionTest.java
+@@ -32,6 +32,7 @@ import static org.apache.commons.lang3.J
+ import static org.apache.commons.lang3.JavaVersion.JAVA_1_7;
+ import static org.apache.commons.lang3.JavaVersion.JAVA_1_8;
+ import static org.apache.commons.lang3.JavaVersion.JAVA_9;
++import static org.apache.commons.lang3.JavaVersion.JAVA_10;
+ import static org.apache.commons.lang3.JavaVersion.get;
+ import static org.apache.commons.lang3.JavaVersion.getJavaVersion;
+ 
+@@ -52,6 +53,7 @@ public class JavaVersionTest {
+         assertEquals("1.7 failed", JAVA_1_7, get("1.7"));
+         assertEquals("1.8 failed", JAVA_1_8, get("1.8"));
+         assertEquals("9 failed", JAVA_9, get("9"));
++        assertEquals("10 failed", JAVA_10, get("10"));
+         assertEquals("1.10 failed", JAVA_RECENT, get("1.10"));
+         // assertNull("2.10 unexpectedly worked", get("2.10"));
+         assertEquals("Wrapper method failed", get("1.5"), getJavaVersion("1.5"));
+--- a/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java
++++ b/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java
+@@ -28,6 +28,7 @@ import static org.apache.commons.lang3.J
+ import static org.apache.commons.lang3.JavaVersion.JAVA_1_7;
+ import static org.apache.commons.lang3.JavaVersion.JAVA_1_8;
+ import static org.apache.commons.lang3.JavaVersion.JAVA_9;
++import static org.apache.commons.lang3.JavaVersion.JAVA_10;
+ import static org.junit.Assert.assertEquals;
+ import static org.junit.Assert.assertFalse;
+ import static org.junit.Assert.assertNotNull;
+@@ -125,6 +126,7 @@ public class SystemUtilsTest {
+             assertFalse(SystemUtils.IS_JAVA_1_8);
+             assertFalse(SystemUtils.IS_JAVA_1_9);
+             assertFalse(SystemUtils.IS_JAVA_9);
++            assertFalse(SystemUtils.IS_JAVA_10);
+         } else if (javaVersion.startsWith("1.7")) {
+             assertFalse(SystemUtils.IS_JAVA_1_1);
+             assertFalse(SystemUtils.IS_JAVA_1_2);
+@@ -136,6 +138,7 @@ public class SystemUtilsTest {
+             assertFalse(SystemUtils.IS_JAVA_1_8);
+             assertFalse(SystemUtils.IS_JAVA_1_9);
+             assertFalse(SystemUtils.IS_JAVA_9);
++            assertFalse(SystemUtils.IS_JAVA_10);
+         } else if (javaVersion.startsWith("1.8")) {
+             assertFalse(SystemUtils.IS_JAVA_1_1);
+             assertFalse(SystemUtils.IS_JAVA_1_2);
+@@ -147,6 +150,7 @@ public class SystemUtilsTest {
+             assertTrue(SystemUtils.IS_JAVA_1_8);
+             assertFalse(SystemUtils.IS_JAVA_1_9);
+             assertFalse(SystemUtils.IS_JAVA_9);
++            assertFalse(SystemUtils.IS_JAVA_10);
+         } else if (javaVersion.startsWith("9")) {
+             assertFalse(SystemUtils.IS_JAVA_1_1);
+             assertFalse(SystemUtils.IS_JAVA_1_2);
+@@ -158,8 +162,21 @@ public class SystemUtilsTest {
+             assertFalse(SystemUtils.IS_JAVA_1_8);
+             assertTrue(SystemUtils.IS_JAVA_1_9);
+             assertTrue(SystemUtils.IS_JAVA_9);
++            assertFalse(SystemUtils.IS_JAVA_10);
++        } else if (javaVersion.startsWith("10")) {
++            assertFalse(SystemUtils.IS_JAVA_1_1);
++            assertFalse(SystemUtils.IS_JAVA_1_2);
++            assertFalse(SystemUtils.IS_JAVA_1_3);
++            assertFalse(SystemUtils.IS_JAVA_1_4);
++            assertFalse(SystemUtils.IS_JAVA_1_5);
++            assertFalse(SystemUtils.IS_JAVA_1_6);
++            assertFalse(SystemUtils.IS_JAVA_1_7);
++            assertFalse(SystemUtils.IS_JAVA_1_8);
++            assertFalse(SystemUtils.IS_JAVA_1_9);
++            assertFalse(SystemUtils.IS_JAVA_9);
++            assertTrue(SystemUtils.IS_JAVA_10);
+         } else {
+-            System.out.println("Can't test IS_JAVA value: "+javaVersion);
++            System.out.println("Can't test IS_JAVA value: " + javaVersion);
+         }
+     }
+ 
+@@ -406,6 +423,7 @@ public class SystemUtilsTest {
+             assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_7));
+             assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_1_8));
+             assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_9));
++            assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_10));
+         } else if (SystemUtils.IS_JAVA_1_8) {
+             assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_1));
+             assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_2));
+@@ -416,6 +434,7 @@ public class SystemUtilsTest {
+             assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_7));
+             assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_8));
+             assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_9));
++            assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_10));
+         } else if (SystemUtils.IS_JAVA_9) {
+             assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_1));
+             assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_2));
+@@ -426,6 +445,18 @@ public class SystemUtilsTest {
+             assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_7));
+             assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_8));
+             assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_9));
++            assertFalse(SystemUtils.isJavaVersionAtLeast(JAVA_10));
++        } else if (SystemUtils.IS_JAVA_10) {
++            assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_1));
++            assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_2));
++            assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_3));
++            assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_4));
++            assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_5));
++            assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_6));
++            assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_7));
++            assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_1_8));
++            assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_9));
++            assertTrue(SystemUtils.isJavaVersionAtLeast(JAVA_10));
+         }
+     }
+ 
diff -Nru libcommons-lang3-java-3.5/debian/patches/series libcommons-lang3-java-3.5/debian/patches/series
--- libcommons-lang3-java-3.5/debian/patches/series	2016-10-20 15:05:09.000000000 -0200
+++ libcommons-lang3-java-3.5/debian/patches/series	2018-04-12 10:14:49.000000000 -0300
@@ -1 +1,3 @@
 disable_testGetUserHome_test.diff
+fix-openjdk-10-nullpointer-lang-1365.diff
+fix-numeric-3-area-code-support-lang-1312.diff
__
This is the maintainer address of Debian's Java team
<http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-maintainers>. 
Please use
debian-j...@lists.debian.org for discussions and questions.

Reply via email to