ICEpdf
  1. ICEpdf
  2. PDF-94

PTrailer incorrectly appling previous trainer dictionary values

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 4.0 - Beta, 4.0
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      any

      Description

      I came across an issue when trying to add new object a a PDF. When I asked the PTrailer for the next available object number I was given the number of an object that was already in use. After tracing the document a bit and our trailer code I found an issue in how we where coping dictionary values from the previous trailer to the current. This appears to be a long standing bug but because we never actually used the size data in the past release it was not an issue.

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #19849 Wed Dec 02 06:10:08 MST 2009 patrick.corless PDF-94 updated the prev/next xref dictionary code to use containsKey instead of contains to fix an issue where the size entry was getting overwritten by prev/next dictionaries.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/PTrailer.java
        Patrick Corless created issue -
        Patrick Corless made changes -
        Field Original Value New Value
        Salesforce Case []
        Fix Version/s 4.0 [ 10212 ]
        Hide
        Patrick Corless added a comment -

        The PTrailer has two methods that copy properties from previous or next trailers if the property doesn't exist in the origional trailer. The code previously did a check for the property key with !dictionary.contains(key) which always returned true and values where incorrectly over written.

        I updated the hash code to read !dictionary.containsKey(key) and the copy worked as expected. I suspect his was just an hash API typo.

        I know correctly get the next object number in the the file.

        Show
        Patrick Corless added a comment - The PTrailer has two methods that copy properties from previous or next trailers if the property doesn't exist in the origional trailer. The code previously did a check for the property key with !dictionary.contains(key) which always returned true and values where incorrectly over written. I updated the hash code to read !dictionary.containsKey(key) and the copy worked as expected. I suspect his was just an hash API typo. I know correctly get the next object number in the the file.
        Hide
        Patrick Corless added a comment -

        Marking as fixed.

        Show
        Patrick Corless added a comment - Marking as fixed.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 4.0 [ 10222 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Patrick Corless
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: