bmarwell commented on a change in pull request #36:
URL: 
https://github.com/apache/maven-compiler-plugin/pull/36#discussion_r546900913



##########
File path: src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
##########
@@ -319,7 +352,42 @@ else if ( Double.valueOf( getTarget() ) < Double.valueOf( 
MODULE_INFO_TARGET ) )
         if ( testModuleDescriptor != null )
         {
             modulepathElements = testPath;
-            classpathElements = Collections.emptyList();
+            classpathElements = null;
+            for ( String path : modulepathElements )
+            {
+                File file = new File( path );
+                if ( file.exists() && ! file.isDirectory() && 
file.getName().endsWith( ".jar" ) )
+                {
+                    // check if the jar file contains the module-info.class
+                    try
+                    {
+                        JarFile jarFile = new JarFile( file );
+                        if ( jarFile.getJarEntry( "module-info.class" ) == 
null )
+                        {
+                            if ( getLog().isDebugEnabled() )
+                            {
+                                getLog().debug( "Add non-module jar dependency 
" + path
+                                        + " to class path." );
+                            }
+                            if ( classpathElements ==  null )
+                            {
+                                classpathElements = new ArrayList<String>();
+                            }
+                            // add the path to the classpathElements list.
+                            classpathElements.add( path );
+                        }

Review comment:
       Well, now you have the same amount of indentation in a loop. But I will 
not complain anymore about indentation unless another committer does. ;-)
   The comment in the new method is helpful. Nit: You could have added it as 
Javadoc while you were at it.
   
   I will check it out locally in a few days to inspect the changes further.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to