8148454: [PIT] Failure of ReplaceMetadataTest on TIFF with IllegalStateException
authorbpb
Fri, 22 Jul 2016 14:32:49 -0700
changeset 40137 0d7d50ab241f
parent 40136 e1aeb5f5a777
child 40138 d294794a0878
8148454: [PIT] Failure of ReplaceMetadataTest on TIFF with IllegalStateException Summary: Move super.setOutput() to end of setOutput() to avoid setting super.output to null Reviewed-by: prr
jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java
jdk/test/ProblemList.txt
jdk/test/javax/imageio/plugins/tiff/MultiPageImageTIFFFieldTest.java
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java	Sat Jul 23 02:08:17 2016 +0530
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java	Fri Jul 22 14:32:49 2016 -0700
@@ -263,15 +263,15 @@
     }
 
     public void setOutput(Object output) {
-        super.setOutput(output);
-
         if (output != null) {
-            reset();
-
             if (!(output instanceof ImageOutputStream)) {
                 throw new IllegalArgumentException
                     ("output not an ImageOutputStream!");
             }
+
+            // reset() must precede setOutput() as it sets output to null
+            reset();
+
             this.stream = (ImageOutputStream)output;
 
             //
@@ -312,6 +312,8 @@
         } else {
             this.stream = null;
         }
+
+        super.setOutput(output);
     }
 
     public IIOMetadata
--- a/jdk/test/ProblemList.txt	Sat Jul 23 02:08:17 2016 +0530
+++ b/jdk/test/ProblemList.txt	Fri Jul 22 14:32:49 2016 -0700
@@ -293,9 +293,6 @@
 ############################################################################
 
 # jdk_imageio
-javax/imageio/plugins/shared/CanWriteSequence.java              8148454 generic-all
-javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java     8148454 generic-all
-javax/imageio/plugins/tiff/WriteToSequenceAfterAbort.java       8148454 generic-all
 
 ############################################################################
 
--- a/jdk/test/javax/imageio/plugins/tiff/MultiPageImageTIFFFieldTest.java	Sat Jul 23 02:08:17 2016 +0530
+++ b/jdk/test/javax/imageio/plugins/tiff/MultiPageImageTIFFFieldTest.java	Fri Jul 22 14:32:49 2016 -0700
@@ -23,7 +23,6 @@
 
 /**
  * @test
- * @ignore  8148454
  * @bug     8152183 8148454
  * @author  a.stepanov
  * @summary check that TIFFields are derived properly for multi-page tiff