Skip to content

Commit 2a9aa35

Browse files
committed
PDFBOX-5660: optimize, as suggested by Valery Bokov; improve javadoc; closes #264
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1928757 13f79535-47bb-0310-9956-ffa450edef68
1 parent 5d81180 commit 2a9aa35

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDActionEmbeddedGoTo.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,14 @@ public void setFile(PDFileSpecification fs)
124124
* This will specify whether to open the destination document in a new window, in the same
125125
* window, or behave in accordance with the current user preference.
126126
*
127-
* @return A flag specifying how to open the destination document.
127+
* @return A flag specifying how to open the destination document, never null.
128128
*/
129129
public OpenMode getOpenInNewWindow()
130130
{
131-
if (getCOSObject().getDictionaryObject(COSName.NEW_WINDOW) instanceof COSBoolean)
131+
COSBase dictionaryObject = getCOSObject().getDictionaryObject(COSName.NEW_WINDOW);
132+
if (dictionaryObject instanceof COSBoolean)
132133
{
133-
COSBoolean b = (COSBoolean) getCOSObject().getDictionaryObject(COSName.NEW_WINDOW);
134+
COSBoolean b = (COSBoolean) dictionaryObject;
134135
return b.getValue() ? OpenMode.NEW_WINDOW : OpenMode.SAME_WINDOW;
135136
}
136137
return OpenMode.USER_PREFERENCE;

0 commit comments

Comments
 (0)