pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1609780 - in /pdfbox/trunk/pdfbox/src: main/java/org/apache/pdfbox/pdfparser/ main/java/org/apache/pdfbox/pdmodel/ main/java/org/apache/pdfbox/pdmodel/common/ main/java/org/apache/pdfbox/pdmodel/common/function/type4/ main/java/org/apache/...
Date Fri, 11 Jul 2014 19:55:21 GMT
Author: tilman
Date: Fri Jul 11 19:55:21 2014
New Revision: 1609780

URL: http://svn.apache.org/r1609780
Log:
PDFBOX-2147: Removed unneccesary boxing

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFObjectStreamParser.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSDictionaryMap.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNumberTreeNode.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/type4/ArithmeticOperators.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/type4/InstructionSequence.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDExtendedGraphicsState.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestPDNumberTreeNode.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFObjectStreamParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFObjectStreamParser.java?rev=1609780&r1=1609779&r2=1609780&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFObjectStreamParser.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFObjectStreamParser.java
Fri Jul 11 19:55:21 2014
@@ -98,7 +98,7 @@ public class PDFObjectStreamParser exten
             {
                 long objectNumber = readObjectNumber();
                 long offset = readLong();
-                objectNumbers.add( new Long( objectNumber ) );
+                objectNumbers.add( objectNumber);
             }
             COSObject object = null;
             COSBase cosObject = null;

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java?rev=1609780&r1=1609779&r2=1609780&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java
Fri Jul 11 19:55:21 2014
@@ -96,7 +96,7 @@ public class PDFXrefStreamParser extends
                 int size = ((COSInteger)indexIter.next()).intValue();
                 for(int i = 0; i < size; i++)
                 {
-                    objNums.add(new Integer(objID + i));
+                    objNums.add(objID + i);
                 }
             }
             Iterator<Integer> objIter = objNums.iterator();

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java?rev=1609780&r1=1609779&r2=1609780&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java Fri Jul 11 19:55:21
2014
@@ -556,7 +556,7 @@ public class PDPage implements COSObject
         COSNumber value = (COSNumber) page.getDictionaryObject(COSName.ROTATE);
         if (value != null)
         {
-            retval = new Integer(value.intValue());
+            retval = value.intValue();
         }
         return retval;
     }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java?rev=1609780&r1=1609779&r2=1609780&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java Fri
Jul 11 19:55:21 2014
@@ -308,7 +308,7 @@ public class COSArrayList<E> implements 
             List<Float> numbers = new ArrayList<Float>();
             for( int i=0; i<floatArray.size(); i++ )
             {
-                numbers.add( new Float( ((COSNumber)floatArray.get( i )).floatValue() ) );
+                numbers.add( ((COSNumber)floatArray.get( i )).floatValue());
             }
             retval = new COSArrayList<Float>( numbers, floatArray );
         }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSDictionaryMap.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSDictionaryMap.java?rev=1609780&r1=1609779&r2=1609780&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSDictionaryMap.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSDictionaryMap.java
Fri Jul 11 19:55:21 2014
@@ -232,7 +232,7 @@ public class COSDictionaryMap<K,V> imple
                 }
                 else if( cosObj instanceof COSInteger )
                 {
-                    actualObject = new Integer( ((COSInteger)cosObj).intValue() );
+                    actualObject = ((COSInteger)cosObj).intValue();
                 }
                 else if( cosObj instanceof COSName )
                 {
@@ -240,7 +240,7 @@ public class COSDictionaryMap<K,V> imple
                 }
                 else if( cosObj instanceof COSFloat )
                 {
-                    actualObject = new Float( ((COSFloat)cosObj).floatValue() );
+                    actualObject = ((COSFloat)cosObj).floatValue();
                 }
                 else if( cosObj instanceof COSBoolean )
                 {

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNumberTreeNode.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNumberTreeNode.java?rev=1609780&r1=1609779&r2=1609780&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNumberTreeNode.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNumberTreeNode.java
Fri Jul 11 19:55:21 2014
@@ -197,7 +197,7 @@ public class PDNumberTreeNode implements
                 COSInteger key = (COSInteger)namesArray.getObject(i);
                 COSBase cosValue = namesArray.getObject( i+1 );
                 COSObjectable pdValue = convertCOSToPD( cosValue );
-                indices.put( Integer.valueOf(key.intValue()), pdValue );
+                indices.put( key.intValue(), pdValue );
             }
             indices = Collections.unmodifiableMap(indices);
         }
@@ -289,7 +289,7 @@ public class PDNumberTreeNode implements
         COSArray arr = (COSArray)node.getDictionaryObject( COSName.LIMITS );
         if( arr != null && arr.get(0) != null )
         {
-            retval = Integer.valueOf(arr.getInt( 1 ));
+            retval = arr.getInt( 1 );
         }
         return retval;
     }
@@ -330,7 +330,7 @@ public class PDNumberTreeNode implements
         COSArray arr = (COSArray)node.getDictionaryObject( COSName.LIMITS );
         if( arr != null && arr.get(0) != null )
         {
-            retval = Integer.valueOf(arr.getInt( 0 ));
+            retval = arr.getInt( 0 );
         }
         return retval;
     }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/type4/ArithmeticOperators.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/type4/ArithmeticOperators.java?rev=1609780&r1=1609779&r2=1609780&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/type4/ArithmeticOperators.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/type4/ArithmeticOperators.java
Fri Jul 11 19:55:21 2014
@@ -58,17 +58,17 @@ class ArithmeticOperators
                 long sum = num1.longValue() + num2.longValue();
                 if (sum < Integer.MIN_VALUE || sum > Integer.MAX_VALUE)
                 {
-                    context.getStack().push(Float.valueOf(sum));
+                    context.getStack().push((float) sum);
                 }
                 else
                 {
-                    context.getStack().push(Integer.valueOf((int)sum));
+                    context.getStack().push((int)sum);
                 }
             }
             else
             {
                 float sum = num1.floatValue() + num2.floatValue();
-                context.getStack().push(Float.valueOf(sum));
+                context.getStack().push(sum);
             }
         }
 
