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

ebourg-guest pushed a commit to branch master
in repository maven-javadoc-plugin.

commit 23dfd2938e487dc2c5ac36710752359ce3a20216
Author: Emmanuel Bourg <ebo...@apache.org>
Date:   Fri Jan 5 18:30:20 2018 +0100

    Fixed the NullPointerException when JAVA_HOME isn't defined (MJAVADOC-504)
---
 debian/changelog                  |  7 ++++++
 debian/patches/MJAVADOC-504.patch | 49 +++++++++++++++++++++++++++++++++++++++
 debian/patches/series             |  1 +
 3 files changed, 57 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 8047b4a..08d638f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+maven-javadoc-plugin (3.0.0-2) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Fixed the NullPointerException when JAVA_HOME isn't defined (MJAVADOC-504)
+
+ -- Emmanuel Bourg <ebo...@apache.org>  Tue, 02 Jan 2018 23:43:39 +0100
+
 maven-javadoc-plugin (3.0.0-1) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/patches/MJAVADOC-504.patch 
b/debian/patches/MJAVADOC-504.patch
new file mode 100644
index 0000000..22e6ac5
--- /dev/null
+++ b/debian/patches/MJAVADOC-504.patch
@@ -0,0 +1,49 @@
+Description: Fixes the NullPointerException in JavadocUtil.getJavaHome() when 
JAVA_HOME isn't set
+Origin: upstream, https://github.com/apache/maven-javadoc-plugin/commit/6c53ec5
+Bug: https://issues.apache.org/jira/browse/MJAVADOC-504
+--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
++++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
+@@ -1278,10 +1278,22 @@
+     private static File getJavaHome( Log log )
+     {
+         File javaHome = null;
++        
++        String javaHomeValue = null;
++        try
++        {
++            javaHomeValue = CommandLineUtils.getSystemEnvVars().getProperty( 
"JAVA_HOME" );
++        }
++        catch ( IOException e )
++        {
++            if ( log != null && log.isDebugEnabled() )
++            {
++                log.debug( "IOException: " + e.getMessage() );
++            }
++        }
+ 
+         // if maven.home is set, we can assume JAVA_HOME must be used for 
testing
+-        
+-        if ( System.getProperty( "maven.home" ) == null )
++        if ( System.getProperty( "maven.home" ) == null || javaHomeValue == 
null )
+         {
+             // JEP220 (Java9) restructured the JRE/JDK runtime image
+             if ( ( SystemUtils.IS_OS_MAC_OSX
+@@ -1297,17 +1309,7 @@
+ 
+         if ( javaHome == null || !javaHome.exists() )
+         {
+-            try
+-            {
+-                javaHome = new File( 
CommandLineUtils.getSystemEnvVars().getProperty( "JAVA_HOME" ) );
+-            }
+-            catch ( IOException e )
+-            {
+-                if ( log != null && log.isDebugEnabled() )
+-                {
+-                    log.debug( "IOException: " + e.getMessage() );
+-                }
+-            }
++            javaHome = new File( javaHomeValue );
+         }
+ 
+         if ( javaHome == null || !javaHome.exists() )
diff --git a/debian/patches/series b/debian/patches/series
index 224a858..ee33b91 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ fix-unmappable-characters.patch
 reproducible-footer.patch
 openjdk-9-javadoc-path.patch
 plexus-component-metadata-plugin-version.patch
+MJAVADOC-504.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-java/maven-javadoc-plugin.git

_______________________________________________
pkg-java-commits mailing list
pkg-java-comm...@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

Reply via email to