You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/07/25 17:21:20 UTC

[jira] [Commented] (MNG-6053) Unsafe System Properties copy in MavenRepositorySystemUtils, causing NPEs

    [ https://issues.apache.org/jira/browse/MNG-6053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15392324#comment-15392324 ] 

ASF GitHub Bot commented on MNG-6053:
-------------------------------------

GitHub user fbricon opened a pull request:

    https://github.com/apache/maven/pull/90

    [MNG-6053] prevent NPE when copying System Properties in MavenRepositorySystemUtils

    Added a Null check when copying System Properties in MavenRepositorySystemUtils.newSession().
    Many NPEs were reported when using Maven in Eclipse[1]. The error is most probably caused by some concurrency issue.
    
    [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=493871
    
    Signed-off-by: Fred Bricon <fb...@gmail.com>

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/fbricon/maven MNG-6053

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven/pull/90.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #90
    
----
commit 57c846618cbc5c44d7f7b011f8ce7580486045bb
Author: Fred Bricon <fb...@gmail.com>
Date:   2016-07-25T17:15:30Z

    [MNG-6053] prevent NPE when copying System Properties in MavenRepositorySystemUtils
    
    Signed-off-by: Fred Bricon <fb...@gmail.com>

----


> Unsafe System Properties copy in MavenRepositorySystemUtils, causing NPEs
> -------------------------------------------------------------------------
>
>                 Key: MNG-6053
>                 URL: https://issues.apache.org/jira/browse/MNG-6053
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.3.9
>         Environment: Eclipse m2e 1.7
>            Reporter: Fred Bricon
>
> This bug has been reported in m2e https://bugs.eclipse.org/bugs/show_bug.cgi?id=493871:
> {quote}
> I'm occasionally, not 100% reliably reproducible, but regularly enough (like it occurs every now and then, not just once) seeing the error below, in the Error Log of Eclipse during workspace rebuilds.  This is with M2E 1.7.0. -- I'm not sure if this is just "annoying" or actually prevents M2E from correctly configuring projects (?).  Either way, perhaps it would be possible to "harden" respective code to prevent this?
> java.lang.NullPointerException
> 	at java.util.Hashtable.put(Hashtable.java:459)
> 	at org.apache.maven.repository.internal.MavenRepositorySystemUtils.newSession(MavenRepositorySystemUtils.java:133)
> 	at org.apache.maven.internal.aether.DefaultRepositorySystemSessionFactory.newRepositorySession(DefaultRepositorySystemSessionFactory.java:98)
> 	at org.apache.maven.DefaultMaven.newRepositorySession(DefaultMaven.java:352)
> 	at org.eclipse.m2e.core.internal.embedder.MavenImpl.createRepositorySession(MavenImpl.java:309)
> {quote}
> Looking at https://github.com/apache/maven/blob/86b656167923923e2e416def4a48303b4e6248fa/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java#L132, it seems some system property is null (maybe due to some concurrency issue), and given that Hashtable doesn't support null values, then it throws an NPE on the put() call



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)