pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1666277 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDAction.java
Date Thu, 12 Mar 2015 19:18:53 GMT
Author: tilman
Date: Thu Mar 12 19:18:52 2015
New Revision: 1666277

URL: http://svn.apache.org/r1666277
Log:
PDFBOX-2576: properly parametrize lists, as suggested by Martin Schröder

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDAction.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDAction.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDAction.java?rev=1666277&r1=1666276&r2=1666277&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDAction.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/action/PDAction.java
Thu Mar 12 19:18:52 2015
@@ -23,7 +23,6 @@ import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
-
 import org.apache.pdfbox.pdmodel.common.COSArrayList;
 import org.apache.pdfbox.pdmodel.common.PDDestinationOrAction;
 
@@ -136,24 +135,24 @@ public abstract class PDAction implement
      *
      * @return The Next action or sequence of actions.
      */
-    public List getNext()
+    public List<PDAction> getNext()
     {
-        List retval = null;
+        List<PDAction> retval = null;
         COSBase next = action.getDictionaryObject(COSName.NEXT);
         if( next instanceof COSDictionary )
         {
             PDAction pdAction = PDActionFactory.createAction( (COSDictionary) next );
-            retval = new COSArrayList(pdAction, next, action, COSName.NEXT);
+            retval = new COSArrayList<PDAction>(pdAction, next, action, COSName.NEXT);
         }
         else if( next instanceof COSArray )
         {
             COSArray array = (COSArray)next;
-            List actions = new ArrayList();
+            List<PDAction> actions = new ArrayList<PDAction>();
             for( int i=0; i<array.size(); i++ )
             {
                 actions.add( PDActionFactory.createAction( (COSDictionary) array.getObject(
i )));
             }
-            retval = new COSArrayList( actions, array );
+            retval = new COSArrayList<PDAction>( actions, array );
         }
 
         return retval;
@@ -166,7 +165,7 @@ public abstract class PDAction implement
      *
      * @param next The Next action or sequence of actions.
      */
-    public void setNext( List next )
+    public void setNext( List<?> next )
     {
         action.setItem(COSName.NEXT, COSArrayList.converterToCOSArray(next));
     }



Mime
View raw message