maven git commit: [MNG-6053] prevent NPE when copying System Properties in MavenRepositorySystemUtils
Repository: maven Updated Branches: refs/heads/master 6d9ffe351 -> 3d1117353 [MNG-6053] prevent NPE when copying System Properties in MavenRepositorySystemUtils Signed-off-by: Fred Bricon This closes #90 Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/3d111735 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/3d111735 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/3d111735 Branch: refs/heads/master Commit: 3d111735310c4630d6e805ca8cd3916afcf66802 Parents: 6d9ffe3 Author: Fred Bricon Authored: Mon Jul 25 19:15:30 2016 +0200 Committer: Christian Schulte Committed: Mon Jul 25 19:44:45 2016 +0200 -- .../maven/repository/internal/MavenRepositorySystemUtils.java | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/3d111735/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java -- diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java index 3a98b2a..17cbc6d 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -131,7 +131,12 @@ public final class MavenRepositorySystemUtils Properties sysProps = new Properties(); for ( String key : System.getProperties().stringPropertyNames() ) { -sysProps.put( key, System.getProperty( key ) ); +Object value = System.getProperty( key ); +// MNG-6053 guard against key without value +if ( value != null ) +{ +sysProps.put( key, value ); +} } session.setSystemProperties( sysProps ); session.setConfigProperties( sysProps );
maven git commit: [MNG-5670] guard against ConcurrentModificationException [MNG-6053] guard against key without value
Repository: maven Updated Branches: refs/heads/master 3d1117353 -> f848bc20f [MNG-5670] guard against ConcurrentModificationException [MNG-6053] guard against key without value Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/f848bc20 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/f848bc20 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/f848bc20 Branch: refs/heads/master Commit: f848bc20f90ff25f5585f3f9515de65dfe12779a Parents: 3d11173 Author: Christian Schulte Authored: Mon Jul 25 19:53:27 2016 +0200 Committer: Christian Schulte Committed: Mon Jul 25 19:53:27 2016 +0200 -- .../internal/MavenRepositorySystemUtils.java| 28 ++-- 1 file changed, 20 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/maven/blob/f848bc20/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java -- diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java index 17cbc6d..fa009f7 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java @@ -19,6 +19,9 @@ package org.apache.maven.repository.internal; * under the License. */ +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.util.Properties; import org.eclipse.aether.DefaultRepositorySystemSession; @@ -128,18 +131,27 @@ public final class MavenRepositorySystemUtils session.setArtifactDescriptorPolicy( new SimpleArtifactDescriptorPolicy( true, true ) ); // MNG-5670 guard against ConcurrentModificationException -Properties sysProps = new Properties(); -for ( String key : System.getProperties().stringPropertyNames() ) +// MNG-6053 guard against key without value +final Properties systemProperties = new Properties(); +// This relies on the fact that load/store are synchronized internally. +try ( final ByteArrayOutputStream out = new ByteArrayOutputStream() ) { -Object value = System.getProperty( key ); -// MNG-6053 guard against key without value -if ( value != null ) +System.getProperties().store( out, null ); +out.close(); + +try ( final ByteArrayInputStream in = new ByteArrayInputStream( out.toByteArray() ) ) { -sysProps.put( key, value ); +systemProperties.load( in ); +in.close(); } } -session.setSystemProperties( sysProps ); -session.setConfigProperties( sysProps ); +catch ( final IOException e ) +{ +throw new AssertionError( "Unexpected IO error copying system properties." ); +} + +session.setSystemProperties( systemProperties ); +session.setConfigProperties( systemProperties ); return session; }
svn commit: r1754050 - in /maven/plugin-tools/trunk/maven-plugin-tools-generators/src: main/java/org/apache/maven/tools/plugin/generator/ main/resources/ test/java/org/apache/maven/tools/plugin/genera
Author: gboue Date: Mon Jul 25 21:19:22 2016 New Revision: 1754050 URL: http://svn.apache.org/viewvc?rev=1754050&view=rev Log: [MPLUGIN-307] The "alias" field on the annotation "@Parameter" is not considered for goal "plugin:report" PluginXdocGenerator didn't include the alias for parameters in the report. Added to the end of the bullet list. Modified: maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/pluginxdoc.properties maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/pluginxdoc_de.properties maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/pluginxdoc_fr.properties maven/plugin-tools/trunk/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java maven/plugin-tools/trunk/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGeneratorTest.java Modified: maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java?rev=1754050&r1=1754049&r2=1754050&view=diff == --- maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java (original) +++ maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java Mon Jul 25 21:19:22 2016 @@ -543,6 +543,10 @@ public class PluginXdocGenerator addedUl = addUl( w, addedUl, parameter.getDefaultValue() ); writeDetail( getString( "pluginxdoc.mojodescriptor.parameter.default" ), escapeXml( parameter.getDefaultValue() ), w ); + +addedUl = addUl( w, addedUl, parameter.getAlias() ); +writeDetail( getString( "pluginxdoc.mojodescriptor.parameter.alias" ), escapeXml( parameter.getAlias() ), + w ); if ( addedUl ) { @@ -719,6 +723,13 @@ public class PluginXdocGenerator if ( property != null ) { w.writeMarkup( format( "pluginxdoc.mojodescriptor.parameter.property.description", property ) ); +w.writeMarkup( "" ); +} + +if ( StringUtils.isNotEmpty( parameter.getAlias() ) ) +{ +w.writeMarkup( format( "pluginxdoc.mojodescriptor.parameter.alias.description", + escapeXml( parameter.getAlias() ) ) ); } w.endElement(); //td Modified: maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/pluginxdoc.properties URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/pluginxdoc.properties?rev=1754050&r1=1754049&r2=1754050&view=diff == --- maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/pluginxdoc.properties (original) +++ maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/pluginxdoc.properties Mon Jul 25 21:19:22 2016 @@ -53,6 +53,8 @@ pluginxdoc.mojodescriptor.parameter.prop pluginxdoc.mojodescriptor.parameter.property.description=User property is: {0}. pluginxdoc.mojodescriptor.parameter.default=Default pluginxdoc.mojodescriptor.parameter.defaultValue=Default value is: {0}. +pluginxdoc.mojodescriptor.parameter.alias=Alias +pluginxdoc.mojodescriptor.parameter.alias.description=Alias is: {0}. pluginxdoc.mojodescriptor.requiredParameters=Required Parameters pluginxdoc.mojodescriptor.optionalParameters=Optional Parameters pluginxdoc.mojodescriptor.parameters=Parameters Modified: maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/pluginxdoc_de.properties URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/pluginxdoc_de.properties?rev=1754050&r1=1754049&r2=1754050&view=diff == --- maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/pluginxdoc_de.properties (original) +++ maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/resources/pluginxdoc_de.properties Mon Jul 25 21:19:22 2016 @@ -47,6 +47,8 @@ pluginxdoc.mojodescriptor.parameter.requ pluginxdoc.mojodescriptor.parameter.expression=Ausdruck pluginxdoc.mojodescriptor.parameter.default=Standard pluginxdoc.mojodescriptor