Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.2
-
None
-
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.