Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2576 Improve code quality
  3. PDFBOX-2783

Remove getCOSDictionary() method, adjust getCOSObject() return type

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • None
    • None

    Description

      As discussed on the mailing list: Remove getCOSDictionary(), use getCOSObject() instead, change return type to COSDictionary or whatever is applicable. If possible, change javadoc too.

      While working on it, I noticed code like this:

              if (newDomain == null)
              {
                  getCOSDictionary().removeItem(COSName.DOMAIN);
              }
              else
              {
                  getCOSDictionary().setItem(COSName.DOMAIN, newDomain);
              }
      

      this should be replaced with

              getCOSObject().setItem(COSName.DOMAIN, newDomain);
      

      because setItem() calls removeItem() when the second parameter is nulll.

      Attachments

        Activity

          People

            Unassigned Unassigned
            tilman Tilman Hausherr
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: