From: Simon Pepping Date: Wed, 17 Nov 2010 19:45:27 +0000 (+0000) Subject: findbugs-reported bug squashing; 959 bugs left (findbugs 1.3.9) X-Git-Tag: fop-1_1rc1old~409 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cfa853d5b2a728fa90c12cd1a44ca1a3eec1a12e;p=xmlgraphics-fop.git findbugs-reported bug squashing; 959 bugs left (findbugs 1.3.9) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1036179 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/checkstyle-5.1.xml b/checkstyle-5.1.xml index dab1e5ebb..8a393d452 100644 --- a/checkstyle-5.1.xml +++ b/checkstyle-5.1.xml @@ -96,7 +96,7 @@ - + diff --git a/examples/embedding/java/embedding/ExampleFO2PDF.java b/examples/embedding/java/embedding/ExampleFO2PDF.java index 6ae674908..20d27c128 100644 --- a/examples/embedding/java/embedding/ExampleFO2PDF.java +++ b/examples/embedding/java/embedding/ExampleFO2PDF.java @@ -94,8 +94,8 @@ public class ExampleFO2PDF { for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) { PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next(); System.out.println("PageSequence " - + (String.valueOf(pageSequenceResults.getID()).length() > 0 - ? pageSequenceResults.getID() : "") + + (String.valueOf(pageSequenceResults.getId()).length() > 0 + ? pageSequenceResults.getId() : "") + " generated " + pageSequenceResults.getPageCount() + " pages."); } System.out.println("Generated " + foResults.getPageCount() + " pages in total."); diff --git a/examples/embedding/java/embedding/MultipleFO2PDF.java b/examples/embedding/java/embedding/MultipleFO2PDF.java index a9ace7cf0..0da9ae14c 100644 --- a/examples/embedding/java/embedding/MultipleFO2PDF.java +++ b/examples/embedding/java/embedding/MultipleFO2PDF.java @@ -147,8 +147,8 @@ public class MultipleFO2PDF { for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) { PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next(); System.out.println("PageSequence " - + (String.valueOf(pageSequenceResults.getID()).length() > 0 - ? pageSequenceResults.getID() : "") + + (String.valueOf(pageSequenceResults.getId()).length() > 0 + ? pageSequenceResults.getId() : "") + " generated " + pageSequenceResults.getPageCount() + " pages."); } System.out.println("Generated " + foResults.getPageCount() + " pages in total."); diff --git a/src/java/org/apache/fop/afp/AbstractAFPPainter.java b/src/java/org/apache/fop/afp/AbstractAFPPainter.java index e0da25ff9..a2a128be5 100644 --- a/src/java/org/apache/fop/afp/AbstractAFPPainter.java +++ b/src/java/org/apache/fop/afp/AbstractAFPPainter.java @@ -30,7 +30,7 @@ import org.apache.commons.logging.LogFactory; public abstract class AbstractAFPPainter { /** Static logging instance */ - protected static Log log = LogFactory.getLog("org.apache.xmlgraphics.afp"); + protected static final Log log = LogFactory.getLog("org.apache.xmlgraphics.afp"); /** data stream */ protected final DataStream dataStream; diff --git a/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java b/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java index 4b1439da0..af679fa25 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java +++ b/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java @@ -45,7 +45,7 @@ public abstract class AbstractAFPObject implements Streamable { protected static final byte SF_CLASS = (byte)0xD3; /** the structure field header */ - protected static final byte[] SF_HEADER = new byte[] { + static final byte[] SF_HEADER = new byte[] { 0x5A, // Structured field identifier 0x00, // Length byte 1 0x10, // Length byte 2 diff --git a/src/java/org/apache/fop/apps/PageSequenceResults.java b/src/java/org/apache/fop/apps/PageSequenceResults.java index 241f4a5f9..f94fe8fdb 100644 --- a/src/java/org/apache/fop/apps/PageSequenceResults.java +++ b/src/java/org/apache/fop/apps/PageSequenceResults.java @@ -44,7 +44,7 @@ public class PageSequenceResults { * * @return The ID */ - public String getID() { + public String getId() { return this.id; } diff --git a/src/java/org/apache/fop/area/Area.java b/src/java/org/apache/fop/area/Area.java index ddf2f5198..f94c68454 100644 --- a/src/java/org/apache/fop/area/Area.java +++ b/src/java/org/apache/fop/area/Area.java @@ -38,6 +38,9 @@ import org.apache.fop.traits.BorderProps; * Base object for all areas. */ public class Area extends AreaTreeObject implements Serializable { + + private static final long serialVersionUID = 6342888466142626492L; + // stacking directions /** * Stacking left to right @@ -134,7 +137,7 @@ public class Area extends AreaTreeObject implements Serializable { /** * logging instance */ - protected static Log log = LogFactory.getLog(Area.class); + protected static final Log log = LogFactory.getLog(Area.class); /** diff --git a/src/java/org/apache/fop/area/AreaTreeModel.java b/src/java/org/apache/fop/area/AreaTreeModel.java index e5f6db17b..8659b4cca 100644 --- a/src/java/org/apache/fop/area/AreaTreeModel.java +++ b/src/java/org/apache/fop/area/AreaTreeModel.java @@ -42,7 +42,7 @@ public class AreaTreeModel { protected PageSequence currentPageSequence; // private List offDocumentItems = new java.util.ArrayList(); /** logger instance */ - protected static Log log = LogFactory.getLog(AreaTreeModel.class); + protected static final Log log = LogFactory.getLog(AreaTreeModel.class); /** * Create a new store pages model diff --git a/src/java/org/apache/fop/area/AreaTreeParser.java b/src/java/org/apache/fop/area/AreaTreeParser.java index 31c0e04fc..ae7c0a7c3 100644 --- a/src/java/org/apache/fop/area/AreaTreeParser.java +++ b/src/java/org/apache/fop/area/AreaTreeParser.java @@ -98,7 +98,7 @@ import org.apache.fop.util.XMLUtil; public class AreaTreeParser { /** Logger instance */ - protected static Log log = LogFactory.getLog(AreaTreeParser.class); + protected static final Log log = LogFactory.getLog(AreaTreeParser.class); private static SAXTransformerFactory tFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); diff --git a/src/java/org/apache/fop/area/BeforeFloat.java b/src/java/org/apache/fop/area/BeforeFloat.java index 490476368..b64eff556 100644 --- a/src/java/org/apache/fop/area/BeforeFloat.java +++ b/src/java/org/apache/fop/area/BeforeFloat.java @@ -25,6 +25,9 @@ package org.apache.fop.area; * See fo:region-body definition in the XSL Rec for more information. */ public class BeforeFloat extends BlockParent { + + private static final long serialVersionUID = 4101415711488333380L; + // this is an optional block area that will be rendered // as the separator only if there are float areas private Block separator = null; diff --git a/src/java/org/apache/fop/area/Block.java b/src/java/org/apache/fop/area/Block.java index ecb9c4990..e37931510 100644 --- a/src/java/org/apache/fop/area/Block.java +++ b/src/java/org/apache/fop/area/Block.java @@ -32,6 +32,9 @@ package org.apache.fop.area; * It holds child block areas such as other blocks or lines. */ public class Block extends BlockParent { + + private static final long serialVersionUID = 6843727817993665788L; + /** * Normally stacked with other blocks. */ diff --git a/src/java/org/apache/fop/area/BlockParent.java b/src/java/org/apache/fop/area/BlockParent.java index 1be0b785d..f2cf01cf2 100644 --- a/src/java/org/apache/fop/area/BlockParent.java +++ b/src/java/org/apache/fop/area/BlockParent.java @@ -27,6 +27,11 @@ import java.util.List; */ public class BlockParent extends Area { + /** + * + */ + private static final long serialVersionUID = 7076916890348533805L; + // this position is used for absolute position // or as an indent // this has the size in the block progression dimension diff --git a/src/java/org/apache/fop/area/BlockViewport.java b/src/java/org/apache/fop/area/BlockViewport.java index 60bf1fb22..032b39f95 100644 --- a/src/java/org/apache/fop/area/BlockViewport.java +++ b/src/java/org/apache/fop/area/BlockViewport.java @@ -25,6 +25,9 @@ package org.apache.fop.area; * The block-container creates this area. */ public class BlockViewport extends Block { + + private static final long serialVersionUID = -7840580922580735157L; + // clipping for this viewport private boolean clip = false; // transform if rotated or absolute diff --git a/src/java/org/apache/fop/area/BodyRegion.java b/src/java/org/apache/fop/area/BodyRegion.java index 7b183a188..2dd8a9a7c 100644 --- a/src/java/org/apache/fop/area/BodyRegion.java +++ b/src/java/org/apache/fop/area/BodyRegion.java @@ -30,6 +30,9 @@ import org.apache.fop.fo.pagination.RegionBody; * See fo:region-body definition in the XSL Rec for more information. */ public class BodyRegion extends RegionReference { + + private static final long serialVersionUID = -1848872997724078080L; + private BeforeFloat beforeFloat; // optional private MainReference mainReference; // mandatory private Footnote footnote; // optional diff --git a/src/java/org/apache/fop/area/CTM.java b/src/java/org/apache/fop/area/CTM.java index 099ab38fa..eb6207c42 100644 --- a/src/java/org/apache/fop/area/CTM.java +++ b/src/java/org/apache/fop/area/CTM.java @@ -34,6 +34,8 @@ import org.apache.fop.fo.Constants; */ public class CTM implements Serializable { + private static final long serialVersionUID = -8743287485623778341L; + private double a, b, c, d, e, f; private static final CTM CTM_LRTB = new CTM(1, 0, 0, 1, 0, 0); diff --git a/src/java/org/apache/fop/area/Footnote.java b/src/java/org/apache/fop/area/Footnote.java index a25f5467e..72b9f2ed0 100644 --- a/src/java/org/apache/fop/area/Footnote.java +++ b/src/java/org/apache/fop/area/Footnote.java @@ -27,6 +27,9 @@ package org.apache.fop.area; * See fo:region-body definition in the XSL Rec for more information. */ public class Footnote extends BlockParent { + + private static final long serialVersionUID = -7907428219886367161L; + private Block separator = null; // footnote has an optional separator diff --git a/src/java/org/apache/fop/area/LineArea.java b/src/java/org/apache/fop/area/LineArea.java index 0e6e6ac30..4d622bcec 100644 --- a/src/java/org/apache/fop/area/LineArea.java +++ b/src/java/org/apache/fop/area/LineArea.java @@ -32,12 +32,17 @@ import java.util.List; */ public class LineArea extends Area { + private static final long serialVersionUID = 7670235908329290684L; + /** * this class stores information about line width and potential adjustments * that can be used in order to re-compute adjustement and / or indents when a * page-number or a page-number-citation is resolved */ private final class LineAdjustingInfo implements Serializable { + + private static final long serialVersionUID = -6103629976229458273L; + private int lineAlignment; private int difference; private int availableStretch; diff --git a/src/java/org/apache/fop/area/LinkResolver.java b/src/java/org/apache/fop/area/LinkResolver.java index 51a952ddc..70bdfdf91 100644 --- a/src/java/org/apache/fop/area/LinkResolver.java +++ b/src/java/org/apache/fop/area/LinkResolver.java @@ -33,6 +33,9 @@ import org.apache.fop.area.Area; * Link resolving for resolving internal links. */ public class LinkResolver implements Resolvable, Serializable { + + private static final long serialVersionUID = -7102134165192960718L; + private boolean resolved = false; private String idRef; private Area area; diff --git a/src/java/org/apache/fop/area/MainReference.java b/src/java/org/apache/fop/area/MainReference.java index dd53113af..87e594169 100644 --- a/src/java/org/apache/fop/area/MainReference.java +++ b/src/java/org/apache/fop/area/MainReference.java @@ -31,6 +31,8 @@ import java.util.List; */ public class MainReference extends Area { + private static final long serialVersionUID = 7635126485620012448L; + private BodyRegion parent; private List spanAreas = new java.util.ArrayList(); private boolean isEmpty = true; diff --git a/src/java/org/apache/fop/area/NormalFlow.java b/src/java/org/apache/fop/area/NormalFlow.java index 5e0192389..3daf2dafd 100644 --- a/src/java/org/apache/fop/area/NormalFlow.java +++ b/src/java/org/apache/fop/area/NormalFlow.java @@ -25,6 +25,9 @@ package org.apache.fop.area; * See fo:region-body definition in the XSL Rec for more information. */ public class NormalFlow extends BlockParent { + + private static final long serialVersionUID = -3753538631016929004L; + /** * Constructor. * @param ipd of Normal flow object diff --git a/src/java/org/apache/fop/area/Page.java b/src/java/org/apache/fop/area/Page.java index 4607dfb74..242123baa 100644 --- a/src/java/org/apache/fop/area/Page.java +++ b/src/java/org/apache/fop/area/Page.java @@ -47,6 +47,9 @@ import org.apache.fop.layoutmgr.TraitSetter; * the top level page and regions. */ public class Page extends AreaTreeObject implements Serializable, Cloneable { + + private static final long serialVersionUID = 6272157047421543866L; + // contains before, start, body, end and after regions private RegionViewport regionBefore = null; private RegionViewport regionStart = null; diff --git a/src/java/org/apache/fop/area/PageViewport.java b/src/java/org/apache/fop/area/PageViewport.java index bccae8754..a4fcb61a8 100644 --- a/src/java/org/apache/fop/area/PageViewport.java +++ b/src/java/org/apache/fop/area/PageViewport.java @@ -87,7 +87,7 @@ public class PageViewport extends AreaTreeObject implements Resolvable, Cloneabl /** * logging instance */ - protected static Log log = LogFactory.getLog(PageViewport.class); + protected static final Log log = LogFactory.getLog(PageViewport.class); /** * Create a page viewport. diff --git a/src/java/org/apache/fop/area/RegionReference.java b/src/java/org/apache/fop/area/RegionReference.java index 200f0bff3..0aec7a395 100644 --- a/src/java/org/apache/fop/area/RegionReference.java +++ b/src/java/org/apache/fop/area/RegionReference.java @@ -31,13 +31,14 @@ import org.apache.fop.fo.pagination.Region; */ public class RegionReference extends Area implements Cloneable { + private static final long serialVersionUID = -298980963268244238L; + /** Reference to the region FO. */ //protected Region regionFO; private int regionClass; private String regionName; private CTM ctm; - // the list of block areas from the static flow private ArrayList blocks = new ArrayList(); diff --git a/src/java/org/apache/fop/area/RegionViewport.java b/src/java/org/apache/fop/area/RegionViewport.java index d55ecefbb..0654c5f6b 100644 --- a/src/java/org/apache/fop/area/RegionViewport.java +++ b/src/java/org/apache/fop/area/RegionViewport.java @@ -30,6 +30,9 @@ import java.util.HashMap; * in the fo:region-body description in the XSL Recommendation. */ public class RegionViewport extends Area implements Cloneable { + + private static final long serialVersionUID = 505781815165102572L; + // this rectangle is relative to the page private RegionReference regionReference; private Rectangle2D viewArea; diff --git a/src/java/org/apache/fop/area/Span.java b/src/java/org/apache/fop/area/Span.java index 69b37f4b3..e2ef90432 100644 --- a/src/java/org/apache/fop/area/Span.java +++ b/src/java/org/apache/fop/area/Span.java @@ -30,6 +30,9 @@ import java.util.List; * See fo:region-body definition in the XSL Rec for more information. */ public class Span extends Area { + + private static final long serialVersionUID = -5551430053660081549L; + // the list of flow reference areas in this span area private List flowAreas; private int colCount; diff --git a/src/java/org/apache/fop/area/Trait.java b/src/java/org/apache/fop/area/Trait.java index 42c5462e4..4ad03b468 100644 --- a/src/java/org/apache/fop/area/Trait.java +++ b/src/java/org/apache/fop/area/Trait.java @@ -36,6 +36,8 @@ import org.apache.fop.util.ColorUtil; */ public final class Trait implements Serializable { + private static final long serialVersionUID = 3234280285391611437L; + private Trait() { } @@ -313,6 +315,8 @@ public final class Trait implements Serializable { */ public static class InternalLink implements Serializable { + private static final long serialVersionUID = -8993505060996723039L; + /** The unique key of the PageViewport. */ private String pvKey; @@ -447,6 +451,8 @@ public final class Trait implements Serializable { */ public static class ExternalLink implements Serializable { + private static final long serialVersionUID = -3720707599232620946L; + private String destination; private boolean newWindow; @@ -520,6 +526,8 @@ public final class Trait implements Serializable { */ public static class Background implements Serializable { + private static final long serialVersionUID = 8452078676273242870L; + /** The background color if any. */ private Color color = null; diff --git a/src/java/org/apache/fop/area/inline/AbstractTextArea.java b/src/java/org/apache/fop/area/inline/AbstractTextArea.java index b50f53a24..08997a817 100644 --- a/src/java/org/apache/fop/area/inline/AbstractTextArea.java +++ b/src/java/org/apache/fop/area/inline/AbstractTextArea.java @@ -24,6 +24,8 @@ package org.apache.fop.area.inline; */ public abstract class AbstractTextArea extends InlineParent { + private static final long serialVersionUID = -1246306443569094371L; + /** * this class stores information about spaces and potential adjustments * that can be used in order to re-compute adjustments when a @@ -31,6 +33,8 @@ public abstract class AbstractTextArea extends InlineParent { */ protected class TextAdjustingInfo extends InlineAdjustingInfo { + private static final long serialVersionUID = -2412095162983479947L; + /** difference between the optimal width of a space * and the default width of a space according to the font * (this is equivalent to the property word-spacing.optimum) diff --git a/src/java/org/apache/fop/area/inline/Anchor.java b/src/java/org/apache/fop/area/inline/Anchor.java index ec6dbbcfb..8ad663111 100644 --- a/src/java/org/apache/fop/area/inline/Anchor.java +++ b/src/java/org/apache/fop/area/inline/Anchor.java @@ -25,6 +25,8 @@ package org.apache.fop.area.inline; */ public class Anchor extends InlineArea { + private static final long serialVersionUID = 5227798744787823499L; + // has a keep with adjacent area // has reference to associated footnote or float out-of-line area diff --git a/src/java/org/apache/fop/area/inline/Container.java b/src/java/org/apache/fop/area/inline/Container.java index 98c0aaef0..f6dbf3a15 100644 --- a/src/java/org/apache/fop/area/inline/Container.java +++ b/src/java/org/apache/fop/area/inline/Container.java @@ -32,6 +32,9 @@ import java.util.ArrayList; * This allows an inline area to have blocks as children. */ public class Container extends Area { + + private static final long serialVersionUID = 5256423939348189260L; + /** * The list of block areas stacked inside this container */ diff --git a/src/java/org/apache/fop/area/inline/FilledArea.java b/src/java/org/apache/fop/area/inline/FilledArea.java index 7df62e79b..06d0d3aa3 100644 --- a/src/java/org/apache/fop/area/inline/FilledArea.java +++ b/src/java/org/apache/fop/area/inline/FilledArea.java @@ -34,6 +34,9 @@ import java.util.Iterator; * this as a normal inline parent. */ public class FilledArea extends InlineParent { + + private static final long serialVersionUID = 8586584705587017474L; + private int unitWidth; /** diff --git a/src/java/org/apache/fop/area/inline/Image.java b/src/java/org/apache/fop/area/inline/Image.java index 7d802db49..baf3c183b 100644 --- a/src/java/org/apache/fop/area/inline/Image.java +++ b/src/java/org/apache/fop/area/inline/Image.java @@ -27,6 +27,9 @@ import org.apache.fop.area.Area; * The url of the image is used as a key to reference the image cache. */ public class Image extends Area { + + private static final long serialVersionUID = 4800834714349695386L; + private String url; /** diff --git a/src/java/org/apache/fop/area/inline/InlineArea.java b/src/java/org/apache/fop/area/inline/InlineArea.java index 30afc149b..0889d1dad 100644 --- a/src/java/org/apache/fop/area/inline/InlineArea.java +++ b/src/java/org/apache/fop/area/inline/InlineArea.java @@ -32,12 +32,17 @@ import org.apache.fop.area.Trait; */ public class InlineArea extends Area { + private static final long serialVersionUID = -8940066479810170980L; + /** * this class stores information about potential adjustments * that can be used in order to re-compute adjustments when a * page-number or a page-number-citation is resolved */ protected class InlineAdjustingInfo implements Serializable { + + private static final long serialVersionUID = -5601387735459712149L; + /** stretch of the inline area */ protected int availableStretch; /** shrink of the inline area */ diff --git a/src/java/org/apache/fop/area/inline/InlineBlockParent.java b/src/java/org/apache/fop/area/inline/InlineBlockParent.java index e580b1667..fe024ac0f 100644 --- a/src/java/org/apache/fop/area/inline/InlineBlockParent.java +++ b/src/java/org/apache/fop/area/inline/InlineBlockParent.java @@ -29,6 +29,9 @@ import org.apache.fop.area.Block; */ public class InlineBlockParent extends InlineArea { + + private static final long serialVersionUID = -3661746143321407377L; + /** * The list of inline areas added to this inline parent. */ diff --git a/src/java/org/apache/fop/area/inline/InlineParent.java b/src/java/org/apache/fop/area/inline/InlineParent.java index cbc5b578c..5d4369103 100644 --- a/src/java/org/apache/fop/area/inline/InlineParent.java +++ b/src/java/org/apache/fop/area/inline/InlineParent.java @@ -29,6 +29,9 @@ import java.util.ArrayList; * This is an inline area that can have other inlines as children. */ public class InlineParent extends InlineArea { + + private static final long serialVersionUID = -3047168298770354813L; + /** * The list of inline areas added to this inline parent. */ diff --git a/src/java/org/apache/fop/area/inline/Leader.java b/src/java/org/apache/fop/area/inline/Leader.java index cd7b2e9f3..ff8ba12b0 100644 --- a/src/java/org/apache/fop/area/inline/Leader.java +++ b/src/java/org/apache/fop/area/inline/Leader.java @@ -32,6 +32,9 @@ public class Leader extends InlineArea { // if space replaced with a space // otherwise this is a holder for a line + + private static final long serialVersionUID = -8011373048313956301L; + private int ruleStyle = Constants.EN_SOLID; private int ruleThickness = 1000; diff --git a/src/java/org/apache/fop/area/inline/Space.java b/src/java/org/apache/fop/area/inline/Space.java index 9a24de0d3..bf683bb22 100644 --- a/src/java/org/apache/fop/area/inline/Space.java +++ b/src/java/org/apache/fop/area/inline/Space.java @@ -25,4 +25,6 @@ package org.apache.fop.area.inline; */ public class Space extends InlineArea { + private static final long serialVersionUID = -8748265505356839796L; + } diff --git a/src/java/org/apache/fop/area/inline/SpaceArea.java b/src/java/org/apache/fop/area/inline/SpaceArea.java index 202408deb..6f0863789 100644 --- a/src/java/org/apache/fop/area/inline/SpaceArea.java +++ b/src/java/org/apache/fop/area/inline/SpaceArea.java @@ -24,6 +24,8 @@ package org.apache.fop.area.inline; */ public class SpaceArea extends InlineArea { + private static final long serialVersionUID = 2218803009825411416L; + /** * The space for this space area */ diff --git a/src/java/org/apache/fop/area/inline/TextArea.java b/src/java/org/apache/fop/area/inline/TextArea.java index f736b894c..8fb9455ad 100644 --- a/src/java/org/apache/fop/area/inline/TextArea.java +++ b/src/java/org/apache/fop/area/inline/TextArea.java @@ -24,6 +24,8 @@ package org.apache.fop.area.inline; */ public class TextArea extends AbstractTextArea { + private static final long serialVersionUID = 7315900267242540809L; + /** * Create a text inline area */ diff --git a/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java b/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java index 43a995670..3457ad698 100644 --- a/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java +++ b/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java @@ -32,6 +32,9 @@ import java.util.List; */ public class UnresolvedPageNumber extends TextArea implements Resolvable { + + private static final long serialVersionUID = -1758090835371647980L; + private boolean resolved = false; private String pageIDRef; private String text; diff --git a/src/java/org/apache/fop/area/inline/Viewport.java b/src/java/org/apache/fop/area/inline/Viewport.java index 489f5afda..206a965e2 100644 --- a/src/java/org/apache/fop/area/inline/Viewport.java +++ b/src/java/org/apache/fop/area/inline/Viewport.java @@ -32,6 +32,9 @@ import java.util.HashMap; * holds the area and positions it. */ public class Viewport extends InlineArea { + + private static final long serialVersionUID = 813338534627918689L; + // contents could be container, foreign object or image private Area content; // clipping for the viewport diff --git a/src/java/org/apache/fop/area/inline/WordArea.java b/src/java/org/apache/fop/area/inline/WordArea.java index 4737d81d3..8bb6888ce 100644 --- a/src/java/org/apache/fop/area/inline/WordArea.java +++ b/src/java/org/apache/fop/area/inline/WordArea.java @@ -24,6 +24,8 @@ package org.apache.fop.area.inline; */ public class WordArea extends InlineArea { + private static final long serialVersionUID = 6444644662158970942L; + /** The text for this word area */ protected String word; diff --git a/src/java/org/apache/fop/cli/CommandLineOptions.java b/src/java/org/apache/fop/cli/CommandLineOptions.java index 2a5c0d272..eff7b76f0 100644 --- a/src/java/org/apache/fop/cli/CommandLineOptions.java +++ b/src/java/org/apache/fop/cli/CommandLineOptions.java @@ -89,23 +89,23 @@ public class CommandLineOptions { /* user configuration file */ private File userConfigFile = null; /* input fo file */ - private File fofile = null; + private File foFile = null; /* xsltfile (xslt transformation as input) */ - private File xsltfile = null; + private File xsltFile = null; /* xml file (xslt transformation as input) */ - private File xmlfile = null; + private File xmlFile = null; /* area tree input file */ - private File areatreefile = null; + private File areatreeFile = null; /* intermediate format input file */ - private File iffile = null; + private File ifFile = null; /* area tree input file */ - private File imagefile = null; + private File imageFile = null; /* output file */ - private File outfile = null; + private File outFile = null; /* input mode */ - private int inputmode = NOT_SET; + private int inputMode = NOT_SET; /* output mode */ - private String outputmode = null; + private String outputMode = null; /* true if System.in (stdin) should be used for the input file */ private boolean useStdIn = false; /* true if System.out (stdout) should be used for the output file */ @@ -194,7 +194,7 @@ public class CommandLineOptions { inputHandler = createInputHandler(); - if (MimeConstants.MIME_FOP_AWT_PREVIEW.equals(outputmode)) { + if (MimeConstants.MIME_FOP_AWT_PREVIEW.equals(outputMode)) { //set the system look&feel for the preview dialog try { UIManager.setLookAndFeel( @@ -207,7 +207,7 @@ public class CommandLineOptions { renderer.setRenderable(inputHandler); //set before user agent! renderer.setUserAgent(foUserAgent); foUserAgent.setRendererOverride(renderer); - } else if (MimeConstants.MIME_FOP_AREA_TREE.equals(outputmode) + } else if (MimeConstants.MIME_FOP_AREA_TREE.equals(outputMode) && mimicRenderer != null) { // render from FO to Intermediate Format Renderer targetRenderer = foUserAgent.getRendererFactory().createRenderer( @@ -220,7 +220,7 @@ public class CommandLineOptions { //Make sure the prepared XMLRenderer is used foUserAgent.setRendererOverride(xmlRenderer); - } else if (MimeConstants.MIME_FOP_IF.equals(outputmode) + } else if (MimeConstants.MIME_FOP_IF.equals(outputMode) && mimicRenderer != null) { // render from FO to Intermediate Format IFSerializer serializer = new IFSerializer(); @@ -447,7 +447,7 @@ public class CommandLineOptions { if (isSystemInOutFile(filename)) { this.useStdIn = true; } else { - fofile = new File(filename); + foFile = new File(filename); } return 1; } @@ -460,7 +460,7 @@ public class CommandLineOptions { throw new FOPException("you must specify the stylesheet " + "file for the '-xsl' option"); } else { - xsltfile = new File(args[i + 1]); + xsltFile = new File(args[i + 1]); return 1; } } @@ -476,7 +476,7 @@ public class CommandLineOptions { if (isSystemInOutFile(filename)) { this.useStdIn = true; } else { - xmlfile = new File(filename); + xmlFile = new File(filename); } return 1; } @@ -508,7 +508,7 @@ public class CommandLineOptions { if (isSystemInOutFile(filename)) { this.useStdOut = true; } else { - outfile = new File(filename); + outFile = new File(filename); } } @@ -701,16 +701,16 @@ public class CommandLineOptions { } private int parseUnknownOption(String[] args, int i) throws FOPException { - if (inputmode == NOT_SET) { - inputmode = FO_INPUT; + if (inputMode == NOT_SET) { + inputMode = FO_INPUT; String filename = args[i]; if (isSystemInOutFile(filename)) { this.useStdIn = true; } else { - fofile = new File(filename); + foFile = new File(filename); } - } else if (outputmode == null) { - outputmode = MimeConstants.MIME_PDF; + } else if (outputMode == null) { + outputMode = MimeConstants.MIME_PDF; setOutputFile(args[i]); } else { throw new FOPException("Don't know what to do with " @@ -765,7 +765,7 @@ public class CommandLineOptions { if (isSystemInOutFile(filename)) { this.useStdIn = true; } else { - areatreefile = new File(filename); + areatreeFile = new File(filename); } return 1; } @@ -781,7 +781,7 @@ public class CommandLineOptions { if (isSystemInOutFile(filename)) { this.useStdIn = true; } else { - iffile = new File(filename); + ifFile = new File(filename); } return 1; } @@ -797,7 +797,7 @@ public class CommandLineOptions { if (isSystemInOutFile(filename)) { this.useStdIn = true; } else { - imagefile = new File(filename); + imageFile = new File(filename); } return 1; } @@ -867,8 +867,8 @@ public class CommandLineOptions { } private void setOutputMode(String mime) throws FOPException { - if (outputmode == null) { - outputmode = mime; + if (outputMode == null) { + outputMode = mime; } else { throw new FOPException("you can only set one output method"); } @@ -896,8 +896,8 @@ public class CommandLineOptions { } private void setInputFormat(int format) throws FOPException { - if (inputmode == NOT_SET || inputmode == format) { - inputmode = format; + if (inputMode == NOT_SET || inputMode == format) { + inputMode = format; } else { throw new FOPException("Only one input mode can be specified!"); } @@ -907,100 +907,100 @@ public class CommandLineOptions { * checks whether all necessary information has been given in a consistent way */ private void checkSettings() throws FOPException, FileNotFoundException { - if (inputmode == NOT_SET) { + if (inputMode == NOT_SET) { throw new FOPException("No input file specified"); } - if (outputmode == null) { + if (outputMode == null) { throw new FOPException("No output file specified"); } - if ((outputmode.equals(MimeConstants.MIME_FOP_AWT_PREVIEW) - || outputmode.equals(MimeConstants.MIME_FOP_PRINT)) - && outfile != null) { + if ((outputMode.equals(MimeConstants.MIME_FOP_AWT_PREVIEW) + || outputMode.equals(MimeConstants.MIME_FOP_PRINT)) + && outFile != null) { throw new FOPException("Output file may not be specified " + "for AWT or PRINT output"); } - if (inputmode == XSLT_INPUT) { + if (inputMode == XSLT_INPUT) { // check whether xml *and* xslt file have been set - if (xmlfile == null && !this.useStdIn) { + if (xmlFile == null && !this.useStdIn) { throw new FOPException("XML file must be specified for the transform mode"); } - if (xsltfile == null) { + if (xsltFile == null) { throw new FOPException("XSLT file must be specified for the transform mode"); } // warning if fofile has been set in xslt mode - if (fofile != null) { + if (foFile != null) { log.warn("Can't use fo file with transform mode! Ignoring.\n" + "Your input is " + "\n xmlfile: " - + xmlfile.getAbsolutePath() + + xmlFile.getAbsolutePath() + "\nxsltfile: " - + xsltfile.getAbsolutePath() + + xsltFile.getAbsolutePath() + "\n fofile: " - + fofile.getAbsolutePath()); + + foFile.getAbsolutePath()); } - if (xmlfile != null && !xmlfile.exists()) { + if (xmlFile != null && !xmlFile.exists()) { throw new FileNotFoundException("Error: xml file " - + xmlfile.getAbsolutePath() + + xmlFile.getAbsolutePath() + " not found "); } - if (!xsltfile.exists()) { + if (!xsltFile.exists()) { throw new FileNotFoundException("Error: xsl file " - + xsltfile.getAbsolutePath() + + xsltFile.getAbsolutePath() + " not found "); } - } else if (inputmode == FO_INPUT) { - if (outputmode.equals(MimeConstants.MIME_XSL_FO)) { + } else if (inputMode == FO_INPUT) { + if (outputMode.equals(MimeConstants.MIME_XSL_FO)) { throw new FOPException( "FO output mode is only available if you use -xml and -xsl"); } - if (fofile != null && !fofile.exists()) { + if (foFile != null && !foFile.exists()) { throw new FileNotFoundException("Error: fo file " - + fofile.getAbsolutePath() + + foFile.getAbsolutePath() + " not found "); } - } else if (inputmode == AREATREE_INPUT) { - if (outputmode.equals(MimeConstants.MIME_XSL_FO)) { + } else if (inputMode == AREATREE_INPUT) { + if (outputMode.equals(MimeConstants.MIME_XSL_FO)) { throw new FOPException( "FO output mode is only available if you use -xml and -xsl"); - } else if (outputmode.equals(MimeConstants.MIME_FOP_AREA_TREE)) { + } else if (outputMode.equals(MimeConstants.MIME_FOP_AREA_TREE)) { throw new FOPException( "Area Tree Output is not available if Area Tree is used as input!"); } - if (areatreefile != null && !areatreefile.exists()) { + if (areatreeFile != null && !areatreeFile.exists()) { throw new FileNotFoundException("Error: area tree file " - + areatreefile.getAbsolutePath() + + areatreeFile.getAbsolutePath() + " not found "); } - } else if (inputmode == IF_INPUT) { - if (outputmode.equals(MimeConstants.MIME_XSL_FO)) { + } else if (inputMode == IF_INPUT) { + if (outputMode.equals(MimeConstants.MIME_XSL_FO)) { throw new FOPException( "FO output mode is only available if you use -xml and -xsl"); - } else if (outputmode.equals(MimeConstants.MIME_FOP_AREA_TREE)) { + } else if (outputMode.equals(MimeConstants.MIME_FOP_AREA_TREE)) { throw new FOPException( "Area Tree Output is not available if Intermediate Format" + " is used as input!"); - } else if (outputmode.equals(MimeConstants.MIME_FOP_IF)) { + } else if (outputMode.equals(MimeConstants.MIME_FOP_IF)) { throw new FOPException( "Intermediate Output is not available if Intermediate Format" + " is used as input!"); } - if (iffile != null && !iffile.exists()) { + if (ifFile != null && !ifFile.exists()) { throw new FileNotFoundException("Error: intermediate format file " - + iffile.getAbsolutePath() + + ifFile.getAbsolutePath() + " not found "); } - } else if (inputmode == IMAGE_INPUT) { - if (outputmode.equals(MimeConstants.MIME_XSL_FO)) { + } else if (inputMode == IMAGE_INPUT) { + if (outputMode.equals(MimeConstants.MIME_XSL_FO)) { throw new FOPException( "FO output mode is only available if you use -xml and -xsl"); } - if (imagefile != null && !imagefile.exists()) { + if (imageFile != null && !imageFile.exists()) { throw new FileNotFoundException("Error: image file " - + imagefile.getAbsolutePath() + + imageFile.getAbsolutePath() + " not found "); } } @@ -1027,13 +1027,13 @@ public class CommandLineOptions { * @throws FOPException for invalid output formats */ protected String getOutputFormat() throws FOPException { - if (outputmode == null) { + if (outputMode == null) { throw new FOPException("Renderer has not been set!"); } - if (outputmode.equals(MimeConstants.MIME_FOP_AREA_TREE)) { + if (outputMode.equals(MimeConstants.MIME_FOP_AREA_TREE)) { renderingOptions.put("fineDetail", isCoarseAreaXml()); } - return outputmode; + return outputMode; } /** @@ -1042,21 +1042,21 @@ public class CommandLineOptions { * @throws IllegalArgumentException if invalid/missing parameters */ private InputHandler createInputHandler() { - switch (inputmode) { + switch (inputMode) { case FO_INPUT: - return new InputHandler(fofile); + return new InputHandler(foFile); case AREATREE_INPUT: - return new AreaTreeInputHandler(areatreefile); + return new AreaTreeInputHandler(areatreeFile); case IF_INPUT: - return new IFInputHandler(iffile); + return new IFInputHandler(ifFile); case XSLT_INPUT: - InputHandler handler = new InputHandler(xmlfile, xsltfile, xsltParams); + InputHandler handler = new InputHandler(xmlFile, xsltFile, xsltParams); if (useCatalogResolver) { handler.createCatalogResolver(foUserAgent); } return handler; case IMAGE_INPUT: - return new ImageInputHandler(imagefile, xsltfile, xsltParams); + return new ImageInputHandler(imageFile, xsltFile, xsltParams); default: throw new IllegalArgumentException("Error creating InputHandler object."); } @@ -1074,24 +1074,24 @@ public class CommandLineOptions { * Returns the XSL-FO file if set. * @return the XSL-FO file, null if not set */ - public File getFOFile() { - return fofile; + public File getFoFile() { + return foFile; } /** * Returns the input XML file if set. * @return the input XML file, null if not set */ - public File getXMLFile() { - return xmlfile; + public File getXmlFile() { + return xmlFile; } /** * Returns the stylesheet to be used for transformation to XSL-FO. * @return stylesheet */ - public File getXSLFile() { - return xsltfile; + public File getXslFile() { + return xsltFile; } /** @@ -1099,7 +1099,7 @@ public class CommandLineOptions { * @return the output file */ public File getOutputFile() { - return outfile; + return outFile; } /** @@ -1139,13 +1139,13 @@ public class CommandLineOptions { * @return either the fofile or the xmlfile */ public File getInputFile() { - switch (inputmode) { + switch (inputMode) { case FO_INPUT: - return fofile; + return foFile; case XSLT_INPUT: - return xmlfile; + return xmlFile; default: - return fofile; + return foFile; } } @@ -1270,7 +1270,7 @@ public class CommandLineOptions { */ private void dumpConfiguration() { log.info("Input mode: "); - switch (inputmode) { + switch (inputMode) { case NOT_SET: log.info("not set"); break; @@ -1279,7 +1279,7 @@ public class CommandLineOptions { if (isInputFromStdIn()) { log.info("fo input file: from stdin"); } else { - log.info("fo input file: " + fofile.toString()); + log.info("fo input file: " + foFile.toString()); } break; case XSLT_INPUT: @@ -1287,16 +1287,16 @@ public class CommandLineOptions { if (isInputFromStdIn()) { log.info("xml input file: from stdin"); } else { - log.info("xml input file: " + xmlfile.toString()); + log.info("xml input file: " + xmlFile.toString()); } - log.info("xslt stylesheet: " + xsltfile.toString()); + log.info("xslt stylesheet: " + xsltFile.toString()); break; case AREATREE_INPUT: log.info("AT "); if (isInputFromStdIn()) { log.info("area tree input file: from stdin"); } else { - log.info("area tree input file: " + areatreefile.toString()); + log.info("area tree input file: " + areatreeFile.toString()); } break; case IF_INPUT: @@ -1304,7 +1304,7 @@ public class CommandLineOptions { if (isInputFromStdIn()) { log.info("intermediate input file: from stdin"); } else { - log.info("intermediate input file: " + iffile.toString()); + log.info("intermediate input file: " + ifFile.toString()); } break; case IMAGE_INPUT: @@ -1312,28 +1312,28 @@ public class CommandLineOptions { if (isInputFromStdIn()) { log.info("image input file: from stdin"); } else { - log.info("image input file: " + imagefile.toString()); + log.info("image input file: " + imageFile.toString()); } break; default: log.info("unknown input type"); } log.info("Output mode: "); - if (outputmode == null) { + if (outputMode == null) { log.info("not set"); - } else if (MimeConstants.MIME_FOP_AWT_PREVIEW.equals(outputmode)) { + } else if (MimeConstants.MIME_FOP_AWT_PREVIEW.equals(outputMode)) { log.info("awt on screen"); - if (outfile != null) { + if (outFile != null) { log.error("awt mode, but outfile is set:"); - log.error("out file: " + outfile.toString()); + log.error("out file: " + outFile.toString()); } - } else if (MimeConstants.MIME_FOP_PRINT.equals(outputmode)) { + } else if (MimeConstants.MIME_FOP_PRINT.equals(outputMode)) { log.info("print directly"); - if (outfile != null) { + if (outFile != null) { log.error("print mode, but outfile is set:"); - log.error("out file: " + outfile.toString()); + log.error("out file: " + outFile.toString()); } - } else if (MimeConstants.MIME_FOP_AREA_TREE.equals(outputmode)) { + } else if (MimeConstants.MIME_FOP_AREA_TREE.equals(outputMode)) { log.info("area tree"); if (mimicRenderer != null) { log.info("mimic renderer: " + mimicRenderer); @@ -1341,17 +1341,17 @@ public class CommandLineOptions { if (isOutputToStdOut()) { log.info("output file: to stdout"); } else { - log.info("output file: " + outfile.toString()); + log.info("output file: " + outFile.toString()); } - } else if (MimeConstants.MIME_FOP_IF.equals(outputmode)) { + } else if (MimeConstants.MIME_FOP_IF.equals(outputMode)) { log.info("intermediate format"); - log.info("output file: " + outfile.toString()); + log.info("output file: " + outFile.toString()); } else { - log.info(outputmode); + log.info(outputMode); if (isOutputToStdOut()) { log.info("output file: to stdout"); } else { - log.info("output file: " + outfile.toString()); + log.info("output file: " + outFile.toString()); } } diff --git a/src/java/org/apache/fop/datatypes/LengthBase.java b/src/java/org/apache/fop/datatypes/LengthBase.java index 137ca94fa..00eaee8c8 100644 --- a/src/java/org/apache/fop/datatypes/LengthBase.java +++ b/src/java/org/apache/fop/datatypes/LengthBase.java @@ -62,7 +62,7 @@ public class LengthBase implements PercentBase { /** * logging instance */ - protected static Log log = LogFactory.getLog(LengthBase.class); + protected static final Log log = LogFactory.getLog(LengthBase.class); /** * The FO for which this property is to be calculated. diff --git a/src/java/org/apache/fop/fo/FONode.java b/src/java/org/apache/fop/fo/FONode.java index a6be832f0..c9c04aa4e 100644 --- a/src/java/org/apache/fop/fo/FONode.java +++ b/src/java/org/apache/fop/fo/FONode.java @@ -69,7 +69,7 @@ public abstract class FONode implements Cloneable { protected Locator locator; /** Logger for fo-tree related messages **/ - protected static Log log = LogFactory.getLog(FONode.class); + protected static final Log log = LogFactory.getLog(FONode.class); /** * Base constructor diff --git a/src/java/org/apache/fop/fo/FOText.java b/src/java/org/apache/fop/fo/FOText.java index 5db11f731..c78421cbe 100644 --- a/src/java/org/apache/fop/fo/FOText.java +++ b/src/java/org/apache/fop/fo/FOText.java @@ -619,7 +619,7 @@ public class FOText extends FONode implements CharSequence { } /** @return the baseline-shift property */ - public Length getBaseLineShift() { + public Length getBaselineShift() { return baselineShift; } diff --git a/src/java/org/apache/fop/fo/extensions/xmp/XMPMetadata.java b/src/java/org/apache/fop/fo/extensions/xmp/XMPMetadata.java index 224741294..6dcc31385 100644 --- a/src/java/org/apache/fop/fo/extensions/xmp/XMPMetadata.java +++ b/src/java/org/apache/fop/fo/extensions/xmp/XMPMetadata.java @@ -33,6 +33,8 @@ import org.xml.sax.SAXException; */ public class XMPMetadata implements ExtensionAttachment, Serializable, XMLizable { + private static final long serialVersionUID = 591347206217931578L; + /** The category URI for this extension attachment. */ public static final String CATEGORY = XMPConstants.XMP_NAMESPACE; diff --git a/src/java/org/apache/fop/fo/properties/Property.java b/src/java/org/apache/fop/fo/properties/Property.java index 29e8faac5..a04f96a3c 100644 --- a/src/java/org/apache/fop/fo/properties/Property.java +++ b/src/java/org/apache/fop/fo/properties/Property.java @@ -36,7 +36,7 @@ import org.apache.fop.fo.Constants; public class Property { /** Logger for all property classes */ - protected static Log log = LogFactory.getLog(PropertyMaker.class); + protected static final Log log = LogFactory.getLog(PropertyMaker.class); /** * The original specified value for properties which inherit @@ -197,6 +197,6 @@ public class Property { if (obj != this) { return obj.toString(); } - return null; + return ""; } } diff --git a/src/java/org/apache/fop/fonts/FontInfo.java b/src/java/org/apache/fop/fonts/FontInfo.java index a7b840fcc..e36b5ff68 100644 --- a/src/java/org/apache/fop/fonts/FontInfo.java +++ b/src/java/org/apache/fop/fonts/FontInfo.java @@ -41,7 +41,7 @@ import org.apache.commons.logging.LogFactory; public class FontInfo { /** logging instance */ - protected static Log log = LogFactory.getLog(FontInfo.class); + protected static final Log log = LogFactory.getLog(FontInfo.class); /** Map containing fonts that have been used */ private Map/**/ usedFonts = null; //(String = font key) diff --git a/src/java/org/apache/fop/fonts/FontInfoConfigurator.java b/src/java/org/apache/fop/fonts/FontInfoConfigurator.java index 9a11f84bc..911e57646 100644 --- a/src/java/org/apache/fop/fonts/FontInfoConfigurator.java +++ b/src/java/org/apache/fop/fonts/FontInfoConfigurator.java @@ -44,7 +44,7 @@ import org.apache.fop.util.LogUtil; */ public class FontInfoConfigurator { /** logger instance */ - protected static Log log = LogFactory.getLog(FontInfoConfigurator.class); + protected static final Log log = LogFactory.getLog(FontInfoConfigurator.class); private Configuration cfg; private FontManager fontManager; diff --git a/src/java/org/apache/fop/fonts/FontLoader.java b/src/java/org/apache/fop/fonts/FontLoader.java index 93d4ae03f..02c09a1a1 100644 --- a/src/java/org/apache/fop/fonts/FontLoader.java +++ b/src/java/org/apache/fop/fonts/FontLoader.java @@ -40,7 +40,7 @@ import org.apache.fop.fonts.type1.Type1FontLoader; public abstract class FontLoader { /** logging instance */ - protected static Log log = LogFactory.getLog(FontLoader.class); + protected static final Log log = LogFactory.getLog(FontLoader.class); /** URI representing the font file */ protected String fontFileURI = null; diff --git a/src/java/org/apache/fop/fonts/apps/PFMReader.java b/src/java/org/apache/fop/fonts/apps/PFMReader.java index e5e8ca524..bc294057b 100644 --- a/src/java/org/apache/fop/fonts/apps/PFMReader.java +++ b/src/java/org/apache/fop/fonts/apps/PFMReader.java @@ -173,7 +173,7 @@ public class PFMReader extends AbstractFontReader { public void preview(PFMFile pfm) { if (log != null && log.isInfoEnabled()) { log.info("Font: " + pfm.getWindowsName()); - log.info("Name: " + pfm.getPostscriptName()); + log.info("Name: " + pfm.getPostScriptName()); log.info("CharSet: " + pfm.getCharSetName()); log.info("CapHeight: " + pfm.getCapHeight()); log.info("XHeight: " + pfm.getXHeight()); @@ -217,7 +217,7 @@ public class PFMReader extends AbstractFontReader { Element el = doc.createElement("font-name"); root.appendChild(el); - el.appendChild(doc.createTextNode(pfm.getPostscriptName())); + el.appendChild(doc.createTextNode(pfm.getPostScriptName())); // Currently unused. // String s = pfm.getPostscriptName(); diff --git a/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java b/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java index 313ad04a8..e018bb2c2 100644 --- a/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java +++ b/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java @@ -35,7 +35,7 @@ public class FontSubstitutions extends java.util.ArrayList/**/ { private static final long serialVersionUID = -9173104935431899722L; /** logging instance */ - protected static Log log = LogFactory.getLog(FontSubstitutions.class); + protected static final Log log = LogFactory.getLog(FontSubstitutions.class); /** * Adjusts a given fontInfo using this font substitution catalog diff --git a/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java b/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java index 29ae0556d..34e04eb67 100644 --- a/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java +++ b/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java @@ -30,7 +30,7 @@ import org.apache.commons.logging.LogFactory; public class FontWeightRange { /** logging instance */ - protected static Log log = LogFactory.getLog("org.apache.fop.render.fonts"); + protected static final Log log = LogFactory.getLog("org.apache.fop.render.fonts"); /** * Returns an FontWeightRange object holding the diff --git a/src/java/org/apache/fop/fonts/type1/PFMFile.java b/src/java/org/apache/fop/fonts/type1/PFMFile.java index d1a3d79ff..b5faddac1 100644 --- a/src/java/org/apache/fop/fonts/type1/PFMFile.java +++ b/src/java/org/apache/fop/fonts/type1/PFMFile.java @@ -38,7 +38,7 @@ public class PFMFile { // Header stuff private String windowsName; - private String postscriptName; + private String postScriptName; private short dfItalic; private int dfWeight; private short dfCharSet; @@ -164,7 +164,7 @@ public class PFMFile { inStream.reset(); inStream.skip(driverInfoOffset); - postscriptName = inStream.readString(); + postScriptName = inStream.readString(); if (extMetricsOffset != 0) { inStream.reset(); @@ -279,8 +279,8 @@ public class PFMFile { * * @return The Postscript name. */ - public String getPostscriptName() { - return postscriptName; + public String getPostScriptName() { + return postScriptName; } /** @@ -304,7 +304,7 @@ public class PFMFile { case 0: return "WinAnsi"; // AKA ISOAdobe case 2: - if ("Symbol".equals(getPostscriptName())) { + if ("Symbol".equals(getPostScriptName())) { return "Symbol"; } break; diff --git a/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java b/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java index d5036de7b..0c0c6187c 100644 --- a/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java +++ b/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java @@ -226,8 +226,8 @@ public class Type1FontLoader extends FontLoader { names.add(afm.getFamilyName()); returnFont.setFamilyNames(names); } else { - returnFont.setFontName(pfm.getPostscriptName()); - String fullName = pfm.getPostscriptName(); + returnFont.setFontName(pfm.getPostScriptName()); + String fullName = pfm.getPostScriptName(); fullName = fullName.replace('-', ' '); //Hack! Try to emulate full name returnFont.setFullName(fullName); //emulate afm.getFullName() Set names = new java.util.HashSet(); diff --git a/src/java/org/apache/fop/hyphenation/ByteVector.java b/src/java/org/apache/fop/hyphenation/ByteVector.java index d1448abdc..0df1bd925 100644 --- a/src/java/org/apache/fop/hyphenation/ByteVector.java +++ b/src/java/org/apache/fop/hyphenation/ByteVector.java @@ -29,6 +29,8 @@ import java.io.Serializable; */ public class ByteVector implements Serializable { + private static final long serialVersionUID = 1554572867863466772L; + /** * Capacity increment size */ diff --git a/src/java/org/apache/fop/hyphenation/CharVector.java b/src/java/org/apache/fop/hyphenation/CharVector.java index 0ba42362b..97a63392e 100644 --- a/src/java/org/apache/fop/hyphenation/CharVector.java +++ b/src/java/org/apache/fop/hyphenation/CharVector.java @@ -29,6 +29,8 @@ import java.io.Serializable; */ public class CharVector implements Cloneable, Serializable { + private static final long serialVersionUID = 4263472982169004048L; + /** * Capacity increment size */ diff --git a/src/java/org/apache/fop/hyphenation/Hyphen.java b/src/java/org/apache/fop/hyphenation/Hyphen.java index ca876e1ec..ae33ec616 100644 --- a/src/java/org/apache/fop/hyphenation/Hyphen.java +++ b/src/java/org/apache/fop/hyphenation/Hyphen.java @@ -39,6 +39,8 @@ import java.io.Serializable; */ public class Hyphen implements Serializable { + private static final long serialVersionUID = 8989909741110279085L; + /** pre break string */ public String preBreak; // CSOK: VisibilityModifier diff --git a/src/java/org/apache/fop/hyphenation/Hyphenator.java b/src/java/org/apache/fop/hyphenation/Hyphenator.java index 76e8b6327..455520b09 100644 --- a/src/java/org/apache/fop/hyphenation/Hyphenator.java +++ b/src/java/org/apache/fop/hyphenation/Hyphenator.java @@ -43,7 +43,7 @@ import org.xml.sax.InputSource; public final class Hyphenator { /** logging instance */ - protected static Log log = LogFactory.getLog(Hyphenator.class); + protected static final Log log = LogFactory.getLog(Hyphenator.class); private static HyphenationTreeCache hTreeCache = null; diff --git a/src/java/org/apache/fop/hyphenation/TernaryTree.java b/src/java/org/apache/fop/hyphenation/TernaryTree.java index a3a823324..206b81f3f 100644 --- a/src/java/org/apache/fop/hyphenation/TernaryTree.java +++ b/src/java/org/apache/fop/hyphenation/TernaryTree.java @@ -75,6 +75,8 @@ public class TernaryTree implements Cloneable, Serializable { * if it ain't broken, don't fix it. */ + private static final long serialVersionUID = 3175412271203716160L; + /** * Pointer to low branch and to rest of the key when it is * stored directly in this node, we don't have unions in java! diff --git a/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java b/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java index cc18c5b36..76616bfb5 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java @@ -40,7 +40,7 @@ import org.apache.fop.util.ListUtil; public abstract class AbstractBreaker { /** logging instance */ - protected static Log log = LogFactory.getLog(AbstractBreaker.class); + protected static final Log log = LogFactory.getLog(AbstractBreaker.class); /** * A page break position. @@ -93,6 +93,8 @@ public abstract class AbstractBreaker { */ public class BlockSequence extends BlockKnuthSequence { + private static final long serialVersionUID = -5348831120146774118L; + /** Number of elements to ignore at the beginning of the list. */ int ignoreAtStart = 0; // CSOK: VisibilityModifier /** Number of elements to ignore at the end of the list. */ diff --git a/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java b/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java index fac5bf075..0be0c9437 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java +++ b/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java @@ -27,6 +27,8 @@ import java.util.List; */ public class BlockKnuthSequence extends KnuthSequence { + private static final long serialVersionUID = 1648962416582509095L; + private boolean isClosed = false; /** diff --git a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java index 15f8ffa8d..7ac23f74f 100644 --- a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java @@ -42,7 +42,7 @@ import org.apache.fop.fo.Constants; public abstract class BreakingAlgorithm { /** the logger for the class */ - protected static Log log = LogFactory.getLog(BreakingAlgorithm.class); + protected static final Log log = LogFactory.getLog(BreakingAlgorithm.class); /** Maximum adjustment ration */ protected static final int INFINITE_RATIO = 1000; diff --git a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java index 63a2f7c5e..81df3c992 100644 --- a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java +++ b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java @@ -32,6 +32,8 @@ import org.apache.fop.layoutmgr.inline.KnuthInlineBox; */ public class InlineKnuthSequence extends KnuthSequence { + private static final long serialVersionUID = 1354774188859946549L; + private boolean isClosed = false; /** diff --git a/src/java/org/apache/fop/layoutmgr/UnresolvedListElementWithLength.java b/src/java/org/apache/fop/layoutmgr/UnresolvedListElementWithLength.java index d1b16a523..0667b9355 100644 --- a/src/java/org/apache/fop/layoutmgr/UnresolvedListElementWithLength.java +++ b/src/java/org/apache/fop/layoutmgr/UnresolvedListElementWithLength.java @@ -30,7 +30,7 @@ import org.apache.fop.traits.MinOptMax; public abstract class UnresolvedListElementWithLength extends UnresolvedListElement { /** Logger instance */ - protected static Log log = LogFactory.getLog(UnresolvedListElementWithLength.class); + protected static final Log log = LogFactory.getLog(UnresolvedListElementWithLength.class); private MinOptMax length; private boolean conditional; diff --git a/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java b/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java index 338a58d9c..73235d2d1 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java +++ b/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java @@ -37,7 +37,7 @@ import org.apache.fop.fo.properties.LengthRangeProperty; public class ImageLayout implements Constants { /** logging instance */ - protected static Log log = LogFactory.getLog(ImageLayout.class); + protected static final Log log = LogFactory.getLog(ImageLayout.class); //Input private GraphicsProperties props; diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java index df7371fe5..c4a76f2f5 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java @@ -56,7 +56,7 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager /** * logging instance */ - protected static Log log = LogFactory.getLog(LeafNodeLayoutManager.class); + protected static final Log log = LogFactory.getLog(LeafNodeLayoutManager.class); /** * The inline area that this leafnode will add. diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java index 3a03257f8..661f6ec80 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java @@ -184,6 +184,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager // this class represents a paragraph private class Paragraph extends InlineKnuthSequence { + + private static final long serialVersionUID = 5862072380375189105L; + /** Number of elements to ignore at the beginning of the list. */ private int ignoreAtStart = 0; /** Number of elements to ignore at the end of the list. */ diff --git a/src/java/org/apache/fop/pdf/PDFObject.java b/src/java/org/apache/fop/pdf/PDFObject.java index 21ff82394..4bb9a7d34 100644 --- a/src/java/org/apache/fop/pdf/PDFObject.java +++ b/src/java/org/apache/fop/pdf/PDFObject.java @@ -42,7 +42,7 @@ import org.apache.commons.logging.LogFactory; public abstract class PDFObject implements PDFWritable { /** logger for all PDFObjects (and descendants) */ - protected static Log log = LogFactory.getLog(PDFObject.class.getName()); + protected static final Log log = LogFactory.getLog(PDFObject.class.getName()); /** * the object's number diff --git a/src/java/org/apache/fop/render/AbstractConfigurator.java b/src/java/org/apache/fop/render/AbstractConfigurator.java index 096007b98..874bb4d1b 100644 --- a/src/java/org/apache/fop/render/AbstractConfigurator.java +++ b/src/java/org/apache/fop/render/AbstractConfigurator.java @@ -30,7 +30,7 @@ import org.apache.fop.apps.FOUserAgent; */ public abstract class AbstractConfigurator { /** logger instance */ - protected static Log log = LogFactory.getLog(AbstractConfigurator.class); + protected static final Log log = LogFactory.getLog(AbstractConfigurator.class); private static final String MIME = "mime"; diff --git a/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java b/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java index 392eb875e..f2c86b35f 100644 --- a/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java +++ b/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java @@ -178,7 +178,7 @@ public abstract class AbstractGenericSVGHandler implements XMLHandler, RendererC } /** {@inheritDoc} */ - public String getNamespace() { + public String getNameSpace() { return SVGDOMImplementation.SVG_NAMESPACE_URI; } diff --git a/src/java/org/apache/fop/render/AbstractRenderer.java b/src/java/org/apache/fop/render/AbstractRenderer.java index 72be1b0b8..d70d8113f 100644 --- a/src/java/org/apache/fop/render/AbstractRenderer.java +++ b/src/java/org/apache/fop/render/AbstractRenderer.java @@ -79,7 +79,7 @@ public abstract class AbstractRenderer implements Renderer, Constants { /** logging instance */ - protected static Log log = LogFactory.getLog("org.apache.fop.render"); + protected static final Log log = LogFactory.getLog("org.apache.fop.render"); /** * user agent diff --git a/src/java/org/apache/fop/render/PrintRendererConfigurator.java b/src/java/org/apache/fop/render/PrintRendererConfigurator.java index dd7a05067..8f94684b2 100644 --- a/src/java/org/apache/fop/render/PrintRendererConfigurator.java +++ b/src/java/org/apache/fop/render/PrintRendererConfigurator.java @@ -48,7 +48,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator implements RendererConfigurator, IFDocumentHandlerConfigurator { /** logger instance */ - protected static Log log = LogFactory.getLog(PrintRendererConfigurator.class); + protected static final Log log = LogFactory.getLog(PrintRendererConfigurator.class); /** * Default constructor diff --git a/src/java/org/apache/fop/render/XMLHandler.java b/src/java/org/apache/fop/render/XMLHandler.java index f8152fcbf..1060bec51 100644 --- a/src/java/org/apache/fop/render/XMLHandler.java +++ b/src/java/org/apache/fop/render/XMLHandler.java @@ -60,6 +60,6 @@ public interface XMLHandler { * @return the XML namespace for the XML dialect this XMLHandler supports, * null if all XML content is handled by this instance. */ - String getNamespace(); + String getNameSpace(); } diff --git a/src/java/org/apache/fop/render/XMLHandlerConfigurator.java b/src/java/org/apache/fop/render/XMLHandlerConfigurator.java index fb2420572..b93d4003a 100644 --- a/src/java/org/apache/fop/render/XMLHandlerConfigurator.java +++ b/src/java/org/apache/fop/render/XMLHandlerConfigurator.java @@ -32,7 +32,7 @@ import org.apache.fop.apps.FOUserAgent; public class XMLHandlerConfigurator extends AbstractRendererConfigurator { /** logger instance */ - protected static Log log = LogFactory.getLog(XMLHandlerConfigurator.class); + protected static final Log log = LogFactory.getLog(XMLHandlerConfigurator.class); /** * Default constructor diff --git a/src/java/org/apache/fop/render/XMLHandlerRegistry.java b/src/java/org/apache/fop/render/XMLHandlerRegistry.java index 81d9fcc93..84177df45 100644 --- a/src/java/org/apache/fop/render/XMLHandlerRegistry.java +++ b/src/java/org/apache/fop/render/XMLHandlerRegistry.java @@ -85,7 +85,7 @@ public class XMLHandlerRegistry { * @param handler the XMLHandler instance */ public void addXMLHandler(XMLHandler handler) { - String ns = handler.getNamespace(); + String ns = handler.getNameSpace(); if (ns == null) { setDefaultXMLHandler(handler); } else { diff --git a/src/java/org/apache/fop/render/afp/AFPRendererImageInfo.java b/src/java/org/apache/fop/render/afp/AFPRendererImageInfo.java index 2687d9071..cffcf8a25 100644 --- a/src/java/org/apache/fop/render/afp/AFPRendererImageInfo.java +++ b/src/java/org/apache/fop/render/afp/AFPRendererImageInfo.java @@ -124,7 +124,7 @@ public class AFPRendererImageInfo { * * @return the uri */ - public String getURI() { + public String getUri() { return this.uri; } diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java b/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java index f2e77ec33..d916738eb 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java @@ -41,7 +41,7 @@ public class AFPExtensionHandler extends DefaultHandler implements ContentHandlerFactory.ObjectSource { /** Logger instance */ - protected static Log log = LogFactory.getLog(AFPExtensionHandler.class); + protected static final Log log = LogFactory.getLog(AFPExtensionHandler.class); private StringBuffer content = new StringBuffer(); private Attributes lastAttributes; diff --git a/src/java/org/apache/fop/render/awt/viewer/PageChangeEvent.java b/src/java/org/apache/fop/render/awt/viewer/PageChangeEvent.java index 045ce7fe4..78f09b537 100644 --- a/src/java/org/apache/fop/render/awt/viewer/PageChangeEvent.java +++ b/src/java/org/apache/fop/render/awt/viewer/PageChangeEvent.java @@ -27,6 +27,8 @@ import java.util.EventObject; */ public class PageChangeEvent extends EventObject { + private static final long serialVersionUID = -5969283475959932887L; + private int oldPage; private int newPage; diff --git a/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java b/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java index 7dd3bcd95..5a9cfa21b 100644 --- a/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java +++ b/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java @@ -31,6 +31,7 @@ import java.awt.image.SinglePixelPackedSampleModel; import java.io.IOException; import java.io.OutputStream; import java.util.Iterator; +import java.util.NoSuchElementException; import org.apache.commons.logging.Log; @@ -133,7 +134,11 @@ public class TIFFRenderer extends Java2DRenderer implements TIFFConstants { multiWriter.close(); } } else { - writer.writeImage((RenderedImage) pageImagesItr.next(), outputStream, writerParams); + RenderedImage renderedImage = null; + if (pageImagesItr.hasNext()) { + renderedImage = (RenderedImage) pageImagesItr.next(); + } + writer.writeImage(renderedImage, outputStream, writerParams); if (pageImagesItr.hasNext()) { BitmapRendererEventProducer eventProducer = BitmapRendererEventProducer.Provider.get( @@ -186,8 +191,7 @@ public class TIFFRenderer extends Java2DRenderer implements TIFFConstants { try { pageImage = getPageImage(current++); } catch (FOPException e) { - log.error(e); - return null; + throw new NoSuchElementException(e.getMessage()); } if (COMPRESSION_CCITT_T4.equalsIgnoreCase(writerParams.getCompressionMethod()) diff --git a/src/java/org/apache/fop/render/intermediate/IFParser.java b/src/java/org/apache/fop/render/intermediate/IFParser.java index da5d8a623..645d1ebc6 100644 --- a/src/java/org/apache/fop/render/intermediate/IFParser.java +++ b/src/java/org/apache/fop/render/intermediate/IFParser.java @@ -71,7 +71,7 @@ import org.apache.fop.util.XMLUtil; public class IFParser implements IFConstants { /** Logger instance */ - protected static Log log = LogFactory.getLog(IFParser.class); + protected static final Log log = LogFactory.getLog(IFParser.class); private static SAXTransformerFactory tFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); diff --git a/src/java/org/apache/fop/render/intermediate/IFRenderer.java b/src/java/org/apache/fop/render/intermediate/IFRenderer.java index bdeb1e9a1..046d1703b 100644 --- a/src/java/org/apache/fop/render/intermediate/IFRenderer.java +++ b/src/java/org/apache/fop/render/intermediate/IFRenderer.java @@ -110,7 +110,7 @@ public class IFRenderer extends AbstractPathOrientedRenderer { //if optimizations can be done to avoid int->float->int conversions. /** logging instance */ - protected static Log log = LogFactory.getLog(IFRenderer.class); + protected static final Log log = LogFactory.getLog(IFRenderer.class); /** XML MIME type */ public static final String IF_MIME_TYPE = MimeConstants.MIME_FOP_IF; diff --git a/src/java/org/apache/fop/render/intermediate/IFSerializer.java b/src/java/org/apache/fop/render/intermediate/IFSerializer.java index edeef9766..dcc0d3523 100644 --- a/src/java/org/apache/fop/render/intermediate/IFSerializer.java +++ b/src/java/org/apache/fop/render/intermediate/IFSerializer.java @@ -668,8 +668,8 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler throw new NullPointerException("action must not be null"); } if (!action.isComplete()) { - assert action.hasID(); - incompleteActions.put(action.getID(), action); + assert action.hasId(); + incompleteActions.put(action.getId(), action); } } @@ -744,8 +744,8 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler /** {@inheritDoc} */ public void addResolvedAction(AbstractAction action) throws IFException { assert action.isComplete(); - assert action.hasID(); - AbstractAction noted = (AbstractAction)incompleteActions.remove(action.getID()); + assert action.hasId(); + AbstractAction noted = (AbstractAction)incompleteActions.remove(action.getId()); if (noted != null) { completeActions.add(action); } else { diff --git a/src/java/org/apache/fop/render/intermediate/extensions/AbstractAction.java b/src/java/org/apache/fop/render/intermediate/extensions/AbstractAction.java index 340b2e068..8d8a30cf6 100644 --- a/src/java/org/apache/fop/render/intermediate/extensions/AbstractAction.java +++ b/src/java/org/apache/fop/render/intermediate/extensions/AbstractAction.java @@ -33,7 +33,7 @@ public abstract class AbstractAction implements XMLizable { * Sets an ID to make the action referencable. * @param id the ID */ - public void setID(String id) { + public void setId(String id) { this.id = id; } @@ -41,7 +41,7 @@ public abstract class AbstractAction implements XMLizable { * Returns an optional ID for this action. * @return the ID or null */ - public String getID() { + public String getId() { return this.id; } @@ -65,7 +65,7 @@ public abstract class AbstractAction implements XMLizable { * Indicates whether the action has an ID and is therefore referencable. * @return true if the action has an ID */ - public boolean hasID() { + public boolean hasId() { return this.id != null; } @@ -90,7 +90,7 @@ public abstract class AbstractAction implements XMLizable { * Returns a string that is used to prefix a generated ID to make it unique. * @return the prefix string */ - public String getIDPrefix() { + public String getIdPrefix() { return null; } diff --git a/src/java/org/apache/fop/render/intermediate/extensions/ActionSet.java b/src/java/org/apache/fop/render/intermediate/extensions/ActionSet.java index b980f1051..719d2225b 100644 --- a/src/java/org/apache/fop/render/intermediate/extensions/ActionSet.java +++ b/src/java/org/apache/fop/render/intermediate/extensions/ActionSet.java @@ -39,7 +39,7 @@ public class ActionSet { */ public synchronized String generateNewID(AbstractAction action) { this.lastGeneratedID++; - String prefix = action.getIDPrefix(); + String prefix = action.getIdPrefix(); if (prefix == null) { throw new IllegalArgumentException("Action class is not compatible"); } @@ -62,12 +62,12 @@ public class ActionSet { * @return the action instance that should be used in place of the given one */ public AbstractAction put(AbstractAction action) { - if (!action.hasID()) { - action.setID(generateNewID(action)); + if (!action.hasId()) { + action.setId(generateNewID(action)); } AbstractAction effAction = normalize(action); if (effAction == action) { - this.actionRegistry.put(action.getID(), action); + this.actionRegistry.put(action.getId(), action); } return effAction; } diff --git a/src/java/org/apache/fop/render/intermediate/extensions/DocumentNavigationHandler.java b/src/java/org/apache/fop/render/intermediate/extensions/DocumentNavigationHandler.java index 5ca480f4a..1d5bc23fe 100644 --- a/src/java/org/apache/fop/render/intermediate/extensions/DocumentNavigationHandler.java +++ b/src/java/org/apache/fop/render/intermediate/extensions/DocumentNavigationHandler.java @@ -41,7 +41,7 @@ public class DocumentNavigationHandler extends DefaultHandler implements DocumentNavigationExtensionConstants { /** Logger instance */ - protected static Log log = LogFactory.getLog(DocumentNavigationHandler.class); + protected static final Log log = LogFactory.getLog(DocumentNavigationHandler.class); private StringBuffer content = new StringBuffer(); private Stack objectStack = new Stack(); @@ -132,7 +132,7 @@ public class DocumentNavigationHandler extends DefaultHandler boolean newWindow = "new".equals(showDestination); URIAction action = new URIAction(gotoURI, newWindow); if (id != null) { - action.setID(id); + action.setId(id); } if (structurePointer != null) { action.setStructurePointer(structurePointer); diff --git a/src/java/org/apache/fop/render/intermediate/extensions/GoToXYAction.java b/src/java/org/apache/fop/render/intermediate/extensions/GoToXYAction.java index a2b4f31b6..d905c7800 100644 --- a/src/java/org/apache/fop/render/intermediate/extensions/GoToXYAction.java +++ b/src/java/org/apache/fop/render/intermediate/extensions/GoToXYAction.java @@ -52,7 +52,7 @@ public class GoToXYAction extends AbstractAction implements DocumentNavigationEx * or null, if the position isn't known, yet */ public GoToXYAction(String id, int pageIndex, Point targetLocation) { - setID(id); + setId(id); if (pageIndex < 0 && targetLocation != null) { throw new IllegalArgumentException( "Page index may not be null if target location is known!"); @@ -144,7 +144,7 @@ public class GoToXYAction extends AbstractAction implements DocumentNavigationEx AttributesImpl atts = new AttributesImpl(); if (this.isCompleteExceptTargetLocation()) { final Point reportedTargetLocation = this.getTargetLocation(); - atts.addAttribute(null, "id", "id", XMLUtil.CDATA, getID()); + atts.addAttribute(null, "id", "id", XMLUtil.CDATA, getId()); atts.addAttribute(null, "page-index", "page-index", XMLUtil.CDATA, Integer.toString(pageIndex)); atts.addAttribute(null, "x", "x", XMLUtil.CDATA, @@ -152,7 +152,7 @@ public class GoToXYAction extends AbstractAction implements DocumentNavigationEx atts.addAttribute(null, "y", "y", XMLUtil.CDATA, Integer.toString(reportedTargetLocation.y)); } else { - atts.addAttribute(null, "idref", "idref", XMLUtil.CDATA, getID()); + atts.addAttribute(null, "idref", "idref", XMLUtil.CDATA, getId()); } handler.startElement(GOTO_XY.getNamespaceURI(), GOTO_XY.getLocalName(), GOTO_XY.getQName(), atts); @@ -162,7 +162,7 @@ public class GoToXYAction extends AbstractAction implements DocumentNavigationEx /** {@inheritDoc} */ public String toString() { - return "GoToXY: ID=" + getID() + return "GoToXY: ID=" + getId() + ", page=" + getPageIndex() + ", loc=" + getTargetLocation() + ", " + (isComplete() ? "complete" : "INCOMPLETE"); diff --git a/src/java/org/apache/fop/render/intermediate/extensions/URIAction.java b/src/java/org/apache/fop/render/intermediate/extensions/URIAction.java index 22e7a270c..4251619ff 100644 --- a/src/java/org/apache/fop/render/intermediate/extensions/URIAction.java +++ b/src/java/org/apache/fop/render/intermediate/extensions/URIAction.java @@ -82,15 +82,15 @@ public class URIAction extends AbstractAction implements DocumentNavigationExten } /** {@inheritDoc} */ - public String getIDPrefix() { + public String getIdPrefix() { return "fop-" + GOTO_URI.getLocalName(); } /** {@inheritDoc} */ public void toSAX(ContentHandler handler) throws SAXException { AttributesImpl atts = new AttributesImpl(); - if (hasID()) { - atts.addAttribute(null, "id", "id", XMLUtil.CDATA, getID()); + if (hasId()) { + atts.addAttribute(null, "id", "id", XMLUtil.CDATA, getId()); } atts.addAttribute(null, "uri", "uri", XMLUtil.CDATA, getURI()); if (isNewWindow()) { diff --git a/src/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java b/src/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java index c215243a7..4a51cb176 100644 --- a/src/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java +++ b/src/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java @@ -129,7 +129,7 @@ public class PDFDocumentNavigationHandler implements IFDocumentNavigationHandler /** {@inheritDoc} */ public void addResolvedAction(AbstractAction action) throws IFException { assert action.isComplete(); - PDFAction pdfAction = (PDFAction)this.incompleteActions.remove(action.getID()); + PDFAction pdfAction = (PDFAction)this.incompleteActions.remove(action.getId()); if (pdfAction == null) { getAction(action); } else if (pdfAction instanceof PDFGoTo) { @@ -145,11 +145,11 @@ public class PDFDocumentNavigationHandler implements IFDocumentNavigationHandler if (action == null) { return null; } - PDFAction pdfAction = (PDFAction)this.completeActions.get(action.getID()); + PDFAction pdfAction = (PDFAction)this.completeActions.get(action.getId()); if (pdfAction != null) { return pdfAction; } else if (action instanceof GoToXYAction) { - pdfAction = (PDFAction) incompleteActions.get(action.getID()); + pdfAction = (PDFAction) incompleteActions.get(action.getId()); if (pdfAction != null) { return pdfAction; } else { @@ -159,7 +159,7 @@ public class PDFDocumentNavigationHandler implements IFDocumentNavigationHandler if (action.isComplete()) { updateTargetLocation(pdfGoTo, a); } else { - this.incompleteActions.put(action.getID(), pdfGoTo); + this.incompleteActions.put(action.getId(), pdfGoTo); } return pdfGoTo; } @@ -173,7 +173,7 @@ public class PDFDocumentNavigationHandler implements IFDocumentNavigationHandler //Some PDF actions are pooled getPDFDoc().registerObject(pdfAction); } - this.completeActions.put(action.getID(), pdfAction); + this.completeActions.put(action.getId(), pdfAction); return pdfAction; } else { throw new UnsupportedOperationException("Unsupported action type: " @@ -195,7 +195,7 @@ public class PDFDocumentNavigationHandler implements IFDocumentNavigationHandler //Queue this object now that it's complete getPDFDoc().addObject(pdfGoTo); - this.completeActions.put(action.getID(), pdfGoTo); + this.completeActions.put(action.getId(), pdfGoTo); } } diff --git a/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionHandler.java b/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionHandler.java index 04c95545c..e7e863a23 100644 --- a/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionHandler.java +++ b/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionHandler.java @@ -37,7 +37,7 @@ public class PDFExtensionHandler extends DefaultHandler implements ContentHandlerFactory.ObjectSource { /** Logger instance */ - protected static Log log = LogFactory.getLog(PDFExtensionHandler.class); + protected static final Log log = LogFactory.getLog(PDFExtensionHandler.class); private Attributes lastAttributes; diff --git a/src/java/org/apache/fop/render/ps/PSFontUtils.java b/src/java/org/apache/fop/render/ps/PSFontUtils.java index 8acc390d0..0d0975045 100644 --- a/src/java/org/apache/fop/render/ps/PSFontUtils.java +++ b/src/java/org/apache/fop/render/ps/PSFontUtils.java @@ -54,7 +54,7 @@ import org.apache.fop.fonts.Typeface; public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils { /** logging instance */ - protected static Log log = LogFactory.getLog(PSFontUtils.class); + protected static final Log log = LogFactory.getLog(PSFontUtils.class); /** * Generates the PostScript code for the font dictionary. This method should only be diff --git a/src/java/org/apache/fop/render/ps/PSImageFormResource.java b/src/java/org/apache/fop/render/ps/PSImageFormResource.java index 11c3205e6..4c40c6f92 100644 --- a/src/java/org/apache/fop/render/ps/PSImageFormResource.java +++ b/src/java/org/apache/fop/render/ps/PSImageFormResource.java @@ -53,7 +53,7 @@ public class PSImageFormResource extends PSResource { * Returns the image URI. * @return the image URI */ - public String getImageURI() { + public String getImageUri() { return this.uri; } diff --git a/src/java/org/apache/fop/render/ps/ResourceHandler.java b/src/java/org/apache/fop/render/ps/ResourceHandler.java index 502242c17..06d6b9034 100644 --- a/src/java/org/apache/fop/render/ps/ResourceHandler.java +++ b/src/java/org/apache/fop/render/ps/ResourceHandler.java @@ -281,7 +281,7 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors { private void generateFormForImage(PSGenerator gen, PSImageFormResource form) throws IOException { - final String uri = form.getImageURI(); + final String uri = form.getImageUri(); ImageManager manager = userAgent.getFactory().getImageManager(); ImageInfo info = null; diff --git a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java index bf970d0a6..d499ef6ab 100644 --- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java +++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java @@ -37,7 +37,7 @@ public class PSExtensionHandler extends DefaultHandler implements ContentHandlerFactory.ObjectSource { /** Logger instance */ - protected static Log log = LogFactory.getLog(PSExtensionHandler.class); + protected static final Log log = LogFactory.getLog(PSExtensionHandler.class); private StringBuffer content = new StringBuffer(); private Attributes lastAttributes; diff --git a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java index d377f740d..29bbecded 100644 --- a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java +++ b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java @@ -149,7 +149,7 @@ final class TextAttributesConverter { attrFont(fobj.getCommonFont(), attrib); attrFontColor(fobj.getColor(), attrib); attrTextDecoration(fobj.getTextDecoration(), attrib); - attrBaseLineShift(fobj.getBaseLineShift(), attrib); + attrBaseLineShift(fobj.getBaselineShift(), attrib); return attrib; } diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java index f231a1f06..146a8c19c 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java @@ -37,23 +37,10 @@ public final class ParagraphKeeptogetherContext { private static int paraKeepTogetherOpen = 0; private static boolean paraResetProperties = false; - private static ParagraphKeeptogetherContext instance = null; private ParagraphKeeptogetherContext() { } - /** - * Singelton. - * - * @return The instance of ParagraphKeeptogetherContext - */ - public static ParagraphKeeptogetherContext getInstance() { - if (instance == null) { - instance = new ParagraphKeeptogetherContext(); - } - return instance; - } - /** * @return the level of current "keep whith next" paragraph */ diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfJforCmd.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfJforCmd.java index d7b77f633..b9e53d42f 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfJforCmd.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfJforCmd.java @@ -39,14 +39,12 @@ public class RtfJforCmd extends RtfContainer { private static final String PARA_KEEP_OFF = "para-keep:off"; private final RtfAttributes attrib; - private ParagraphKeeptogetherContext paragraphKeeptogetherContext; RtfJforCmd(RtfContainer parent, Writer w, RtfAttributes attrs) throws IOException { super((RtfContainer)parent, w); attrib = attrs; - paragraphKeeptogetherContext = ParagraphKeeptogetherContext.getInstance(); } diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java index 128c9a3df..927159ffc 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java @@ -54,7 +54,7 @@ public class RtfTextrun extends RtfContainer { /** * logging instance */ - protected static Log log = LogFactory.getLog(RtfTextrun.class); + protected static final Log log = LogFactory.getLog(RtfTextrun.class); /** Manager for handling space-* property. */ private RtfSpaceManager rtfSpaceManager = new RtfSpaceManager(); @@ -271,7 +271,6 @@ public class RtfTextrun extends RtfContainer { //add RtfSpaceSplitter to inherit accumulated space rtfSpaceManager.pushRtfSpaceSplitter(attrs); rtfSpaceManager.setCandidate(attrs); - RtfString r = new RtfString(this, writer, s); rtfSpaceManager.popRtfSpaceSplitter(); } @@ -301,7 +300,7 @@ public class RtfTextrun extends RtfContainer { ListIterator lit = children.listIterator(children.size()); while (lit.hasPrevious() && (lit.previous() instanceof RtfCloseGroupMark)) { - tmp.push(new Integer(((RtfCloseGroupMark)lit.next()).getBreakType())); + tmp.push(Integer.valueOf(((RtfCloseGroupMark)lit.next()).getBreakType())); lit.remove(); deletedCloseGroupCount++; } diff --git a/src/java/org/apache/fop/render/xml/XMLXMLHandler.java b/src/java/org/apache/fop/render/xml/XMLXMLHandler.java index d1cf1cf9a..f181e1911 100644 --- a/src/java/org/apache/fop/render/xml/XMLXMLHandler.java +++ b/src/java/org/apache/fop/render/xml/XMLXMLHandler.java @@ -48,7 +48,7 @@ public class XMLXMLHandler implements XMLHandler { } /** {@inheritDoc} */ - public String getNamespace() { + public String getNameSpace() { return null; //Handle all XML content } diff --git a/src/java/org/apache/fop/servlet/FopPrintServlet.java b/src/java/org/apache/fop/servlet/FopPrintServlet.java index d446dff54..5c243ecae 100644 --- a/src/java/org/apache/fop/servlet/FopPrintServlet.java +++ b/src/java/org/apache/fop/servlet/FopPrintServlet.java @@ -61,6 +61,8 @@ import org.apache.fop.apps.MimeConstants; */ public class FopPrintServlet extends FopServlet { + private static final long serialVersionUID = 1645706757391617935L; + /** * {@inheritDoc} */ diff --git a/src/java/org/apache/fop/servlet/FopServlet.java b/src/java/org/apache/fop/servlet/FopServlet.java index 304cf21b9..7eb8a2f89 100644 --- a/src/java/org/apache/fop/servlet/FopServlet.java +++ b/src/java/org/apache/fop/servlet/FopServlet.java @@ -70,6 +70,8 @@ import org.apache.fop.apps.MimeConstants; */ public class FopServlet extends HttpServlet { + private static final long serialVersionUID = -908918093488215264L; + /** Name of the parameter used for the XSL-FO file */ protected static final String FO_REQUEST_PARAM = "fo"; /** Name of the parameter used for the XML file */ diff --git a/src/java/org/apache/fop/tools/TestConverter.java b/src/java/org/apache/fop/tools/TestConverter.java index 0c6e09bd0..ba03ee567 100644 --- a/src/java/org/apache/fop/tools/TestConverter.java +++ b/src/java/org/apache/fop/tools/TestConverter.java @@ -56,7 +56,7 @@ public class TestConverter { private String outputFormat = MimeConstants.MIME_FOP_AREA_TREE; private File destdir; private File compare = null; - private String baseDir = "./"; + private String basedir = "./"; private Map differ = new java.util.HashMap(); /** @@ -95,7 +95,7 @@ public class TestConverter { } else if (args[count].equals("-d")) { tc.setDebug(true); } else if (args[count].equals("-b")) { - tc.setBaseDir(args[++count]); + tc.setBasedir(args[++count]); } else if (args[count].equals("-results")) { results = args[++count]; } else { @@ -138,8 +138,8 @@ public class TestConverter { * Sets the base directory. * @param str base directory */ - public void setBaseDir(String str) { - baseDir = str; + public void setBasedir(String str) { + basedir = str; } /** @@ -167,11 +167,11 @@ public class TestConverter { logger.debug("running tests in file:" + fname); try { if (compDir != null) { - compare = new File(baseDir + "/" + compDir); + compare = new File(basedir + "/" + compDir); } - destdir = new File(baseDir + "/" + dest); + destdir = new File(basedir + "/" + dest); destdir.mkdirs(); - File f = new File(baseDir + "/" + fname); + File f = new File(basedir + "/" + fname); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder db = factory.newDocumentBuilder(); Document doc = db.parse(f); @@ -271,7 +271,7 @@ public class TestConverter { res = resNode.getNodeValue(); } try { - File xmlFile = new File(baseDir + "/" + xml); + File xmlFile = new File(basedir + "/" + xml); String baseURL = null; try { baseURL = xmlFile.getParentFile().toURI().toURL().toExternalForm(); @@ -284,7 +284,7 @@ public class TestConverter { inputHandler = new InputHandler(xmlFile); } else { inputHandler = new InputHandler(xmlFile, - new File(baseDir + "/" + new File(basedir + "/" + xsl), null); } diff --git a/src/java/org/apache/fop/tools/anttasks/Fop.java b/src/java/org/apache/fop/tools/anttasks/Fop.java index 58dd1fb5b..3aeac1215 100644 --- a/src/java/org/apache/fop/tools/anttasks/Fop.java +++ b/src/java/org/apache/fop/tools/anttasks/Fop.java @@ -85,7 +85,7 @@ public class Fop extends Task { * Sets the filename for the userconfig.xml. * @param userConfig Configuration to use */ - public void setUserconfig(File userConfig) { + public void setUserConfig(File userConfig) { this.userConfig = userConfig; } @@ -93,7 +93,7 @@ public class Fop extends Task { * Returns the file for the userconfig.xml. * @return the userconfig.xml file */ - public File getUserconfig() { + public File getUserConfig() { return this.userConfig; } @@ -101,7 +101,7 @@ public class Fop extends Task { * Sets the input XSL-FO file. * @param foFile input XSL-FO file */ - public void setFofile(File foFile) { + public void setFoFile(File foFile) { this.foFile = foFile; } @@ -109,7 +109,7 @@ public class Fop extends Task { * Gets the input XSL-FO file. * @return input XSL-FO file */ - public File getFofile() { + public File getFoFile() { return foFile; } @@ -267,7 +267,7 @@ public class Fop extends Task { * default is false. * @param throwExceptions true if exceptions should be thrown */ - public void setThrowexceptions(boolean throwExceptions) { + public void setThrowExceptions(boolean throwExceptions) { this.throwExceptions = throwExceptions; } @@ -275,7 +275,7 @@ public class Fop extends Task { * Gets the throw exceptions attribute * @return the throw exceptions attribute */ - public boolean getThrowexceptions() { + public boolean getThrowExceptions() { return this.throwExceptions; } @@ -408,8 +408,8 @@ class FOPTaskStarter { FOPTaskStarter(Fop task) throws SAXException, IOException { this.task = task; - if (task.getUserconfig() != null) { - fopFactory.setUserConfig(task.getUserconfig()); + if (task.getUserConfig() != null) { + fopFactory.setUserConfig(task.getUserConfig()); } } @@ -497,8 +497,8 @@ class FOPTaskStarter { } } else { try { - if (task.getFofile() != null) { - this.baseURL = task.getFofile().getParentFile().toURI().toURL(). + if (task.getFoFile() != null) { + this.baseURL = task.getFoFile().getParentFile().toURI().toURL(). toExternalForm(); } } catch (MalformedURLException mfue) { @@ -517,8 +517,8 @@ class FOPTaskStarter { int skippedcount = 0; // deal with single source file - if (task.getFofile() != null) { - if (task.getFofile().exists()) { + if (task.getFoFile() != null) { + if (task.getFoFile().exists()) { File outf = task.getOutfile(); if (outf == null) { throw new BuildException("outfile is required when fofile is used"); @@ -530,11 +530,11 @@ class FOPTaskStarter { // OR output file doesn't exist OR // output file is older than input file if (task.getForce() || !outf.exists() - || (task.getFofile().lastModified() > outf.lastModified() )) { - render(task.getFofile(), outf, outputFormat); + || (task.getFoFile().lastModified() > outf.lastModified() )) { + render(task.getFoFile(), outf, outputFormat); actioncount++; } else if (outf.exists() - && (task.getFofile().lastModified() <= outf.lastModified() )) { + && (task.getFoFile().lastModified() <= outf.lastModified() )) { skippedcount++; } } @@ -653,7 +653,7 @@ class FOPTaskStarter { inputHandler.renderTo(userAgent, outputFormat, out); success = true; } catch (Exception ex) { - if (task.getThrowexceptions()) { + if (task.getThrowExceptions()) { throw new BuildException(ex); } throw ex; diff --git a/src/java/org/apache/fop/traits/BorderProps.java b/src/java/org/apache/fop/traits/BorderProps.java index 25ac86ced..a76c6e8a3 100644 --- a/src/java/org/apache/fop/traits/BorderProps.java +++ b/src/java/org/apache/fop/traits/BorderProps.java @@ -34,6 +34,8 @@ import org.apache.fop.util.ColorUtil; */ public class BorderProps implements Serializable { + private static final long serialVersionUID = -886871454032189183L; + /** Separate border model */ public static final int SEPARATE = 0; /** Collapsing border model, for borders inside a table */ diff --git a/src/java/org/apache/fop/util/ColorUtil.java b/src/java/org/apache/fop/util/ColorUtil.java index 8fe6c707f..21277d60a 100644 --- a/src/java/org/apache/fop/util/ColorUtil.java +++ b/src/java/org/apache/fop/util/ColorUtil.java @@ -53,7 +53,7 @@ public final class ColorUtil { private static Map colorMap = null; /** Logger instance */ - protected static Log log = LogFactory.getLog(ColorUtil.class); + protected static final Log log = LogFactory.getLog(ColorUtil.class); static { initializeColorMap();