Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-1457

wasted work in TrailerValidationProcess.compareIds()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      The problem appears in revision 1414788. I attached a four-line patch
      that fixes it. This problem and the attached patch are similar the
      previously fixed PDFBOX-1447 and its patch.

      In method "TrailerValidationProcess.compareIds", the loop over
      "af.toList()" (outer loop) should break immediately after "isEqual"
      becomes "false", because "isEqual = isEqual && oneIsEquals;" can never
      become "true" again.

      The loop over "al.toList()" (inner loop) should break immediately
      after "oneIsEquals" is set to "true". All the iterations after
      "oneIsEquals" is set to "true" do not perform any useful work because
      the "if" statement depends on "!oneIsEquals".

      Attachments

        1. patch.diff
          0.7 kB
          Adrian Nistor

        Activity

          People

            Unassigned Unassigned
            adriannistor Adrian Nistor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: