From aee25bbe7a9fc5acdc1918ce9162007f30fad228 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Fri, 18 Jan 2013 17:45:40 +0000 Subject: [PATCH] FOP-2192: fix checkstyle and findbugs warnings git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1435269 13f79535-47bb-0310-9956-ffa450edef68 --- .../complexscripts/fonts/GlyphPositioningSubtable.java | 2 +- .../complexscripts/fonts/GlyphSubstitutionSubtable.java | 2 +- .../fop/complexscripts/scripts/ScriptProcessor.java | 2 ++ src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java | 8 ++++---- src/java/org/apache/fop/pdf/PDFText.java | 2 +- src/java/org/apache/fop/pdf/PDFTextUtil.java | 2 +- src/java/org/apache/fop/render/ps/PSTextPainter.java | 6 ++++-- status.xml | 3 +++ 8 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningSubtable.java b/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningSubtable.java index 5bf073bf4..d1dae3275 100644 --- a/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningSubtable.java +++ b/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningSubtable.java @@ -34,7 +34,7 @@ import org.apache.fop.complexscripts.util.ScriptContextTester; */ public abstract class GlyphPositioningSubtable extends GlyphSubtable implements GlyphPositioning { - private static final GlyphPositioningState state = new GlyphPositioningState(); + private static final GlyphPositioningState state = new GlyphPositioningState(); // CSOK: ConstantName /** * Instantiate a GlyphPositioningSubtable. diff --git a/src/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionSubtable.java b/src/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionSubtable.java index 446854566..2ea247785 100644 --- a/src/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionSubtable.java +++ b/src/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionSubtable.java @@ -33,7 +33,7 @@ import org.apache.fop.complexscripts.util.ScriptContextTester; */ public abstract class GlyphSubstitutionSubtable extends GlyphSubtable implements GlyphSubstitution { - private static final GlyphSubstitutionState state = new GlyphSubstitutionState(); + private static final GlyphSubstitutionState state = new GlyphSubstitutionState(); // CSOK: ConstantName /** * Instantiate a GlyphSubstitutionSubtable. diff --git a/src/java/org/apache/fop/complexscripts/scripts/ScriptProcessor.java b/src/java/org/apache/fop/complexscripts/scripts/ScriptProcessor.java index 95d9a4e00..d8223bf47 100644 --- a/src/java/org/apache/fop/complexscripts/scripts/ScriptProcessor.java +++ b/src/java/org/apache/fop/complexscripts/scripts/ScriptProcessor.java @@ -33,7 +33,9 @@ import org.apache.fop.complexscripts.util.ScriptContextTester; // CSOFF: InnerAssignmentCheck // CSOFF: LineLengthCheck +// CSOFF: NoWhitespaceAfterCheck // CSOFF: ParameterNumberCheck +// CSOFF: SimplifyBooleanReturnCheck /** *

Abstract script processor base class for which an implementation of the substitution and positioning methods diff --git a/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java b/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java index 2ef70b15e..530ad024c 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java +++ b/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java @@ -179,13 +179,13 @@ public class ImageLayout implements Constants { //Adjust viewport if not explicit if (ipd == -1) { ipd = constrainExtent(cwidth, - props.getInlineProgressionDimension(), (foundNonAuto) ? - props.getContentWidth() : new DefaultLength()); + props.getInlineProgressionDimension(), (foundNonAuto) + ? props.getContentWidth() : new DefaultLength()); } if (bpd == -1) { bpd = constrainExtent(cheight, - props.getBlockProgressionDimension(), (foundNonAuto) ? - props.getContentHeight() : new DefaultLength()); + props.getBlockProgressionDimension(), (foundNonAuto) + ? props.getContentHeight() : new DefaultLength()); } this.clip = false; diff --git a/src/java/org/apache/fop/pdf/PDFText.java b/src/java/org/apache/fop/pdf/PDFText.java index e581800e0..a1b3cff16 100644 --- a/src/java/org/apache/fop/pdf/PDFText.java +++ b/src/java/org/apache/fop/pdf/PDFText.java @@ -213,7 +213,7 @@ public class PDFText extends PDFObject { */ public static final void toUnicodeHex(char c, StringBuffer sb) { for (int i = 0; i < 4; ++i) { - sb.append(DIGITS[(c >> (12-4*i)) & 0x0F]); + sb.append(DIGITS[(c >> (12 - 4 * i)) & 0x0F]); } } diff --git a/src/java/org/apache/fop/pdf/PDFTextUtil.java b/src/java/org/apache/fop/pdf/PDFTextUtil.java index 1b960ebb5..aae214fd3 100644 --- a/src/java/org/apache/fop/pdf/PDFTextUtil.java +++ b/src/java/org/apache/fop/pdf/PDFTextUtil.java @@ -186,7 +186,7 @@ public abstract class PDFTextUtil { sb.append('/'); sb.append(fontName); sb.append(' '); - PDFNumber.doubleOut(fontSize,6,sb); + PDFNumber.doubleOut(fontSize, 6, sb); sb.append(" Tf\n"); write(sb); this.startText = useMultiByte ? "<" : "("; diff --git a/src/java/org/apache/fop/render/ps/PSTextPainter.java b/src/java/org/apache/fop/render/ps/PSTextPainter.java index 9abe37ed7..eb2188026 100644 --- a/src/java/org/apache/fop/render/ps/PSTextPainter.java +++ b/src/java/org/apache/fop/render/ps/PSTextPainter.java @@ -38,6 +38,10 @@ import java.util.List; import org.apache.batik.gvt.font.GVTGlyphVector; import org.apache.batik.gvt.text.TextPaintInfo; import org.apache.batik.gvt.text.TextSpanLayout; + +import org.apache.xmlgraphics.java2d.ps.PSGraphics2D; +import org.apache.xmlgraphics.ps.PSGenerator; + import org.apache.fop.fonts.Font; import org.apache.fop.fonts.FontInfo; import org.apache.fop.fonts.FontMetrics; @@ -46,8 +50,6 @@ import org.apache.fop.fonts.MultiByteFont; import org.apache.fop.svg.NativeTextPainter; import org.apache.fop.util.CharUtilities; import org.apache.fop.util.HexEncoder; -import org.apache.xmlgraphics.java2d.ps.PSGraphics2D; -import org.apache.xmlgraphics.ps.PSGenerator; /** * Renders the attributed character iterator of a {@link org.apache.batik.gvt.TextNode TextNode}. diff --git a/status.xml b/status.xml index caec3a862..925ba4c17 100644 --- a/status.xml +++ b/status.xml @@ -59,6 +59,9 @@ documents. Example: the fix of marks layering will be such a case when it's done. --> + + Fix checkstyle and findbugs warnings. + Cache matched lookups, assembled lookup spec uses; reduce glyph processing state allocation. -- 2.39.5