Pankraz76 commented on code in PR #2303:
URL: https://github.com/apache/maven/pull/2303#discussion_r2079489202
##########
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java:
##########
@@ -38,20 +38,20 @@
import org.apache.maven.plugin.descriptor.io.PluginDescriptorStaxReader;
import org.apache.maven.plugin.descriptor.io.PluginDescriptorStaxWriter;
-import static org.apache.maven.impl.ImplUtils.nonNull;
+import static java.util.Objects.requireNonNull;
import static org.apache.maven.impl.StaxLocation.getLocation;
import static org.apache.maven.impl.StaxLocation.getMessage;
@Named
@Singleton
public class DefaultPluginXmlFactory implements PluginXmlFactory {
+
@Override
public PluginDescriptor read(@Nonnull XmlReaderRequest request) throws
XmlReaderException {
- nonNull(request, "request");
- Path path = request.getPath();
- URL url = request.getURL();
- Reader reader = request.getReader();
Review Comment:
With this `SOC`, we get better visibility into the system and can avoid
unnecessary complexity in the code. The current implementation is already clean
and follows a functional `OOP` style, but it's not the final version. There's
still room to extract dedicated abstraction layers to support more specialized
responsibilities.
However, this approach currently mimics fields of a class, which introduces
`coupling` and reduces `cohesion`. It leans into `feature envy` and bypasses
`SOLID` design principles and established architectural patterns. We should aim
to refactor accordingly.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]