[ https://issues.apache.org/jira/browse/PDFBOX-1458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adrian Nistor updated PDFBOX-1458: ---------------------------------- Description: The problem appears in version version 1.7.1 and in revision 1414788. I attached a three-line patch (on.diff) that fixes it. This problem and the attached patch are similar the previously fixed PDFBOX-1447 and its patch. In method "PDOptionalContentProperties.setGroupEnabled", the loop over "on" should not be executed if "enable" is "true". When "enable" is "true", all the iterations just compute "group" and "name", and then discard them, because the "if" condition depends on "!enable". Similarly, in the same method "PDOptionalContentProperties.setGroupEnabled", the loop over "off" should not be executed if "enable" is "false". I attached a separate patch (off.diff) for the "off" loop. was: The problem appears in version version 1.7.1 and in revision 1414788. I attached a three-line patch (on.diff) that fixes it. In method "PDOptionalContentProperties.setGroupEnabled", the loop over "on" should not be executed if "enable" is "true". When "enable" is "true", all the iterations just compute "group" and "name", and then discard them, because the "if" condition depends on "!enable". Similarly, in the same method "PDOptionalContentProperties.setGroupEnabled", the loop over "off" should not be executed if "enable" is "false". I attached a separate patch (off.diff) for the "off" loop. > wasted work in PDOptionalContentProperties.setGroupEnabled() > ------------------------------------------------------------ > > Key: PDFBOX-1458 > URL: https://issues.apache.org/jira/browse/PDFBOX-1458 > Project: PDFBox > Issue Type: Bug > Affects Versions: 1.7.1 > Reporter: Adrian Nistor > Labels: patch, performance > Attachments: off.diff, on.diff > > > The problem appears in version version 1.7.1 and in revision 1414788. > I attached a three-line patch (on.diff) that fixes it. This problem > and the attached patch are similar the previously fixed PDFBOX-1447 > and its patch. > In method "PDOptionalContentProperties.setGroupEnabled", the loop over > "on" should not be executed if "enable" is "true". When "enable" is > "true", all the iterations just compute "group" and "name", and then > discard them, because the "if" condition depends on "!enable". > Similarly, in the same method > "PDOptionalContentProperties.setGroupEnabled", the loop over "off" > should not be executed if "enable" is "false". I attached a separate > patch (off.diff) for the "off" loop. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira