You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2019/03/23 20:04:56 UTC

[maven-jlink-plugin] branch CODE_IMPROVEMENTS updated (7ab016c -> a4df80a)

This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a change to branch CODE_IMPROVEMENTS
in repository https://gitbox.apache.org/repos/asf/maven-jlink-plugin.git.


 discard 7ab016c  Cleaned up code.
     new a4df80a  Cleaned up code.

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (7ab016c)
            \
             N -- N -- N   refs/heads/CODE_IMPROVEMENTS (a4df80a)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/maven/plugins/jlink/JLinkMojo.java   | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)


[maven-jlink-plugin] 01/01: Cleaned up code.

Posted by kh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a commit to branch CODE_IMPROVEMENTS
in repository https://gitbox.apache.org/repos/asf/maven-jlink-plugin.git

commit a4df80a4b5911e40ac32d4cb4c2570b53714bad3
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sun Feb 10 19:08:46 2019 +0100

    Cleaned up code.
---
 .../org/apache/maven/plugins/jlink/JLinkMojo.java   | 21 +++++++++++----------
 .../maven/plugins/jlink/AbstractJLinkMojoTest.java  | 21 ---------------------
 2 files changed, 11 insertions(+), 31 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 137c6b8..83459ee 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -368,7 +368,8 @@ public class JLinkMojo
 
             for ( Map.Entry<File, JavaModuleDescriptor> entry : resolvePathsResult.getPathElements().entrySet() )
             {
-                if ( entry.getValue() == null )
+                JavaModuleDescriptor value = entry.getValue();
+                if ( value == null )
                 {
                     String message = "The given dependency " + entry.getKey()
                         + " does not have a module-info.java file. So it can't be linked.";
@@ -377,13 +378,12 @@ public class JLinkMojo
                 }
 
                 // Don't warn for automatic modules, let the jlink tool do that
-                getLog().debug( " module: " + entry.getValue().name() + " automatic: "
-                    + entry.getValue().isAutomatic() );
-                if ( modulepathElements.containsKey( entry.getValue().name() ) )
+                getLog().debug(" module: " + value.name() + " automatic: " + value.isAutomatic());
+                if ( modulepathElements.containsKey( value.name() ) )
                 {
-                    getLog().warn( "The module name " + entry.getValue().name() + " does already exists." );
+                    getLog().warn( "The module name " + value.name() + " does already exists." );
                 }
-                modulepathElements.put( entry.getValue().name(), entry.getKey() );
+                modulepathElements.put( value.name(), entry.getKey() );
             }
 
             // This part is for the module in target/classes ? (Hacky..)
@@ -397,18 +397,19 @@ public class JLinkMojo
                 ResolvePathsResult<File> resolvePaths = locationManager.resolvePaths( singleModuls );
                 for ( Entry<File, JavaModuleDescriptor> entry : resolvePaths.getPathElements().entrySet() )
                 {
-                    if ( entry.getValue() == null )
+                    JavaModuleDescriptor value = entry.getValue();
+                    if ( value == null )
                     {
                         String message = "The given project " + entry.getKey()
                             + " does not contain a module-info.java file. So it can't be linked.";
                         getLog().error( message );
                         throw new MojoFailureException( message );
                     }
-                    if ( modulepathElements.containsKey( entry.getValue().name() ) )
+                    if ( modulepathElements.containsKey( value.name() ) )
                     {
-                        getLog().warn( "The module name " + entry.getValue().name() + " does already exists." );
+                        getLog().warn( "The module name " + value.name() + " does already exists." );
                     }
-                    modulepathElements.put( entry.getValue().name(), entry.getKey() );
+                    modulepathElements.put( value.name(), entry.getKey() );
                 }
             }
 
diff --git a/src/test/java/org/apache/maven/plugins/jlink/AbstractJLinkMojoTest.java b/src/test/java/org/apache/maven/plugins/jlink/AbstractJLinkMojoTest.java
index 85dd34c..bcabd52 100644
--- a/src/test/java/org/apache/maven/plugins/jlink/AbstractJLinkMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/jlink/AbstractJLinkMojoTest.java
@@ -109,25 +109,4 @@ public class AbstractJLinkMojoTest
         assertThat( result ).isEqualTo( "A,B" );
     }
 
-//    @Test
-//    public void xxx()
-//        throws MojoExecutionException, IOException, CommandLineException
-//    {
-//        Process p = mock( Process.class );
-//
-//        String b = "Error occured";
-//        byte[] bytes = b.getBytes();
-//        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-//        baos.write( bytes );
-//        
-//        when (p.getOutputStream()).thenReturn( baos );
-//        
-//        Commandline cmd = mock( Commandline.class );
-//        when (cmd.execute()).thenReturn( p );
-//        
-//        File outputDirectory = mock( File.class );
-//
-//        mojoMock.executeCommand( cmd, outputDirectory );
-//
-//    }
 }