You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Johannes Koch (JIRA)" <ji...@apache.org> on 2010/02/22 13:54:28 UTC

[jira] Created: (PDFBOX-628) Too many detours in COSDictionary convenience methods

Too many detours in COSDictionary convenience methods
-----------------------------------------------------

                 Key: PDFBOX-628
                 URL: https://issues.apache.org/jira/browse/PDFBOX-628
             Project: PDFBox
          Issue Type: Improvement
          Components: PDModel
            Reporter: Johannes Koch
            Priority: Minor


I think there are too many detours in some of the COSDictionary convenience methods. E.g.

getInt( COSName key )
-> getInt( COSName key, int defaultValue )
   // create String from COSName
-> getInt( String key, int defaultValue )
-> getInt( String[] keyList, int defaultValue )
-> getDictionaryObject( String[] keyList )
   // create COSName from String
-> getDictionaryObject( COSName key )


Wouldn't it be easier to just do the following?

getInt( COSName key )
-> getDictionaryObject( COSName key )


Same with getLong(COSName):

getLong( COSName key )
-> getLong( COSName key, long defaultValue )
-> getLong( String key, long defaultValue )
-> getLong( String[] keyList, long defaultValue )
-> getDictionaryObject( String[] keyList )
-> getDictionaryObject( COSName key )

This could be reduced to:

getLong( COSName key )
-> getDictionaryObject( COSName key )


getFloat(COSName) has only one detour:

getFloat( COSName key )
-> getFloat( COSName key, float defaultValue )
-> getDictionaryObject( COSName key )

This could be reduced to:

getFloat( COSName key )
-> getDictionaryObject( COSName key )

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Created: (PDFBOX-628) Too many detours in COSDictionary convenience methods

Posted by Ad...@swmc.com.
+1

This change makes perfect sense to me.



From:
"Johannes Koch (JIRA)" <ji...@apache.org>
To:
dev@pdfbox.apache.org
Date:
02/22/2010 04:54
Subject:
[jira] Created: (PDFBOX-628) Too many detours in COSDictionary convenience 
methods



Too many detours in COSDictionary convenience methods
-----------------------------------------------------

                 Key: PDFBOX-628
                 URL: https://issues.apache.org/jira/browse/PDFBOX-628
             Project: PDFBox
          Issue Type: Improvement
          Components: PDModel
            Reporter: Johannes Koch
            Priority: Minor


I think there are too many detours in some of the COSDictionary 
convenience methods. E.g.

getInt( COSName key )
-> getInt( COSName key, int defaultValue )
   // create String from COSName
-> getInt( String key, int defaultValue )
-> getInt( String[] keyList, int defaultValue )
-> getDictionaryObject( String[] keyList )
   // create COSName from String
-> getDictionaryObject( COSName key )


Wouldn't it be easier to just do the following?

getInt( COSName key )
-> getDictionaryObject( COSName key )


Same with getLong(COSName):

getLong( COSName key )
-> getLong( COSName key, long defaultValue )
-> getLong( String key, long defaultValue )
-> getLong( String[] keyList, long defaultValue )
-> getDictionaryObject( String[] keyList )
-> getDictionaryObject( COSName key )

This could be reduced to:

getLong( COSName key )
-> getDictionaryObject( COSName key )


getFloat(COSName) has only one detour:

getFloat( COSName key )
-> getFloat( COSName key, float defaultValue )
-> getDictionaryObject( COSName key )

This could be reduced to:

getFloat( COSName key )
-> getDictionaryObject( COSName key )

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.




?  Click here to submit conditions  

This email and any content within or attached hereto from  Sun West Mortgage Company, Inc.  is confidential and/or legally privileged. The information is intended only for the use of the individual or entity named on this email. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this email information is strictly prohibited, and that the documents should be returned to this office immediately by email. Receipt by anyone other than the intended recipient is not a waiver of any privilege. Please do not include your social security number, account number, or any other personal or financial information in the content of the email. Should you have any questions, please call  (800) 453 7884.   

[jira] Updated: (PDFBOX-628) Too many detours in COSDictionary convenience methods

Posted by "Johannes Koch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johannes Koch updated PDFBOX-628:
---------------------------------

    Attachment: PDFBox-628_patch_00.txt

Not quite the same as suggested, but PDFBox-628_patch_00.txt solves the issue.

> Too many detours in COSDictionary convenience methods
> -----------------------------------------------------
>
>                 Key: PDFBOX-628
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-628
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: PDModel
>            Reporter: Johannes Koch
>            Priority: Minor
>         Attachments: PDFBox-628_patch_00.txt
>
>
> I think there are too many detours in some of the COSDictionary convenience methods. E.g.
> getInt( COSName key )
> -> getInt( COSName key, int defaultValue )
>    // create String from COSName
> -> getInt( String key, int defaultValue )
> -> getInt( String[] keyList, int defaultValue )
> -> getDictionaryObject( String[] keyList )
>    // create COSName from String
> -> getDictionaryObject( COSName key )
> Wouldn't it be easier to just do the following?
> getInt( COSName key )
> -> getDictionaryObject( COSName key )
> Same with getLong(COSName):
> getLong( COSName key )
> -> getLong( COSName key, long defaultValue )
> -> getLong( String key, long defaultValue )
> -> getLong( String[] keyList, long defaultValue )
> -> getDictionaryObject( String[] keyList )
> -> getDictionaryObject( COSName key )
> This could be reduced to:
> getLong( COSName key )
> -> getDictionaryObject( COSName key )
> getFloat(COSName) has only one detour:
> getFloat( COSName key )
> -> getFloat( COSName key, float defaultValue )
> -> getDictionaryObject( COSName key )
> This could be reduced to:
> getFloat( COSName key )
> -> getDictionaryObject( COSName key )

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (PDFBOX-628) Too many detours in COSDictionary convenience methods

Posted by "Johannes Koch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johannes Koch closed PDFBOX-628.
--------------------------------


Thanks

> Too many detours in COSDictionary convenience methods
> -----------------------------------------------------
>
>                 Key: PDFBOX-628
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-628
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: PDModel
>            Reporter: Johannes Koch
>            Priority: Minor
>             Fix For: 1.1.0
>
>         Attachments: PDFBox-628_patch_00.txt
>
>
> I think there are too many detours in some of the COSDictionary convenience methods. E.g.
> getInt( COSName key )
> -> getInt( COSName key, int defaultValue )
>    // create String from COSName
> -> getInt( String key, int defaultValue )
> -> getInt( String[] keyList, int defaultValue )
> -> getDictionaryObject( String[] keyList )
>    // create COSName from String
> -> getDictionaryObject( COSName key )
> Wouldn't it be easier to just do the following?
> getInt( COSName key )
> -> getDictionaryObject( COSName key )
> Same with getLong(COSName):
> getLong( COSName key )
> -> getLong( COSName key, long defaultValue )
> -> getLong( String key, long defaultValue )
> -> getLong( String[] keyList, long defaultValue )
> -> getDictionaryObject( String[] keyList )
> -> getDictionaryObject( COSName key )
> This could be reduced to:
> getLong( COSName key )
> -> getDictionaryObject( COSName key )
> getFloat(COSName) has only one detour:
> getFloat( COSName key )
> -> getFloat( COSName key, float defaultValue )
> -> getDictionaryObject( COSName key )
> This could be reduced to:
> getFloat( COSName key )
> -> getDictionaryObject( COSName key )

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PDFBOX-628) Too many detours in COSDictionary convenience methods

Posted by "Johannes Koch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johannes Koch updated PDFBOX-628:
---------------------------------

    Fix Version/s: 1.1.0

> Too many detours in COSDictionary convenience methods
> -----------------------------------------------------
>
>                 Key: PDFBOX-628
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-628
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: PDModel
>            Reporter: Johannes Koch
>            Priority: Minor
>             Fix For: 1.1.0
>
>         Attachments: PDFBox-628_patch_00.txt
>
>
> I think there are too many detours in some of the COSDictionary convenience methods. E.g.
> getInt( COSName key )
> -> getInt( COSName key, int defaultValue )
>    // create String from COSName
> -> getInt( String key, int defaultValue )
> -> getInt( String[] keyList, int defaultValue )
> -> getDictionaryObject( String[] keyList )
>    // create COSName from String
> -> getDictionaryObject( COSName key )
> Wouldn't it be easier to just do the following?
> getInt( COSName key )
> -> getDictionaryObject( COSName key )
> Same with getLong(COSName):
> getLong( COSName key )
> -> getLong( COSName key, long defaultValue )
> -> getLong( String key, long defaultValue )
> -> getLong( String[] keyList, long defaultValue )
> -> getDictionaryObject( String[] keyList )
> -> getDictionaryObject( COSName key )
> This could be reduced to:
> getLong( COSName key )
> -> getDictionaryObject( COSName key )
> getFloat(COSName) has only one detour:
> getFloat( COSName key )
> -> getFloat( COSName key, float defaultValue )
> -> getDictionaryObject( COSName key )
> This could be reduced to:
> getFloat( COSName key )
> -> getDictionaryObject( COSName key )

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (PDFBOX-628) Too many detours in COSDictionary convenience methods

Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PDFBOX-628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler resolved PDFBOX-628.
---------------------------------------

    Resolution: Fixed

I've added the pathc with version 920021. I've made some small additions to avoid some other detours.

Thanks to Johannes for the contribution.

> Too many detours in COSDictionary convenience methods
> -----------------------------------------------------
>
>                 Key: PDFBOX-628
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-628
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: PDModel
>            Reporter: Johannes Koch
>            Priority: Minor
>             Fix For: 1.1.0
>
>         Attachments: PDFBox-628_patch_00.txt
>
>
> I think there are too many detours in some of the COSDictionary convenience methods. E.g.
> getInt( COSName key )
> -> getInt( COSName key, int defaultValue )
>    // create String from COSName
> -> getInt( String key, int defaultValue )
> -> getInt( String[] keyList, int defaultValue )
> -> getDictionaryObject( String[] keyList )
>    // create COSName from String
> -> getDictionaryObject( COSName key )
> Wouldn't it be easier to just do the following?
> getInt( COSName key )
> -> getDictionaryObject( COSName key )
> Same with getLong(COSName):
> getLong( COSName key )
> -> getLong( COSName key, long defaultValue )
> -> getLong( String key, long defaultValue )
> -> getLong( String[] keyList, long defaultValue )
> -> getDictionaryObject( String[] keyList )
> -> getDictionaryObject( COSName key )
> This could be reduced to:
> getLong( COSName key )
> -> getDictionaryObject( COSName key )
> getFloat(COSName) has only one detour:
> getFloat( COSName key )
> -> getFloat( COSName key, float defaultValue )
> -> getDictionaryObject( COSName key )
> This could be reduced to:
> getFloat( COSName key )
> -> getDictionaryObject( COSName key )

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.