Pankraz76 commented on code in PR #2306:
URL: https://github.com/apache/maven/pull/2306#discussion_r2083273049


##########
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java:
##########
@@ -62,14 +63,9 @@ public PluginDescriptor read(@Nonnull XmlReaderRequest 
request) throws XmlReader
                 return xml.read(inputStream, request.isStrict());
             } else if (reader != null) {
                 return xml.read(reader, request.isStrict());
-            } else if (path != null) {
-                try (InputStream is = Files.newInputStream(path)) {
-                    return xml.read(is, request.isStrict());
-                }
-            } else {
-                try (InputStream is = url.openStream()) {
-                    return xml.read(is, request.isStrict());
-                }
+            }
+            try (InputStream is = 
Files.newInputStream(Objects.requireNonNull(path))) {
+                return xml.read(is, request.isStrict());
             }
         } catch (Exception e) {

Review Comment:
   Of course, it's better API design to be precise and not broad—especially in 
this case.
   
   If possible we should ensure this standard as well. In `checkstyle` its the 
same (of course as all the checkers are on), so i know this quite well. Its a 
good thing to strengthen the design.
   
   https://github.com/apache/maven-shared-resources/pull/73



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