You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by sp...@apache.org on 2011/09/29 10:58:13 UTC

svn commit: r1177228 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop: afp/fonts/CharactersetEncoder.java afp/ptoca/PtocaBuilder.java fonts/MultiByteFont.java render/java2d/InstalledFontCollection.java render/ps/PSImageHandlerGraphics2D.java

Author: spepping
Date: Thu Sep 29 08:58:12 2011
New Revision: 1177228

URL: http://svn.apache.org/viewvc?rev=1177228&view=rev
Log:
Various small fixes

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharactersetEncoder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/MultiByteFont.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharactersetEncoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharactersetEncoder.java?rev=1177228&r1=1177227&r2=1177228&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharactersetEncoder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharactersetEncoder.java Thu Sep 29 08:58:12 2011
@@ -98,7 +98,7 @@ public abstract class CharactersetEncode
      * sequence it will return its EBCDIC code-point, however, the "Shift In - Shift Out" operators
      * are removed from the sequence of bytes. These are only used in Line Data.
      */
-    private final static class EbcdicDoubleByteEncoder extends CharactersetEncoder {
+    private static final class EbcdicDoubleByteEncoder extends CharactersetEncoder {
         private EbcdicDoubleByteEncoder(String encoding) {
             super(encoding);
         }
@@ -116,7 +116,7 @@ public abstract class CharactersetEncode
      * the primary format for most Latin character sets. This can also be used for Unicode double-
      * byte character sets (DBCS).
      */
-    private final static class DefaultEncoder extends CharactersetEncoder {
+    private static final class DefaultEncoder extends CharactersetEncoder {
         private DefaultEncoder(String encoding) {
             super(encoding);
         }
@@ -145,20 +145,26 @@ public abstract class CharactersetEncode
     /**
      * A container for encoded character bytes
      */
-    public static class EncodedChars {
+    public static final class EncodedChars {
 
-        final private byte[] bytes;
+        private final byte[] bytes;
 
-        final private int offset;
+        private final int offset;
 
-        final private int length;
+        private final int length;
 
         private EncodedChars(byte[] bytes, int offset, int length) {
-            if (offset < 0) throw new IllegalArgumentException();
+            if (offset < 0) {
+                throw new IllegalArgumentException();
+            }
 
-            if (length < 0) throw new IllegalArgumentException();
+            if (length < 0) {
+                throw new IllegalArgumentException();
+            }
 
-            if (offset + length > bytes.length) throw new IllegalArgumentException();
+            if (offset + length > bytes.length) {
+                throw new IllegalArgumentException();
+            }
 
             this.bytes = bytes;
 
@@ -175,14 +181,22 @@ public abstract class CharactersetEncode
          * write <code>length</code> bytes from <code>offset</code> to the output stream
          *
          * @param out output to write the bytes to
+         * @param offset the offset where to write
+         * @param length the length to write
          * @throws IOException if an I/O error occurs
          */
         public void writeTo(OutputStream out, int offset, int length) throws IOException {
-            if (offset < 0) throw new IllegalArgumentException();
+            if (offset < 0) {
+                throw new IllegalArgumentException();
+            }
 
-            if (length < 0) throw new IllegalArgumentException();
+            if (length < 0) {
+                throw new IllegalArgumentException();
+            }
 
-            if (offset + length > this.length) throw new IllegalArgumentException();
+            if (offset + length > this.length) {
+                throw new IllegalArgumentException();
+            }
 
             out.write(bytes, this.offset + offset, length);
         }
@@ -190,7 +204,7 @@ public abstract class CharactersetEncode
         /**
          * The number of containing bytes.
          *
-         * @return
+         * @return the length
          */
         public int getLength() {
             return length;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java?rev=1177228&r1=1177227&r2=1177228&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java Thu Sep 29 08:58:12 2011
@@ -85,10 +85,6 @@ public abstract class PtocaBuilder imple
         baout.writeTo(out);
     }
 
-    private void write(byte[] data, int offset, int length) {
-        baout.write(data, offset, length);
-    }
-
     private void writeByte(int data) {
         baout.write(data);
     }
@@ -180,14 +176,12 @@ public abstract class PtocaBuilder imple
         currentX = -1;
     }
 
-    private static final int TRANSPARENT_MAX_SIZE = 253;
-
     /**
      * The Transparent Data control sequence contains a sequence of code points
      * that are presented without a scan for embedded control sequences. If the data is larger
      * than fits in one chunk, additional chunks are automatically generated.
      *
-     * @param data The text data to add.
+     * @param encodedChars The encoded text data to add.
      * @throws IOException if an I/O error occurs
      */
     public void addTransparentData(EncodedChars encodedChars) throws IOException {
@@ -206,7 +200,8 @@ public abstract class PtocaBuilder imple
 
 
 
-    private void addTransparentDataChunk(EncodedChars encodedChars, int offset, int length) throws IOException {
+    private void addTransparentDataChunk(EncodedChars encodedChars, int offset, int length)
+            throws IOException {
         newControlSequence();
         encodedChars.writeTo(baout, offset, length);
         commit(chained(TRN));

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/MultiByteFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/MultiByteFont.java?rev=1177228&r1=1177227&r2=1177228&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/MultiByteFont.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/MultiByteFont.java Thu Sep 29 08:58:12 2011
@@ -47,8 +47,8 @@ public class MultiByteFont extends CIDFo
         setFontType(FontType.TYPE0);
     }
 
-    /** {@inheritdoc} */
-    public int getdefaultwidth() {
+    /** {@inheritDoc} */
+    public int getDefaultWidth() {
         return defaultWidth;
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java?rev=1177228&r1=1177227&r2=1177228&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java Thu Sep 29 08:58:12 2011
@@ -38,10 +38,10 @@ public class InstalledFontCollection imp
 
     private static Log log = LogFactory.getLog(InstalledFontCollection.class);
 
-    private static final Set HARDCODED_FONT_NAMES;
+    private static final Set<String> HARDCODED_FONT_NAMES;
 
     static {
-        HARDCODED_FONT_NAMES = new java.util.HashSet();
+        HARDCODED_FONT_NAMES = new java.util.HashSet<String>();
         HARDCODED_FONT_NAMES.add("any");
         HARDCODED_FONT_NAMES.add("sans-serif");
         HARDCODED_FONT_NAMES.add("serif");
@@ -58,7 +58,7 @@ public class InstalledFontCollection imp
     }
 
     /** Required by new instances of FontMetricsMapper */
-    final private Java2DFontMetrics java2DFontMetrics;
+    private final Java2DFontMetrics java2DFontMetrics;
 
     /**
      * Main constructor

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java?rev=1177228&r1=1177227&r2=1177228&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java Thu Sep 29 08:58:12 2011
@@ -168,7 +168,7 @@ public class PSImageHandlerGraphics2D im
         return formGen;
     }
 
-    private static abstract class EPSFormGenerator extends FormGenerator {
+    private abstract static class EPSFormGenerator extends FormGenerator {
 
         EPSFormGenerator(String formName, String title, Dimension2D dimensions) {
             super(formName, title, dimensions);



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Re: svn commit: r1177228 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop: afp/fonts/CharactersetEncoder.java afp/ptoca/PtocaBuilder.java fonts/MultiByteFont.java render/java2d/InstalledFontCollection.java render/ps/PSImageHandlerGraphics2D.java

Posted by Simon Pepping <sp...@leverkruid.eu>.
Please, use our source code quality control tools. Simon

On Thu, Sep 29, 2011 at 08:58:13AM -0000, spepping@apache.org wrote:
> Author: spepping
> Date: Thu Sep 29 08:58:12 2011
> New Revision: 1177228
> 
> URL: http://svn.apache.org/viewvc?rev=1177228&view=rev
> Log:
> Various small fixes
> 
> Modified:
>     xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharactersetEncoder.java
>     xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java
>     xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/MultiByteFont.java
>     xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
>     xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java