You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/02/05 19:29:01 UTC

[GitHub] [maven] Tibor17 commented on a change in pull request #669: Use try-with-resources

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 on 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-unsubscribe@maven.apache.org

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