PropertyUtils: stop closing caller's InputStream
diff --git a/src/main/java/org/apache/maven/shared/utils/PropertyUtils.java b/src/main/java/org/apache/maven/shared/utils/PropertyUtils.java
index 199def0..70e62a9 100644
--- a/src/main/java/org/apache/maven/shared/utils/PropertyUtils.java
+++ b/src/main/java/org/apache/maven/shared/utils/PropertyUtils.java
@@ -90,11 +90,7 @@
         try {
             Properties result = new Properties();
             if (is != null) {
-                try (InputStream in = is) {
-                    result.load(in);
-                } catch (IOException e) {
-                    // ignore
-                }
+                result.load(is);
             }
             return result;
         } catch (Exception e) {
@@ -168,9 +164,8 @@
         Properties properties = new Properties();
 
         if (inputStream != null) {
-            try (InputStream in = inputStream) // reassign inputStream to autoclose
-            {
-                properties.load(in);
+            try {
+                properties.load(inputStream);
             } catch (IllegalArgumentException | IOException ex) {
                 // ignore and return empty properties
             }
diff --git a/src/test/java/org/apache/maven/shared/utils/PropertyUtilsTest.java b/src/test/java/org/apache/maven/shared/utils/PropertyUtilsTest.java
index 1055425..f133597 100644
--- a/src/test/java/org/apache/maven/shared/utils/PropertyUtilsTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/PropertyUtilsTest.java
@@ -29,6 +29,7 @@
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 import java.net.URL;
+import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.util.Properties;
 
@@ -50,7 +51,6 @@
 
     @Test
     @SuppressWarnings("deprecation")
-    // @ReproducesPlexusBug( "Should return null on error like url and file do" )
     public void loadNullInputStream() {
         assertEquals(new Properties(), PropertyUtils.loadProperties((InputStream) null));
     }
@@ -110,13 +110,11 @@
     public void loadEmptyURL() throws Exception {
         assertEquals(
                 new Properties(),
-                PropertyUtils.loadProperties(
-                        newFile(tempFolder, "empty").toURI().toURL()));
+                PropertyUtils.loadProperties(newFile(tempFolder, "empty").toURI().toURL()));
 
         assertEquals(
                 new Properties(),
-                PropertyUtils.loadOptionalProperties(
-                        newFile(tempFolder, "optional").toURI().toURL()));
+                PropertyUtils.loadOptionalProperties(newFile(tempFolder, "optional").toURI().toURL()));
     }
 
     @Test
@@ -154,11 +152,26 @@
         try (OutputStream out = Files.newOutputStream(valid.toPath())) {
             value.store(out, "a test");
             assertEquals(value, PropertyUtils.loadProperties(valid.toURI().toURL()));
-            assertEquals(
-                    value, PropertyUtils.loadOptionalProperties(valid.toURI().toURL()));
+            assertEquals(value, PropertyUtils.loadOptionalProperties(valid.toURI().toURL()));
         }
     }
 
+    @Test
+    @SuppressWarnings("deprecation")
+    public void streamIsNotClosedByLoadProperties() throws IOException {
+        ByteArrayInputStream stream = new ByteArrayInputStream("a=b".getBytes(StandardCharsets.ISO_8859_1));
+        PropertyUtils.loadProperties(stream);
+        assertEquals(0, stream.available());
+    }
+
+    @Test
+    @SuppressWarnings("deprecation")
+    public void streamIsNotClosedByLoadOptionalProperties() throws IOException {
+        ByteArrayInputStream stream = new ByteArrayInputStream("a=b".getBytes(StandardCharsets.ISO_8859_1));
+        PropertyUtils.loadOptionalProperties(stream);
+        assertEquals(0, stream.available());
+    }
+
     private static File newFile(File parent, String child) throws IOException {
         File result = new File(parent, child);
         result.createNewFile();