You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by ga...@apache.org on 2012/06/03 16:50:37 UTC
svn commit: r1345683 [2/2] - in /xmlgraphics/commons/trunk: ./
src/java/org/apache/xmlgraphics/fonts/ src/java/org/apache/xmlgraphics/image/
src/java/org/apache/xmlgraphics/image/codec/png/
src/java/org/apache/xmlgraphics/image/codec/tiff/ src/java/org...
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/CachableRed.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/CachableRed.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/CachableRed.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/CachableRed.java Sun Jun 3 14:50:33 2012
@@ -27,8 +27,9 @@ import java.awt.image.RenderedImage;
* This provides a number of extra methods that enable a system to
* better analyse the dependencies between nodes in a render graph.
*
- * @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
* @version $Id$
+ *
+ * Originally authored by Thomas DeWeese.
*/
public interface CachableRed extends RenderedImage {
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/FormatRed.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/FormatRed.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/FormatRed.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/FormatRed.java Sun Jun 3 14:50:33 2012
@@ -35,21 +35,26 @@ import java.awt.image.WritableRaster;
import org.apache.xmlgraphics.image.GraphicsUtil;
+// CSOFF: NeedBraces
+// CSOFF: WhitespaceAfter
+// CSOFF: WhitespaceAround
+
/**
* This allows you to specify the ColorModel, Alpha premult and/or
* SampleModel to be used for output. If the input image lacks
* Alpha and alpha is included in output then it is filled with
* alpha=1. In all other cases bands are simply copied.
*
- * @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
* @version $Id$
+ *
+ * Originally authored by Thomas DeWeese.
*/
public class FormatRed extends AbstractRed {
public static CachableRed construct(CachableRed src, ColorModel cm) {
ColorModel srcCM = src.getColorModel();
- if ((cm.hasAlpha() != srcCM.hasAlpha()) ||
- (cm.isAlphaPremultiplied() != srcCM.isAlphaPremultiplied()))
+ if ((cm.hasAlpha() != srcCM.hasAlpha())
+ || (cm.isAlphaPremultiplied() != srcCM.isAlphaPremultiplied()))
return new FormatRed(src, cm);
if (cm.getNumComponents() != srcCM.getNumComponents())
@@ -57,12 +62,12 @@ public class FormatRed extends AbstractR
("Incompatible ColorModel given");
- if ((srcCM instanceof ComponentColorModel) &&
- (cm instanceof ComponentColorModel))
+ if ((srcCM instanceof ComponentColorModel)
+ && (cm instanceof ComponentColorModel))
return src;
- if ((srcCM instanceof DirectColorModel) &&
- (cm instanceof DirectColorModel))
+ if ((srcCM instanceof DirectColorModel)
+ && (cm instanceof DirectColorModel))
return src;
return new FormatRed(src, cm);
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/RenderedImageCachableRed.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/RenderedImageCachableRed.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/RenderedImageCachableRed.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/RenderedImageCachableRed.java Sun Jun 3 14:50:33 2012
@@ -29,14 +29,18 @@ import java.awt.image.SampleModel;
import java.awt.image.WritableRaster;
import java.util.Vector;
+// CSOFF: NeedBraces
+// CSOFF: WhitespaceAround
+
/**
* This implements CachableRed around a RenderedImage.
* You can use this to wrap a RenderedImage that you want to
* appear as a CachableRed.
* It essentially ignores the dependency and dirty region methods.
*
- * @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
* @version $Id$
+ *
+ * Originally authored by Thomas DeWeese.
*/
public class RenderedImageCachableRed implements CachableRed {
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/ImageWriter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/ImageWriter.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/ImageWriter.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/ImageWriter.java Sun Jun 3 14:50:33 2012
@@ -36,7 +36,7 @@ public interface ImageWriter {
* @param out the OutputStream to write to
* @throws IOException In case of an /IO problem
*/
- public void writeImage(RenderedImage image, OutputStream out)
+ void writeImage(RenderedImage image, OutputStream out)
throws IOException;
/**
@@ -46,18 +46,18 @@ public interface ImageWriter {
* @param params a parameters object to customize the encoding.
* @throws IOException In case of an /IO problem
*/
- public void writeImage(RenderedImage image, OutputStream out,
+ void writeImage(RenderedImage image, OutputStream out,
ImageWriterParams params)
throws IOException;
/** @return the target MIME type supported by this ImageWriter */
- public String getMIMEType();
+ String getMIMEType();
/** @return true if the ImageWriter is expected to work properly in the current environment */
- public boolean isFunctional();
+ boolean isFunctional();
/** @return true if the implemented format supports multiple pages in a single file */
- public boolean supportsMultiImageWriter();
+ boolean supportsMultiImageWriter();
/**
* Creates a MultiImageWriter instance that lets you put multiple pages into a single file
@@ -66,6 +66,6 @@ public interface ImageWriter {
* @return the requested MultiImageWriter instance
* @throws IOException In case of an /IO problem
*/
- public MultiImageWriter createMultiImageWriter(OutputStream out) throws IOException;
+ MultiImageWriter createMultiImageWriter(OutputStream out) throws IOException;
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/ImageWriterUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/ImageWriterUtil.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/ImageWriterUtil.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/ImageWriterUtil.java Sun Jun 3 14:50:33 2012
@@ -29,7 +29,10 @@ import org.apache.commons.io.IOUtils;
/**
* Convenience methods around ImageWriter for the most important tasks.
*/
-public class ImageWriterUtil {
+public final class ImageWriterUtil {
+
+ private ImageWriterUtil() {
+ }
/**
* Saves a RenderedImage as a PNG file with 96 dpi.
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/MultiImageWriter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/MultiImageWriter.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/MultiImageWriter.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/MultiImageWriter.java Sun Jun 3 14:50:33 2012
@@ -36,9 +36,9 @@ public interface MultiImageWriter {
* @param params a parameters object to customize the encoding.
* @throws IOException In case of an /IO problem
*/
- public void writeImage(RenderedImage image, ImageWriterParams params)
+ void writeImage(RenderedImage image, ImageWriterParams params)
throws IOException;
- public void close() throws IOException;
+ void close() throws IOException;
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriter.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriter.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/imageio/ImageIOTIFFImageWriter.java Sun Jun 3 14:50:33 2012
@@ -25,6 +25,8 @@ import javax.imageio.metadata.IIOMetadat
import org.apache.xmlgraphics.image.writer.ImageWriterParams;
+// CSOFF: MultipleVariableDeclarations
+
/**
* ImageWriter that encodes TIFF images using Image I/O.
*
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/internal/PNGImageWriter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/internal/PNGImageWriter.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/internal/PNGImageWriter.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/writer/internal/PNGImageWriter.java Sun Jun 3 14:50:33 2012
@@ -25,7 +25,6 @@ import java.io.OutputStream;
import org.apache.xmlgraphics.image.codec.png.PNGImageEncoder;
import org.apache.xmlgraphics.image.writer.AbstractImageWriter;
-import org.apache.xmlgraphics.image.writer.ImageWriter;
import org.apache.xmlgraphics.image.writer.ImageWriterParams;
/**
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/AbstractGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/AbstractGraphics2D.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/AbstractGraphics2D.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/AbstractGraphics2D.java Sun Jun 3 14:50:33 2012
@@ -47,6 +47,10 @@ import java.awt.image.ImageObserver;
import java.text.AttributedCharacterIterator;
import java.util.Map;
+// CSOFF: NeedBraces
+// CSOFF: ParameterName
+// CSOFF: WhitespaceAround
+
/**
* This extension of the <tt>java.awt.Graphics2D</tt> abstract class
* is still abstract, but it implements a lot of the <tt>Graphics2D</tt>
@@ -62,9 +66,10 @@ import java.util.Map;
* <tt>drawRect</tt> can be expressed as <tt>draw(new Rectangle(..))</tt>),
* are implemented by <tt>AbstractGraphics2D</tt>
*
- * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
* @version $Id$
* @see org.apache.xmlgraphics.java2d.GraphicContext
+ *
+ * Originally authored by Vincent Hardy.
*/
public abstract class AbstractGraphics2D extends Graphics2D implements Cloneable {
/**
@@ -912,8 +917,7 @@ public abstract class AbstractGraphics2D
gc.transform(xform);
retVal = drawImage(img, 0, 0, null);
gc.transform(inverseTransform);
- }
- else{
+ } else {
AffineTransform savTransform = new AffineTransform(gc.getTransform());
gc.transform(xform);
retVal = drawImage(img, 0, 0, null);
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/DefaultGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/DefaultGraphics2D.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/DefaultGraphics2D.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/DefaultGraphics2D.java Sun Jun 3 14:50:33 2012
@@ -34,6 +34,8 @@ import java.awt.image.RenderedImage;
import java.awt.image.renderable.RenderableImage;
import java.text.AttributedCharacterIterator;
+// CSOFF: WhitespaceAround
+
/**
* This concrete implementation of <tt>AbstractGraphics2D</tt> is a
* simple help to programmers to get started with their own
@@ -42,9 +44,10 @@ import java.text.AttributedCharacterIter
* is <tt>AbstractGraphics2D</tt> and makes it easy to start
* implementing a <tt>Graphic2D</tt> piece-meal.
*
- * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
* @version $Id$
* @see org.apache.xmlgraphics.java2d.AbstractGraphics2D
+ *
+ * Originally authored by Vincent Hardy.
*/
public class DefaultGraphics2D extends AbstractGraphics2D {
/**
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/Dimension2DDouble.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/Dimension2DDouble.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/Dimension2DDouble.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/Dimension2DDouble.java Sun Jun 3 14:50:33 2012
@@ -95,4 +95,4 @@ public class Dimension2DDouble extends D
public String toString() {
return getClass().getName() + "[width=" + width + ",height=" + height + "]";
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/GraphicContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/GraphicContext.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/GraphicContext.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/GraphicContext.java Sun Jun 3 14:50:33 2012
@@ -38,6 +38,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+// CSOFF: OperatorWrap
+// CSOFF: ParameterName
+// CSOFF: WhitespaceAround
+
/**
* Handles the attributes in a graphic context:<br>
* + Composite <br>
@@ -48,9 +52,9 @@ import java.util.Map;
* + RenderingHints <br>
* + AffineTransform <br>
*
- * @author <a href="mailto:cjolif@ilog.fr">Christophe Jolif</a>
- * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
* @version $Id$
+ *
+ * Originally authored by Vincent Hardy and Christophe Jolif.
*/
public class GraphicContext implements Cloneable{
/**
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/Graphics2DImagePainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/Graphics2DImagePainter.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/Graphics2DImagePainter.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/Graphics2DImagePainter.java Sun Jun 3 14:50:33 2012
@@ -42,4 +42,4 @@ public interface Graphics2DImagePainter
*/
Dimension getImageSize();
-}
\ No newline at end of file
+}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformStackElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformStackElement.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformStackElement.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformStackElement.java Sun Jun 3 14:50:33 2012
@@ -21,14 +21,19 @@ package org.apache.xmlgraphics.java2d;
import java.awt.geom.AffineTransform;
+// CSOFF: EmptyBlock
+// CSOFF: NoWhitespaceAfter
+// CSOFF: OperatorWrap
+// CSOFF: WhitespaceAround
+
/**
* Contains a description of an elementary transform stack element,
* such as a rotate or translate. A transform stack element has a
* type and a value, which is an array of double values.<br>
*
- * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
- * @author <a href="mailto:paul_evenblij@compuware.com">Paul Evenblij</a>
* @version $Id$
+ *
+ * Originally authored by Vincent Hardy and Paul Evenblij.
*/
public abstract class TransformStackElement implements Cloneable{
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformType.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformType.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformType.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformType.java Sun Jun 3 14:50:33 2012
@@ -19,13 +19,15 @@
package org.apache.xmlgraphics.java2d;
+// CSOFF: WhitespaceAround
+
/**
* Enumeration for transformation types.
*
- * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
* @version $Id$
+ * Originally authored by Vincent Hardy.
*/
-public class TransformType{
+public final class TransformType{
/*
* Transform type constants
*/
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/ColorSpaceOrigin.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/ColorSpaceOrigin.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/ColorSpaceOrigin.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/ColorSpaceOrigin.java Sun Jun 3 14:50:33 2012
@@ -19,8 +19,6 @@
package org.apache.xmlgraphics.java2d.color;
-import java.awt.color.ColorSpace;
-
/**
* Interface used to decorate {@link ColorSpace} subclasses to report the origin of the
* associated color profile.
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/DefaultColorConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/DefaultColorConverter.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/DefaultColorConverter.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/DefaultColorConverter.java Sun Jun 3 14:50:33 2012
@@ -21,8 +21,6 @@ package org.apache.xmlgraphics.java2d.co
import java.awt.Color;
-import org.apache.xmlgraphics.java2d.color.ColorConverter;
-
/**
* A default implementation that does not apply any conversion
*/
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/DeviceCMYKColorSpace.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/DeviceCMYKColorSpace.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/DeviceCMYKColorSpace.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/DeviceCMYKColorSpace.java Sun Jun 3 14:50:33 2012
@@ -20,7 +20,6 @@
package org.apache.xmlgraphics.java2d.color;
import java.awt.Color;
-import java.awt.color.ColorSpace;
/**
* This class represents an uncalibrated CMYK color space.
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/GrayScaleColorConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/GrayScaleColorConverter.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/GrayScaleColorConverter.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/GrayScaleColorConverter.java Sun Jun 3 14:50:33 2012
@@ -33,7 +33,8 @@ public final class GrayScaleColorConvert
private static final GrayScaleColorConverter SINGLETON = new GrayScaleColorConverter();
- private GrayScaleColorConverter() { }
+ private GrayScaleColorConverter() {
+ }
/**
* Returns a singleton instance.
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/profile/ColorProfileUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/profile/ColorProfileUtil.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/profile/ColorProfileUtil.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/profile/ColorProfileUtil.java Sun Jun 3 14:50:33 2012
@@ -26,6 +26,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
+// CSOFF: MethodName
+
/**
* Helper methods for handling color profiles.
*/
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/profile/NamedColorProfile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/profile/NamedColorProfile.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/profile/NamedColorProfile.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/profile/NamedColorProfile.java Sun Jun 3 14:50:33 2012
@@ -19,8 +19,6 @@
package org.apache.xmlgraphics.java2d.color.profile;
-import java.awt.color.ICC_Profile;
-
import org.apache.xmlgraphics.java2d.color.NamedColorSpace;
import org.apache.xmlgraphics.java2d.color.RenderingIntent;
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/AbstractPSDocumentGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/AbstractPSDocumentGraphics2D.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/AbstractPSDocumentGraphics2D.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/AbstractPSDocumentGraphics2D.java Sun Jun 3 14:50:33 2012
@@ -34,9 +34,10 @@ import org.apache.xmlgraphics.ps.PSProcS
* is used to create a full document around the PostScript rendering from
* <tt>PSGraphics2D</tt>.
*
- * @author <a href="mailto:keiron@aftexsw.com">Keiron Liddle</a>
* @version $Id$
* @see org.apache.xmlgraphics.java2d.ps.PSGraphics2D
+ *
+ * Originally authored by Keiron Liddle.
*/
public abstract class AbstractPSDocumentGraphics2D extends PSGraphics2D {
@@ -244,7 +245,7 @@ public abstract class AbstractPSDocument
AffineTransform at;
if ((this.viewportWidth != this.width
|| this.viewportHeight != this.height)
- && (this.viewportWidth > 0) && (this.viewportHeight > 0)){
+ && (this.viewportWidth > 0) && (this.viewportHeight > 0)) {
at = new AffineTransform(this.width / this.viewportWidth, 0,
0, -1 * (this.height / this.viewportHeight),
0, this.height);
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSDocumentGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSDocumentGraphics2D.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSDocumentGraphics2D.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSDocumentGraphics2D.java Sun Jun 3 14:50:33 2012
@@ -29,9 +29,10 @@ import org.apache.xmlgraphics.ps.DSCCons
* is used to create a full document around the PostScript rendering from
* <tt>PSGraphics2D</tt>.
*
- * @author <a href="mailto:keiron@aftexsw.com">Keiron Liddle</a>
* @version $Id$
* @see org.apache.xmlgraphics.java2d.ps.PSGraphics2D
+ *
+ * Originally authored by Keiron Liddle.
*/
public class PSDocumentGraphics2D extends AbstractPSDocumentGraphics2D {
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java Sun Jun 3 14:50:33 2012
@@ -56,9 +56,10 @@ import org.apache.xmlgraphics.ps.PSImage
* therefore of <tt>Graphics2D</tt>) which is able to generate PostScript
* code.
*
- * @author <a href="mailto:keiron@aftexsw.com">Keiron Liddle</a>
* @version $Id$
* @see org.apache.xmlgraphics.java2d.AbstractGraphics2D
+ *
+ * Originally authored by Keiron Liddle.
*/
public class PSGraphics2D extends AbstractGraphics2D {
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSGraphicsConfiguration.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSGraphicsConfiguration.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSGraphicsConfiguration.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSGraphicsConfiguration.java Sun Jun 3 14:50:33 2012
@@ -116,4 +116,4 @@ class PSGraphicsConfiguration extends Gr
return new PSGraphicsDevice(this);
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSTilingPattern.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSTilingPattern.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSTilingPattern.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSTilingPattern.java Sun Jun 3 14:50:33 2012
@@ -28,7 +28,7 @@ import java.util.List;
* This class is implementation of PostScript tiling pattern. It allows to make a pattern
* with defined PaintProc or texture.
*
- * @author Jiri Kunhart
+ * Originally authored by Jiri Kunhart.
*/
public class PSTilingPattern {
@@ -313,7 +313,7 @@ public class PSTilingPattern {
* @param tilingType the tiling type
*/
public void setTilingType(int tilingType) {
- if (! ((tilingType <= 3) && (tilingType >= 1))) {
+ if (!((tilingType <= 3) && (tilingType >= 1))) {
throw new IllegalArgumentException("Parameter tilingType must not be "
+ tilingType + " (only 1, 2 or 3)");
}
@@ -429,6 +429,21 @@ public class PSTilingPattern {
return sb.toString();
}
+ /** {@inheritDoc} */
+ public int hashCode() {
+ return
+ 0
+ ^ patternType
+ ^ ( ( xUID != null ) ? xUID.hashCode() : 0 )
+ ^ ( ( paintProc != null ) ? paintProc.hashCode() : 0 )
+ ^ ( ( bBox != null ) ? bBox.hashCode() : 0 )
+ ^ new Double(xStep).hashCode()
+ ^ new Double(yStep).hashCode()
+ ^ paintType
+ ^ tilingType
+ ^ ( ( texture != null ) ? texture.hashCode() : 0 );
+ }
+
/**
* Compares two patterns data (except their names).
* {@inheritDoc}
@@ -451,8 +466,8 @@ public class PSTilingPattern {
TexturePaint patternTexture = patternObj.getTexturePaint();
- if ( ((patternTexture == null) && (texture != null)) ||
- ((patternTexture != null) && (texture == null))) {
+ if ( ((patternTexture == null) && (texture != null))
+ || ((patternTexture != null) && (texture == null))) {
return false;
}
@@ -482,10 +497,9 @@ public class PSTilingPattern {
return false;
}
}
- }
- else {
+ } else {
// compare PaintProc
- if (! paintProc.toString().equals(patternObj.getPaintProc().toString())) {
+ if (!paintProc.toString().equals(patternObj.getPaintProc().toString())) {
return false;
}
}
@@ -503,11 +517,11 @@ public class PSTilingPattern {
if (tilingType != patternObj.getTilingType()) {
return false;
}
- if (! bBox.equals(patternObj.getBoundingBox())) {
+ if (!bBox.equals(patternObj.getBoundingBox())) {
return false;
}
if ((xUID != null) && (patternObj.getXUID() != null)) {
- if (! xUID.equals(patternObj.getXUID())) {
+ if (!xUID.equals(patternObj.getXUID())) {
return false;
}
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/DSCConstants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/DSCConstants.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/DSCConstants.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/DSCConstants.java Sun Jun 3 14:50:33 2012
@@ -24,7 +24,10 @@ package org.apache.xmlgraphics.ps;
*
* @version $Id$
*/
-public class DSCConstants {
+public final class DSCConstants {
+
+ private DSCConstants() {
+ }
// ----==== General Header Comments ====----
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/ImageEncodingHelper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/ImageEncodingHelper.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/ImageEncodingHelper.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/ImageEncodingHelper.java Sun Jun 3 14:50:33 2012
@@ -143,8 +143,8 @@ public class ImageEncodingHelper {
data = new double[nbands];
break;
default:
- throw new IllegalArgumentException("Unknown data buffer type: "+
- dataType);
+ throw new IllegalArgumentException("Unknown data buffer type: "
+ + dataType);
}
ColorModel colorModel = image.getColorModel();
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSDictionary.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSDictionary.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSDictionary.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSDictionary.java Sun Jun 3 14:50:33 2012
@@ -23,6 +23,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
+// CSOFF: InnerAssignment
+
/**
* This class is used to encapsulate postscript dictionary objects.
*/
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSFontUtils.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSFontUtils.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSFontUtils.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSFontUtils.java Sun Jun 3 14:50:33 2012
@@ -33,7 +33,10 @@ import org.apache.xmlgraphics.util.io.Su
/**
* Utility code for font handling in PostScript.
*/
-public class PSFontUtils {
+public final class PSFontUtils {
+
+ private PSFontUtils() {
+ }
/**
* This method reads a Type 1 font from a stream and embeds it into a PostScript stream.
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSGenerator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSGenerator.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSGenerator.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSGenerator.java Sun Jun 3 14:50:33 2012
@@ -798,4 +798,4 @@ public class PSGenerator implements PSCo
return getResourceTracker().isResourceSupplied(res);
}
- }
\ No newline at end of file
+ }
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSImageUtils.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSImageUtils.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSImageUtils.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSImageUtils.java Sun Jun 3 14:50:33 2012
@@ -42,7 +42,10 @@ import org.apache.xmlgraphics.util.io.Ru
/**
* Utility code for rendering images in PostScript.
*/
-public class PSImageUtils {
+public final class PSImageUtils {
+
+ private PSImageUtils() {
+ }
/**
* Writes a bitmap image to the PostScript stream.
@@ -517,11 +520,11 @@ public class PSImageUtils {
private static String getColorSpaceName(ColorSpace colorSpace) {
if (colorSpace.getType() == ColorSpace.TYPE_CMYK) {
- return("/DeviceCMYK");
+ return "/DeviceCMYK";
} else if (colorSpace.getType() == ColorSpace.TYPE_GRAY) {
- return("/DeviceGray");
+ return "/DeviceGray";
} else {
- return("/DeviceRGB");
+ return "/DeviceRGB";
}
}
@@ -611,8 +614,8 @@ public class PSImageUtils {
data = new double[nbands];
break;
default:
- throw new IllegalArgumentException("Unknown data buffer type: "+
- dataType);
+ throw new IllegalArgumentException("Unknown data buffer type: "
+ + dataType);
}
if (rgbArray == null) {
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSProcSets.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSProcSets.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSProcSets.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSProcSets.java Sun Jun 3 14:50:33 2012
@@ -31,6 +31,9 @@ import java.util.Map;
*/
public final class PSProcSets {
+ private PSProcSets() {
+ }
+
/** the standard procset for the XML Graphics project */
public static final PSResource STD_PROCSET;
/** the EPS procset for the XML Graphics project */
@@ -99,7 +102,7 @@ public final class PSProcSets {
Iterator iter = STANDARD_MACROS.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry)iter.next();
- gen.writeln("/" + entry.getValue() + "/" + entry.getKey()+" ld");
+ gen.writeln("/" + entry.getValue() + "/" + entry.getKey() + " ld");
}
gen.writeln("/re {4 2 roll M"); //define rectangle
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/DSCCommentFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/DSCCommentFactory.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/DSCCommentFactory.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/DSCCommentFactory.java Sun Jun 3 14:50:33 2012
@@ -43,7 +43,10 @@ import org.apache.xmlgraphics.ps.dsc.eve
/**
* Factory for DSCComment subclasses.
*/
-public class DSCCommentFactory {
+public final class DSCCommentFactory {
+
+ private DSCCommentFactory() {
+ }
private static final Map DSC_FACTORIES = new java.util.HashMap();
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/DSCHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/DSCHandler.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/DSCHandler.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/DSCHandler.java Sun Jun 3 14:50:33 2012
@@ -34,13 +34,13 @@ public interface DSCHandler {
* @param header the first line of the DSC-compliant file
* @throws IOException In case of an I/O error
*/
- public void startDocument(String header) throws IOException;
+ void startDocument(String header) throws IOException;
/**
* Called when the PostScript file is fully processed, i.e. after the %%EOF comment.
* @throws IOException In case of an I/O error
*/
- public void endDocument() throws IOException;
+ void endDocument() throws IOException;
/**
* Called for each standard DSC comment. The classes passed to this method may be simple
@@ -48,14 +48,14 @@ public interface DSCHandler {
* @param comment the DSC comment
* @throws IOException In case of an I/O error
*/
- public void handleDSCComment(DSCComment comment) throws IOException;
+ void handleDSCComment(DSCComment comment) throws IOException;
/**
* Called for a normal line of PostScript code.
* @param line the line of code
* @throws IOException In case of an I/O error
*/
- public void line(String line) throws IOException;
+ void line(String line) throws IOException;
/**
* Called for any line containing a full-line PostScript comment. This is also called for
@@ -63,6 +63,6 @@ public interface DSCHandler {
* @param comment the comment line
* @throws IOException In case of an I/O error
*/
- public void comment(String comment) throws IOException;
+ void comment(String comment) throws IOException;
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/DSCParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/DSCParser.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/DSCParser.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/DSCParser.java Sun Jun 3 14:50:33 2012
@@ -125,7 +125,7 @@ public class DSCParser implements DSCPar
}
}
- private final boolean isWhitespace(char c) {
+ private boolean isWhitespace(char c) {
return c == ' ' || c == '\t';
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/NestedDocumentHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/NestedDocumentHandler.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/NestedDocumentHandler.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/NestedDocumentHandler.java Sun Jun 3 14:50:33 2012
@@ -45,4 +45,4 @@ public interface NestedDocumentHandler {
*/
void handle(DSCEvent event, DSCParser parser) throws IOException, DSCException;
-}
\ No newline at end of file
+}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/AbstractDSCComment.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/AbstractDSCComment.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/AbstractDSCComment.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/AbstractDSCComment.java Sun Jun 3 14:50:33 2012
@@ -26,7 +26,7 @@ import java.util.List;
*/
public abstract class AbstractDSCComment extends AbstractEvent implements DSCComment {
- private final boolean isWhitespace(char c) {
+ private boolean isWhitespace(char c) {
return c == ' ' || c == '\t';
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/tools/DSCTools.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/tools/DSCTools.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/tools/DSCTools.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/tools/DSCTools.java Sun Jun 3 14:50:33 2012
@@ -34,7 +34,10 @@ import org.apache.xmlgraphics.ps.dsc.eve
/**
* Helper methods commonly used when dealing with DSC-compliant PostScript files.
*/
-public class DSCTools implements DSCParserConstants {
+public final class DSCTools implements DSCParserConstants {
+
+ private DSCTools() {
+ }
/**
* Indicates whether the given event ends a header comment section according to the rules in
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/tools/PageExtractor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/tools/PageExtractor.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/tools/PageExtractor.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/tools/PageExtractor.java Sun Jun 3 14:50:33 2012
@@ -39,7 +39,10 @@ import org.apache.xmlgraphics.ps.dsc.eve
/**
* This class can extract a certain range of pages from a DSC-compliant PostScript file.
*/
-public class PageExtractor implements DSCParserConstants {
+public final class PageExtractor implements DSCParserConstants {
+
+ private PageExtractor() {
+ }
/**
* Parses a DSC-compliant file and pipes the content through to the OutputStream omitting
@@ -116,4 +119,4 @@ public class PageExtractor implements DS
}
}
-}
\ No newline at end of file
+}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/DoubleFormatUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/DoubleFormatUtil.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/DoubleFormatUtil.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/DoubleFormatUtil.java Sun Jun 3 14:50:33 2012
@@ -24,7 +24,7 @@ package org.apache.xmlgraphics.util;
* with a given number of decimal digits.
* <p>
* The contract for the format methods is this one:
- * if the source is greater than or equal to 1 (in absolute value),
+ * if the source is greater than or equal to 1 (in absolute value),
* use the decimals parameter to define the number of decimal digits; else,
* use the precision parameter to define the number of decimal digits.
* <p>
@@ -39,15 +39,18 @@ package org.apache.xmlgraphics.util;
* <li>0.00000001 should be rendered as "0.00000001"
* <li>0.000000001 should be rendered as "0"
* </ul>
- *
+ *
* Originally authored by Julien Aymé.
*/
-public class DoubleFormatUtil {
+public final class DoubleFormatUtil {
+
+ private DoubleFormatUtil() {
+ }
/**
- * Rounds the given source value at the given precision
+ * Rounds the given source value at the given precision
* and writes the rounded value into the given target
- *
+ *
* @param source the source value to round
* @param decimals the decimals to round at (use if abs(source) ≥ 1.0)
* @param precision the precision to round at (use if abs(source) < 1.0)
@@ -63,12 +66,12 @@ public class DoubleFormatUtil {
}
/**
- * Rounds the given source value at the given precision
+ * Rounds the given source value at the given precision
* and writes the rounded value into the given target
* <p>
* This method internally uses the String representation of the source value,
* in order to avoid any double precision computation error.
- *
+ *
* @param source the source value to round
* @param decimals the decimals to round at (use if abs(source) ≥ 1.0)
* @param precision the precision to round at (use if abs(source) < 1.0)
@@ -178,7 +181,7 @@ public class DoubleFormatUtil {
/**
* Returns true if the given source value will be rounded to zero
- *
+ *
* @param source the source value to round
* @param decimals the decimals to round at (use if abs(source) ≥ 1.0)
* @param precision the precision to round at (use if abs(source) < 1.0)
@@ -191,41 +194,41 @@ public class DoubleFormatUtil {
/**
* Most used power of ten (to avoid the cost of Math.pow(10, n)
*/
- private static final long[] tenPows = new long[19];
- private static final double[] tenPowsDouble = new double[21];
+ private static final long[] POWERS_OF_TEN_LONG = new long[19];
+ private static final double[] POWERS_OF_TEN_DOUBLE = new double[21];
static {
- tenPows[0] = 1L;
- for (int i = 1; i < tenPows.length; i++) {
- tenPows[i] = tenPows[i - 1] * 10L;
+ POWERS_OF_TEN_LONG[0] = 1L;
+ for (int i = 1; i < POWERS_OF_TEN_LONG.length; i++) {
+ POWERS_OF_TEN_LONG[i] = POWERS_OF_TEN_LONG[i - 1] * 10L;
}
- for (int i = 0; i < tenPowsDouble.length; i++) {
- tenPowsDouble[i] = Double.parseDouble("1e" + i);
+ for (int i = 0; i < POWERS_OF_TEN_DOUBLE.length; i++) {
+ POWERS_OF_TEN_DOUBLE[i] = Double.parseDouble("1e" + i);
}
}
/**
* Returns ten to the power of n
- *
+ *
* @param n the nth power of ten to get
* @return ten to the power of n
*/
public static long tenPow(int n) {
assert n >= 0;
- return n < tenPows.length ? tenPows[n] : (long) Math.pow(10, n);
+ return n < POWERS_OF_TEN_LONG.length ? POWERS_OF_TEN_LONG[n] : (long) Math.pow(10, n);
}
private static double tenPowDouble(int n) {
assert n >= 0;
- return n < tenPowsDouble.length ? tenPowsDouble[n] : Math.pow(10, n);
+ return n < POWERS_OF_TEN_DOUBLE.length ? POWERS_OF_TEN_DOUBLE[n] : Math.pow(10, n);
}
/**
* Helper method to do the custom rounding used within formatDoublePrecise
- *
+ *
* @param target the buffer to write to
* @param scale the expected rounding scale
* @param intP the source integer part
- * @param decP the source decimal part, truncated to scale + 1 digit
+ * @param decP the source decimal part, truncated to scale + 1 digit
*/
private static void format(StringBuffer target, int scale, long intP, long decP) {
if (decP != 0L) {
@@ -257,12 +260,12 @@ public class DoubleFormatUtil {
}
/**
- * Rounds the given source value at the given precision
+ * Rounds the given source value at the given precision
* and writes the rounded value into the given target
* <p>
* This method internally uses double precision computation and rounding,
* so the result may not be accurate (see formatDouble method for conditions).
- *
+ *
* @param source the source value to round
* @param decimals the decimals to round at (use if abs(source) ≥ 1.0)
* @param precision the precision to round at (use if abs(source) < 1.0)
@@ -323,7 +326,7 @@ public class DoubleFormatUtil {
/**
* Returns the exponent of the given value
- *
+ *
* @param value the value to get the exponent from
* @return the value's exponent
*/
@@ -336,9 +339,9 @@ public class DoubleFormatUtil {
}
/**
- * Returns true if the rounding is considered to use too many digits
+ * Returns true if the rounding is considered to use too many digits
* of the double for a fast rounding
- *
+ *
* @param source the source to round
* @param scale the scale to round at
* @return true if the rounding will potentially use too many digits
@@ -351,7 +354,7 @@ public class DoubleFormatUtil {
/**
* Returns true if the given source is considered to be too close
* of a rounding value for the given scale.
- *
+ *
* @param source the source to round
* @param scale the scale to round at
* @return true if the source will be potentially rounded at the scale
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/ImageIODebugUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/ImageIODebugUtil.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/ImageIODebugUtil.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/ImageIODebugUtil.java Sun Jun 3 14:50:33 2012
@@ -36,7 +36,10 @@ import org.w3c.dom.Node;
*
* @version $Id$
*/
-public class ImageIODebugUtil {
+public final class ImageIODebugUtil {
+
+ private ImageIODebugUtil() {
+ }
public static void dumpMetadata(IIOMetadata meta, boolean nativeFormat) {
String format;
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/Service.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/Service.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/Service.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/Service.java Sun Jun 3 14:50:33 2012
@@ -41,10 +41,14 @@ import org.apache.commons.io.IOUtils;
* interface is very similar to the one they describe which seems to
* be missing in the JDK.
*
- * @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
* @version $Id$
+ *
+ * Originally authored by Thomas DeWeese.
*/
-public class Service {
+public final class Service {
+
+ private Service() {
+ }
// Remember providers we have looked up before.
static Map<String, List<String>> classMap = new java.util.HashMap<String, List<String>>();
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/UnitConv.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/UnitConv.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/UnitConv.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/UnitConv.java Sun Jun 3 14:50:33 2012
@@ -26,6 +26,9 @@ import java.awt.geom.AffineTransform;
*/
public final class UnitConv {
+ private UnitConv() {
+ }
+
/** conversion factory from millimeters to inches. */
public static final float IN2MM = 25.4f;
@@ -189,27 +192,21 @@ public final class UnitConv {
if (value.toLowerCase().indexOf(PX) > 0) {
retValue = Double.parseDouble(value.substring(0, value.length() - 2));
retValue *= 1000;
- }
- else if (value.toLowerCase().indexOf(INCH) > 0) {
+ } else if (value.toLowerCase().indexOf(INCH) > 0) {
retValue = Double.parseDouble(value.substring(0, value.length() - 2));
retValue *= 72000;
- }
- else if (value.toLowerCase().indexOf(CM) > 0) {
+ } else if (value.toLowerCase().indexOf(CM) > 0) {
retValue = Double.parseDouble(value.substring(0, value.length() - 2));
retValue *= 28346.4567;
- }
- else if (value.toLowerCase().indexOf(MM) > 0) {
+ } else if (value.toLowerCase().indexOf(MM) > 0) {
retValue = Double.parseDouble(value.substring(0, value.length() - 2));
retValue *= 2834.64567;
- }
- else if (value.toLowerCase().indexOf(MPT) > 0) {
+ } else if (value.toLowerCase().indexOf(MPT) > 0) {
retValue = Double.parseDouble(value.substring(0, value.length() - 3));
- }
- else if (value.toLowerCase().indexOf(POINT) > 0) {
+ } else if (value.toLowerCase().indexOf(POINT) > 0) {
retValue = Double.parseDouble(value.substring(0, value.length() - 2));
retValue *= 1000;
- }
- else if (value.toLowerCase().indexOf(PICA) > 0) {
+ } else if (value.toLowerCase().indexOf(PICA) > 0) {
retValue = Double.parseDouble(value.substring(0, value.length() - 2));
retValue *= 12000;
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/dijkstra/EdgeDirectory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/dijkstra/EdgeDirectory.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/dijkstra/EdgeDirectory.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/dijkstra/EdgeDirectory.java Sun Jun 3 14:50:33 2012
@@ -42,4 +42,4 @@ public interface EdgeDirectory {
*/
Iterator getDestinations(Vertex origin);
-}
\ No newline at end of file
+}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/ExtendedLocalizable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/ExtendedLocalizable.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/ExtendedLocalizable.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/ExtendedLocalizable.java Sun Jun 3 14:50:33 2012
@@ -26,8 +26,9 @@ import java.util.ResourceBundle;
* This interface provides much more control over internationalization
* than the Localizable interface.
*
- * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id$
+ *
+ * Originally authored by Stephane Hillion.
*/
public interface ExtendedLocalizable extends Localizable {
/**
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/LocaleGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/LocaleGroup.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/LocaleGroup.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/LocaleGroup.java Sun Jun 3 14:50:33 2012
@@ -25,8 +25,9 @@ import java.util.Locale;
* This class represents a group of ExtendedLocalizable objects which
* have a shared default locale.
*
- * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id$
+ *
+ * Originally authored by Stephane Hillion.
*/
public class LocaleGroup {
/**
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/Localizable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/Localizable.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/Localizable.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/Localizable.java Sun Jun 3 14:50:33 2012
@@ -26,8 +26,9 @@ import java.util.MissingResourceExceptio
* This interface must be implemented by the classes which must provide a
* way to override the default locale.
*
- * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id$
+ *
+ * Originally authored by Stephane Hillion.
*/
public interface Localizable {
/**
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/LocalizableSupport.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/LocalizableSupport.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/LocalizableSupport.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/i18n/LocalizableSupport.java Sun Jun 3 14:50:33 2012
@@ -23,6 +23,8 @@ import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
+// CSOFF: InnerAssignment
+
/**
* This class provides a default implementation of the Localizable interface.
* You can use it as a base class or as a member field and delegates various
@@ -73,8 +75,9 @@ import java.util.ResourceBundle;
* Note: if no group is specified a LocalizableSupport object belongs to a
* default group common to each instance of LocalizableSupport.
*
- * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id$
+ *
+ * Originally authored by Stephane Hillion.
*/
public class LocalizableSupport implements Localizable {
/**
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85Constants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85Constants.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85Constants.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85Constants.java Sun Jun 3 14:50:33 2012
@@ -27,30 +27,30 @@ package org.apache.xmlgraphics.util.io;
public interface ASCII85Constants {
/** Special character "z" stands for four NULL bytes (short-cut for !!!!!) */
- public static final int ZERO = 0x7A; //"z"
+ int ZERO = 0x7A; //"z"
/** ZERO as a byte array */
- public static final byte[] ZERO_ARRAY = {(byte)ZERO};
+ byte[] ZERO_ARRAY = {(byte)ZERO};
/** The start index for ASCII85 characters (!) */
- public static final int START = 0x21; //"!"
+ int START = 0x21; //"!"
/** The end index for ASCII85 characters (u) */
- public static final int END = 0x75; //"u"
+ int END = 0x75; //"u"
/** The EOL indicator (LF) */
- public static final int EOL = 0x0A; //"\n"
+ int EOL = 0x0A; //"\n"
/** The EOD (end of data) indicator */
- public static final byte[] EOD = {0x7E, 0x3E}; //"~>"
+ byte[] EOD = {0x7E, 0x3E}; //"~>"
/** Array of powers of 85 (4, 3, 2, 1, 0) */
- public static final long POW85[] = new long[] {85 * 85 * 85 * 85,
+ long[] POW85 = new long[] {85 * 85 * 85 * 85,
85 * 85 * 85,
85 * 85,
85,
1};
/*
- public static final long BASE85_4 = 85;
- public static final long BASE85_3 = BASE85_4 * BASE85_4;
- public static final long BASE85_2 = BASE85_3 * BASE85_4;
- public static final long BASE85_1 = BASE85_2 * BASE85_4;
+ long BASE85_4 = 85;
+ long BASE85_3 = BASE85_4 * BASE85_4;
+ long BASE85_2 = BASE85_3 * BASE85_4;
+ long BASE85_1 = BASE85_2 * BASE85_4;
*/
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85InputStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85InputStream.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85InputStream.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85InputStream.java Sun Jun 3 14:50:33 2012
@@ -19,8 +19,8 @@
package org.apache.xmlgraphics.util.io;
-import java.io.InputStream;
import java.io.IOException;
+import java.io.InputStream;
/**
* This class applies a ASCII85 decoding to the stream.
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85OutputStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85OutputStream.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85OutputStream.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85OutputStream.java Sun Jun 3 14:50:33 2012
@@ -19,9 +19,9 @@
package org.apache.xmlgraphics.util.io;
-import java.io.OutputStream;
import java.io.FilterOutputStream;
import java.io.IOException;
+import java.io.OutputStream;
/**
* This class applies a ASCII85 encoding to the stream.
@@ -92,7 +92,8 @@ public class ASCII85OutputStream extends
if (firstpart > 0) {
out.write(buf, 0, firstpart);
}
- out.write(EOL); bw++;
+ out.write(EOL);
+ bw++;
int rest = len - firstpart;
if (rest > 0) {
out.write(buf, firstpart, rest);
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCIIHexOutputStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCIIHexOutputStream.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCIIHexOutputStream.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCIIHexOutputStream.java Sun Jun 3 14:50:33 2012
@@ -19,9 +19,9 @@
package org.apache.xmlgraphics.util.io;
-import java.io.OutputStream;
import java.io.FilterOutputStream;
import java.io.IOException;
+import java.io.OutputStream;
/**
* This class applies a ASCII Hex encoding to the stream.
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/Base64DecodeStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/Base64DecodeStream.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/Base64DecodeStream.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/Base64DecodeStream.java Sun Jun 3 14:50:33 2012
@@ -22,6 +22,13 @@ package org.apache.xmlgraphics.util.io;
import java.io.IOException;
import java.io.InputStream;
+// CSOFF: ConstantName
+// CSOFF: MemberName
+// CSOFF: MultipleVariableDeclarations
+// CSOFF: NeedBraces
+// CSOFF: OperatorWrap
+// CSOFF: WhitespaceAround
+
/**
* This class implements a Base64 Character decoder as specified in RFC1113.
* Unlike some other encoding schemes there is nothing in this encoding that
@@ -42,10 +49,9 @@ import java.io.InputStream;
* "Base64DecodeStream: Bad Padding byte (1)."
* </pre>
*
- * @author <a href="mailto:thomas.deweese@kodak.com">Thomas DeWeese</a>
- * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
- * @author Chuck McManis
* @version $Id$
+ *
+ * Originally authored by Thomas DeWeese, Vincent Hardy, and Chuck McManis.
*/
public class Base64DecodeStream extends InputStream {
@@ -56,7 +62,7 @@ public class Base64DecodeStream extends
this.src = src;
}
- private static final byte pem_array[] = new byte[256];
+ private static final byte[] pem_array = new byte[256];
static {
for (int i=0; i<pem_array.length; i++)
pem_array[i] = -1;
@@ -89,8 +95,8 @@ public class Base64DecodeStream extends
return 3-out_offset;
}
- byte decode_buffer[] = new byte[4];
- byte out_buffer[] = new byte[3];
+ byte[] decode_buffer = new byte[4];
+ byte[] out_buffer = new byte[3];
int out_offset = 3;
boolean EOF = false;
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/Base64EncodeStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/Base64EncodeStream.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/Base64EncodeStream.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/Base64EncodeStream.java Sun Jun 3 14:50:33 2012
@@ -23,6 +23,14 @@ import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
+// CSOFF: ConstantName
+// CSOFF: InnerAssignment
+// CSOFF: MultipleVariableDeclarations
+// CSOFF: NeedBraces
+// CSOFF: OneStatementPerLine
+// CSOFF: WhitespaceAfter
+// CSOFF: WhitespaceAround
+
/**
* This class implements a Base64 Character encoder as specified in RFC1113.
* Unlike some other encoding schemes there is nothing in this encoding
@@ -31,15 +39,14 @@ import java.io.PrintStream;
* This means that the encoded text will simply start with the first line
* of encoded text and end with the last line of encoded text.
*
- * @author <a href="mailto:deweese@apache.org">Thomas DeWeese</a>
- * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
- * @author Chuck McManis
* @version $Id$
+ *
+ * Originally authored by Thomas DeWeese, Vincent Hardy, and Chuck McManis.
*/
public class Base64EncodeStream extends OutputStream {
/** This array maps the 6 bit values to their characters */
- private final static byte pem_array[] = {
+ private static final byte[] pem_array = {
// 0 1 2 3 4 5 6 7
'A','B','C','D','E','F','G','H', // 0
'I','J','K','L','M','N','O','P', // 1
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/RunLengthEncodeOutputStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/RunLengthEncodeOutputStream.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/RunLengthEncodeOutputStream.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/RunLengthEncodeOutputStream.java Sun Jun 3 14:50:33 2012
@@ -20,15 +20,16 @@
package org.apache.xmlgraphics.util.io;
import java.io.FilterOutputStream;
-import java.io.OutputStream;
import java.io.IOException;
+import java.io.OutputStream;
/**
* This class applies a RunLengthEncode filter to the stream.
*
- * @author <a href="mailto:smwolke@geistig.com">Stephen Wolke</a>
* @version $Id$
+ *
+ * Originally authored by Stephen Wolke.
*/
public class RunLengthEncodeOutputStream extends FilterOutputStream
implements Finalizable {
@@ -97,17 +98,6 @@ public class RunLengthEncodeOutputStream
break;
default:
switch (isSequence) {
- case IN_SEQUENCE:
- if (runBuffer[runCount] != runBuffer[runCount - 1]) {
- out.write(BYTE_MAX - (runCount - 1));
- out.write(runBuffer[runCount - 1]);
- runBuffer[0] = runBuffer[runCount];
- runCount = 1;
- isSequence = NOT_IDENTIFY_SEQUENCE;
- break;
- }
- runCount++;
- break;
case NOT_IN_SEQUENCE:
if (runBuffer[runCount] == runBuffer[runCount - 1]) {
isSequence = START_SEQUENCE;
@@ -129,6 +119,18 @@ public class RunLengthEncodeOutputStream
runCount++;
break;
}
+ case IN_SEQUENCE:
+ default:
+ if (runBuffer[runCount] != runBuffer[runCount - 1]) {
+ out.write(BYTE_MAX - (runCount - 1));
+ out.write(runBuffer[runCount - 1]);
+ runBuffer[0] = runBuffer[runCount];
+ runCount = 1;
+ isSequence = NOT_IDENTIFY_SEQUENCE;
+ break;
+ }
+ runCount++;
+ break;
}
}
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/CommonURIResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/CommonURIResolver.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/CommonURIResolver.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/CommonURIResolver.java Sun Jun 3 14:50:33 2012
@@ -41,7 +41,7 @@ public class CommonURIResolver implement
private final List uriResolvers = new LinkedList();
- private final static class DefaultInstanceHolder {
+ private static final class DefaultInstanceHolder {
private static final CommonURIResolver INSTANCE = new CommonURIResolver();
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/DataURIResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/DataURIResolver.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/DataURIResolver.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/DataURIResolver.java Sun Jun 3 14:50:33 2012
@@ -30,6 +30,7 @@ import javax.xml.transform.stream.Stream
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.apache.xmlgraphics.util.io.Base64DecodeStream;
/**
@@ -41,7 +42,7 @@ import org.apache.xmlgraphics.util.io.Ba
public class DataURIResolver implements URIResolver {
/** logger */
- private static Log LOG = LogFactory.getLog(URIResolver.class);
+ private static final Log LOG = LogFactory.getLog(URIResolver.class);
/**
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/DataURLUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/DataURLUtil.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/DataURLUtil.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/DataURLUtil.java Sun Jun 3 14:50:33 2012
@@ -32,7 +32,10 @@ import org.apache.xmlgraphics.util.io.Ba
/**
* Utility classes for generating RFC 2397 data URLs.
*/
-public class DataURLUtil {
+public final class DataURLUtil {
+
+ private DataURLUtil() {
+ }
/**
* Creates a new data URL and returns it as a String.
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/PropertyAccess.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/PropertyAccess.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/PropertyAccess.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/PropertyAccess.java Sun Jun 3 14:50:33 2012
@@ -74,4 +74,4 @@ public interface PropertyAccess {
*/
Iterator iterator();
-}
\ No newline at end of file
+}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java Sun Jun 3 14:50:33 2012
@@ -51,11 +51,7 @@ public class XMPHandler extends DefaultH
private boolean hasComplexContent() {
Object obj = this.contextStack.peek();
- if (obj instanceof QName) {
- return false;
- } else {
- return true;
- }
+ return !(obj instanceof QName);
}
private PropertyAccess getCurrentProperties() {
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPPacketParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPPacketParser.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPPacketParser.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPPacketParser.java Sun Jun 3 14:50:33 2012
@@ -37,7 +37,10 @@ import org.apache.commons.io.output.Byte
* Important: Before you use this class to look for an XMP packet in some random file, please read
* the chapter on "Scanning Files for XMP Packets" in the XMP specification!
*/
-public class XMPPacketParser {
+public final class XMPPacketParser {
+
+ private XMPPacketParser() {
+ }
private static final byte[] PACKET_HEADER;
private static final byte[] PACKET_HEADER_END;
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPParser.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPParser.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPParser.java Sun Jun 3 14:50:33 2012
@@ -31,7 +31,10 @@ import javax.xml.transform.stream.Stream
/**
* The XMP parser.
*/
-public class XMPParser {
+public final class XMPParser {
+
+ private XMPParser() {
+ }
/**
* Parses an XMP file.
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java Sun Jun 3 14:50:33 2012
@@ -29,7 +29,7 @@ import org.apache.xmlgraphics.xmp.schema
/**
* This class is a registry of XMP schemas. It's implemented as a singleton.
*/
-public class XMPSchemaRegistry {
+public final class XMPSchemaRegistry {
private static XMPSchemaRegistry instance = null;
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSerializer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSerializer.java?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSerializer.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSerializer.java Sun Jun 3 14:50:33 2012
@@ -34,7 +34,10 @@ import org.xml.sax.SAXException;
/**
* Serializes an XMP tree to XML or to an XMP packet.
*/
-public class XMPSerializer {
+public final class XMPSerializer {
+
+ private XMPSerializer() {
+ }
private static final String DEFAULT_ENCODING = "UTF-8";
Modified: xmlgraphics/commons/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/status.xml?rev=1345683&r1=1345682&r2=1345683&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/status.xml (original)
+++ xmlgraphics/commons/trunk/status.xml Sun Jun 3 14:50:33 2012
@@ -41,6 +41,9 @@
</contexts>
<changes>
<release version="Trunk" date="n/a">
+ <action context="Code" dev="GA" type="fix" fixes-bug="53352">
+ Upgrade to checkstyle-5.5 and ensure no warnings.
+ </action>
<action context="Code" dev="GA" type="fix" fixes-bug="51149" due-to="Luis Bernardo">
Improve performance for certain kinds of PNG images.
</action>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org