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

Wasted work in XMPSchema.merge()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.2
    • None
    • XmpBox
    • any

    Description

      The problem appears in version 1.8.2 and in revision 1493964. I
      attached a two-line patch that fixes it. This problem and the
      attached patch are similar the previously fixed PDFBOX-1456,
      PDFBOX-1457, and PDFBOX-1583, and their patches.

      In method "org.apache.xmpbox.schema.XMPSchema.merge", the loops over
      "itNewValues" and "itActualEmbeddedProperties" should break
      immediately after "alreadyPresent" is set to "true". All the
      iterations after "alreadyPresent" is set to "true" do not perform any
      useful work because the only side effect is:
      "((ArrayProperty)tmpEmbeddedProperty).getContainer().addProperty(tmpNewValue);",
      which is executed only when "if (!alreadyPresent)" is "true", i.e., it
      is never executed once "alreadyPresent" is set to "true" because
      "alreadyPresent" cannot become "false" again.

      Attachments

        1. patch.diff
          1 kB
          Adrian Nistor

        Activity

          People

            gbm.bailleul Guillaume Bailleul
            adriannistor Adrian Nistor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: