From af35f0470875116ed42e407c05127f16272ec890 Mon Sep 17 00:00:00 2001 From: Mehdi Houshmand Date: Mon, 30 Jan 2012 11:46:13 +0000 Subject: [PATCH] Amended checkstyle errors and return carriages git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1237610 13f79535-47bb-0310-9956-ffa450edef68 --- .../afp/fonts/AFPBase12FontCollection.java | 3 + .../apache/fop/afp/modca/GraphicsObject.java | 1 + .../fop/fonts/type1/Type1FontLoader.java | 2 +- .../render/AbstractPathOrientedRenderer.java | 3 + .../org/apache/fop/render/PrintRenderer.java | 3 + .../render/afp/AFPRendererConfigurator.java | 6 +- .../apache/fop/render/bitmap/PNGRenderer.java | 3 + .../fop/render/bitmap/TIFFRenderer.java | 6 +- .../fop/render/intermediate/IFRenderer.java | 2 + .../fop/render/java2d/Java2DRenderer.java | 6 +- .../fop/render/print/PageableRenderer.java | 2 + .../fop/render/print/PrintRenderer.java | 2 + .../apache/fop/render/txt/TXTRenderer.java | 2 + .../fop/render/xml/AbstractXMLRenderer.java | 3 + .../apache/fop/render/xml/XMLRenderer.java | 3 + .../apache/fop/render/svg/SVGRenderer.java | 3 + .../fonts/truetype/TTFFontLoaderTestCase.java | 114 +++++++++--------- .../org/apache/fop/pdf/PDFObjectTestCase.java | 10 +- 18 files changed, 109 insertions(+), 65 deletions(-) diff --git a/src/java/org/apache/fop/afp/fonts/AFPBase12FontCollection.java b/src/java/org/apache/fop/afp/fonts/AFPBase12FontCollection.java index c872a08cc..244e6122c 100644 --- a/src/java/org/apache/fop/afp/fonts/AFPBase12FontCollection.java +++ b/src/java/org/apache/fop/afp/fonts/AFPBase12FontCollection.java @@ -43,6 +43,9 @@ public class AFPBase12FontCollection implements FontCollection { private final AFPEventProducer eventProducer; + /** + * @param eventProducer the AFP-specific event producer + */ public AFPBase12FontCollection(AFPEventProducer eventProducer) { this.eventProducer = eventProducer; } diff --git a/src/java/org/apache/fop/afp/modca/GraphicsObject.java b/src/java/org/apache/fop/afp/modca/GraphicsObject.java index 66876a5ac..19d4618be 100644 --- a/src/java/org/apache/fop/afp/modca/GraphicsObject.java +++ b/src/java/org/apache/fop/afp/modca/GraphicsObject.java @@ -325,6 +325,7 @@ public class GraphicsObject extends AbstractDataObject { * @param str the string * @param x the x coordinate * @param y the y coordinate + * @param charSet the character set associated with the string */ public void addString(String str, int x, int y, CharacterSet charSet) { addObject(new GraphicsCharacterString(str, x, y, charSet)); diff --git a/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java b/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java index b5b573eca..1e93763e8 100644 --- a/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java +++ b/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java @@ -62,7 +62,7 @@ public class Type1FontLoader extends FontLoader { return pfbURI.substring(0, pfbURI.length() - 4) + "." + pfmExt; } - private static final String[] AFM_EXTENSIONS = new String[] { ".AFM", ".afm", ".Afm" }; + private static final String[] AFM_EXTENSIONS = new String[] {".AFM", ".afm", ".Afm"}; /** {@inheritDoc} */ @Override diff --git a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java index 83d3d84a2..333248f4d 100644 --- a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java +++ b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java @@ -57,6 +57,9 @@ import org.apache.fop.traits.BorderProps; */ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { + /** + * @param userAgent the user agent that contains configuration details. This cannot be null. + */ public AbstractPathOrientedRenderer(FOUserAgent userAgent) { super(userAgent); } diff --git a/src/java/org/apache/fop/render/PrintRenderer.java b/src/java/org/apache/fop/render/PrintRenderer.java index 05e9cb7af..4e49adc25 100644 --- a/src/java/org/apache/fop/render/PrintRenderer.java +++ b/src/java/org/apache/fop/render/PrintRenderer.java @@ -43,6 +43,9 @@ import org.apache.fop.fonts.base14.Base14FontCollection; /** Abstract base class of "Print" type renderers. */ public abstract class PrintRenderer extends AbstractRenderer { + /** + * @param userAgent the user agent that contains configuration details. This cannot be null. + */ public PrintRenderer(FOUserAgent userAgent) { super(userAgent); } diff --git a/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java b/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java index bfef1b0cc..23449ce4e 100644 --- a/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java +++ b/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java @@ -204,8 +204,10 @@ public class AFPRendererConfigurator extends PrintRendererConfigurator "org.apache.fop.fonts.base14." + base14).asSubclass(Typeface.class); try { Typeface tf = clazz.newInstance(); - font.addCharacterSet(sizeMpt, CharacterSetBuilder.getSingleByteInstance() - .build(characterset, codepage, encoding, tf, eventProducer)); + font.addCharacterSet(sizeMpt, + CharacterSetBuilder.getSingleByteInstance() + .build(characterset, codepage, encoding, tf, + eventProducer)); } catch (Exception ie) { String msg = "The base 14 font class " + clazz.getName() + " could not be instantiated"; diff --git a/src/java/org/apache/fop/render/bitmap/PNGRenderer.java b/src/java/org/apache/fop/render/bitmap/PNGRenderer.java index 1c6f2e33d..6f45d18ca 100644 --- a/src/java/org/apache/fop/render/bitmap/PNGRenderer.java +++ b/src/java/org/apache/fop/render/bitmap/PNGRenderer.java @@ -41,6 +41,9 @@ import org.apache.fop.render.java2d.Java2DRenderer; */ public class PNGRenderer extends Java2DRenderer { + /** + * @param userAgent the user agent that contains configuration details. This cannot be null. + */ public PNGRenderer(FOUserAgent userAgent) { super(userAgent); } diff --git a/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java b/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java index 0e2364d35..3cdcf2cdc 100644 --- a/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java +++ b/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java @@ -82,7 +82,11 @@ public class TIFFRenderer extends Java2DRenderer implements TIFFConstants { return MIME_TYPE; } - /** Creates TIFF renderer. */ + /** + * Creates TIFF renderer. + * + * @param userAgent the user agent that contains configuration details. This cannot be null. + */ public TIFFRenderer(FOUserAgent userAgent) { super(userAgent); writerParams = new ImageWriterParams(); diff --git a/src/java/org/apache/fop/render/intermediate/IFRenderer.java b/src/java/org/apache/fop/render/intermediate/IFRenderer.java index d5d5a154a..9d8fb6e4b 100644 --- a/src/java/org/apache/fop/render/intermediate/IFRenderer.java +++ b/src/java/org/apache/fop/render/intermediate/IFRenderer.java @@ -158,6 +158,8 @@ public class IFRenderer extends AbstractPathOrientedRenderer { /** * Main constructor + * + * @param userAgent the user agent that contains configuration details. This cannot be null. */ public IFRenderer(FOUserAgent userAgent) { super(userAgent); diff --git a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java index 3c7006588..1d1697607 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java +++ b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java @@ -146,7 +146,11 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem private GeneralPath currentPath = null; - /** Default constructor */ + /** + * Default constructor + * + * @param userAgent the user agent that contains configuration details. This cannot be null. + */ public Java2DRenderer(FOUserAgent userAgent) { super(userAgent); diff --git a/src/java/org/apache/fop/render/print/PageableRenderer.java b/src/java/org/apache/fop/render/print/PageableRenderer.java index 08d5b0f04..70a7f84a6 100644 --- a/src/java/org/apache/fop/render/print/PageableRenderer.java +++ b/src/java/org/apache/fop/render/print/PageableRenderer.java @@ -72,6 +72,8 @@ public class PageableRenderer extends Java2DRenderer implements Pageable { /** * Creates a new PageableRenderer. + * + * @param userAgent the user agent that contains configuration details. This cannot be null. */ public PageableRenderer(FOUserAgent userAgent) { super(userAgent); diff --git a/src/java/org/apache/fop/render/print/PrintRenderer.java b/src/java/org/apache/fop/render/print/PrintRenderer.java index ea68bc9b2..1540acd23 100644 --- a/src/java/org/apache/fop/render/print/PrintRenderer.java +++ b/src/java/org/apache/fop/render/print/PrintRenderer.java @@ -54,6 +54,8 @@ public class PrintRenderer extends PageableRenderer { /** * Creates a new PrintRenderer with the options set through the renderer options if a custom * PrinterJob is not given in FOUserAgent's renderer options. + * + * @param userAgent the user agent that contains configuration details. This cannot be null. */ public PrintRenderer(FOUserAgent userAgent) { super(userAgent); diff --git a/src/java/org/apache/fop/render/txt/TXTRenderer.java b/src/java/org/apache/fop/render/txt/TXTRenderer.java index 74c5b84a8..eecb6a623 100644 --- a/src/java/org/apache/fop/render/txt/TXTRenderer.java +++ b/src/java/org/apache/fop/render/txt/TXTRenderer.java @@ -110,6 +110,8 @@ public class TXTRenderer extends AbstractPathOrientedRenderer { /** * Constructs a newly allocated TXTRenderer object. + * + * @param userAgent the user agent that contains configuration details. This cannot be null. */ public TXTRenderer(FOUserAgent userAgent) { super(userAgent); diff --git a/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java b/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java index 9c938199f..149111e0d 100644 --- a/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java +++ b/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java @@ -49,6 +49,9 @@ import org.apache.fop.render.RendererContext; /** Abstract xml renderer base class. */ public abstract class AbstractXMLRenderer extends PrintRenderer { + /** + * @param userAgent the user agent that contains configuration details. This cannot be null. + */ public AbstractXMLRenderer(FOUserAgent userAgent) { super(userAgent); } diff --git a/src/java/org/apache/fop/render/xml/XMLRenderer.java b/src/java/org/apache/fop/render/xml/XMLRenderer.java index 3ae49b121..d2cd55abe 100644 --- a/src/java/org/apache/fop/render/xml/XMLRenderer.java +++ b/src/java/org/apache/fop/render/xml/XMLRenderer.java @@ -112,6 +112,9 @@ public class XMLRenderer extends AbstractXMLRenderer { private int pageSequenceIndex; + /** + * @param userAgent the user agent that contains configuration details. This cannot be null. + */ public XMLRenderer(FOUserAgent userAgent) { super(userAgent); context = new RendererContext(this, XML_MIME_TYPE); diff --git a/src/sandbox/org/apache/fop/render/svg/SVGRenderer.java b/src/sandbox/org/apache/fop/render/svg/SVGRenderer.java index 246062a32..0e575c736 100644 --- a/src/sandbox/org/apache/fop/render/svg/SVGRenderer.java +++ b/src/sandbox/org/apache/fop/render/svg/SVGRenderer.java @@ -70,6 +70,9 @@ public class SVGRenderer extends Java2DRenderer { /** Helper class for generating multiple files */ private MultiFileRenderingUtil multiFileUtil; + /** + * @param userAgent the user agent that contains configuration details. This cannot be null. + */ public SVGRenderer(FOUserAgent userAgent) { super(userAgent); } diff --git a/test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java b/test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java index 0d6fc1d48..aadf877e0 100644 --- a/test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java +++ b/test/java/org/apache/fop/fonts/truetype/TTFFontLoaderTestCase.java @@ -1,57 +1,57 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.fonts.truetype; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import java.io.File; -import java.io.IOException; - -import org.junit.Test; - -import org.apache.fop.fonts.EncodingMode; -import org.apache.fop.fonts.FontManager; -import org.apache.fop.fonts.FontResolver; - -/** - * Test case for {@link TTFFontLoader}. - */ -public class TTFFontLoaderTestCase { - - @Test - public void testUseKerning() throws IOException { - File file = new File("test/resources/fonts/ttf/DejaVuLGCSerif.ttf"); - String absoluteFilePath = file.toURL().toExternalForm(); - FontResolver resolver = FontManager.createMinimalFontResolver(); - String fontName = "Deja Vu"; - boolean embedded = false; - boolean useKerning = true; - - TTFFontLoader fontLoader = new TTFFontLoader(absoluteFilePath, fontName, embedded, - EncodingMode.AUTO, useKerning, resolver); - assertTrue(fontLoader.getFont().hasKerningInfo()); - useKerning = false; - - fontLoader = new TTFFontLoader(absoluteFilePath, fontName, embedded, EncodingMode.AUTO, - useKerning, resolver); - assertFalse(fontLoader.getFont().hasKerningInfo()); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.fonts.truetype; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.io.IOException; + +import org.junit.Test; + +import org.apache.fop.fonts.EncodingMode; +import org.apache.fop.fonts.FontManager; +import org.apache.fop.fonts.FontResolver; + +/** + * Test case for {@link TTFFontLoader}. + */ +public class TTFFontLoaderTestCase { + + @Test + public void testUseKerning() throws IOException { + File file = new File("test/resources/fonts/ttf/DejaVuLGCSerif.ttf"); + String absoluteFilePath = file.toURI().toURL().toExternalForm(); + FontResolver resolver = FontManager.createMinimalFontResolver(); + String fontName = "Deja Vu"; + boolean embedded = false; + boolean useKerning = true; + + TTFFontLoader fontLoader = new TTFFontLoader(absoluteFilePath, fontName, embedded, + EncodingMode.AUTO, useKerning, resolver); + assertTrue(fontLoader.getFont().hasKerningInfo()); + useKerning = false; + + fontLoader = new TTFFontLoader(absoluteFilePath, fontName, embedded, EncodingMode.AUTO, + useKerning, resolver); + assertFalse(fontLoader.getFont().hasKerningInfo()); + } +} diff --git a/test/java/org/apache/fop/pdf/PDFObjectTestCase.java b/test/java/org/apache/fop/pdf/PDFObjectTestCase.java index d4ad87d78..ee9512d88 100644 --- a/test/java/org/apache/fop/pdf/PDFObjectTestCase.java +++ b/test/java/org/apache/fop/pdf/PDFObjectTestCase.java @@ -19,13 +19,17 @@ package org.apache.fop.pdf; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.io.ByteArrayOutputStream; import java.io.IOException; +import org.junit.Before; +import org.junit.Test; + /** * Tests the PDFObject class. */ -- 2.39.5