@@ -363,17 +363,17 @@ class ArithmeticOperators
                 long result = num1.longValue() - num2.longValue();
                 if (result < Integer.MIN_VALUE || result > Integer.MAX_VALUE)
                 {
-                    stack.push(Float.valueOf(result));
+                    stack.push((float) result);
                 }
                 else
                 {
-                    stack.push(Integer.valueOf((int)result));
+                    stack.push((int)result);
                 }
             }
             else
             {
                 float result = num1.floatValue() - num2.floatValue();
-                stack.push(Float.valueOf(result));
+                stack.push(result);
             }
         }
 

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/type4/InstructionSequence.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/type4/InstructionSequence.java?rev=1609780&r1=1609779&r2=1609780&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/type4/InstructionSequence.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/type4/InstructionSequence.java
Fri Jul 11 19:55:21 2014
@@ -44,7 +44,7 @@ public class InstructionSequence
      */
     public void addInteger(int value)
     {
-        this.instructions.add(Integer.valueOf(value));
+        this.instructions.add(value);
     }
 
     /**
@@ -53,7 +53,7 @@ public class InstructionSequence
      */
     public void addReal(float value)
     {
-        this.instructions.add(Float.valueOf(value));
+        this.instructions.add(value);
     }
 
     /**
@@ -62,7 +62,7 @@ public class InstructionSequence
      */
     public void addBoolean(boolean value)
     {
-        this.instructions.add(Boolean.valueOf(value));
+        this.instructions.add(value);
     }
 
     /**

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java?rev=1609780&r1=1609779&r2=1609780&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java Fri
Jul 11 19:55:21 2014
@@ -223,7 +223,7 @@ public abstract class FDFAnnotation impl
         COSNumber page = (COSNumber)annot.getDictionaryObject( "Page" );
         if( page != null )
         {
-            retval = new Integer( page.intValue() );
+            retval = page.intValue();
         }
         return retval;
     }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java?rev=1609780&r1=1609779&r2=1609780&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java Fri Jul
11 19:55:21 2014
@@ -302,7 +302,7 @@ public class FDFField implements COSObje
         COSNumber ff = (COSNumber)field.getDictionaryObject( COSName.FF );
         if( ff != null )
         {
-            retval = new Integer( ff.intValue() );
+            retval = ff.intValue();
         }
         return retval;
     }
@@ -346,7 +346,7 @@ public class FDFField implements COSObje
         COSNumber ff = (COSNumber)field.getDictionaryObject( COSName.SET_FF );
         if( ff != null )
         {
-            retval = new Integer( ff.intValue() );
+            retval = ff.intValue();
         }
         return retval;
     }
@@ -390,7 +390,7 @@ public class FDFField implements COSObje
         COSNumber ff = (COSNumber)field.getDictionaryObject( COSName.CLR_FF );
         if( ff != null )
         {
-            retval = new Integer( ff.intValue() );
+            retval = ff.intValue();
         }
         return retval;
     }
@@ -434,7 +434,7 @@ public class FDFField implements COSObje
         COSNumber f = (COSNumber)field.getDictionaryObject( "F" );
         if( f != null )
         {
-            retval = new Integer( f.intValue() );
+            retval = f.intValue();
         }
         return retval;
     }
@@ -478,7 +478,7 @@ public class FDFField implements COSObje
         COSNumber ff = (COSNumber)field.getDictionaryObject( COSName.SET_F );
         if( ff != null )
         {
-            retval = new Integer( ff.intValue() );
+            retval = ff.intValue();
         }
         return retval;
     }
@@ -522,7 +522,7 @@ public class FDFField implements COSObje
         COSNumber ff = (COSNumber)field.getDictionaryObject( COSName.CLR_F );
         if( ff != null )
         {
-            retval = new Integer( ff.intValue() );
+            retval = ff.intValue();
         }
         return retval;
     }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDExtendedGraphicsState.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDExtendedGraphicsState.java?rev=1609780&r1=1609779&r2=1609780&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDExtendedGraphicsState.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDExtendedGraphicsState.java
Fri Jul 11 19:55:21 2014
@@ -580,7 +580,7 @@ public class PDExtendedGraphicsState imp
         COSNumber value = (COSNumber)graphicsState.getDictionaryObject( key );
         if( value != null )
         {
-            retval = new Float( value.floatValue() );
+            retval = value.floatValue();
         }
         return retval;
     }

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestPDNumberTreeNode.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestPDNumberTreeNode.java?rev=1609780&r1=1609779&r2=1609780&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestPDNumberTreeNode.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestPDNumberTreeNode.java
Fri Jul 11 19:55:21 2014
@@ -143,13 +143,13 @@ public class TestPDNumberTreeNode extend
 
     public void testUpperLimit() throws IOException
     {
-        Assert.assertEquals(Integer.valueOf( 7 ), this.node5.getUpperLimit());
-        Assert.assertEquals(Integer.valueOf( 7 ), this.node2.getUpperLimit());
+        Assert.assertEquals(7, this.node5.getUpperLimit());
+        Assert.assertEquals(7, this.node2.getUpperLimit());
 
-        Assert.assertEquals(Integer.valueOf( 12 ), this.node24.getUpperLimit());
-        Assert.assertEquals(Integer.valueOf( 12 ), this.node4.getUpperLimit());
+        Assert.assertEquals(12, this.node24.getUpperLimit());
+        Assert.assertEquals(12, this.node4.getUpperLimit());
 
-        Assert.assertEquals(Integer.valueOf( 12 ), this.node1.getUpperLimit());
+        Assert.assertEquals(12, this.node1.getUpperLimit());
 
         this.node24.setNumbers( new HashMap<Integer, COSObjectable>() );
         Assert.assertNull( this.node24.getUpperLimit() );
@@ -163,13 +163,13 @@ public class TestPDNumberTreeNode extend
 
     public void testLowerLimit() throws IOException
     {
-        Assert.assertEquals(Integer.valueOf( 1 ), this.node5.getLowerLimit());
-        Assert.assertEquals(Integer.valueOf( 1 ), this.node2.getLowerLimit());
+        Assert.assertEquals(1, this.node5.getLowerLimit());
+        Assert.assertEquals(1, this.node2.getLowerLimit());
 
-        Assert.assertEquals(Integer.valueOf( 8 ), this.node24.getLowerLimit());
-        Assert.assertEquals(Integer.valueOf( 8 ), this.node4.getLowerLimit());
+        Assert.assertEquals(8, this.node24.getLowerLimit());
+        Assert.assertEquals(8, this.node4.getLowerLimit());
 
-        Assert.assertEquals(Integer.valueOf( 1 ), this.node1.getLowerLimit());
+        Assert.assertEquals(1, this.node1.getLowerLimit());
         
         this.node24.setNumbers( new HashMap<Integer, COSObjectable>() );
         Assert.assertNull( this.node24.getLowerLimit() );



Mime
View raw message