Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4447284

FileImageOutputStream.write(int) falls into an infinite loop

    Details

    • Subcomponent:
    • Resolved In Build:
      beta2
    • CPU:
      generic
    • OS:
      generic

      Description



      Name: mlR10151 Date: 04/19/2001



      Method write(int) of the FileImageOutputStream class falls into an infinite loop.
      To reproduce the bug run the following test:

      ========================== a.java =============================
      import java.io.*;
      import javax.imageio.stream.*;

      public class a {
          public static void main (String argv[]) throws Exception {
              System.setSecurityManager(null);
              File tempFile = File.createTempFile("test", "tmp");

              FileImageOutputStream fios = new FileImageOutputStream(tempFile);
              fios.writeBits(0xFFFFFFFFFFFFFFFFL, 0);
              fios.write(1);
              fios.seek(0);
              fios.writeBits(0xFFFFFFFFFFFFFFFFL, 1);
              fios.write(1);

              System.out.println("Passed");
          }
      }
      ==========================log========================
      % java -version
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b60)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b60, mixed mode)
      % java a
      Exception in thread "main" java.lang.StackOverflowError
              at javax.imageio.stream.FileImageOutputStream.write(FileImageOutputStream.java:87)
              at javax.imageio.stream.ImageOutputStreamImpl.flushBits(ImageOutputStreamImpl.java:435)
              at javax.imageio.stream.FileImageOutputStream.write(FileImageOutputStream.java:87)
              at javax.imageio.stream.ImageOutputStreamImpl.flushBits(ImageOutputStreamImpl.java:435)
              . . .
       

      This bug causes failure of the new JCK test
      api/javax_imageio/stream/FileImageOutputStream/index.html#write


      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              dricesunw Daniel Rice (Inactive)
              Reporter:
              mlsunw Ml Ml (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: