pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1651513 - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos: COSArray.java COSBoolean.java COSDictionary.java COSFloat.java
Date Tue, 13 Jan 2015 21:58:34 GMT
Author: tilman
Date: Tue Jan 13 21:58:34 2015
New Revision: 1651513

URL: http://svn.apache.org/r1651513
Log:
PDFBOX-2576: class which has only private constructors should be declared as final; make fields
final; make method final that is overidden in constructor

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSBoolean.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDictionary.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSFloat.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java?rev=1651513&r1=1651512&r2=1651513&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java Tue Jan 13 21:58:34
2015
@@ -32,7 +32,7 @@ import org.apache.pdfbox.pdmodel.common.
  */
 public class COSArray extends COSBase implements Iterable<COSBase>
 {
-    private List<COSBase> objects = new ArrayList<COSBase>();
+    private final List<COSBase> objects = new ArrayList<COSBase>();
 
     /**
      * Constructor.

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSBoolean.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSBoolean.java?rev=1651513&r1=1651512&r2=1651513&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSBoolean.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSBoolean.java Tue Jan 13 21:58:34
2015
@@ -25,7 +25,7 @@ import java.io.OutputStream;
  * @author <a href="ben@benlitchfield.com">Ben Litchfield</a>
  * @version $Revision: 1.14 $
  */
-public class COSBoolean extends COSBase
+public final class COSBoolean extends COSBase
 {
     /**
      * The true boolean token.
@@ -46,14 +46,14 @@ public class COSBoolean extends COSBase
      */
     public static final COSBoolean FALSE = new COSBoolean( false );
 
-    private boolean value;
+    private final boolean value;
 
     /**
      * Constructor.
      *
      * @param aValue The boolean value.
      */
-    private COSBoolean(boolean aValue )
+    private COSBoolean(boolean aValue)
     {
         value = aValue;
     }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDictionary.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDictionary.java?rev=1651513&r1=1651512&r2=1651513&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDictionary.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDictionary.java Tue Jan 13
21:58:34 2015
@@ -458,8 +458,7 @@ public class COSDictionary extends COSBa
      */
     public void setLong(COSName key, long value)
     {
-        COSInteger intVal = null;
-        intVal = COSInteger.get(value);
+        COSInteger intVal = COSInteger.get(value);
         setItem(key, intVal);
     }
 

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSFloat.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSFloat.java?rev=1651513&r1=1651512&r2=1651513&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSFloat.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSFloat.java Tue Jan 13 21:58:34
2015
@@ -66,7 +66,7 @@ public class COSFloat extends COSNumber
      *
      * @param floatValue The new float value.
      */
-    public void setValue( float floatValue )
+    public final void setValue( float floatValue )
     {
         // use a BigDecimal as intermediate state to avoid 
         // a floating point string representation of the float value



Mime
View raw message