Harmony
  1. Harmony
  2. HARMONY-6623

[classlib][archive]Deflater.setlevel/setStrategy throws IllegalStateException if inputBuffer is not null

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0M3, 5.0M15
    • Labels:
      None
    • Environment:
      Windows/Linux

      Description

      Please consider the below testcase [1] . RI works fine. But Harmony throws IllegalStateException.

      This is the same case with defl.setStrategy() function also.

      [1] public void test () {
      byte[] byteArray = new byte[100];
      InputStream inFile = new FileInputStream(new File("Input.txt"));
      //input.txt - any text file with some text in it.
      inFile.read(byteArray);
      inFile.close();
      Deflater defl = new Deflater();
      byte[] outPutBuf = new byte[500];
      defl.setInput(byteArray);
      defl.setLevel(2);
      while (!defl.needsInput())

      { defl.deflate(outPutBuf); }
      defl.finish();
      while (!defl.finished()) { defl.deflate(outPutBuf); }

      int totalOut;
      totalOut = defl.getTotalOut();
      System.out.println("TotalOut=" + totalOut);
      }

      1. HARMONY-6623.patch
        2 kB
        Mohanraj Loganathan

        Activity

        Hide
        Mohanraj Loganathan added a comment -

        Patch HARMONY-6623.patch taken from Java5 level.
        It can be applied to Java6 level also.

        All the unit tests from Archive passes after this change. I believe checking inputBuffer!=NULL not required while setLevel and setStrategy.

        Show
        Mohanraj Loganathan added a comment - Patch HARMONY-6623 .patch taken from Java5 level. It can be applied to Java6 level also. All the unit tests from Archive passes after this change. I believe checking inputBuffer!=NULL not required while setLevel and setStrategy.
        Hide
        Oliver Deakin added a comment -

        Thanks Mohan. Patch applied at repo revision r989780. Please check it applied as expected.

        Show
        Oliver Deakin added a comment - Thanks Mohan. Patch applied at repo revision r989780. Please check it applied as expected.
        Hide
        Mohanraj Loganathan added a comment -

        Thanks Oliver. I verified @ r989795. Patches are applied as expected.

        Show
        Mohanraj Loganathan added a comment - Thanks Oliver. I verified @ r989795. Patches are applied as expected.
        Hide
        Hudson added a comment -

        Integrated in Harmony-select-1.5-head-linux-x86_64 #102 (See https://hudson.apache.org/hudson/job/Harmony-select-1.5-head-linux-x86_64/102/)
        Apply patch for HARMONY-6623 ([classlib][archive]Deflater.setlevel/setStrategy throws IllegalStateException if inputBuffer is not null)

        Show
        Hudson added a comment - Integrated in Harmony-select-1.5-head-linux-x86_64 #102 (See https://hudson.apache.org/hudson/job/Harmony-select-1.5-head-linux-x86_64/102/ ) Apply patch for HARMONY-6623 ( [classlib] [archive] Deflater.setlevel/setStrategy throws IllegalStateException if inputBuffer is not null)
        Hide
        Hudson added a comment -

        Integrated in Harmony-1.5-head-linux-x86_64 #940 (See https://hudson.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/940/)
        Apply patch for HARMONY-6623 ([classlib][archive]Deflater.setlevel/setStrategy throws IllegalStateException if inputBuffer is not null)

        Show
        Hudson added a comment - Integrated in Harmony-1.5-head-linux-x86_64 #940 (See https://hudson.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/940/ ) Apply patch for HARMONY-6623 ( [classlib] [archive] Deflater.setlevel/setStrategy throws IllegalStateException if inputBuffer is not null)

          People

          • Assignee:
            Oliver Deakin
            Reporter:
            Mohanraj Loganathan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development