Tibor17 commented on a change in pull request #669:
URL: https://github.com/apache/maven/pull/669#discussion_r800091854



##########
File path: 
maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
##########
@@ -216,9 +216,10 @@ private PluginDescriptor extractPluginDescriptor( Artifact 
pluginArtifact, Plugi
 
                     if ( pluginDescriptorEntry != null )
                     {
-                        InputStream is = pluginJar.getInputStream( 
pluginDescriptorEntry );
-
-                        pluginDescriptor = parsePluginDescriptor( is, plugin, 
pluginFile.getAbsolutePath() );
+                        try ( InputStream is = pluginJar.getInputStream( 
pluginDescriptorEntry ) )

Review comment:
       This is wrong.
   The caller must not close the stream. It can be done only in the private 
method `parsePluginDescriptor()` and not here.
   The method wraps the stream and so the `Reader` has to close it.




-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to