changeset 17304:398dc40602fe

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
author bpb
date Fri, 22 Jul 2016 14:32:49 -0700
parents c038e0adf5af
children 987d0d79ebe4
files src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java test/ProblemList.txt test/javax/imageio/plugins/tiff/MultiPageImageTIFFFieldTest.java
diffstat 3 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java	Sat Jul 23 02:08:17 2016 +0530
+++ b/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/test/ProblemList.txt	Sat Jul 23 02:08:17 2016 +0530
+++ b/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/test/javax/imageio/plugins/tiff/MultiPageImageTIFFFieldTest.java	Sat Jul 23 02:08:17 2016 +0530
+++ b/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