Skip to content

Commit c901eed

Browse files
author
Vincent Potucek
committed
Pull #3003: fix unused stream in DefaultPluginXmlFactory#write
1 parent 6be7a12 commit c901eed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public void write(XmlWriterRequest<PluginDescriptor> request) throws XmlWriterEx
8181
nonNull(request, "request");
8282
PluginDescriptor content = nonNull(request.getContent(), "content");
8383
Path path = request.getPath();
84+
Path pathUnused;
8485
OutputStream outputStream = request.getOutputStream();
8586
Writer writer = request.getWriter();
8687
if (writer == null && outputStream == null && path == null) {
@@ -93,7 +94,7 @@ public void write(XmlWriterRequest<PluginDescriptor> request) throws XmlWriterEx
9394
new PluginDescriptorStaxWriter().write(outputStream, content);
9495
} else {
9596
try (OutputStream os = Files.newOutputStream(path)) {
96-
new PluginDescriptorStaxWriter().write(outputStream, content);
97+
new PluginDescriptorStaxWriter().write(os, content);
9798
}
9899
}
99100
} catch (Exception e) {

0 commit comments

Comments
 (0)