8228204: Fix for JDK-8067801 breaks java/io/NegativeInitSize.java

Brian Burkhalter brian.burkhalter at oracle.com
Wed Jul 17 21:43:45 UTC 2019


https://bugs.openjdk.java.net/browse/JDK-8228204

I lamely did not catch this before the push of the patch for [1]. The diff is below.

Thanks,

Brian

[1] https://bugs.openjdk.java.net/browse/JDK-8067801
[2] diff

@@ -22,7 +22,7 @@
  */
 
 /* @test
-   @bug 4015701 4127654
+   @bug 4015701 4127654 8067801
    @summary Test if the constructor would detect
             illegal arguments.
 */
@@ -49,8 +49,10 @@
                 ("PushbackReader failed to detect negative init size");
         }
 
+        byte[] ba = { 123 };
+        ByteArrayInputStream goodbis = new ByteArrayInputStream(ba);
         try {
-            PushbackInputStream pbis = new PushbackInputStream(null, -1);
+            PushbackInputStream pbis = new PushbackInputStream(goodbis, -1);
         } catch (IllegalArgumentException e) {
         } catch (Exception e) {
             throw new Exception
@@ -66,8 +68,6 @@
                 ("BufferedOutputStream failed to detect negative init size");
         }
 
-        byte[] ba = { 123 };
-        ByteArrayInputStream goodbis = new ByteArrayInputStream(ba);
         try {
             BufferedInputStream bis = new BufferedInputStream(goodbis, -1);
         } catch (IllegalArgumentException e) {



More information about the core-libs-dev mailing list