diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2014-07-18 14:21:06 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2014-07-18 14:21:06 +0000 |
commit | 7f21c0ae8547429472f10bfd297294d6248b41b6 (patch) | |
tree | c371ab7720164ec30528fe5e7e84e71e5b149edc /src/java/org/apache | |
parent | f8dd309bf637ecd62762fdfd889be1e7b210b755 (diff) | |
parent | d8823a706376a572303ab86004c7370b12ef7d85 (diff) | |
download | xmlgraphics-fop-7f21c0ae8547429472f10bfd297294d6248b41b6.tar.gz xmlgraphics-fop-7f21c0ae8547429472f10bfd297294d6248b41b6.zip |
Merged latest trunk
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP-2393_gradient-rendering@1611658 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
294 files changed, 1115 insertions, 933 deletions
diff --git a/src/java/org/apache/fop/afp/AFPGraphics2D.java b/src/java/org/apache/fop/afp/AFPGraphics2D.java index 937cf68b0..3fc70f3a4 100644 --- a/src/java/org/apache/fop/afp/AFPGraphics2D.java +++ b/src/java/org/apache/fop/afp/AFPGraphics2D.java @@ -93,22 +93,22 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand private static final int Y3 = 5; /** graphics object */ - private GraphicsObject graphicsObj = null; + private GraphicsObject graphicsObj; /** Fallback text handler */ protected TextHandler fallbackTextHandler = new StrokingTextHandler(); /** Custom text handler */ - protected TextHandler customTextHandler = null; + protected TextHandler customTextHandler; /** AFP resource manager */ - private AFPResourceManager resourceManager = null; + private AFPResourceManager resourceManager; /** AFP resource info */ - private AFPResourceInfo resourceInfo = null; + private AFPResourceInfo resourceInfo; /** Current AFP state */ - private AFPPaintingState paintingState = null; + private AFPPaintingState paintingState; /** AFP graphics configuration */ private final GraphicsConfigurationWithTransparency graphicsConfig = new GraphicsConfigurationWithTransparency(); diff --git a/src/java/org/apache/fop/afp/AFPLineDataInfo.java b/src/java/org/apache/fop/afp/AFPLineDataInfo.java index 108b98596..a0fddb6db 100644 --- a/src/java/org/apache/fop/afp/AFPLineDataInfo.java +++ b/src/java/org/apache/fop/afp/AFPLineDataInfo.java @@ -43,7 +43,7 @@ public class AFPLineDataInfo { private Color color; /** the rotation */ - private int rotation = 0; + private int rotation; /** * Default constructor diff --git a/src/java/org/apache/fop/afp/AFPPaintingState.java b/src/java/org/apache/fop/afp/AFPPaintingState.java index ea2ebe475..74506aa7e 100644 --- a/src/java/org/apache/fop/afp/AFPPaintingState.java +++ b/src/java/org/apache/fop/afp/AFPPaintingState.java @@ -42,13 +42,13 @@ public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState private static Log log = LogFactory.getLog("org.apache.xmlgraphics.afp"); /** the portrait rotation */ - private int portraitRotation = 0; + private int portraitRotation; /** the landscape rotation */ private int landscapeRotation = 270; /** color image support */ - private boolean colorImages = false; + private boolean colorImages; /** dithering quality setting (0.0f..1.0f) */ private float ditheringQuality; @@ -63,9 +63,9 @@ public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState * true if certain image formats may be embedded unchanged in their native * format. */ - private boolean nativeImagesSupported = false; + private boolean nativeImagesSupported; - private boolean canEmbedJpeg = false; + private boolean canEmbedJpeg; /** * true if CMYK images (requires IOCA FS45 suppport on the target platform) @@ -88,7 +88,7 @@ public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState /** determines whether GOCA is enabled or disabled */ private boolean gocaEnabled = true; /** determines whether to stroke text in GOCA mode or to use text operators where possible */ - private boolean strokeGocaText = false; + private boolean strokeGocaText; /** use page segment with F11 and F45 images*/ @@ -600,19 +600,19 @@ public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState */ private class AFPPagePaintingState implements Cloneable { /** page width */ - private int width = 0; + private int width; /** page height */ - private int height = 0; + private int height; /** page fonts */ private AFPPageFonts fonts = new AFPPageFonts(); /** page font count */ - private int fontCount = 0; + private int fontCount; /** page orientation */ - private int orientation = 0; + private int orientation; /** * Returns the page width @@ -726,9 +726,9 @@ public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState private static final long serialVersionUID = -1789481244175275686L; /** The current fill status */ - private boolean filled = false; + private boolean filled; - private String imageUri = null; + private String imageUri; /** {@inheritDoc} */ @Override diff --git a/src/java/org/apache/fop/afp/AFPResourceInfo.java b/src/java/org/apache/fop/afp/AFPResourceInfo.java index bbd552c67..7cad51596 100644 --- a/src/java/org/apache/fop/afp/AFPResourceInfo.java +++ b/src/java/org/apache/fop/afp/AFPResourceInfo.java @@ -33,22 +33,22 @@ public class AFPResourceInfo { = new AFPResourceLevel(ResourceType.PRINT_FILE); /** the URI of this resource */ - private String uri = null; + private String uri; /** * the image dimension in page coordinates (non-null only when page segments are * generated because the cannot be scaled for painting). */ - private Dimension imageDimension = null; + private Dimension imageDimension; /** the reference name of this resource */ - private String name = null; + private String name; /** the resource level of this resource */ private AFPResourceLevel level = DEFAULT_LEVEL; /** true when the resource level was changed */ - private boolean levelChanged = false; + private boolean levelChanged; /** * Sets the data object URI. diff --git a/src/java/org/apache/fop/afp/AFPResourceLevel.java b/src/java/org/apache/fop/afp/AFPResourceLevel.java index d56763050..8516521bb 100644 --- a/src/java/org/apache/fop/afp/AFPResourceLevel.java +++ b/src/java/org/apache/fop/afp/AFPResourceLevel.java @@ -66,7 +66,7 @@ public class AFPResourceLevel { } } - private URI extUri = null; + private URI extUri; private final ResourceType resourceType; /** diff --git a/src/java/org/apache/fop/afp/AFPResourceManager.java b/src/java/org/apache/fop/afp/AFPResourceManager.java index 2eb0b5596..6fa4a17b7 100644 --- a/src/java/org/apache/fop/afp/AFPResourceManager.java +++ b/src/java/org/apache/fop/afp/AFPResourceManager.java @@ -65,7 +65,7 @@ public class AFPResourceManager { private final AFPDataObjectFactory dataObjectFactory; /** Maintain a reference count of instream objects for referencing purposes */ - private int instreamObjectCount = 0; + private int instreamObjectCount; /** Mapping of resourceInfo to AbstractCachedObject */ private final Map<AFPResourceInfo, AbstractCachedObject> includeObjectCache diff --git a/src/java/org/apache/fop/afp/DataStream.java b/src/java/org/apache/fop/afp/DataStream.java index 272c000bd..e9e574a6f 100644 --- a/src/java/org/apache/fop/afp/DataStream.java +++ b/src/java/org/apache/fop/afp/DataStream.java @@ -68,22 +68,22 @@ public class DataStream { protected static final Log LOG = LogFactory.getLog("org.apache.xmlgraphics.afp"); /** Boolean completion indicator */ - private boolean complete = false; + private boolean complete; /** The AFP document object */ - private Document document = null; + private Document document; /** The current page group object */ - private PageGroup currentPageGroup = null; + private PageGroup currentPageGroup; /** The current page object */ - private PageObject currentPageObject = null; + private PageObject currentPageObject; /** The current overlay object */ - private Overlay currentOverlay = null; + private Overlay currentOverlay; /** The current page */ - private AbstractPageObject currentPage = null; + private AbstractPageObject currentPage; /** The MO:DCA interchange set in use (default to MO:DCA-P IS/2 set) */ private InterchangeSet interchangeSet diff --git a/src/java/org/apache/fop/afp/Factory.java b/src/java/org/apache/fop/afp/Factory.java index 279abcd34..9e54ed84f 100644 --- a/src/java/org/apache/fop/afp/Factory.java +++ b/src/java/org/apache/fop/afp/Factory.java @@ -97,46 +97,46 @@ public class Factory { /** the page group count */ - private int pageGroupCount = 0; + private int pageGroupCount; /** the page count */ - private int pageCount = 0; + private int pageCount; /** the image count */ - private int imageCount = 0; + private int imageCount; /** the im image count */ - private int imImageCount = 0; + private int imImageCount; /** the image segment count */ - private int imageSegmentCount = 0; + private int imageSegmentCount; /** the graphic count */ - private int graphicCount = 0; + private int graphicCount; /** the object container count */ - private int objectContainerCount = 0; + private int objectContainerCount; /** the resource count */ - private int resourceCount = 0; + private int resourceCount; /** the resource group count */ - private int resourceGroupCount = 0; + private int resourceGroupCount; /** the overlay count */ - private int overlayCount = 0; + private int overlayCount; /** the presentation text object count */ - private int textObjectCount = 0; + private int textObjectCount; /** the active environment group count */ - private int activeEnvironmentGroupCount = 0; + private int activeEnvironmentGroupCount; /** the document count */ - private int documentCount = 0; + private int documentCount; /** the object environment group count */ - private int objectEnvironmentGroupCount = 0; + private int objectEnvironmentGroupCount; /** * Main constructor diff --git a/src/java/org/apache/fop/afp/fonts/AbstractOutlineFont.java b/src/java/org/apache/fop/afp/fonts/AbstractOutlineFont.java index edbdf5e95..2eaedc0c3 100644 --- a/src/java/org/apache/fop/afp/fonts/AbstractOutlineFont.java +++ b/src/java/org/apache/fop/afp/fonts/AbstractOutlineFont.java @@ -29,7 +29,7 @@ import org.apache.fop.afp.AFPEventProducer; public abstract class AbstractOutlineFont extends AFPFont { /** The character set for this font */ - protected CharacterSet charSet = null; + protected CharacterSet charSet; private final AFPEventProducer eventProducer; diff --git a/src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java b/src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java index a3b2ab8ec..6f19c64d5 100644 --- a/src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java +++ b/src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java @@ -622,7 +622,7 @@ public abstract class CharacterSetBuilder { private int dpi; private int unitsPerEm; - private boolean isRelative = false; + private boolean isRelative; public int getDpi() { return dpi; diff --git a/src/java/org/apache/fop/afp/fonts/FopCharacterSet.java b/src/java/org/apache/fop/afp/fonts/FopCharacterSet.java index b729a8995..b1210c6c1 100644 --- a/src/java/org/apache/fop/afp/fonts/FopCharacterSet.java +++ b/src/java/org/apache/fop/afp/fonts/FopCharacterSet.java @@ -31,7 +31,7 @@ import org.apache.fop.fonts.Typeface; public class FopCharacterSet extends CharacterSet { /** The character set for this font */ - private Typeface charSet = null; + private Typeface charSet; /** * Constructor for the CharacterSetMetric object, the character set is used diff --git a/src/java/org/apache/fop/afp/fonts/RasterFont.java b/src/java/org/apache/fop/afp/fonts/RasterFont.java index 1fd30e0ba..7a5107d04 100644 --- a/src/java/org/apache/fop/afp/fonts/RasterFont.java +++ b/src/java/org/apache/fop/afp/fonts/RasterFont.java @@ -43,7 +43,7 @@ public class RasterFont extends AFPFont { private final SortedMap<Integer, CharacterSet> charSets = new TreeMap<Integer, CharacterSet>(); private Map<Integer, CharacterSet> substitutionCharSets; - private CharacterSet charSet = null; + private CharacterSet charSet; /** * Constructor for the raster font requires the name, weight and style diff --git a/src/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java b/src/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java index 6f91e5809..01333f367 100644 --- a/src/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java +++ b/src/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java @@ -30,10 +30,10 @@ import org.apache.fop.afp.util.BinaryUtils; public abstract class AbstractGraphicsCoord extends AbstractGraphicsDrawingOrder { /** array of x/y coordinates */ - protected int[] coords = null; + protected int[] coords; /** if true, then uses relative drawing order */ - protected boolean relative = false; + protected boolean relative; /** * Constructor diff --git a/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java b/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java index a158fbe8f..5bd05fd4b 100644 --- a/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java +++ b/src/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java @@ -41,10 +41,10 @@ implements StructuredData, Completable, Startable { = new java.util.ArrayList/*<StructuredDataObject>*/(); /** object is complete */ - private boolean complete = false; + private boolean complete; /** object has started */ - private boolean started = false; + private boolean started; /** * Default constructor diff --git a/src/java/org/apache/fop/afp/goca/GraphicsAreaBegin.java b/src/java/org/apache/fop/afp/goca/GraphicsAreaBegin.java index 7f569f233..19a5a8f2d 100644 --- a/src/java/org/apache/fop/afp/goca/GraphicsAreaBegin.java +++ b/src/java/org/apache/fop/afp/goca/GraphicsAreaBegin.java @@ -32,7 +32,7 @@ public class GraphicsAreaBegin extends AbstractGraphicsDrawingOrder { private static final int NO_BOUNDARY = 0; /** draw boundary lines around this area */ - private boolean drawBoundary = false; + private boolean drawBoundary; /** * Sets whether boundary lines are drawn diff --git a/src/java/org/apache/fop/afp/goca/GraphicsData.java b/src/java/org/apache/fop/afp/goca/GraphicsData.java index aa64c23c4..ed406b06e 100644 --- a/src/java/org/apache/fop/afp/goca/GraphicsData.java +++ b/src/java/org/apache/fop/afp/goca/GraphicsData.java @@ -36,7 +36,7 @@ public final class GraphicsData extends AbstractGraphicsDrawingOrderContainer { //+16 to avoid unnecessary, practically empty GraphicsData instances. /** the graphics segment */ - private GraphicsChainedSegment currentSegment = null; + private GraphicsChainedSegment currentSegment; private boolean segmentedData; diff --git a/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java b/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java index 9bcdeda88..ba616def4 100644 --- a/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java +++ b/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java @@ -40,10 +40,10 @@ public class IDEStructureParameter implements Streamable { public static final byte COLOR_MODEL_YCBCR = (byte)0x12; /** additive/subtractive setting for ASFLAG */ - private boolean subtractive = false; + private boolean subtractive; /** setting for GRAYCODE flag */ - private boolean grayCoding = false; + private boolean grayCoding; /** the image color model */ private byte colorModel = COLOR_MODEL_RGB; diff --git a/src/java/org/apache/fop/afp/ioca/ImageCellPosition.java b/src/java/org/apache/fop/afp/ioca/ImageCellPosition.java index 6de100245..216d8bcd5 100644 --- a/src/java/org/apache/fop/afp/ioca/ImageCellPosition.java +++ b/src/java/org/apache/fop/afp/ioca/ImageCellPosition.java @@ -32,10 +32,10 @@ import org.apache.fop.afp.util.BinaryUtils; public class ImageCellPosition extends AbstractAFPObject { /** offset of image cell in X direction */ - private int xOffset = 0; + private int xOffset; /** offset of image cell in Y direction */ - private int yOffset = 0; + private int yOffset; /** size of image cell in X direction */ private final byte[] xSize = new byte[] {(byte)0xFF, (byte)0xFF}; diff --git a/src/java/org/apache/fop/afp/ioca/ImageContent.java b/src/java/org/apache/fop/afp/ioca/ImageContent.java index 81b260bd4..f5dac7b33 100644 --- a/src/java/org/apache/fop/afp/ioca/ImageContent.java +++ b/src/java/org/apache/fop/afp/ioca/ImageContent.java @@ -57,10 +57,10 @@ public class ImageContent extends AbstractStructuredObject { public static final byte COMPID_JPEG = (byte)0x83; /** the image size parameter */ - private ImageSizeParameter imageSizeParameter = null; + private ImageSizeParameter imageSizeParameter; /** the IDE Structure parameter */ - private IDEStructureParameter ideStructureParameter = null; + private IDEStructureParameter ideStructureParameter; /** the image encoding */ private byte encoding = (byte)0x03; diff --git a/src/java/org/apache/fop/afp/ioca/ImageOutputControl.java b/src/java/org/apache/fop/afp/ioca/ImageOutputControl.java index 7ea84dfad..8e7ff750c 100644 --- a/src/java/org/apache/fop/afp/ioca/ImageOutputControl.java +++ b/src/java/org/apache/fop/afp/ioca/ImageOutputControl.java @@ -34,19 +34,19 @@ import org.apache.fop.afp.util.BinaryUtils; public class ImageOutputControl extends AbstractAFPObject { /** the orientation of the image */ - private int orientation = 0; + private int orientation; /** * Specifies the offset, along the X-axis, of the IM image object area * origin to the origin of the including page */ - private int xCoord = 0; + private int xCoord; /** * Specifies the offset, along the Y-axis, of the IM image object area * origin to the origin of the including page */ - private int yCoord = 0; + private int yCoord; /** map an image point to a single presentation device */ private boolean singlePoint = true; diff --git a/src/java/org/apache/fop/afp/ioca/ImageSegment.java b/src/java/org/apache/fop/afp/ioca/ImageSegment.java index 9965bb94a..a0d98f501 100644 --- a/src/java/org/apache/fop/afp/ioca/ImageSegment.java +++ b/src/java/org/apache/fop/afp/ioca/ImageSegment.java @@ -40,7 +40,7 @@ public class ImageSegment extends AbstractNamedAFPObject { /** * The ImageContent for the image segment */ - private ImageContent imageContent = null; + private ImageContent imageContent; private final Factory factory; diff --git a/src/java/org/apache/fop/afp/ioca/ImageSizeParameter.java b/src/java/org/apache/fop/afp/ioca/ImageSizeParameter.java index 38e7d9e56..6700462ec 100644 --- a/src/java/org/apache/fop/afp/ioca/ImageSizeParameter.java +++ b/src/java/org/apache/fop/afp/ioca/ImageSizeParameter.java @@ -30,10 +30,10 @@ import org.apache.fop.afp.util.BinaryUtils; */ public class ImageSizeParameter extends AbstractAFPObject { - private int hSize = 0; - private int vSize = 0; - private int hRes = 0; - private int vRes = 0; + private int hSize; + private int vSize; + private int hRes; + private int vRes; /** * Constructor for a ImageSizeParameter for the specified diff --git a/src/java/org/apache/fop/afp/modca/AbstractDataObject.java b/src/java/org/apache/fop/afp/modca/AbstractDataObject.java index a8bf09998..db4bf23a1 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractDataObject.java +++ b/src/java/org/apache/fop/afp/modca/AbstractDataObject.java @@ -38,7 +38,7 @@ public abstract class AbstractDataObject extends AbstractNamedAFPObject implements Startable, Completable { /** the object environment group */ - protected ObjectEnvironmentGroup objectEnvironmentGroup = null; + protected ObjectEnvironmentGroup objectEnvironmentGroup; /** the object factory */ protected final Factory factory; diff --git a/src/java/org/apache/fop/afp/modca/AbstractDescriptor.java b/src/java/org/apache/fop/afp/modca/AbstractDescriptor.java index 8344bf0d1..0b87f45fc 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractDescriptor.java +++ b/src/java/org/apache/fop/afp/modca/AbstractDescriptor.java @@ -25,13 +25,13 @@ package org.apache.fop.afp.modca; public abstract class AbstractDescriptor extends AbstractTripletStructuredObject { /** width of this descriptor */ - protected int width = 0; + protected int width; /** height of this descriptor */ - protected int height = 0; + protected int height; /** width resolution of this descriptor */ - protected int widthRes = 0; + protected int widthRes; /** height resolution of this descriptor */ - protected int heightRes = 0; + protected int heightRes; /** * Default constructor diff --git a/src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java b/src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java index d06311a47..6b193c072 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java +++ b/src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java @@ -33,7 +33,7 @@ public abstract class AbstractEnvironmentGroup extends AbstractNamedAFPObject { protected final List mapDataResources = null; /** the collection of MapPageOverlay objects */ - protected List mapPageOverlays = null; + protected List mapPageOverlays; /** * Main constructor diff --git a/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java b/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java index 83c720e58..0d1b7bc7e 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java +++ b/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java @@ -34,7 +34,7 @@ public abstract class AbstractNamedAFPObject extends AbstractTripletStructuredOb /** * The actual name of the object */ - protected String name = null; + protected String name; /** * Default constructor diff --git a/src/java/org/apache/fop/afp/modca/AbstractPageObject.java b/src/java/org/apache/fop/afp/modca/AbstractPageObject.java index f429af28d..575697790 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractPageObject.java +++ b/src/java/org/apache/fop/afp/modca/AbstractPageObject.java @@ -52,10 +52,10 @@ import org.apache.fop.afp.ptoca.PtocaProducer; public abstract class AbstractPageObject extends AbstractNamedAFPObject implements Completable { /** The active environment group for the page */ - protected ActiveEnvironmentGroup activeEnvironmentGroup = null; + protected ActiveEnvironmentGroup activeEnvironmentGroup; /** The current presentation text object */ - private PresentationTextObject currentPresentationTextObject = null; + private PresentationTextObject currentPresentationTextObject; /** The list of objects within this resource container */ protected List/*<AbstractStructuredObject>*/ objects = new java.util.ArrayList(); @@ -67,10 +67,10 @@ public abstract class AbstractPageObject extends AbstractNamedAFPObject implemen private int height; /** The page rotation */ - protected int rotation = 0; + protected int rotation; /** The page state */ - protected boolean complete = false; + protected boolean complete; /** The width resolution */ private int widthRes; diff --git a/src/java/org/apache/fop/afp/modca/AbstractResourceEnvironmentGroupContainer.java b/src/java/org/apache/fop/afp/modca/AbstractResourceEnvironmentGroupContainer.java index 1319b3cdb..6e753b1e0 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractResourceEnvironmentGroupContainer.java +++ b/src/java/org/apache/fop/afp/modca/AbstractResourceEnvironmentGroupContainer.java @@ -35,7 +35,7 @@ public abstract class AbstractResourceEnvironmentGroupContainer /** * The resource environment group used to store complex resources */ - protected ResourceEnvironmentGroup resourceEnvironmentGroup = null; + protected ResourceEnvironmentGroup resourceEnvironmentGroup; /** * Main constructor diff --git a/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java b/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java index 45499748c..f52ede652 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java +++ b/src/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java @@ -36,10 +36,10 @@ public abstract class AbstractResourceGroupContainer extends AbstractPageObject implements Streamable { /** The container started state */ - protected boolean started = false; + protected boolean started; /** the resource group object */ - protected ResourceGroup resourceGroup = null; + protected ResourceGroup resourceGroup; /** * Default constructor diff --git a/src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java b/src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java index 97954b9de..05f48b47c 100644 --- a/src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java +++ b/src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java @@ -46,19 +46,19 @@ public final class ActiveEnvironmentGroup extends AbstractEnvironmentGroup { = new java.util.ArrayList/*<MapCodedFonts>*/(); /** the collection of MapPageSegments objects */ - private List mapPageSegments = null; + private List mapPageSegments; /** the Object Area Descriptor for the active environment group */ - private ObjectAreaDescriptor objectAreaDescriptor = null; + private ObjectAreaDescriptor objectAreaDescriptor; /** the Object Area Position for the active environment group */ - private ObjectAreaPosition objectAreaPosition = null; + private ObjectAreaPosition objectAreaPosition; /** the PresentationTextDescriptor for the active environment group */ - private PresentationTextDescriptor presentationTextDataDescriptor = null; + private PresentationTextDescriptor presentationTextDataDescriptor; /** the PageDescriptor for the active environment group */ - private PageDescriptor pageDescriptor = null; + private PageDescriptor pageDescriptor; /** the resource manager */ private final Factory factory; diff --git a/src/java/org/apache/fop/afp/modca/GraphicsObject.java b/src/java/org/apache/fop/afp/modca/GraphicsObject.java index 79aa3147b..434d4f838 100644 --- a/src/java/org/apache/fop/afp/modca/GraphicsObject.java +++ b/src/java/org/apache/fop/afp/modca/GraphicsObject.java @@ -62,7 +62,7 @@ import org.apache.fop.afp.goca.GraphicsSetProcessColor; public class GraphicsObject extends AbstractDataObject { /** the graphics data */ - private GraphicsData currentData = null; + private GraphicsData currentData; /** list of objects contained within this container */ protected List<GraphicsData> objects @@ -73,7 +73,7 @@ public class GraphicsObject extends AbstractDataObject { /** color converter */ - private ColorConverter colorConverter = null; + private ColorConverter colorConverter; /** * Default constructor diff --git a/src/java/org/apache/fop/afp/modca/IMImageObject.java b/src/java/org/apache/fop/afp/modca/IMImageObject.java index a09042441..cf9363f33 100644 --- a/src/java/org/apache/fop/afp/modca/IMImageObject.java +++ b/src/java/org/apache/fop/afp/modca/IMImageObject.java @@ -45,22 +45,22 @@ public class IMImageObject extends AbstractNamedAFPObject { /** * The image output control */ - private ImageOutputControl imageOutputControl = null; + private ImageOutputControl imageOutputControl; /** * The image input descriptor */ - private ImageInputDescriptor imageInputDescriptor = null; + private ImageInputDescriptor imageInputDescriptor; /** * The image cell position */ - private ImageCellPosition imageCellPosition = null; + private ImageCellPosition imageCellPosition; /** * The image rastor data */ - private ImageRasterData imageRasterData = null; + private ImageRasterData imageRasterData; /** * Constructor for the image object with the specified name, diff --git a/src/java/org/apache/fop/afp/modca/ImageObject.java b/src/java/org/apache/fop/afp/modca/ImageObject.java index e42639248..610eacb08 100644 --- a/src/java/org/apache/fop/afp/modca/ImageObject.java +++ b/src/java/org/apache/fop/afp/modca/ImageObject.java @@ -39,7 +39,7 @@ public class ImageObject extends AbstractDataObject { private static final int MAX_DATA_LEN = 8192; /** the image segment */ - private ImageSegment imageSegment = null; + private ImageSegment imageSegment; /** * Constructor for the image object with the specified name, diff --git a/src/java/org/apache/fop/afp/modca/IncludeObject.java b/src/java/org/apache/fop/afp/modca/IncludeObject.java index 4dca1b357..90b8ad664 100644 --- a/src/java/org/apache/fop/afp/modca/IncludeObject.java +++ b/src/java/org/apache/fop/afp/modca/IncludeObject.java @@ -61,10 +61,10 @@ public class IncludeObject extends AbstractNamedAFPObject { private byte objectType = TYPE_OTHER; /** the X-axis origin of the object area */ - private int xoaOset = 0; + private int xoaOset; /** the Y-axis origin of the object area */ - private int yoaOset = 0; + private int yoaOset; /** the orientation of the referenced object */ private AxisOrientation oaOrent = AxisOrientation.RIGHT_HANDED_0; diff --git a/src/java/org/apache/fop/afp/modca/IncludePageOverlay.java b/src/java/org/apache/fop/afp/modca/IncludePageOverlay.java index 4806050cf..a45eba3ed 100644 --- a/src/java/org/apache/fop/afp/modca/IncludePageOverlay.java +++ b/src/java/org/apache/fop/afp/modca/IncludePageOverlay.java @@ -42,17 +42,17 @@ public class IncludePageOverlay extends AbstractNamedAFPObject { /** * The x coordinate */ - private int x = 0; + private int x; /** * The y coordinate */ - private int y = 0; + private int y; /** * The orientation */ - private int orientation = 0; + private int orientation; /** * Constructor for the Include Page Overlay diff --git a/src/java/org/apache/fop/afp/modca/MapCodedFont.java b/src/java/org/apache/fop/afp/modca/MapCodedFont.java index 69d8ccf31..38533652c 100644 --- a/src/java/org/apache/fop/afp/modca/MapCodedFont.java +++ b/src/java/org/apache/fop/afp/modca/MapCodedFont.java @@ -292,7 +292,7 @@ public class MapCodedFont extends AbstractStructuredObject { /** * The scale (only specified for outline fonts) */ - private int scale = 0; + private int scale; } } diff --git a/src/java/org/apache/fop/afp/modca/MapPageOverlay.java b/src/java/org/apache/fop/afp/modca/MapPageOverlay.java index 8b689de71..cde2e031d 100644 --- a/src/java/org/apache/fop/afp/modca/MapPageOverlay.java +++ b/src/java/org/apache/fop/afp/modca/MapPageOverlay.java @@ -39,7 +39,7 @@ public class MapPageOverlay extends AbstractAFPObject { /** * The collection of overlays (maximum of 254 stored as byte[]) */ - private List overLays = null; + private List overLays; /** * Constructor for the Map Page Overlay diff --git a/src/java/org/apache/fop/afp/modca/MapPageSegment.java b/src/java/org/apache/fop/afp/modca/MapPageSegment.java index 5ea533c6b..81d6f4724 100644 --- a/src/java/org/apache/fop/afp/modca/MapPageSegment.java +++ b/src/java/org/apache/fop/afp/modca/MapPageSegment.java @@ -39,7 +39,7 @@ public class MapPageSegment extends AbstractAFPObject { /** * The collection of page segments (maximum of 127 stored as String) */ - private Set pageSegments = null; + private Set pageSegments; /** * Constructor for the Map Page Overlay diff --git a/src/java/org/apache/fop/afp/modca/PageSegment.java b/src/java/org/apache/fop/afp/modca/PageSegment.java index 333608d7f..50c3a642c 100644 --- a/src/java/org/apache/fop/afp/modca/PageSegment.java +++ b/src/java/org/apache/fop/afp/modca/PageSegment.java @@ -31,7 +31,7 @@ import java.util.List; */ public class PageSegment extends AbstractNamedAFPObject { - private List/*<AbstractAFPObject>*/ objects = null; + private List/*<AbstractAFPObject>*/ objects; /** * Main constructor diff --git a/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java b/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java index a7ce0ea0b..db0bac905 100644 --- a/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java +++ b/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java @@ -35,7 +35,7 @@ public class PreprocessPresentationObject extends AbstractTripletStructuredObjec private static final byte TYPE_IMAGE = (byte)0xFB; private byte objType = TYPE_OTHER; - private byte objOrent = 0; // object always processed at 0 degree orientation + private byte objOrent; // object always processed at 0 degree orientation private int objXOffset = -1; private int objYOffset = -1; diff --git a/src/java/org/apache/fop/afp/modca/PresentationTextObject.java b/src/java/org/apache/fop/afp/modca/PresentationTextObject.java index f3b562d98..f4d4d93ed 100644 --- a/src/java/org/apache/fop/afp/modca/PresentationTextObject.java +++ b/src/java/org/apache/fop/afp/modca/PresentationTextObject.java @@ -53,12 +53,12 @@ public class PresentationTextObject extends AbstractNamedAFPObject { /** * The current presentation text data */ - private PresentationTextData currentPresentationTextData = null; + private PresentationTextData currentPresentationTextData; /** * The presentation text data list */ - private List/*<PresentationTextData>*/ presentationTextDataList = null; + private List/*<PresentationTextData>*/ presentationTextDataList; private PtocaBuilder builder = new DefaultBuilder(); diff --git a/src/java/org/apache/fop/afp/modca/Registry.java b/src/java/org/apache/fop/afp/modca/Registry.java index 64afce3b5..50aaca32c 100644 --- a/src/java/org/apache/fop/afp/modca/Registry.java +++ b/src/java/org/apache/fop/afp/modca/Registry.java @@ -48,7 +48,7 @@ public final class Registry { = Collections.synchronizedMap(new HashMap<String, ObjectType>()); /** singleton instance */ - private static Registry instance = null; + private static Registry instance; /** * Returns a single instance of a MO:DCA Registry diff --git a/src/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java b/src/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java index 3f9258741..db9b5e1c9 100644 --- a/src/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java +++ b/src/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java @@ -35,10 +35,10 @@ public class ResourceEnvironmentGroup extends AbstractEnvironmentGroup implement private static final String DEFAULT_NAME = "REG00001"; /** the pre-process presentation objects contained in this resource environment group */ - private List/*<PreprocessPresentationObject>*/ preProcessPresentationObjects = null; + private List/*<PreprocessPresentationObject>*/ preProcessPresentationObjects; /** the resource environment group state */ - private boolean complete = false; + private boolean complete; /** * Default constructor diff --git a/src/java/org/apache/fop/afp/modca/StreamedResourceGroup.java b/src/java/org/apache/fop/afp/modca/StreamedResourceGroup.java index c79ffe299..ed9c82194 100644 --- a/src/java/org/apache/fop/afp/modca/StreamedResourceGroup.java +++ b/src/java/org/apache/fop/afp/modca/StreamedResourceGroup.java @@ -31,9 +31,9 @@ public class StreamedResourceGroup extends ResourceGroup implements Completable /** the outputstream to write to */ private final OutputStream os; - private boolean started = false; + private boolean started; - private boolean complete = false; + private boolean complete; /** * Main constructor diff --git a/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java b/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java index befd2cc1a..d6bd65609 100644 --- a/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java +++ b/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java @@ -51,16 +51,16 @@ public abstract class PtocaBuilder implements PtocaConstants { private int currentFont = Integer.MIN_VALUE; /** the current orientation */ - private int currentOrientation = 0; + private int currentOrientation; /** the current color */ private Color currentColor = Color.BLACK; /** the current variable space increment */ - private int currentVariableSpaceCharacterIncrement = 0; + private int currentVariableSpaceCharacterIncrement; /** the current inter character adjustment */ - private int currentInterCharacterAdjustment = 0; + private int currentInterCharacterAdjustment; /** diff --git a/src/java/org/apache/fop/afp/svg/AFPTextHandler.java b/src/java/org/apache/fop/afp/svg/AFPTextHandler.java index e8e391bdb..00831c985 100644 --- a/src/java/org/apache/fop/afp/svg/AFPTextHandler.java +++ b/src/java/org/apache/fop/afp/svg/AFPTextHandler.java @@ -48,7 +48,7 @@ public class AFPTextHandler extends FOPTextHandlerAdapter { private static Log log = LogFactory.getLog(AFPTextHandler.class); /** Overriding FontState */ - protected Font overrideFont = null; + protected Font overrideFont; /** Font information */ private final FontInfo fontInfo; diff --git a/src/java/org/apache/fop/afp/util/StructuredFieldReader.java b/src/java/org/apache/fop/afp/util/StructuredFieldReader.java index 1fc6d8369..b20e1579f 100644 --- a/src/java/org/apache/fop/afp/util/StructuredFieldReader.java +++ b/src/java/org/apache/fop/afp/util/StructuredFieldReader.java @@ -43,7 +43,7 @@ public class StructuredFieldReader { /** * The input stream to read */ - private InputStream inputStream = null; + private InputStream inputStream; /** * The constructor for the StructuredFieldReader diff --git a/src/java/org/apache/fop/apps/FOUserAgent.java b/src/java/org/apache/fop/apps/FOUserAgent.java index 8b9e079ab..ca267fa8a 100644 --- a/src/java/org/apache/fop/apps/FOUserAgent.java +++ b/src/java/org/apache/fop/apps/FOUserAgent.java @@ -97,12 +97,12 @@ public class FOUserAgent { private float targetResolution = FopFactoryConfig.DEFAULT_TARGET_RESOLUTION; private Map rendererOptions = new java.util.HashMap(); - private File outputFile = null; - private IFDocumentHandler documentHandlerOverride = null; - private Renderer rendererOverride = null; - private FOEventHandler foEventHandlerOverride = null; + private File outputFile; + private IFDocumentHandler documentHandlerOverride; + private Renderer rendererOverride; + private FOEventHandler foEventHandlerOverride; private boolean locatorEnabled = true; // true by default (for error messages). - private boolean conserveMemoryPolicy = false; + private boolean conserveMemoryPolicy; private EventBroadcaster eventBroadcaster = new FOPEventBroadcaster(); private StructureTreeEventHandler structureTreeEventHandler = DummyStructureTreeEventHandler.INSTANCE; @@ -115,21 +115,21 @@ public class FOUserAgent { /** Creator: Metadata element for the user that created the * document. (Some renderers can store this in the document.) */ - protected String creator = null; + protected String creator; /** Creation Date: Override of the date the document was created. * (Some renderers can store this in the document.) */ - protected Date creationDate = null; + protected Date creationDate; /** Author of the content of the document. */ - protected String author = null; + protected String author; /** Title of the document. */ - protected String title = null; + protected String title; /** Subject of the document. */ - protected String subject = null; + protected String subject; /** Set of keywords applicable to this document. */ - protected String keywords = null; + protected String keywords; private final ImageSessionContext imageSessionContext; diff --git a/src/java/org/apache/fop/apps/Fop.java b/src/java/org/apache/fop/apps/Fop.java index 5e3261221..f7b1c39b1 100644 --- a/src/java/org/apache/fop/apps/Fop.java +++ b/src/java/org/apache/fop/apps/Fop.java @@ -46,16 +46,16 @@ import org.apache.fop.fo.FOTreeBuilder; public class Fop { // desired output format: MIME type such as "application/pdf", "application/postscript" etc. - private String outputFormat = null; + private String outputFormat; // output stream to send results to - private OutputStream stream = null; + private OutputStream stream; // FOUserAgent object to set processing options private final FOUserAgent foUserAgent; // FOTreeBuilder object to maintain reference for access to results - private FOTreeBuilder foTreeBuilder = null; + private FOTreeBuilder foTreeBuilder; /** * Constructor for use with already-created FOUserAgents. It uses MIME types to select the diff --git a/src/java/org/apache/fop/apps/FopFactory.java b/src/java/org/apache/fop/apps/FopFactory.java index 6bc744b7e..d9c9708eb 100644 --- a/src/java/org/apache/fop/apps/FopFactory.java +++ b/src/java/org/apache/fop/apps/FopFactory.java @@ -103,7 +103,7 @@ public final class FopFactory implements ImageContext { /** * Map of configured names of hyphenation pattern file names: ll_CC => name */ - private Map/*<String,String>*/ hyphPatNames = null; + private Map/*<String,String>*/ hyphPatNames; /** * FOP has the ability, for some FO's, to continue processing even if the diff --git a/src/java/org/apache/fop/apps/FormattingResults.java b/src/java/org/apache/fop/apps/FormattingResults.java index 0c0cddcc6..e55d51195 100644 --- a/src/java/org/apache/fop/apps/FormattingResults.java +++ b/src/java/org/apache/fop/apps/FormattingResults.java @@ -28,8 +28,8 @@ import org.apache.fop.fo.pagination.AbstractPageSequence; */ public class FormattingResults { - private int pageCount = 0; - private List pageSequences = null; + private int pageCount; + private List pageSequences; /** * Constructor for the FormattingResults object diff --git a/src/java/org/apache/fop/area/AreaTreeHandler.java b/src/java/org/apache/fop/area/AreaTreeHandler.java index 71d22f6d9..fda5ad07b 100644 --- a/src/java/org/apache/fop/area/AreaTreeHandler.java +++ b/src/java/org/apache/fop/area/AreaTreeHandler.java @@ -65,7 +65,7 @@ public class AreaTreeHandler extends FOEventHandler { private static Log log = LogFactory.getLog(AreaTreeHandler.class); // Recorder of debug statistics - private Statistics statistics = null; + private Statistics statistics; // The LayoutManager maker private LayoutManagerMaker lmMaker; @@ -87,7 +87,7 @@ public class AreaTreeHandler extends FOEventHandler { private TopLevelLayoutManager prevPageSeqLM; - private int idGen = 0; + private int idGen; /** * Constructor. diff --git a/src/java/org/apache/fop/area/AreaTreeModel.java b/src/java/org/apache/fop/area/AreaTreeModel.java index 941f6cea2..baa30245e 100644 --- a/src/java/org/apache/fop/area/AreaTreeModel.java +++ b/src/java/org/apache/fop/area/AreaTreeModel.java @@ -37,8 +37,8 @@ import org.apache.commons.logging.LogFactory; * the life of the area tree model. */ public class AreaTreeModel { - private List<PageSequence> pageSequenceList = null; - private int currentPageIndex = 0; + private List<PageSequence> pageSequenceList; + private int currentPageIndex; /** the current page sequence */ protected PageSequence currentPageSequence; diff --git a/src/java/org/apache/fop/area/AreaTreeObject.java b/src/java/org/apache/fop/area/AreaTreeObject.java index 91e76c3d4..83bf98b55 100644 --- a/src/java/org/apache/fop/area/AreaTreeObject.java +++ b/src/java/org/apache/fop/area/AreaTreeObject.java @@ -35,10 +35,10 @@ import org.apache.fop.fo.extensions.ExtensionAttachment; public abstract class AreaTreeObject implements Cloneable { /** Foreign attributes */ - protected Map<QName, String> foreignAttributes = null; + protected Map<QName, String> foreignAttributes; /** Extension attachments */ - protected List<ExtensionAttachment> extensionAttachments = null; + protected List<ExtensionAttachment> extensionAttachments; /** {@inheritDoc} */ public Object clone() throws CloneNotSupportedException { diff --git a/src/java/org/apache/fop/area/BeforeFloat.java b/src/java/org/apache/fop/area/BeforeFloat.java index c4d7e21d6..37f7332a0 100644 --- a/src/java/org/apache/fop/area/BeforeFloat.java +++ b/src/java/org/apache/fop/area/BeforeFloat.java @@ -30,7 +30,7 @@ public class BeforeFloat extends BlockParent { // this is an optional block area that will be rendered // as the separator only if there are float areas - private Block separator = null; + private Block separator; /** * Set the separator area for this before float. diff --git a/src/java/org/apache/fop/area/BlockParent.java b/src/java/org/apache/fop/area/BlockParent.java index 5a64d52cf..72baaeccf 100644 --- a/src/java/org/apache/fop/area/BlockParent.java +++ b/src/java/org/apache/fop/area/BlockParent.java @@ -38,19 +38,19 @@ public class BlockParent extends Area { * Used for relative (serves as left-offset trait) and absolute positioning * (serves as left-position trait). */ - protected int xOffset = 0; + protected int xOffset; /** * The y offset position of this block parent. * Used for relative (serves as top-offset trait) and absolute positioning * (serves as top-position trait). */ - protected int yOffset = 0; + protected int yOffset; /** * The children of this block parent area. */ - protected List<Area> children = null; + protected List<Area> children; /** {@inheritDoc} */ @Override diff --git a/src/java/org/apache/fop/area/BlockViewport.java b/src/java/org/apache/fop/area/BlockViewport.java index 066f2f9e8..58d8d2106 100644 --- a/src/java/org/apache/fop/area/BlockViewport.java +++ b/src/java/org/apache/fop/area/BlockViewport.java @@ -31,7 +31,7 @@ public class BlockViewport extends Block implements Viewport { private static final long serialVersionUID = -7840580922580735157L; // clipping for this viewport - private boolean clip = false; + private boolean clip; // transform if rotated or absolute private CTM viewportCTM; diff --git a/src/java/org/apache/fop/area/BookmarkData.java b/src/java/org/apache/fop/area/BookmarkData.java index 727040a3c..495fd1901 100644 --- a/src/java/org/apache/fop/area/BookmarkData.java +++ b/src/java/org/apache/fop/area/BookmarkData.java @@ -35,7 +35,7 @@ public class BookmarkData extends AbstractOffDocumentItem implements Resolvable private List<BookmarkData> subData = new java.util.ArrayList<BookmarkData>(); // bookmark-title for this fo:bookmark - private String bookmarkTitle = null; + private String bookmarkTitle; // indicator of whether to initially display/hide child bookmarks of this object private boolean showChildren = true; @@ -44,7 +44,7 @@ public class BookmarkData extends AbstractOffDocumentItem implements Resolvable private String idRef; // PageViewport that the idRef item refers to - private PageViewport pageRef = null; + private PageViewport pageRef; // unresolved idrefs by this bookmark and child bookmarks below it private Map<String, List<Resolvable>> unresolvedIDRefs diff --git a/src/java/org/apache/fop/area/DestinationData.java b/src/java/org/apache/fop/area/DestinationData.java index 5797e41df..1dffb3b92 100644 --- a/src/java/org/apache/fop/area/DestinationData.java +++ b/src/java/org/apache/fop/area/DestinationData.java @@ -34,7 +34,7 @@ public class DestinationData extends AbstractOffDocumentItem implements Resolvab private String[] idRefs; // PageViewport that the idRef item refers to - private PageViewport pageRef = null; + private PageViewport pageRef; /** * Create a new pdf destination data object. diff --git a/src/java/org/apache/fop/area/Footnote.java b/src/java/org/apache/fop/area/Footnote.java index 28f3ee523..cbf8f80fa 100644 --- a/src/java/org/apache/fop/area/Footnote.java +++ b/src/java/org/apache/fop/area/Footnote.java @@ -30,7 +30,7 @@ public class Footnote extends BlockParent { private static final long serialVersionUID = -7907428219886367161L; - private Block separator = null; + private Block separator; // footnote has an optional separator // and a list of sub block areas that can be added/removed diff --git a/src/java/org/apache/fop/area/LineArea.java b/src/java/org/apache/fop/area/LineArea.java index b7a580cb0..8debd1e3d 100644 --- a/src/java/org/apache/fop/area/LineArea.java +++ b/src/java/org/apache/fop/area/LineArea.java @@ -75,7 +75,7 @@ public class LineArea extends Area { } } - private LineAdjustingInfo adjustingInfo = null; + private LineAdjustingInfo adjustingInfo; // this class can contain the dominant char styling info // this means that many renderers can optimise a bit diff --git a/src/java/org/apache/fop/area/LinkResolver.java b/src/java/org/apache/fop/area/LinkResolver.java index 576914a97..0d5672e2b 100644 --- a/src/java/org/apache/fop/area/LinkResolver.java +++ b/src/java/org/apache/fop/area/LinkResolver.java @@ -30,10 +30,10 @@ public class LinkResolver implements Resolvable, Serializable { private static final long serialVersionUID = -7102134165192960718L; - private boolean resolved = false; + private boolean resolved; private String idRef; private Area area; - private transient List<Resolvable> dependents = null; + private transient List<Resolvable> dependents; /** * Create a new link resolver. diff --git a/src/java/org/apache/fop/area/Page.java b/src/java/org/apache/fop/area/Page.java index 209476199..e26429fcc 100644 --- a/src/java/org/apache/fop/area/Page.java +++ b/src/java/org/apache/fop/area/Page.java @@ -59,17 +59,17 @@ public class Page extends AreaTreeObject implements Serializable { private static final long serialVersionUID = 6272157047421543866L; // contains before, start, body, end and after regions - private RegionViewport regionBefore = null; - private RegionViewport regionStart = null; - private RegionViewport regionBody = null; - private RegionViewport regionEnd = null; - private RegionViewport regionAfter = null; + private RegionViewport regionBefore; + private RegionViewport regionStart; + private RegionViewport regionBody; + private RegionViewport regionEnd; + private RegionViewport regionAfter; // temporary map of unresolved objects used when serializing the page - private Map<String, List<Resolvable>> unresolved = null; + private Map<String, List<Resolvable>> unresolved; /** Set to true to make this page behave as if it were not empty. */ - private boolean fakeNonEmpty = false; + private boolean fakeNonEmpty; /** * Empty constructor diff --git a/src/java/org/apache/fop/area/PageViewport.java b/src/java/org/apache/fop/area/PageViewport.java index b5f73b4c6..3235d8f3c 100644 --- a/src/java/org/apache/fop/area/PageViewport.java +++ b/src/java/org/apache/fop/area/PageViewport.java @@ -62,7 +62,7 @@ public class PageViewport extends AreaTreeObject implements Resolvable { private String pageKey; private int pageNumber = -1; - private String pageNumberString = null; + private String pageNumberString; private int pageIndex = -1; //-1 = undetermined private boolean blank; @@ -77,7 +77,7 @@ public class PageViewport extends AreaTreeObject implements Resolvable { private Map<String, List<Resolvable>> unresolvedIDRefs = new java.util.HashMap<String, List<Resolvable>>(); - private Map<String, List<PageViewport>> pendingResolved = null; + private Map<String, List<PageViewport>> pendingResolved; private Markers pageMarkers; diff --git a/src/java/org/apache/fop/area/RegionViewport.java b/src/java/org/apache/fop/area/RegionViewport.java index 1b1c5ae7d..36984b610 100644 --- a/src/java/org/apache/fop/area/RegionViewport.java +++ b/src/java/org/apache/fop/area/RegionViewport.java @@ -39,7 +39,7 @@ public class RegionViewport extends Area implements Viewport { // this rectangle is relative to the page private RegionReference regionReference; private Rectangle2D viewArea; - private boolean clip = false; + private boolean clip; /** * Create a new region-viewport-area diff --git a/src/java/org/apache/fop/area/Trait.java b/src/java/org/apache/fop/area/Trait.java index bd8182099..2d733022e 100644 --- a/src/java/org/apache/fop/area/Trait.java +++ b/src/java/org/apache/fop/area/Trait.java @@ -491,13 +491,13 @@ public final class Trait implements Serializable { private static final long serialVersionUID = 8452078676273242870L; /** The background color if any. */ - private Color color = null; + private Color color; /** The background image url if any. */ - private String url = null; + private String url; /** The background image if any. */ - private ImageInfo imageInfo = null; + private ImageInfo imageInfo; /** Background repeat enum for images. */ private int repeat; diff --git a/src/java/org/apache/fop/area/inline/AbstractTextArea.java b/src/java/org/apache/fop/area/inline/AbstractTextArea.java index 348820939..0a4b2b504 100644 --- a/src/java/org/apache/fop/area/inline/AbstractTextArea.java +++ b/src/java/org/apache/fop/area/inline/AbstractTextArea.java @@ -39,7 +39,7 @@ public abstract class AbstractTextArea extends InlineParent { * and the default width of a space according to the font * (this is equivalent to the property word-spacing.optimum) */ - protected int spaceDifference = 0; + protected int spaceDifference; /** * Constructor @@ -53,10 +53,10 @@ public abstract class AbstractTextArea extends InlineParent { } } - private int textWordSpaceAdjust = 0; - private int textLetterSpaceAdjust = 0; - private TextAdjustingInfo textAdjustingInfo = null; - private int baselineOffset = 0; + private int textWordSpaceAdjust; + private int textLetterSpaceAdjust; + private TextAdjustingInfo textAdjustingInfo; + private int baselineOffset; /** * Default constructor diff --git a/src/java/org/apache/fop/area/inline/InlineArea.java b/src/java/org/apache/fop/area/inline/InlineArea.java index c6089f1e0..8994663a2 100644 --- a/src/java/org/apache/fop/area/inline/InlineArea.java +++ b/src/java/org/apache/fop/area/inline/InlineArea.java @@ -81,26 +81,26 @@ public class InlineArea extends Area { /** * offset position from before edge of parent area */ - protected int blockProgressionOffset = 0; + protected int blockProgressionOffset; /** * parent area * it is needed in order to recompute adjust ratio and indents * when a page-number or a page-number-citation is resolved */ - private Area parentArea = null; + private Area parentArea; /** * ipd variation of child areas: if this area has not already * been added and cannot notify its parent area, store the variation * and wait for the parent area to be set */ - private int storedIPDVariation = 0; + private int storedIPDVariation; /** * The adjustment information object */ - protected InlineAdjustingInfo adjustingInfo = null; + protected InlineAdjustingInfo adjustingInfo; /** * Default constructor for 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 982e8848f..f2a7fecee 100644 --- a/src/java/org/apache/fop/area/inline/InlineBlockParent.java +++ b/src/java/org/apache/fop/area/inline/InlineBlockParent.java @@ -35,7 +35,7 @@ public class InlineBlockParent extends InlineArea { /** * The list of inline areas added to this inline parent. */ - protected Block child = null; + protected Block child; /** * Create a new inline block parent to add areas to. diff --git a/src/java/org/apache/fop/area/inline/InlineViewport.java b/src/java/org/apache/fop/area/inline/InlineViewport.java index c2e1243c0..32c4c1235 100644 --- a/src/java/org/apache/fop/area/inline/InlineViewport.java +++ b/src/java/org/apache/fop/area/inline/InlineViewport.java @@ -40,7 +40,7 @@ public class InlineViewport extends InlineArea implements Viewport { // contents could be container, foreign object or image private Area content; // clipping for the viewport - private boolean clip = false; + private boolean clip; // position of the child area relative to this area private Rectangle2D contentPosition; diff --git a/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java b/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java index df991cd20..64d79b536 100644 --- a/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java +++ b/src/java/org/apache/fop/area/inline/UnresolvedPageNumber.java @@ -36,7 +36,7 @@ public class UnresolvedPageNumber extends TextArea implements Resolvable { private static final long serialVersionUID = -1758090835371647980L; - private boolean resolved = false; + private boolean resolved; private String pageIDRef; private String text; private boolean pageType; diff --git a/src/java/org/apache/fop/cli/CommandLineOptions.java b/src/java/org/apache/fop/cli/CommandLineOptions.java index b559e90b8..8a5259ef0 100644 --- a/src/java/org/apache/fop/cli/CommandLineOptions.java +++ b/src/java/org/apache/fop/cli/CommandLineOptions.java @@ -89,31 +89,31 @@ public class CommandLineOptions { /* for area tree XML output, only down to block area level */ private Boolean suppressLowLevelAreas = Boolean.FALSE; /* user configuration file */ - private File userConfigFile = null; + private File userConfigFile; /* input fo file */ - private File fofile = null; + private File fofile; /* xsltfile (xslt transformation as input) */ - private File xsltfile = null; + private File xsltfile; /* xml file (xslt transformation as input) */ - private File xmlfile = null; + private File xmlfile; /* area tree input file */ - private File areatreefile = null; + private File areatreefile; /* intermediate format input file */ - private File iffile = null; + private File iffile; /* area tree input file */ - private File imagefile = null; + private File imagefile; /* output file */ - private File outfile = null; + private File outfile; /* input mode */ private int inputmode = NOT_SET; /* output mode */ - private String outputmode = null; + private String outputmode; /* true if System.in (stdin) should be used for the input file */ - private boolean useStdIn = false; + private boolean useStdIn; /* true if System.out (stdout) should be used for the output file */ - private boolean useStdOut = false; + private boolean useStdOut; /* true if a catalog resolver should be used for entity and uri resolution */ - private boolean useCatalogResolver = false; + private boolean useCatalogResolver; /* rendering options (for the user agent) */ private Map renderingOptions = new java.util.HashMap(); /* target resolution (for the user agent) */ @@ -121,11 +121,11 @@ public class CommandLineOptions { private boolean strictValidation = true; /* control memory-conservation policy */ - private boolean conserveMemoryPolicy = false; + private boolean conserveMemoryPolicy; /* true if a complex script features are enabled */ private boolean useComplexScriptFeatures = true; /* set to true if -dpi used in command line */ - private boolean overrideTargetResolution = false; + private boolean overrideTargetResolution; private FopFactory factory; private FOUserAgent foUserAgent; @@ -134,11 +134,11 @@ public class CommandLineOptions { private Log log; - private Vector xsltParams = null; + private Vector xsltParams; - private String mimicRenderer = null; + private String mimicRenderer; - private boolean flushCache = false; + private boolean flushCache; private URI baseURI = new File(".").getAbsoluteFile().toURI(); diff --git a/src/java/org/apache/fop/cli/InputHandler.java b/src/java/org/apache/fop/cli/InputHandler.java index 3320c0b1f..5b9d2fd77 100644 --- a/src/java/org/apache/fop/cli/InputHandler.java +++ b/src/java/org/apache/fop/cli/InputHandler.java @@ -64,8 +64,8 @@ public class InputHandler implements ErrorListener, Renderable { protected File sourcefile; private File stylesheet; // for XML/XSLT usage private Vector xsltParams; // for XML/XSLT usage - private EntityResolver entityResolver = null; - private URIResolver uriResolver = null; + private EntityResolver entityResolver; + private URIResolver uriResolver; /** the logger */ protected Log log = LogFactory.getLog(InputHandler.class); diff --git a/src/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java b/src/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java index 410f5e544..469bb6211 100644 --- a/src/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java +++ b/src/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java @@ -125,9 +125,9 @@ public class GlyphMappingTable { /** range mapping table base class */ protected abstract static class RangeMappingTable extends GlyphMappingTable { - private int[] sa = null; // array of range (inclusive) starts - private int[] ea = null; // array of range (inclusive) ends - private int[] ma = null; // array of range mapped values + private int[] sa; // array of range (inclusive) starts + private int[] ea; // array of range (inclusive) ends + private int[] ma; // array of range mapped values private int miMax = -1; /** * Construct range mapping table. diff --git a/src/java/org/apache/fop/complexscripts/util/CharScript.java b/src/java/org/apache/fop/complexscripts/util/CharScript.java index 6809be609..6442b7dbd 100644 --- a/src/java/org/apache/fop/complexscripts/util/CharScript.java +++ b/src/java/org/apache/fop/complexscripts/util/CharScript.java @@ -849,8 +849,8 @@ public final class CharScript { } } - private static Map<Integer, String> scriptTagsMap = null; - private static Map<String, Integer> scriptCodeMap = null; + private static Map<Integer, String> scriptTagsMap; + private static Map<String, Integer> scriptCodeMap; private static void putScriptTag(Map tm, Map cm, int code, String tag) { assert tag != null; diff --git a/src/java/org/apache/fop/datatypes/KeepValue.java b/src/java/org/apache/fop/datatypes/KeepValue.java index 51d8bbd51..36fff432a 100644 --- a/src/java/org/apache/fop/datatypes/KeepValue.java +++ b/src/java/org/apache/fop/datatypes/KeepValue.java @@ -31,7 +31,7 @@ public class KeepValue { /** constant for a user-settable keep-with value (??) */ public static final String KEEP_WITH_VALUE = "KEEP_WITH_VALUE"; private String type = KEEP_WITH_AUTO; - private int value = 0; + private int value; /** * Constructor diff --git a/src/java/org/apache/fop/datatypes/ValidationPercentBaseContext.java b/src/java/org/apache/fop/datatypes/ValidationPercentBaseContext.java index dba6d89ff..fe9caf5fe 100644 --- a/src/java/org/apache/fop/datatypes/ValidationPercentBaseContext.java +++ b/src/java/org/apache/fop/datatypes/ValidationPercentBaseContext.java @@ -47,7 +47,7 @@ public final class ValidationPercentBaseContext implements PercentBaseContext { return 100000; } - private static PercentBaseContext pseudoContextForValidation = null; + private static PercentBaseContext pseudoContextForValidation; /** @return a base context for validation purposes. See class description. */ public static PercentBaseContext getPseudoContext() { diff --git a/src/java/org/apache/fop/fo/ElementMapping.java b/src/java/org/apache/fop/fo/ElementMapping.java index befb65eff..fcd1b9e89 100644 --- a/src/java/org/apache/fop/fo/ElementMapping.java +++ b/src/java/org/apache/fop/fo/ElementMapping.java @@ -38,11 +38,11 @@ public abstract class ElementMapping { public static final String DEFAULT = "<default>"; /** The HashMap table of formatting objects defined by the ElementMapping */ - protected HashMap<String, Maker> foObjs = null; + protected HashMap<String, Maker> foObjs; //Please don't change that to java.util.Map as that can break extensions. /** The namespace for the ElementMapping */ - protected String namespaceURI = null; + protected String namespaceURI; /** * Returns a HashMap of maker objects for this element mapping diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java index 2c97594ce..4615b33b5 100644 --- a/src/java/org/apache/fop/fo/FOPropertyMapping.java +++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java @@ -86,23 +86,23 @@ public final class FOPropertyMapping implements Constants { private static Map<String, Integer> subPropNames = new HashMap<String, Integer>(); private static Map<Integer, String> propIds = new HashMap<Integer, String>(); - private static PropertyMaker[] generics = null; + private static PropertyMaker[] generics; // The rest is only used during the building of the generics array. - private Property[] enums = null; - - private PropertyMaker genericColor = null; - private PropertyMaker genericBoolean = null; - private PropertyMaker genericKeep = null; - private PropertyMaker genericCondLength = null; - private PropertyMaker genericCondPadding = null; - private PropertyMaker genericPadding = null; - private PropertyMaker genericCondBorderWidth = null; - private PropertyMaker genericBorderWidth = null; - private PropertyMaker genericBorderStyle = null; - private PropertyMaker genericCondCornerRadius = null; - private PropertyMaker genericBreak = null; - private PropertyMaker genericSpace = null; + private Property[] enums; + + private PropertyMaker genericColor; + private PropertyMaker genericBoolean; + private PropertyMaker genericKeep; + private PropertyMaker genericCondLength; + private PropertyMaker genericCondPadding; + private PropertyMaker genericPadding; + private PropertyMaker genericCondBorderWidth; + private PropertyMaker genericBorderWidth; + private PropertyMaker genericBorderStyle; + private PropertyMaker genericCondCornerRadius; + private PropertyMaker genericBreak; + private PropertyMaker genericSpace; /** * Create the generic property maker templates. These templates diff --git a/src/java/org/apache/fop/fo/FOText.java b/src/java/org/apache/fop/fo/FOText.java index e32094907..305e2db57 100644 --- a/src/java/org/apache/fop/fo/FOText.java +++ b/src/java/org/apache/fop/fo/FOText.java @@ -71,19 +71,19 @@ public class FOText extends FONode implements CharSequence, TextFragment { * Points to the previous FOText object created within the current * block. If this is "null", this is the first such object. */ - private FOText prevFOTextThisBlock = null; + private FOText prevFOTextThisBlock; /** * Points to the next FOText object created within the current * block. If this is "null", this is the last such object. */ - private FOText nextFOTextThisBlock = null; + private FOText nextFOTextThisBlock; /** * Points to the ancestor Block object. This is used to keep track of * which FOText nodes are descendants of the same block. */ - private Block ancestorBlock = null; + private Block ancestorBlock; /** Holds the text decoration values. May be null */ private CommonTextDecoration textDecoration; @@ -507,10 +507,10 @@ public class FOText extends FONode implements CharSequence, TextFragment { private class TextCharIterator extends CharIterator { - private int currentPosition = 0; + private int currentPosition; - private boolean canRemove = false; - private boolean canReplace = false; + private boolean canRemove; + private boolean canReplace; public TextCharIterator() { } diff --git a/src/java/org/apache/fop/fo/FOTreeBuilder.java b/src/java/org/apache/fop/fo/FOTreeBuilder.java index 68380a300..e3afbbb75 100644 --- a/src/java/org/apache/fop/fo/FOTreeBuilder.java +++ b/src/java/org/apache/fop/fo/FOTreeBuilder.java @@ -60,7 +60,7 @@ public class FOTreeBuilder extends DefaultHandler { protected ElementMappingRegistry elementMappingRegistry; /** The root of the formatting object tree */ - protected Root rootFObj = null; + protected Root rootFObj; /** Main DefaultHandler that handles the FO namespace. */ protected MainFOHandler mainFOHandler; @@ -80,7 +80,7 @@ public class FOTreeBuilder extends DefaultHandler { /** The user agent for this processing run. */ private FOUserAgent userAgent; - private boolean used = false; + private boolean used; private boolean empty = true; private int depth; @@ -242,13 +242,13 @@ public class FOTreeBuilder extends DefaultHandler { private class MainFOHandler extends DefaultHandler { /** Current formatting object being handled */ - protected FONode currentFObj = null; + protected FONode currentFObj; /** Current propertyList for the node being handled */ protected PropertyList currentPropertyList; /** Current marker nesting-depth */ - private int nestedMarkerDepth = 0; + private int nestedMarkerDepth; /** {@inheritDoc} */ public void startElement(String namespaceURI, String localName, String rawName, diff --git a/src/java/org/apache/fop/fo/FOTreeBuilderContext.java b/src/java/org/apache/fop/fo/FOTreeBuilderContext.java index 870b2b599..f1060e6a4 100644 --- a/src/java/org/apache/fop/fo/FOTreeBuilderContext.java +++ b/src/java/org/apache/fop/fo/FOTreeBuilderContext.java @@ -46,7 +46,7 @@ public class FOTreeBuilderContext { /** * Indicates whether processing descendants of a marker */ - private boolean inMarker = false; + private boolean inMarker; /** * Returns the set of ID references. diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index 8532b27da..a649bfe6f 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -58,15 +58,15 @@ public abstract class FObj extends FONode implements Constants { protected FONode lastChild; /** The list of extension attachments, null if none */ - private List<ExtensionAttachment> extensionAttachments = null; + private List<ExtensionAttachment> extensionAttachments; /** The map of foreign attributes, null if none */ - private Map<QName, String> foreignAttributes = null; + private Map<QName, String> foreignAttributes; /** Used to indicate if this FO is either an Out Of Line FO (see rec) * or a descendant of one. Used during FO validation. */ - private boolean isOutOfLineFODescendant = false; + private boolean isOutOfLineFODescendant; /** Markers added to this element. */ private Map<String, Marker> markers; diff --git a/src/java/org/apache/fop/fo/FObjMixed.java b/src/java/org/apache/fop/fo/FObjMixed.java index f0a4e2695..f66b095b1 100644 --- a/src/java/org/apache/fop/fo/FObjMixed.java +++ b/src/java/org/apache/fop/fo/FObjMixed.java @@ -30,7 +30,7 @@ import org.apache.fop.apps.FOPException; public abstract class FObjMixed extends FObj { /** Represents accumulated, pending FO text. See {@link #flushText()}. */ - private FOText ft = null; + private FOText ft; /** Used for white-space handling; start CharIterator at node ... */ protected FONode currentTextNode; @@ -38,7 +38,7 @@ public abstract class FObjMixed extends FObj { /** Used in creating pointers between subsequent {@link FOText} nodes * in the same {@link org.apache.fop.fo.flow.Block} * (for handling text-transform) */ - protected FOText lastFOTextProcessed = null; + protected FOText lastFOTextProcessed; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/PropertyList.java b/src/java/org/apache/fop/fo/PropertyList.java index 99018636e..2f4d16480 100644 --- a/src/java/org/apache/fop/fo/PropertyList.java +++ b/src/java/org/apache/fop/fo/PropertyList.java @@ -56,8 +56,8 @@ public abstract class PropertyList { private static boolean[] inheritableProperty; /** reference to the parent FO's propertyList **/ - protected PropertyList parentPropertyList = null; - private FObj fobj = null; + protected PropertyList parentPropertyList; + private FObj fobj; private static Log log = LogFactory.getLog(PropertyList.class); diff --git a/src/java/org/apache/fop/fo/RecursiveCharIterator.java b/src/java/org/apache/fop/fo/RecursiveCharIterator.java index 0e9138586..2afb97bcd 100644 --- a/src/java/org/apache/fop/fo/RecursiveCharIterator.java +++ b/src/java/org/apache/fop/fo/RecursiveCharIterator.java @@ -32,12 +32,12 @@ public class RecursiveCharIterator extends CharIterator { /** parent node for whose child nodes this iterator iterates */ private FONode fobj; /** iterator for the child nodes */ - private Iterator childIter = null; + private Iterator childIter; /** current child object that is being managed by childIter*/ private FONode curChild; /** CharIterator for curChild's characters */ - private CharIterator curCharIter = null; + private CharIterator curCharIter; /** * Constructor which creates an iterator for all child nodes diff --git a/src/java/org/apache/fop/fo/XMLObj.java b/src/java/org/apache/fop/fo/XMLObj.java index 5f20fa159..a62054e72 100644 --- a/src/java/org/apache/fop/fo/XMLObj.java +++ b/src/java/org/apache/fop/fo/XMLObj.java @@ -42,7 +42,7 @@ import org.apache.fop.util.XMLConstants; public abstract class XMLObj extends FONode implements ObjectBuiltListener { // temp reference for attributes - private Attributes attr = null; + private Attributes attr; /** DOM element representing this node */ protected Element element; diff --git a/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java b/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java index bc406cfcd..e37618736 100644 --- a/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java +++ b/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java @@ -63,7 +63,7 @@ import org.apache.fop.util.CharUtilities; public class XMLWhiteSpaceHandler { /** True if we are in a run of white space */ - private boolean inWhiteSpace = false; + private boolean inWhiteSpace; /** True if the last char was a linefeed */ private boolean afterLinefeed = true; /** Counter, increased every time a non-white-space is encountered */ @@ -392,7 +392,7 @@ public class XMLWhiteSpaceHandler { * the following child is a block-level FO) */ private class EOLchecker { - private boolean nextIsEOL = false; + private boolean nextIsEOL; private RecursiveCharIterator charIter; EOLchecker(CharIterator charIter) { diff --git a/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java b/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java index 22b5c05e4..a4438d1bd 100644 --- a/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java +++ b/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java @@ -48,12 +48,12 @@ class PropertyTokenizer { static final int TOK_INTEGER = TOK_FLOAT + 1; protected int currentToken = TOK_EOF; - protected String currentTokenValue = null; - protected int currentUnitLength = 0; + protected String currentTokenValue; + protected int currentUnitLength; - private int currentTokenStartIndex = 0; + private int currentTokenStartIndex; private /* final */ String expr; - private int exprIndex = 0; + private int exprIndex; private int exprLength; /** diff --git a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java index 3d6b7df5b..3e5ad738d 100644 --- a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java +++ b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java @@ -67,7 +67,7 @@ public class RelativeNumericProperty extends Property implements Length { /** * The second operand. */ - private Numeric op2 = null; + private Numeric op2; /** * The dimension of the result. */ diff --git a/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java b/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java index c8e8fc620..f10456000 100644 --- a/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java +++ b/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java @@ -45,7 +45,7 @@ public abstract class AbstractListItemPart extends FObj implements CommonAccessi // End of property values /** used for FO validation */ - private boolean blockItemFound = false; + private boolean blockItemFound; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/flow/BasicLink.java b/src/java/org/apache/fop/fo/flow/BasicLink.java index 3394842fb..9a490c58b 100644 --- a/src/java/org/apache/fop/fo/flow/BasicLink.java +++ b/src/java/org/apache/fop/fo/flow/BasicLink.java @@ -58,7 +58,7 @@ public class BasicLink extends InlineLevel implements StructureTreeElementHolder // End of property values // used only for FO validation - private boolean blockOrInlineItemFound = false; + private boolean blockOrInlineItemFound; /** * Construct a BasicLink instance with the given {@link FONode} diff --git a/src/java/org/apache/fop/fo/flow/Block.java b/src/java/org/apache/fop/fo/flow/Block.java index 13b218b55..aa55b24a3 100644 --- a/src/java/org/apache/fop/fo/flow/Block.java +++ b/src/java/org/apache/fop/fo/flow/Block.java @@ -51,8 +51,8 @@ public class Block extends FObjMixed implements BreakPropertySet, CommonAccessibilityHolder { // used for FO validation - private boolean blockOrInlineItemFound = false; - private boolean initialPropertySetFound = false; + private boolean blockOrInlineItemFound; + private boolean initialPropertySetFound; // The value of FO traits (refined properties) that apply to fo:block. private CommonAccessibility commonAccessibility; diff --git a/src/java/org/apache/fop/fo/flow/BlockContainer.java b/src/java/org/apache/fop/fo/flow/BlockContainer.java index b250a117c..d5d8114ea 100644 --- a/src/java/org/apache/fop/fo/flow/BlockContainer.java +++ b/src/java/org/apache/fop/fo/flow/BlockContainer.java @@ -67,7 +67,7 @@ public class BlockContainer extends FObj implements BreakPropertySet, WritingMod // End of FO trait values /** used for FO validation */ - private boolean blockItemFound = false; + private boolean blockItemFound; /** * Creates a new BlockContainer instance as a child of diff --git a/src/java/org/apache/fop/fo/flow/Float.java b/src/java/org/apache/fop/fo/flow/Float.java index c12998144..3fb273042 100644 --- a/src/java/org/apache/fop/fo/flow/Float.java +++ b/src/java/org/apache/fop/fo/flow/Float.java @@ -38,7 +38,7 @@ public class Float extends FObj { // private int clear; // End of property values - private static boolean notImplementedWarningGiven = false; + private static boolean notImplementedWarningGiven; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/flow/Footnote.java b/src/java/org/apache/fop/fo/flow/Footnote.java index 3aa2097a2..e997cee67 100644 --- a/src/java/org/apache/fop/fo/flow/Footnote.java +++ b/src/java/org/apache/fop/fo/flow/Footnote.java @@ -37,7 +37,7 @@ public class Footnote extends FObj implements CommonAccessibilityHolder { private CommonAccessibility commonAccessibility; - private Inline footnoteCitation = null; + private Inline footnoteCitation; private FootnoteBody footnoteBody; /** diff --git a/src/java/org/apache/fop/fo/flow/Inline.java b/src/java/org/apache/fop/fo/flow/Inline.java index d115f469a..7a9558bd8 100644 --- a/src/java/org/apache/fop/fo/flow/Inline.java +++ b/src/java/org/apache/fop/fo/flow/Inline.java @@ -47,7 +47,7 @@ public class Inline extends InlineLevel { // private int wrapOption; // End of property values // used for FO validation - private boolean blockOrInlineItemFound = false; + private boolean blockOrInlineItemFound; private boolean canHaveBlockLevelChildren = true; /** diff --git a/src/java/org/apache/fop/fo/flow/ListBlock.java b/src/java/org/apache/fop/fo/flow/ListBlock.java index 647891131..452f2c4d4 100644 --- a/src/java/org/apache/fop/fo/flow/ListBlock.java +++ b/src/java/org/apache/fop/fo/flow/ListBlock.java @@ -61,7 +61,7 @@ public class ListBlock extends FObj implements BreakPropertySet, CommonAccessibi private Length orphanContentLimit; // used for child node validation - private boolean hasListItem = false; + private boolean hasListItem; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/flow/ListItem.java b/src/java/org/apache/fop/fo/flow/ListItem.java index 1f6973942..ec04d3bde 100644 --- a/src/java/org/apache/fop/fo/flow/ListItem.java +++ b/src/java/org/apache/fop/fo/flow/ListItem.java @@ -57,8 +57,8 @@ public class ListItem extends FObj implements BreakPropertySet, CommonAccessibil // private int relativeAlign; // End of property values - private ListItemLabel label = null; - private ListItemBody body = null; + private ListItemLabel label; + private ListItemBody body; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/flow/MultiProperties.java b/src/java/org/apache/fop/fo/flow/MultiProperties.java index ff8192006..653c5f74d 100644 --- a/src/java/org/apache/fop/fo/flow/MultiProperties.java +++ b/src/java/org/apache/fop/fo/flow/MultiProperties.java @@ -37,11 +37,11 @@ public class MultiProperties extends FObj { // private CommonAccessibility commonAccessibility; // End of property values - private static boolean notImplementedWarningGiven = false; + private static boolean notImplementedWarningGiven; // used for input FO validation - private boolean hasMultiPropertySet = false; - private boolean hasWrapper = false; + private boolean hasMultiPropertySet; + private boolean hasWrapper; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/flow/MultiPropertySet.java b/src/java/org/apache/fop/fo/flow/MultiPropertySet.java index 6e7c6a3e0..7a1c5a01e 100644 --- a/src/java/org/apache/fop/fo/flow/MultiPropertySet.java +++ b/src/java/org/apache/fop/fo/flow/MultiPropertySet.java @@ -37,7 +37,7 @@ public class MultiPropertySet extends FObj { // private ToBeImplementedProperty activeState; // End of property values - private static boolean notImplementedWarningGiven = false; + private static boolean notImplementedWarningGiven; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/flow/MultiToggle.java b/src/java/org/apache/fop/fo/flow/MultiToggle.java index 05a634ada..211c5b8b8 100644 --- a/src/java/org/apache/fop/fo/flow/MultiToggle.java +++ b/src/java/org/apache/fop/fo/flow/MultiToggle.java @@ -39,7 +39,7 @@ public class MultiToggle extends FObj { public StringProperty prSwitchTo; // End of property values - private static boolean notImplementedWarningGiven = false; + private static boolean notImplementedWarningGiven; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/flow/Wrapper.java b/src/java/org/apache/fop/fo/flow/Wrapper.java index 134d65c9a..e6625a538 100644 --- a/src/java/org/apache/fop/fo/flow/Wrapper.java +++ b/src/java/org/apache/fop/fo/flow/Wrapper.java @@ -40,7 +40,7 @@ import org.apache.fop.fo.properties.CommonAccessibilityHolder; public class Wrapper extends FObjMixed implements CommonAccessibilityHolder { // used for FO validation - private boolean blockOrInlineItemFound = false; + private boolean blockOrInlineItemFound; private CommonAccessibility commonAccessibility; diff --git a/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java b/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java index 783c2ff8f..0af17996d 100644 --- a/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java +++ b/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java @@ -62,7 +62,7 @@ class CollapsingBorderResolver implements BorderResolver { /* TODO Temporary hack for resolved borders in header */ /* Currently the normal border is always used. */ - private List/*<GridUnit>*/ headerLastRow = null; + private List/*<GridUnit>*/ headerLastRow; /* End of temporary hack */ /** diff --git a/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java b/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java index 275905f2d..c3aa9e710 100644 --- a/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java +++ b/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java @@ -37,7 +37,7 @@ class FixedColRowGroupBuilder extends RowGroupBuilder { /** Number of columns in the corresponding table. */ private int numberOfColumns; - private TableRow currentTableRow = null; + private TableRow currentTableRow; /** 0-based, index in the row group. */ private int currentRowIndex; diff --git a/src/java/org/apache/fop/fo/flow/table/GridUnit.java b/src/java/org/apache/fop/fo/flow/table/GridUnit.java index 229a7177f..9e3f750c6 100644 --- a/src/java/org/apache/fop/fo/flow/table/GridUnit.java +++ b/src/java/org/apache/fop/fo/flow/table/GridUnit.java @@ -62,7 +62,7 @@ public class GridUnit { private int rowSpanIndex; /** flags for the grid unit */ - private byte flags = 0; + private byte flags; /** the border-before specification */ ConditionalBorder borderBefore; diff --git a/src/java/org/apache/fop/fo/flow/table/Table.java b/src/java/org/apache/fop/fo/flow/table/Table.java index 3389112d3..212608664 100644 --- a/src/java/org/apache/fop/fo/flow/table/Table.java +++ b/src/java/org/apache/fop/fo/flow/table/Table.java @@ -88,17 +88,17 @@ public class Table extends TableFObj implements ColumnNumberManagerHolder, Break private ColumnNumberManager columnNumberManager = new ColumnNumberManager(); /** the table-header and -footer */ - private TableHeader tableHeader = null; - private TableFooter tableFooter = null; + private TableHeader tableHeader; + private TableFooter tableFooter; /** used for validation */ - private boolean tableColumnFound = false; - private boolean tableHeaderFound = false; - private boolean tableFooterFound = false; - private boolean tableBodyFound = false; + private boolean tableColumnFound; + private boolean tableHeaderFound; + private boolean tableFooterFound; + private boolean tableBodyFound; - private boolean hasExplicitColumns = false; - private boolean columnsFinalized = false; + private boolean hasExplicitColumns; + private boolean columnsFinalized; private RowGroupBuilder rowGroupBuilder; /** diff --git a/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java b/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java index f5ee8a714..e452f04d0 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java +++ b/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java @@ -55,11 +55,11 @@ public class TableAndCaption extends FObj implements CommonAccessibilityHolder { // private int textAlign; // End of property values - static boolean notImplementedWarningGiven = false; + static boolean notImplementedWarningGiven; /** used for FO validation */ - private boolean tableCaptionFound = false; - private boolean tableFound = false; + private boolean tableCaptionFound; + private boolean tableFound; /** * Create a TableAndCaption instance with the given {@link FONode} diff --git a/src/java/org/apache/fop/fo/flow/table/TableCaption.java b/src/java/org/apache/fop/fo/flow/table/TableCaption.java index 7976e9bae..454bcddfd 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableCaption.java +++ b/src/java/org/apache/fop/fo/flow/table/TableCaption.java @@ -52,9 +52,9 @@ public class TableCaption extends FObj implements CommonAccessibilityHolder { // End of property values /** used for FO validation */ - private boolean blockItemFound = false; + private boolean blockItemFound; - static boolean notImplementedWarningGiven = false; + static boolean notImplementedWarningGiven; /** * Create a TableCaption instance with the given {@link FONode} diff --git a/src/java/org/apache/fop/fo/flow/table/TableCell.java b/src/java/org/apache/fop/fo/flow/table/TableCell.java index b9a811328..33b4a5fe3 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableCell.java +++ b/src/java/org/apache/fop/fo/flow/table/TableCell.java @@ -60,7 +60,7 @@ public class TableCell extends TableFObj implements CommonAccessibilityHolder { // End of property values /** used for FO validation */ - private boolean blockItemFound = false; + private boolean blockItemFound; private boolean hasRetrieveTableMarker; diff --git a/src/java/org/apache/fop/fo/flow/table/TableColumn.java b/src/java/org/apache/fop/fo/flow/table/TableColumn.java index 33cbff884..abfc8cd4d 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableColumn.java +++ b/src/java/org/apache/fop/fo/flow/table/TableColumn.java @@ -51,7 +51,7 @@ public class TableColumn extends TableFObj { // End of property values private boolean implicitColumn; - private PropertyList pList = null; + private PropertyList pList; /** * Create a TableColumn instance with the given {@link FONode} diff --git a/src/java/org/apache/fop/fo/flow/table/TablePart.java b/src/java/org/apache/fop/fo/flow/table/TablePart.java index 032340681..b148ad48e 100644 --- a/src/java/org/apache/fop/fo/flow/table/TablePart.java +++ b/src/java/org/apache/fop/fo/flow/table/TablePart.java @@ -47,13 +47,13 @@ public abstract class TablePart extends TableCellContainer { // End of property values /** table rows found */ - protected boolean tableRowsFound = false; + protected boolean tableRowsFound; /** table cells found */ - protected boolean tableCellsFound = false; + protected boolean tableCellsFound; private boolean firstRow = true; - private boolean rowsStarted = false; + private boolean rowsStarted; private boolean lastCellEndsRow = true; diff --git a/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java b/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java index c74be7d7e..99855b815 100644 --- a/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java @@ -53,7 +53,7 @@ public abstract class AbstractPageSequence extends FObj implements CommonAccessi private PageNumberGenerator pageNumberGenerator; /** starting page number */ - protected int startingPageNumber = 0; + protected int startingPageNumber; /** * Create an AbstractPageSequence that is a child diff --git a/src/java/org/apache/fop/fo/pagination/Declarations.java b/src/java/org/apache/fop/fo/pagination/Declarations.java index 12d95c131..33c688921 100644 --- a/src/java/org/apache/fop/fo/pagination/Declarations.java +++ b/src/java/org/apache/fop/fo/pagination/Declarations.java @@ -41,7 +41,7 @@ import org.apache.fop.fo.ValidationException; */ public class Declarations extends FObj { - private Map<String, ColorProfile> colorProfiles = null; + private Map<String, ColorProfile> colorProfiles; /** * @param parent FONode that is the parent of this object diff --git a/src/java/org/apache/fop/fo/pagination/Flow.java b/src/java/org/apache/fop/fo/pagination/Flow.java index 8a52b9a9e..be3aed3e8 100644 --- a/src/java/org/apache/fop/fo/pagination/Flow.java +++ b/src/java/org/apache/fop/fo/pagination/Flow.java @@ -44,7 +44,7 @@ public class Flow extends FObj implements CommonAccessibilityHolder { private CommonAccessibility commonAccessibility; /** used for FO validation */ - private boolean blockItemFound = false; + private boolean blockItemFound; /** * Create a Flow instance that is a child of the given {@link FONode}. diff --git a/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java b/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java index bda08838e..2d13cd899 100644 --- a/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java +++ b/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java @@ -21,8 +21,6 @@ package org.apache.fop.fo.pagination; import org.apache.fop.complexscripts.util.NumberConverter; -// CSOFF: LineLengthCheck - /** * <p>This class uses the 'format', 'groupingSeparator', 'groupingSize', * and 'letterValue' properties on fo:page-sequence to return a String @@ -49,8 +47,10 @@ public class PageNumberGenerator { * @param language (may be null or empty, which is treated as null) * @param country (may be null or empty, which is treated as null) */ - public PageNumberGenerator(String format, int groupingSeparator, int groupingSize, int letterValue, String features, String language, String country) { - this.converter = new NumberConverter(format, groupingSeparator, groupingSize, letterValue, features, language, country); + public PageNumberGenerator(String format, int groupingSeparator, int groupingSize, + int letterValue, String features, String language, String country) { + this.converter = new NumberConverter(format, groupingSeparator, groupingSize, + letterValue, features, language, country); } /** diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java index bddc47fa3..39a19b622 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java @@ -75,7 +75,7 @@ public class PageSequence extends AbstractPageSequence implements WritingModeTra /** * The fo:flow object for this page-sequence. */ - private Flow mainFlow = null; + private Flow mainFlow; /** * Create a PageSequence instance that is a child of the diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java index 439ed2859..dc69c600d 100644 --- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java +++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java @@ -47,11 +47,11 @@ public class RepeatablePageMasterAlternatives extends FObj private static final int INFINITE = -1; - private int numberConsumed = 0; + private int numberConsumed; private List<ConditionalPageMasterReference> conditionalPageMasterRefs; - private boolean hasPagePositionLast = false; - private boolean hasPagePositionOnly = false; + private boolean hasPagePositionLast; + private boolean hasPagePositionOnly; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java index 9ea1ab50a..f6d41ce8b 100644 --- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java +++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java @@ -48,7 +48,7 @@ public class RepeatablePageMasterReference extends FObj private static final int INFINITE = -1; - private int numberConsumed = 0; + private int numberConsumed; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/pagination/Root.java b/src/java/org/apache/fop/fo/pagination/Root.java index 64a6b039d..cb433a064 100644 --- a/src/java/org/apache/fop/fo/pagination/Root.java +++ b/src/java/org/apache/fop/fo/pagination/Root.java @@ -51,19 +51,19 @@ public class Root extends FObj implements CommonAccessibilityHolder { private LayoutMasterSet layoutMasterSet; private Declarations declarations; - private BookmarkTree bookmarkTree = null; + private BookmarkTree bookmarkTree; private List<Destination> destinationList; private List<PageSequence> pageSequences; private Locale locale; // temporary until above list populated - private boolean pageSequenceFound = false; + private boolean pageSequenceFound; /** * Keeps count of page number from over PageSequence instances */ - private int endingPageNumberOfPreviousSequence = 0; - private int totalPagesGenerated = 0; + private int endingPageNumberOfPreviousSequence; + private int totalPagesGenerated; /** * Context class used while building the FO tree. @@ -73,7 +73,7 @@ public class Root extends FObj implements CommonAccessibilityHolder { /** * FOEventHandler object for this FO Tree */ - private FOEventHandler foEventHandler = null; + private FOEventHandler foEventHandler; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java b/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java index 637289cde..f72146e8b 100644 --- a/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java +++ b/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java @@ -59,11 +59,11 @@ public class SimplePageMaster extends FObj { private Map<String, Region> regions; // used for node validation - private boolean hasRegionBody = false; - private boolean hasRegionBefore = false; - private boolean hasRegionAfter = false; - private boolean hasRegionStart = false; - private boolean hasRegionEnd = false; + private boolean hasRegionBody; + private boolean hasRegionBefore; + private boolean hasRegionAfter; + private boolean hasRegionStart; + private boolean hasRegionEnd; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java b/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java index d2bab22ab..763127e4b 100644 --- a/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java @@ -29,7 +29,7 @@ import org.apache.fop.fo.expr.PropertyException; */ public class BorderWidthPropertyMaker extends LengthProperty.Maker { - private int borderStyleId = 0; + private int borderStyleId; /** * Create a length property which check the value of the border-*-style diff --git a/src/java/org/apache/fop/fo/properties/CommonHyphenation.java b/src/java/org/apache/fop/fo/properties/CommonHyphenation.java index a06c27349..4c87030b9 100644 --- a/src/java/org/apache/fop/fo/properties/CommonHyphenation.java +++ b/src/java/org/apache/fop/fo/properties/CommonHyphenation.java @@ -43,7 +43,7 @@ public final class CommonHyphenation { private static final PropertyCache<CommonHyphenation> CACHE = new PropertyCache<CommonHyphenation>(); - private int hash = 0; + private int hash; /** The "language" property */ public final StringProperty language; diff --git a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java index cbd34c9b3..361427245 100644 --- a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java @@ -38,7 +38,7 @@ public class CompoundPropertyMaker extends PropertyMaker { /** * The first subproperty maker which has a setByShorthand of true. */ - private PropertyMaker shorthandMaker = null; + private PropertyMaker shorthandMaker; /** * Construct an instance of a CompoundPropertyMaker for the given property. diff --git a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java index 19c8af1bb..449be5cbf 100644 --- a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java +++ b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java @@ -41,7 +41,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype { private Property length; private EnumProperty conditionality; - private boolean isCached = false; + private boolean isCached; private int hash = -1; /** diff --git a/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java b/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java index b84c5eeea..4860a07ac 100644 --- a/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java @@ -28,7 +28,7 @@ import org.apache.fop.fo.expr.PropertyException; */ public class DimensionPropertyMaker extends CorrespondingPropertyMaker { - private int[][] extraCorresponding = null; + private int[][] extraCorresponding; /** * Instantiate a dimension property maker. diff --git a/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java b/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java index eba62946d..579eb99a4 100644 --- a/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java @@ -32,7 +32,7 @@ public class FontStretchPropertyMaker /* Ordered list of absolute font stretch properties so we can easily find the next / * previous one */ - private Property[] orderedFontStretchValues = null; + private Property[] orderedFontStretchValues; /** * Create an enum property which can handle relative font stretches diff --git a/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java b/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java index 5d4a696c4..d1a696737 100644 --- a/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java @@ -35,12 +35,12 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker { /** * The corresponding padding-* propIds */ - private int[] paddingCorresponding = null; + private int[] paddingCorresponding; /** * The corresponding border-*-width propIds */ - private int[] borderWidthCorresponding = null; + private int[] borderWidthCorresponding; /** * Create a start-indent or end-indent property maker. diff --git a/src/java/org/apache/fop/fo/properties/KeepProperty.java b/src/java/org/apache/fop/fo/properties/KeepProperty.java index 32e94f47a..f24e01e90 100644 --- a/src/java/org/apache/fop/fo/properties/KeepProperty.java +++ b/src/java/org/apache/fop/fo/properties/KeepProperty.java @@ -33,7 +33,7 @@ public final class KeepProperty extends Property implements CompoundDatatype { private static final PropertyCache<KeepProperty> CACHE = new PropertyCache<KeepProperty>(); - private boolean isCachedValue = false; + private boolean isCachedValue; private Property withinLine; private Property withinColumn; private Property withinPage; diff --git a/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java b/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java index 581ac2d84..9eeda0e9f 100644 --- a/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java +++ b/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java @@ -38,8 +38,8 @@ public class LengthRangeProperty extends Property implements CompoundDatatype { private static final int MINSET = 1; private static final int OPTSET = 2; private static final int MAXSET = 4; - private int bfSet = 0; // bit field - private boolean consistent = false; + private int bfSet; // bit field + private boolean consistent; /** * Converts this <code>LengthRangeProperty</code> to a <code>MinOptMax</code>. diff --git a/src/java/org/apache/fop/fo/properties/PropertyMaker.java b/src/java/org/apache/fop/fo/properties/PropertyMaker.java index 795db56e7..845b79a1d 100644 --- a/src/java/org/apache/fop/fo/properties/PropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/PropertyMaker.java @@ -50,16 +50,16 @@ public class PropertyMaker implements Cloneable { /** the property ID */ protected int propId; private boolean inherited = true; - private Map enums = null; - private Map keywords = null; + private Map enums; + private Map keywords; /** the default value for the maker */ - protected String defaultValue = null; + protected String defaultValue; /** Indicates whether the property is context-dependant and therefore can't be cached. */ - protected boolean contextDep = false; + protected boolean contextDep; /** Indicates whether the property is set through a shorthand. */ - protected boolean setByShorthand = false; + protected boolean setByShorthand; private int percentBase = -1; - private PropertyMaker[] shorthands = null; + private PropertyMaker[] shorthands; private ShorthandParser datatypeParser; /** default property **/ diff --git a/src/java/org/apache/fop/fonts/CustomFont.java b/src/java/org/apache/fop/fonts/CustomFont.java index 96b70feea..5c0673b04 100644 --- a/src/java/org/apache/fop/fonts/CustomFont.java +++ b/src/java/org/apache/fop/fonts/CustomFont.java @@ -22,9 +22,11 @@ package org.apache.fop.fonts; import java.io.IOException; import java.io.InputStream; import java.net.URI; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; @@ -74,6 +76,8 @@ public abstract class CustomFont extends Typeface private Map<Integer, Map<Integer, Integer>> kerning; private boolean useKerning = true; + /** the character map, mapping Unicode ranges to glyph indices. */ + protected List<CMapSegment> cmap = new ArrayList<CMapSegment>(); private boolean useAdvanced = true; /** @@ -82,8 +86,7 @@ public abstract class CustomFont extends Typeface public CustomFont(InternalResourceResolver resourceResolver) { this.resourceResolver = resourceResolver; } - /** the character map, mapping Unicode ranges to glyph indices. */ - protected CMapSegment[] cmap; + /** {@inheritDoc} */ public String getFontName() { @@ -503,8 +506,10 @@ public abstract class CustomFont extends Typeface * @param cmap the character map */ public void setCMap(CMapSegment[] cmap) { - this.cmap = new CMapSegment[cmap.length]; - System.arraycopy(cmap, 0, this.cmap, 0, cmap.length); + this.cmap.clear(); + for (CMapSegment c : cmap) { + this.cmap.add(c); + } } /** @@ -513,9 +518,7 @@ public abstract class CustomFont extends Typeface * @return the character map */ public CMapSegment[] getCMap() { - CMapSegment[] copy = new CMapSegment[cmap.length]; - System.arraycopy(this.cmap, 0, copy, 0, this.cmap.length); - return copy; + return cmap.toArray(new CMapSegment[cmap.size()]); } public int getUnderlinePosition(int size) { diff --git a/src/java/org/apache/fop/fonts/Font.java b/src/java/org/apache/fop/fonts/Font.java index 516b60bcd..3006d0873 100644 --- a/src/java/org/apache/fop/fonts/Font.java +++ b/src/java/org/apache/fop/fonts/Font.java @@ -28,8 +28,6 @@ import org.apache.commons.logging.LogFactory; import org.apache.fop.complexscripts.fonts.Positionable; import org.apache.fop.complexscripts.fonts.Substitutable; -// CSOFF: LineLengthCheck - /** * This class holds font state information and provides access to the font * metrics. diff --git a/src/java/org/apache/fop/fonts/FontCache.java b/src/java/org/apache/fop/fonts/FontCache.java index 52db98ff3..9134cf702 100644 --- a/src/java/org/apache/fop/fonts/FontCache.java +++ b/src/java/org/apache/fop/fonts/FontCache.java @@ -75,14 +75,14 @@ public final class FontCache implements Serializable { * TTC file may contain more than 1 font. * @serial */ - private Map<String, CachedFontFile> fontfileMap = null; + private Map<String, CachedFontFile> fontfileMap; /** * mapping of font url -> file modified date (for all fonts that have failed * to load) * @serial */ - private Map<String, Long> failedFontMap = null; + private Map<String, Long> failedFontMap; /** * Default constructor @@ -494,7 +494,7 @@ public final class FontCache implements Serializable { /** file modify date (if available) */ private long lastModified = -1; - private Map<String, EmbedFontInfo> filefontsMap = null; + private Map<String, EmbedFontInfo> filefontsMap; public CachedFontFile(long lastModified) { setLastModified(lastModified); diff --git a/src/java/org/apache/fop/fonts/FontInfo.java b/src/java/org/apache/fop/fonts/FontInfo.java index 720531205..0c94b256f 100644 --- a/src/java/org/apache/fop/fonts/FontInfo.java +++ b/src/java/org/apache/fop/fonts/FontInfo.java @@ -46,23 +46,23 @@ public class FontInfo { protected static final Log log = LogFactory.getLog(FontInfo.class); /** Map containing fonts that have been used */ - private Map<String, Typeface> usedFonts = null; //(String = font key) + private Map<String, Typeface> usedFonts; //(String = font key) /** look up a font-triplet to find a font-name */ - private Map<FontTriplet, String> triplets = null; //(String = font key) + private Map<FontTriplet, String> triplets; //(String = font key) /** look up a font-triplet to find its priority * (only used inside addFontProperties()) */ - private Map<FontTriplet, Integer> tripletPriorities = null; //Map<FontTriplet,Integer> + private Map<FontTriplet, Integer> tripletPriorities; //Map<FontTriplet,Integer> /** look up a font-name to get a font (that implements FontMetrics at least) */ - private Map<String, Typeface> fonts = null; //(String = font key) + private Map<String, Typeface> fonts; //(String = font key) /** Cache for Font instances. */ - private Map<FontTriplet, Map<Integer, Font>> fontInstanceCache = null; + private Map<FontTriplet, Map<Integer, Font>> fontInstanceCache; /** Event listener for font events */ - private FontEventListener eventListener = null; + private FontEventListener eventListener; /** * Main constructor diff --git a/src/java/org/apache/fop/fonts/FontManager.java b/src/java/org/apache/fop/fonts/FontManager.java index 3df8a9078..266220d14 100644 --- a/src/java/org/apache/fop/fonts/FontManager.java +++ b/src/java/org/apache/fop/fonts/FontManager.java @@ -44,10 +44,10 @@ public class FontManager { private FontCacheManager fontCacheManager; /** Font substitutions */ - private FontSubstitutions fontSubstitutions = null; + private FontSubstitutions fontSubstitutions; /** Allows enabling kerning on the base 14 fonts, default is false */ - private boolean enableBase14Kerning = false; + private boolean enableBase14Kerning; /** FontTriplet matcher for fonts that shall be referenced rather than embedded. */ private FontTriplet.Matcher referencedFontsMatcher; diff --git a/src/java/org/apache/fop/fonts/FontType.java b/src/java/org/apache/fop/fonts/FontType.java index edd8d0c37..fc820c8b9 100644 --- a/src/java/org/apache/fop/fonts/FontType.java +++ b/src/java/org/apache/fop/fonts/FontType.java @@ -49,6 +49,10 @@ public class FontType { */ public static final FontType TRUETYPE = new FontType("TrueType", 5); + public static final FontType TYPE1C = new FontType("Type1C", 6); + + public static final FontType CIDTYPE0 = new FontType("CIDFontType0", 7); + private final String name; private final int value; diff --git a/src/java/org/apache/fop/fonts/MultiByteFont.java b/src/java/org/apache/fop/fonts/MultiByteFont.java index cc3d06650..84dc429dc 100644 --- a/src/java/org/apache/fop/fonts/MultiByteFont.java +++ b/src/java/org/apache/fop/fonts/MultiByteFont.java @@ -20,6 +20,7 @@ package org.apache.fop.fonts; import java.awt.Rectangle; +import java.io.InputStream; import java.nio.CharBuffer; import java.nio.IntBuffer; import java.util.BitSet; @@ -53,7 +54,7 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl private int defaultWidth; private CIDFontType cidType = CIDFontType.CIDTYPE2; - private final CIDSet cidSet; + protected final CIDSet cidSet; /* advanced typographic support */ private GlyphDefinitionTable gdef; @@ -72,7 +73,7 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl /** Contains the character bounding boxes for all characters in the font */ protected Rectangle[] boundingBoxes; - private boolean isOTFFile = false; + private boolean isOTFFile; // since for most users the most likely glyphs are in the first cmap segments we store their mapping. private static final int NUM_MOST_LIKELY_GLYPHS = 256; @@ -222,13 +223,13 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl if (idx < NUM_MOST_LIKELY_GLYPHS && mostLikelyGlyphs[idx] != 0) { return mostLikelyGlyphs[idx]; } - for (int i = 0; (i < cmap.length) && retIdx == 0; i++) { - if (cmap[i].getUnicodeStart() <= idx - && cmap[i].getUnicodeEnd() >= idx) { - - retIdx = cmap[i].getGlyphStartIndex() + for (CMapSegment i : cmap) { + if (retIdx == 0 + && i.getUnicodeStart() <= idx + && i.getUnicodeEnd() >= idx) { + retIdx = i.getGlyphStartIndex() + idx - - cmap[i].getUnicodeStart(); + - i.getUnicodeStart(); if (idx < NUM_MOST_LIKELY_GLYPHS) { mostLikelyGlyphs[idx] = retIdx; } @@ -241,14 +242,9 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl * Add a private use mapping {PU,GI} to the existing character map. * N.B. Does not insert in order, merely appends to end of existing map. */ - private synchronized void addPrivateUseMapping(int pu, int gi) { + protected synchronized void addPrivateUseMapping(int pu, int gi) { assert findGlyphIndex(pu) == SingleByteEncoding.NOT_FOUND_CODE_POINT; - CMapSegment[] oldCmap = cmap; - int cmapLength = oldCmap.length; - CMapSegment[] newCmap = new CMapSegment [ cmapLength + 1 ]; - System.arraycopy(oldCmap, 0, newCmap, 0, cmapLength); - newCmap [ cmapLength ] = new CMapSegment(pu, pu, gi); - cmap = newCmap; + cmap.add(new CMapSegment(pu, pu, gi)); } /** @@ -306,8 +302,7 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl // [TBD] - needs optimization, i.e., change from linear search to binary search private int findCharacterFromGlyphIndex(int gi, boolean augment) { int cc = 0; - for (int i = 0, n = cmap.length; i < n; i++) { - CMapSegment segment = cmap [ i ]; + for (CMapSegment segment : cmap) { int s = segment.getGlyphStartIndex(); int e = s + (segment.getUnicodeEnd() - segment.getUnicodeStart()); if ((gi >= s) && (gi <= e)) { @@ -330,10 +325,10 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl bitset.set(0); bitset.set(1); bitset.set(2); - for (int i = 0; i < cmap.length; i++) { - int start = cmap[i].getUnicodeStart(); - int end = cmap[i].getUnicodeEnd(); - int glyphIndex = cmap[i].getGlyphStartIndex(); + for (CMapSegment i : cmap) { + int start = i.getUnicodeStart(); + int end = i.getUnicodeEnd(); + int glyphIndex = i.getGlyphStartIndex(); while (start++ < end + 1) { bitset.set(glyphIndex++); } @@ -344,10 +339,10 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl protected char[] getChars() { // the width array is set when the font is built char[] chars = new char[width.length]; - for (int i = 0; i < cmap.length; i++) { - int start = cmap[i].getUnicodeStart(); - int end = cmap[i].getUnicodeEnd(); - int glyphIndex = cmap[i].getGlyphStartIndex(); + for (CMapSegment i : cmap) { + int start = i.getUnicodeStart(); + int end = i.getUnicodeEnd(); + int glyphIndex = i.getGlyphStartIndex(); while (start < end + 1) { chars[glyphIndex++] = (char) start++; } @@ -642,5 +637,12 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl return cb; } + public Map<Integer, Integer> getWidthsMap() { + return null; + } + + public InputStream getCmapStream() { + return null; + } } diff --git a/src/java/org/apache/fop/fonts/SingleByteFont.java b/src/java/org/apache/fop/fonts/SingleByteFont.java index 7b17c0b5d..e12da81cc 100644 --- a/src/java/org/apache/fop/fonts/SingleByteFont.java +++ b/src/java/org/apache/fop/fonts/SingleByteFont.java @@ -46,10 +46,10 @@ public class SingleByteFont extends CustomFont { /** logger */ private static Log log = LogFactory.getLog(SingleByteFont.class); - private SingleByteEncoding mapping; - private boolean useNativeEncoding = false; + protected SingleByteEncoding mapping; + private boolean useNativeEncoding; - private int[] width = null; + protected int[] width; private Rectangle[] boundingBoxes; diff --git a/src/java/org/apache/fop/fonts/Typeface.java b/src/java/org/apache/fop/fonts/Typeface.java index 0e3844077..571c402bf 100644 --- a/src/java/org/apache/fop/fonts/Typeface.java +++ b/src/java/org/apache/fop/fonts/Typeface.java @@ -46,7 +46,7 @@ public abstract class Typeface implements FontMetrics { * is used as the trigger). This could just as well be a boolean but is a * long out of statistical interest. */ - private long charMapOps = 0; + private long charMapOps; /** An optional event listener that receives events such as missing glyphs etc. */ protected FontEventListener eventListener; diff --git a/src/java/org/apache/fop/fonts/apps/TTFReader.java b/src/java/org/apache/fop/fonts/apps/TTFReader.java index f63e2bb07..12fc638b4 100644 --- a/src/java/org/apache/fop/fonts/apps/TTFReader.java +++ b/src/java/org/apache/fop/fonts/apps/TTFReader.java @@ -39,8 +39,6 @@ import org.apache.fop.fonts.truetype.FontFileReader; import org.apache.fop.fonts.truetype.OFFontLoader; import org.apache.fop.fonts.truetype.TTFFile; -// CSOFF: LineLengthCheck - /** * A tool which reads TTF files and generates * XML font metrics file for use in FOP. @@ -207,7 +205,8 @@ public class TTFReader extends AbstractFontReader { * @return The TTF as an object, null if the font is incompatible. * @throws IOException In case of an I/O problem */ - public TTFFile loadTTF(String fileName, String fontName, boolean useKerning, boolean useAdvanced) throws IOException { + public TTFFile loadTTF(String fileName, String fontName, boolean useKerning, boolean useAdvanced) + throws IOException { TTFFile ttfFile = new TTFFile(useKerning, useAdvanced); log.info("Reading " + fileName + "..."); InputStream stream = new FileInputStream(fileName); diff --git a/src/java/org/apache/fop/fonts/base14/Base14FontCollection.java b/src/java/org/apache/fop/fonts/base14/Base14FontCollection.java index 1afc29b7b..ac01c9850 100644 --- a/src/java/org/apache/fop/fonts/base14/Base14FontCollection.java +++ b/src/java/org/apache/fop/fonts/base14/Base14FontCollection.java @@ -28,7 +28,7 @@ import org.apache.fop.fonts.FontInfo; */ public class Base14FontCollection implements FontCollection { - private boolean kerning = false; + private boolean kerning; /** * Main constructor diff --git a/src/java/org/apache/fop/fonts/cff/CFFDataReader.java b/src/java/org/apache/fop/fonts/cff/CFFDataReader.java index 66126fb84..3ce63a2a4 100644 --- a/src/java/org/apache/fop/fonts/cff/CFFDataReader.java +++ b/src/java/org/apache/fop/fonts/cff/CFFDataReader.java @@ -580,7 +580,9 @@ public class CFFDataReader { LinkedHashMap<String, DICTEntry> fdEntries = parseDictData(fdData); newFontDict.setByteData(fontDicts.getValuePosition(i), fontDicts.getValueLength(i)); DICTEntry fontFDEntry = fdEntries.get("FontName"); - newFontDict.setFontName(getString(fontFDEntry.getOperands().get(0).intValue())); + if (fontFDEntry != null) { + newFontDict.setFontName(getString(fontFDEntry.getOperands().get(0).intValue())); + } DICTEntry privateFDEntry = fdEntries.get("Private"); if (privateFDEntry != null) { newFontDict = setFDData(privateFDEntry, newFontDict); diff --git a/src/java/org/apache/fop/fonts/substitute/FontQualifier.java b/src/java/org/apache/fop/fonts/substitute/FontQualifier.java index c1b6a93cd..b7473d72f 100644 --- a/src/java/org/apache/fop/fonts/substitute/FontQualifier.java +++ b/src/java/org/apache/fop/fonts/substitute/FontQualifier.java @@ -41,13 +41,13 @@ public class FontQualifier { private static Log log = LogFactory.getLog(FontQualifier.class); /** font family attribute value */ - private AttributeValue fontFamilyAttributeValue = null; + private AttributeValue fontFamilyAttributeValue; /** font style attribute value */ - private AttributeValue fontStyleAttributeValue = null; + private AttributeValue fontStyleAttributeValue; /** font weight attribute value */ - private AttributeValue fontWeightAttributeValue = null; + private AttributeValue fontWeightAttributeValue; /** * Default constructor diff --git a/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java b/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java index 75e6497ee..fb60473fc 100644 --- a/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java +++ b/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java @@ -28,7 +28,7 @@ import org.apache.fop.apps.FOPException; */ public class FontSubstitutionsConfigurator { - private Configuration cfg = null; + private Configuration cfg; /** * Main constructor diff --git a/src/java/org/apache/fop/fonts/truetype/GlyfTable.java b/src/java/org/apache/fop/fonts/truetype/GlyfTable.java index 90abccaf2..1233a586e 100644 --- a/src/java/org/apache/fop/fonts/truetype/GlyfTable.java +++ b/src/java/org/apache/fop/fonts/truetype/GlyfTable.java @@ -37,7 +37,7 @@ public class GlyfTable { private final Set<Long> remappedComposites; - private final Map<Integer, Integer> subset; + protected final Map<Integer, Integer> subset; private final FontFileReader in; @@ -45,10 +45,10 @@ public class GlyfTable { private Set<Integer> compositeGlyphs = new TreeSet<Integer>(); /** All the glyphs that are composed, but do not appear in the subset. */ - private Set<Integer> composedGlyphs = new TreeSet<Integer>(); + protected Set<Integer> composedGlyphs = new TreeSet<Integer>(); - GlyfTable(FontFileReader in, OFMtxEntry[] metrics, OFDirTabEntry dirTableEntry, - Map<Integer, Integer> glyphs) throws IOException { + protected GlyfTable(FontFileReader in, OFMtxEntry[] metrics, OFDirTabEntry dirTableEntry, + Map<Integer, Integer> glyphs) throws IOException { mtxTab = metrics; tableOffset = dirTableEntry.getOffset(); remappedComposites = new HashSet<Long>(); @@ -121,7 +121,7 @@ public class GlyfTable { * * @throws IOException an I/O error */ - void populateGlyphsWithComposites() throws IOException { + protected void populateGlyphsWithComposites() throws IOException { for (int indexInOriginal : subset.keySet()) { scanGlyphsRecursively(indexInOriginal); } @@ -166,7 +166,7 @@ public class GlyfTable { * Adds to the subset, all the glyphs that are composed by a glyph, but do not appear themselves * in the subset. */ - private void addAllComposedGlyphsToSubset() { + protected void addAllComposedGlyphsToSubset() { int newIndex = subset.size(); for (int composedGlyph : composedGlyphs) { subset.put(composedGlyph, newIndex++); diff --git a/src/java/org/apache/fop/fonts/truetype/OFMtxEntry.java b/src/java/org/apache/fop/fonts/truetype/OFMtxEntry.java index 89af2296f..b52f03849 100644 --- a/src/java/org/apache/fop/fonts/truetype/OFMtxEntry.java +++ b/src/java/org/apache/fop/fonts/truetype/OFMtxEntry.java @@ -24,7 +24,7 @@ import java.util.List; /** * This class represents a TrueType Mtx Entry. */ -class OFMtxEntry { +public class OFMtxEntry { private int wx; private int lsb; @@ -33,7 +33,7 @@ class OFMtxEntry { private List unicodeIndex = new java.util.ArrayList(); private int[] boundingBox = new int[4]; private long offset; - private byte found = 0; + private byte found; /** * Returns a String representation of this object. diff --git a/src/java/org/apache/fop/fonts/truetype/OTFFile.java b/src/java/org/apache/fop/fonts/truetype/OTFFile.java index ab9654beb..57d875f9c 100644 --- a/src/java/org/apache/fop/fonts/truetype/OTFFile.java +++ b/src/java/org/apache/fop/fonts/truetype/OTFFile.java @@ -147,7 +147,7 @@ public class OTFFile extends OpenFont { * @return The byte data found in the CFF table */ public static byte[] getCFFData(FontFileReader fontFile) throws IOException { - byte[] cff = new byte[0]; + byte[] cff = fontFile.getAllBytes(); CFFDataInput input = new CFFDataInput(fontFile.getAllBytes()); input.readBytes(4); //OTTO short numTables = input.readShort(); diff --git a/src/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java b/src/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java index 9cb3458c8..caace37bc 100644 --- a/src/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java +++ b/src/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java @@ -49,23 +49,23 @@ import org.apache.fop.fonts.cff.CFFDataReader.Format3FDSelect; */ public class OTFSubSetFile extends OTFFile { - private byte[] output; - private int currentPos = 0; - private int realSize = 0; + protected byte[] output; + protected int currentPos; + private int realSize; /** A map containing each glyph to be included in the subset * with their existing and new GID's **/ - private LinkedHashMap<Integer, Integer> subsetGlyphs; + protected LinkedHashMap<Integer, Integer> subsetGlyphs = new LinkedHashMap<Integer, Integer>(); /** A map of the new GID to SID used to construct the charset table **/ - private LinkedHashMap<Integer, Integer> gidToSID; + protected LinkedHashMap<Integer, Integer> gidToSID; - private CFFIndexData localIndexSubr; - private CFFIndexData globalIndexSubr; + protected CFFIndexData localIndexSubr; + protected CFFIndexData globalIndexSubr; /** List of subroutines to write to the local / global indexes in the subset font **/ - private List<byte[]> subsetLocalIndexSubr; - private List<byte[]> subsetGlobalIndexSubr; + protected List<byte[]> subsetLocalIndexSubr; + protected List<byte[]> subsetGlobalIndexSubr; /** For fonts which have an FDSelect or ROS flag in Top Dict, this is used to store the * local subroutine indexes for each group as opposed to the above subsetLocalIndexSubr */ @@ -76,30 +76,30 @@ public class OTFSubSetFile extends OTFFile { private LinkedHashMap<Integer, FDIndexReference> subsetFDSelect; /** A list of unique subroutines from the global / local subroutine indexes */ - private List<Integer> localUniques; - private List<Integer> globalUniques; + protected List<Integer> localUniques; + protected List<Integer> globalUniques; /** A store of the number of subroutines each global / local subroutine will store **/ - private int subsetLocalSubrCount; - private int subsetGlobalSubrCount; + protected int subsetLocalSubrCount; + protected int subsetGlobalSubrCount; /** A list of char string data for each glyph to be stored in the subset font **/ - private List<byte[]> subsetCharStringsIndex; + protected List<byte[]> subsetCharStringsIndex; /** The embedded name to change in the name table **/ - private String embeddedName; + protected String embeddedName; /** An array used to hold the string index data for the subset font **/ - private List<byte[]> stringIndexData = new ArrayList<byte[]>(); + protected List<byte[]> stringIndexData = new ArrayList<byte[]>(); /** The CFF reader object used to read data and offsets from the original font file */ - private CFFDataReader cffReader = null; + protected CFFDataReader cffReader; /** The class used to represent this font **/ private MultiByteFont mbFont; /** The number of standard strings in CFF **/ - private static final int NUM_STANDARD_STRINGS = 391; + public static final int NUM_STANDARD_STRINGS = 391; /** The operator used to identify a local subroutine reference */ private static final int LOCAL_SUBROUTINE = 10; /** The operator used to identify a global subroutine reference */ @@ -162,7 +162,7 @@ public class OTFSubSetFile extends OTFFile { return result; } - private void createCFF() throws IOException { + protected void createCFF() throws IOException { //Header writeBytes(cffReader.getHeader()); @@ -238,7 +238,7 @@ public class OTFSubSetFile extends OTFFile { } } - private List<Integer> storeFDStrings(List<Integer> uniqueNewRefs) throws IOException { + protected List<Integer> storeFDStrings(List<Integer> uniqueNewRefs) throws IOException { ArrayList<Integer> fontNameSIDs = new ArrayList<Integer>(); List<FontDict> fdFonts = cffReader.getFDFonts(); for (int i = 0; i < uniqueNewRefs.size(); i++) { @@ -252,14 +252,13 @@ public class OTFSubSetFile extends OTFFile { return fontNameSIDs; } - private void writeBytes(byte[] out) { + protected void writeBytes(byte[] out) { for (int i = 0; i < out.length; i++) { - output[currentPos++] = out[i]; - realSize++; + writeByte(out[i]); } } - private void writeBytes(byte[] out, int offset, int length) { + protected void writeBytes(byte[] out, int offset, int length) { for (int i = offset; i < offset + length; i++) { output[currentPos++] = out[i]; realSize++; @@ -280,7 +279,7 @@ public class OTFSubSetFile extends OTFFile { } } - private void writeTopDICT() throws IOException { + protected void writeTopDICT() throws IOException { LinkedHashMap<String, DICTEntry> topDICT = cffReader.getTopDictEntries(); List<String> topDictStringEntries = Arrays.asList("version", "Notice", "Copyright", "FullName", "FamilyName", "Weight", "PostScript"); @@ -321,7 +320,7 @@ public class OTFSubSetFile extends OTFFile { writeBytes(cidEntryByteData); } - private void writeCIDCount(DICTEntry dictEntry) throws IOException { + protected void writeCIDCount(DICTEntry dictEntry) throws IOException { byte[] cidCountByteData = dictEntry.getByteData(); cidCountByteData = updateOffset(cidCountByteData, 0, dictEntry.getOperandLengths().get(0), subsetGlyphs.size()); @@ -375,7 +374,7 @@ public class OTFSubSetFile extends OTFFile { writeIndex(stringIndexData); } - private void createCharStringDataCID() throws IOException { + protected void createCharStringDataCID() throws IOException { CFFIndexData charStringsIndex = cffReader.getCharStringIndex(); FDSelect fontDictionary = cffReader.getFDSelect(); @@ -451,22 +450,22 @@ public class OTFSubSetFile extends OTFFile { localUniques = foundLocalUniquesB.get(subsetFDSelect.get(subsetGlyphs.get(gid)).getNewFDIndex()); byte[] data = charStringsIndex.getValue(gid); subsetLocalIndexSubr = fdSubrs.get(subsetFDSelect.get(subsetGlyphs.get(gid)).getNewFDIndex()); - subsetLocalSubrCount = foundLocalUniques.get( - subsetFDSelect.get(subsetGlyphs.get(gid)).getNewFDIndex()).size(); + subsetLocalSubrCount = foundLocalUniques.get(subsetFDSelect.get(subsetGlyphs.get(gid)) + .getNewFDIndex()).size(); data = readCharStringData(data, subsetLocalSubrCount); subsetCharStringsIndex.add(data); } } } - private void writeFDSelect() { + protected void writeFDSelect() { writeByte(0); //Format for (Integer gid : subsetFDSelect.keySet()) { writeByte(subsetFDSelect.get(gid).getNewFDIndex()); } } - private List<Integer> getUsedFDFonts() { + protected List<Integer> getUsedFDFonts() { List<Integer> uniqueNewRefs = new ArrayList<Integer>(); for (int gid : subsetFDSelect.keySet()) { int fdIndex = subsetFDSelect.get(gid).getOldFDIndex(); @@ -477,7 +476,7 @@ public class OTFSubSetFile extends OTFFile { return uniqueNewRefs; } - private List<Integer> writeCIDDictsAndSubrs(List<Integer> uniqueNewRefs) + protected List<Integer> writeCIDDictsAndSubrs(List<Integer> uniqueNewRefs) throws IOException { List<Integer> privateDictOffsets = new ArrayList<Integer>(); List<FontDict> fdFonts = cffReader.getFDFonts(); @@ -499,7 +498,7 @@ public class OTFSubSetFile extends OTFFile { return privateDictOffsets; } - private int writeFDArray(List<Integer> uniqueNewRefs, List<Integer> privateDictOffsets, + protected int writeFDArray(List<Integer> uniqueNewRefs, List<Integer> privateDictOffsets, List<Integer> fontNameSIDs) throws IOException { int offset = currentPos; @@ -796,7 +795,7 @@ public class OTFSubSetFile extends OTFFile { return c; } - private int writeIndex(List<byte[]> dataArray) { + protected int writeIndex(List<byte[]> dataArray) { int hdrTotal = 3; //2 byte number of items this.writeCard16(dataArray.size()); @@ -939,7 +938,7 @@ public class OTFSubSetFile extends OTFFile { } } - private void writePrivateDict() throws IOException { + protected void writePrivateDict() throws IOException { Map<String, DICTEntry> topDICT = cffReader.getTopDictEntries(); DICTEntry privateEntry = topDICT.get("Private"); @@ -948,7 +947,7 @@ public class OTFSubSetFile extends OTFFile { } } - private void updateOffsets(int topDictOffset, int charsetOffset, int charStringOffset, + protected void updateOffsets(int topDictOffset, int charsetOffset, int charStringOffset, int privateDictOffset, int localIndexOffset, int encodingOffset) throws IOException { Map<String, DICTEntry> topDICT = cffReader.getTopDictEntries(); @@ -973,18 +972,20 @@ public class OTFSubSetFile extends OTFFile { //Update the local subroutine index offset in the private dict DICTEntry subroutines = privateDICT.get("Subrs"); - int oldLocalSubrOffset = privateDictOffset + subroutines.getOffset(); - //Value needs to be converted to -139 etc. - int encodeValue = 0; - if (subroutines.getOperandLength() == 1) { - encodeValue = 139; + if (subroutines != null) { + int oldLocalSubrOffset = privateDictOffset + subroutines.getOffset(); + //Value needs to be converted to -139 etc. + int encodeValue = 0; + if (subroutines.getOperandLength() == 1) { + encodeValue = 139; + } + output = updateOffset(output, oldLocalSubrOffset, subroutines.getOperandLength(), + (localIndexOffset - privateDictOffset) + encodeValue); } - output = updateOffset(output, oldLocalSubrOffset, subroutines.getOperandLength(), - (localIndexOffset - privateDictOffset) + encodeValue); } } - private void updateFixedOffsets(Map<String, DICTEntry> topDICT, int dataTopDictOffset, + protected void updateFixedOffsets(Map<String, DICTEntry> topDICT, int dataTopDictOffset, int charsetOffset, int charStringOffset, int encodingOffset) { //Charset offset in the top dict DICTEntry charset = topDICT.get("charset"); @@ -1004,7 +1005,7 @@ public class OTFSubSetFile extends OTFFile { } } - private void updateCIDOffsets(int topDictDataOffset, int fdArrayOffset, int fdSelectOffset, + protected void updateCIDOffsets(int topDictDataOffset, int fdArrayOffset, int fdSelectOffset, int charsetOffset, int charStringOffset, int encodingOffset) { LinkedHashMap<String, DICTEntry> topDict = cffReader.getTopDictEntries(); @@ -1023,7 +1024,7 @@ public class OTFSubSetFile extends OTFFile { updateFixedOffsets(topDict, topDictDataOffset, charsetOffset, charStringOffset, encodingOffset); } - private byte[] updateOffset(byte[] out, int position, int length, int replacement) { + protected byte[] updateOffset(byte[] out, int position, int length, int replacement) { switch (length) { case 1: out[position] = (byte)(replacement & 0xFF); @@ -1061,7 +1062,7 @@ public class OTFSubSetFile extends OTFFile { * Appends a byte to the output array, * updates currentPost but not realSize */ - private void writeByte(int b) { + protected void writeByte(int b) { output[currentPos++] = (byte)b; realSize++; } @@ -1070,7 +1071,7 @@ public class OTFSubSetFile extends OTFFile { * Appends a USHORT to the output array, * updates currentPost but not realSize */ - private void writeCard16(int s) { + protected void writeCard16(int s) { byte b1 = (byte)((s >> 8) & 0xff); byte b2 = (byte)(s & 0xff); writeByte(b1); @@ -1081,10 +1082,9 @@ public class OTFSubSetFile extends OTFFile { byte b1 = (byte)((s >> 16) & 0xFF); byte b2 = (byte)((s >> 8) & 0xFF); byte b3 = (byte)(s & 0xFF); - output[currentPos++] = b1; - output[currentPos++] = b2; - output[currentPos++] = b3; - realSize += 3; + writeByte(b1); + writeByte(b2); + writeByte(b3); } /** @@ -1096,11 +1096,10 @@ public class OTFSubSetFile extends OTFFile { byte b2 = (byte)((s >> 16) & 0xff); byte b3 = (byte)((s >> 8) & 0xff); byte b4 = (byte)(s & 0xff); - output[currentPos++] = b1; - output[currentPos++] = b2; - output[currentPos++] = b3; - output[currentPos++] = b4; - realSize += 4; + writeByte(b1); + writeByte(b2); + writeByte(b3); + writeByte(b4); } /** diff --git a/src/java/org/apache/fop/fonts/truetype/OpenFont.java b/src/java/org/apache/fop/fonts/truetype/OpenFont.java index 3f4765cdc..ecd344f99 100644 --- a/src/java/org/apache/fop/fonts/truetype/OpenFont.java +++ b/src/java/org/apache/fop/fonts/truetype/OpenFont.java @@ -154,7 +154,7 @@ public abstract class OpenFont { private static final short FIRST_CHAR = 0; - protected boolean useKerning = false; + protected boolean useKerning; private boolean isEmbeddable = true; private boolean hasSerifs = true; /** @@ -168,13 +168,13 @@ public abstract class OpenFont { protected List<UnicodeMapping> unicodeMappings; private int upem; // unitsPerEm from "head" table - private int nhmtx; // Number of horizontal metrics + protected int nhmtx; // Number of horizontal metrics private PostScriptVersion postScriptVersion; protected int locaFormat; /** * Offset to last loca */ - protected long lastLoca = 0; + protected long lastLoca; protected int numberOfGlyphs; // Number of glyphs in font (read from "maxp" table) /** @@ -187,33 +187,34 @@ public abstract class OpenFont { protected String notice = ""; protected final Set<String> familyNames = new HashSet<String>(); protected String subFamilyName = ""; - - private long italicAngle = 0; - private long isFixedPitch = 0; - private int fontBBox1 = 0; - private int fontBBox2 = 0; - private int fontBBox3 = 0; - private int fontBBox4 = 0; - private int capHeight = 0; - private int os2CapHeight = 0; + protected boolean cid = true; + + private long italicAngle; + private long isFixedPitch; + private int fontBBox1; + private int fontBBox2; + private int fontBBox3; + private int fontBBox4; + private int capHeight; + private int os2CapHeight; private int underlinePosition; private int underlineThickness; private int strikeoutPosition; private int strikeoutThickness; - private int xHeight = 0; - private int os2xHeight = 0; + private int xHeight; + private int os2xHeight; //Effective ascender/descender - private int ascender = 0; - private int descender = 0; + private int ascender; + private int descender; //Ascender/descender from hhea table - private int hheaAscender = 0; - private int hheaDescender = 0; + private int hheaAscender; + private int hheaDescender; //Ascender/descender from OS/2 table - private int os2Ascender = 0; - private int os2Descender = 0; - private int usWeightClass = 0; + private int os2Ascender; + private int os2Descender; + private int usWeightClass; - private short lastChar = 0; + private short lastChar; private int[] ansiWidth; private Map<Integer, List<Integer>> ansiIndex; @@ -226,7 +227,7 @@ public abstract class OpenFont { private boolean isCFF; // advanced typographic table support - protected boolean useAdvanced = false; + protected boolean useAdvanced; protected OTFAdvancedTypographicTableReader advancedTableReader; /** @@ -393,7 +394,9 @@ public abstract class OpenFont { unicodeMappings = new ArrayList<OpenFont.UnicodeMapping>(); - seekTab(fontFile, OFTableName.CMAP, 2); + if (!seekTab(fontFile, OFTableName.CMAP, 2)) { + return true; + } int numCMap = fontFile.readTTFUShort(); // Number of cmap subtables long cmapUniOffset = 0; long symbolMapOffset = 0; @@ -796,7 +799,9 @@ public abstract class OpenFont { int unicodeStart; int glyphStart; int unicodeEnd; - + if (unicodeMappings.isEmpty()) { + return; + } Iterator<UnicodeMapping> e = unicodeMappings.iterator(); UnicodeMapping um = e.next(); UnicodeMapping lastMapping = um; @@ -1229,7 +1234,7 @@ public abstract class OpenFont { } } - if (nhmtx < mtxSize) { + if (cid && nhmtx < mtxSize) { // Fill in the missing widths int lastWidth = mtxTab[nhmtx - 1].getWx(); for (int i = nhmtx; i < mtxSize; i++) { diff --git a/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java b/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java index ff46af1c7..6d2d68672 100644 --- a/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java +++ b/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java @@ -35,21 +35,21 @@ import java.util.SortedSet; */ public class TTFSubSetFile extends TTFFile { - private byte[] output = null; - private int realSize = 0; - private int currentPos = 0; + protected byte[] output; + protected int realSize; + protected int currentPos; /* * Offsets in name table to be filled out by table. * The offsets are to the checkSum field */ - private Map<OFTableName, Integer> offsets = new HashMap<OFTableName, Integer>(); + protected Map<OFTableName, Integer> offsets = new HashMap<OFTableName, Integer>(); - private int checkSumAdjustmentOffset = 0; - private int locaOffset = 0; + private int checkSumAdjustmentOffset; + protected int locaOffset; /** Stores the glyph offsets so that we can end strings at glyph boundaries */ - private int[] glyphOffsets; + protected int[] glyphOffsets; /** * Default Constructor @@ -67,7 +67,7 @@ public class TTFSubSetFile extends TTFFile { } /** The dir tab entries in the new subset font. */ - private Map<OFTableName, OFDirTabEntry> newDirTabs + protected Map<OFTableName, OFDirTabEntry> newDirTabs = new HashMap<OFTableName, OFDirTabEntry>(); private int determineTableCount() { @@ -86,6 +86,9 @@ public class TTFSubSetFile extends TTFFile { if (hasPrep()) { numTables++; } + if (!cid) { + numTables++; //cmap + } } return numTables; } @@ -93,7 +96,7 @@ public class TTFSubSetFile extends TTFFile { /** * Create the directory table */ - private void createDirectory() { + protected void createDirectory() { int numTables = determineTableCount(); // Create the TrueType header writeByte((byte)0); @@ -118,7 +121,9 @@ public class TTFSubSetFile extends TTFFile { realSize += 2; // Create space for the table entries (these must be in ASCII alphabetical order[A-Z] then[a-z]) writeTableName(OFTableName.OS2); - + if (!cid) { + writeTableName(OFTableName.CMAP); + } if (hasCvt()) { writeTableName(OFTableName.CVT); } @@ -162,7 +167,7 @@ public class TTFSubSetFile extends TTFFile { /** * Create an empty loca table without updating checksum */ - private void createLoca(int size) throws IOException { + protected void createLoca(int size) throws IOException { pad4(); locaOffset = currentPos; int dirTableOffset = offsets.get(OFTableName.LOCA); @@ -177,8 +182,7 @@ public class TTFSubSetFile extends TTFFile { if (entry != null) { pad4(); seekTab(in, tableName, 0); - System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()), - 0, output, currentPos, (int)entry.getLength()); + writeBytes(in.getBytes((int) entry.getOffset(), (int) entry.getLength())); updateCheckSum(currentPos, (int) entry.getLength(), tableName); currentPos += (int) entry.getLength(); @@ -192,28 +196,28 @@ public class TTFSubSetFile extends TTFFile { /** * Copy the cvt table as is from original font to subset font */ - private boolean createCvt(FontFileReader in) throws IOException { + protected boolean createCvt(FontFileReader in) throws IOException { return copyTable(in, OFTableName.CVT); } /** * Copy the fpgm table as is from original font to subset font */ - private boolean createFpgm(FontFileReader in) throws IOException { + protected boolean createFpgm(FontFileReader in) throws IOException { return copyTable(in, OFTableName.FPGM); } /** * Copy the name table as is from the original. */ - private boolean createName(FontFileReader in) throws IOException { + protected boolean createName(FontFileReader in) throws IOException { return copyTable(in, OFTableName.NAME); } /** * Copy the OS/2 table as is from the original. */ - private boolean createOS2(FontFileReader in) throws IOException { + protected boolean createOS2(FontFileReader in) throws IOException { return copyTable(in, OFTableName.OS2); } @@ -221,14 +225,13 @@ public class TTFSubSetFile extends TTFFile { * Copy the maxp table as is from original font to subset font * and set num glyphs to size */ - private void createMaxp(FontFileReader in, int size) throws IOException { + protected void createMaxp(FontFileReader in, int size) throws IOException { OFTableName maxp = OFTableName.MAXP; OFDirTabEntry entry = dirTabs.get(maxp); if (entry != null) { pad4(); seekTab(in, maxp, 0); - System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()), - 0, output, currentPos, (int)entry.getLength()); + writeBytes(in.getBytes((int) entry.getOffset(), (int) entry.getLength())); writeUShort(currentPos + 4, size); updateCheckSum(currentPos, (int)entry.getLength(), maxp); @@ -239,7 +242,7 @@ public class TTFSubSetFile extends TTFFile { } } - private void createPost(FontFileReader in) throws IOException { + protected void createPost(FontFileReader in) throws IOException { OFTableName post = OFTableName.POST; OFDirTabEntry entry = dirTabs.get(post); if (entry != null) { @@ -252,12 +255,12 @@ public class TTFSubSetFile extends TTFFile { 0, newPostTable, 0, newTableSize); // set the post table to Format 3.0 newPostTable[1] = 0x03; - System.arraycopy(newPostTable, 0, output, currentPos, newTableSize); + writeBytes(newPostTable); updateCheckSum(currentPos, newTableSize, post); currentPos += newTableSize; realSize += newTableSize; } else { - throw new IOException("Can't find post table"); +// throw new IOException("Can't find post table"); } } @@ -265,7 +268,7 @@ public class TTFSubSetFile extends TTFFile { /** * Copy the prep table as is from original font to subset font */ - private boolean createPrep(FontFileReader in) throws IOException { + protected boolean createPrep(FontFileReader in) throws IOException { return copyTable(in, OFTableName.PREP); } @@ -274,13 +277,12 @@ public class TTFSubSetFile extends TTFFile { * Copy the hhea table as is from original font to subset font * and fill in size of hmtx table */ - private void createHhea(FontFileReader in, int size) throws IOException { + protected void createHhea(FontFileReader in, int size) throws IOException { OFDirTabEntry entry = dirTabs.get(OFTableName.HHEA); if (entry != null) { pad4(); seekTab(in, OFTableName.HHEA, 0); - System.arraycopy(in.getBytes((int) entry.getOffset(), (int) entry.getLength()), 0, - output, currentPos, (int) entry.getLength()); + writeBytes(in.getBytes((int) entry.getOffset(), (int) entry.getLength())); writeUShort((int) entry.getLength() + currentPos - 2, size); updateCheckSum(currentPos, (int) entry.getLength(), OFTableName.HHEA); @@ -298,14 +300,13 @@ public class TTFSubSetFile extends TTFFile { * checkSumAdjustment to 0, store offset to checkSumAdjustment * in checkSumAdjustmentOffset */ - private void createHead(FontFileReader in) throws IOException { + protected void createHead(FontFileReader in) throws IOException { OFTableName head = OFTableName.HEAD; OFDirTabEntry entry = dirTabs.get(head); if (entry != null) { pad4(); seekTab(in, head, 0); - System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()), - 0, output, currentPos, (int)entry.getLength()); + writeBytes(in.getBytes((int) entry.getOffset(), (int) entry.getLength())); checkSumAdjustmentOffset = currentPos + 8; output[currentPos + 8] = 0; // Set checkSumAdjustment to 0 @@ -313,8 +314,9 @@ public class TTFSubSetFile extends TTFFile { output[currentPos + 10] = 0; output[currentPos + 11] = 0; output[currentPos + 50] = 0; // long locaformat - output[currentPos + 51] = 1; // long locaformat - + if (cid) { + output[currentPos + 51] = 1; // long locaformat + } updateCheckSum(currentPos, (int)entry.getLength(), head); currentPos += (int)entry.getLength(); realSize += (int)entry.getLength(); @@ -361,10 +363,7 @@ public class TTFSubSetFile extends TTFFile { glyphLength); int endOffset1 = endOffset; // Copy glyph - System.arraycopy( - glyphData, 0, - output, currentPos, - glyphLength); + writeBytes(glyphData); // Update loca table @@ -402,12 +401,14 @@ public class TTFSubSetFile extends TTFFile { } } - private int[] buildSubsetIndexToOrigIndexMap(Map<Integer, Integer> glyphs) { + protected int[] buildSubsetIndexToOrigIndexMap(Map<Integer, Integer> glyphs) { int[] origIndexes = new int[glyphs.size()]; for (Map.Entry<Integer, Integer> glyph : glyphs.entrySet()) { int origIndex = glyph.getKey(); int subsetIndex = glyph.getValue(); - origIndexes[subsetIndex] = origIndex; + if (origIndexes.length > subsetIndex) { + origIndexes[subsetIndex] = origIndex; + } } return origIndexes; } @@ -418,8 +419,8 @@ public class TTFSubSetFile extends TTFFile { * Integer key and Integer value that maps the original * metric (key) to the subset metric (value) */ - private void createHmtx(FontFileReader in, - Map<Integer, Integer> glyphs) throws IOException { + protected void createHmtx(FontFileReader in, + Map<Integer, Integer> glyphs) throws IOException { OFTableName hmtx = OFTableName.HMTX; OFDirTabEntry entry = dirTabs.get(hmtx); @@ -560,7 +561,7 @@ public class TTFSubSetFile extends TTFFile { ttfOut.endFontStream(); } - private void scanGlyphs(FontFileReader in, Map<Integer, Integer> subsetGlyphs) + protected void scanGlyphs(FontFileReader in, Map<Integer, Integer> subsetGlyphs) throws IOException { OFDirTabEntry glyfTableInfo = dirTabs.get(OFTableName.GLYF); if (glyfTableInfo == null) { @@ -580,7 +581,7 @@ public class TTFSubSetFile extends TTFFile { int length = 0; try { byte[] buf = str.getBytes("ISO-8859-1"); - System.arraycopy(buf, 0, output, currentPos, buf.length); + writeBytes(buf); length = buf.length; currentPos += length; } catch (java.io.UnsupportedEncodingException e) { @@ -598,11 +599,20 @@ public class TTFSubSetFile extends TTFFile { output[currentPos++] = b; } + protected void writeBytes(byte[] b) { + if (b.length + currentPos > output.length) { + byte[] newoutput = new byte[output.length * 2]; + System.arraycopy(output, 0, newoutput, 0, output.length); + output = newoutput; + } + System.arraycopy(b, 0, output, currentPos, b.length); + } + /** * Appends a USHORT to the output array, * updates currentPost but not realSize */ - private void writeUShort(int s) { + protected void writeUShort(int s) { byte b1 = (byte)((s >> 8) & 0xff); byte b2 = (byte)(s & 0xff); writeByte(b1); @@ -613,7 +623,7 @@ public class TTFSubSetFile extends TTFFile { * Appends a USHORT to the output array, * at the given position without changing currentPos */ - private void writeUShort(int pos, int s) { + protected void writeUShort(int pos, int s) { byte b1 = (byte)((s >> 8) & 0xff); byte b2 = (byte)(s & 0xff); output[pos] = b1; @@ -625,7 +635,7 @@ public class TTFSubSetFile extends TTFFile { * Appends a ULONG to the output array, * at the given position without changing currentPos */ - private void writeULong(int pos, int s) { + protected void writeULong(int pos, int s) { byte b1 = (byte)((s >> 24) & 0xff); byte b2 = (byte)((s >> 16) & 0xff); byte b3 = (byte)((s >> 8) & 0xff); @@ -640,7 +650,7 @@ public class TTFSubSetFile extends TTFFile { * Create a padding in the fontfile to align * on a 4-byte boundary */ - private void pad4() { + protected void pad4() { int padSize = getPadSize(currentPos); if (padSize < 4) { for (int i = 0; i < padSize; i++) { @@ -663,7 +673,7 @@ public class TTFSubSetFile extends TTFFile { } - private void updateCheckSum(int tableStart, int tableSize, OFTableName tableName) { + protected void updateCheckSum(int tableStart, int tableSize, OFTableName tableName) { int checksum = getCheckSum(output, tableStart, tableSize); int offset = offsets.get(tableName); int padSize = getPadSize(tableStart + tableSize); @@ -673,7 +683,7 @@ public class TTFSubSetFile extends TTFFile { writeULong(offset + 8, tableSize); } - private static int getCheckSum(byte[] data, int start, int size) { + protected static int getCheckSum(byte[] data, int start, int size) { // All the tables here are aligned on four byte boundaries // Add remainder to size if it's not a multiple of 4 int remainder = size % 4; @@ -687,14 +697,16 @@ public class TTFSubSetFile extends TTFFile { long l = 0; for (int j = 0; j < 4; j++) { l <<= 8; - l |= data[start + i + j] & 0xff; + if (data.length > (start + i + j)) { + l |= data[start + i + j] & 0xff; + } } sum += l; } return (int) sum; } - private void createCheckSumAdjustment() { + protected void createCheckSumAdjustment() { long sum = getCheckSum(output, 0, realSize); int checksum = (int)(0xb1b0afba - sum); writeULong(checkSumAdjustmentOffset, checksum); diff --git a/src/java/org/apache/fop/fonts/type1/PostscriptParser.java b/src/java/org/apache/fop/fonts/type1/PostscriptParser.java index 05c3c6453..bc984fecd 100644 --- a/src/java/org/apache/fop/fonts/type1/PostscriptParser.java +++ b/src/java/org/apache/fop/fonts/type1/PostscriptParser.java @@ -31,7 +31,7 @@ import java.util.Scanner; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -class PostscriptParser { +public class PostscriptParser { protected static final Log LOG = LogFactory.getLog(PostscriptParser.class); /* Patterns used to identify Postscript elements */ @@ -177,12 +177,12 @@ class PostscriptParser { /* The tokens parsed from the current element */ protected List<String> tokens; /* Determines whether binary data is currently being read / parsed */ - protected boolean readBinary = false; + protected boolean readBinary; /* The location of the element within the binary data */ private int startPoint = -1; protected int endPoint = -1; /* A flag to determine if unexpected postscript has been found in the element */ - private boolean foundUnexpected = false; + private boolean foundUnexpected; public PSElement(String operator, int startPoint) { this.operator = operator; @@ -327,8 +327,8 @@ class PostscriptParser { private String entry = ""; private String token = ""; - private boolean finished = false; - protected int binaryLength = 0; + private boolean finished; + protected int binaryLength; /* A list containing each entry and it's contents in the array */ private HashMap<Integer, String> entries; private static final String READ_ONLY = "readonly"; @@ -441,7 +441,7 @@ class PostscriptParser { * An object representing a Postscript array with a variable number of entries */ public class PSVariableArray extends PSElement { - private int level = 0; + private int level; private List<String> arrayItems; private String entry = ""; @@ -536,7 +536,7 @@ class PostscriptParser { private HashMap<String, String> entries; private String entry = ""; private String token = ""; - protected int binaryLength = 0; + protected int binaryLength; public PSDictionary(String operator, int startPoint) { super(operator, startPoint); diff --git a/src/java/org/apache/fop/fonts/type1/Type1SubsetFile.java b/src/java/org/apache/fop/fonts/type1/Type1SubsetFile.java index 6e6a7f26b..394d5c777 100644 --- a/src/java/org/apache/fop/fonts/type1/Type1SubsetFile.java +++ b/src/java/org/apache/fop/fonts/type1/Type1SubsetFile.java @@ -51,32 +51,31 @@ public class Type1SubsetFile { protected static final Log LOG = LogFactory.getLog(Type1SubsetFile.class); /* The subset list of char strings */ - private HashMap<String, byte[]> subsetCharStrings; + protected HashMap<String, byte[]> subsetCharStrings; /* The list of character names in the subset font */ - private List<String> charNames = null; + protected List<String> charNames; /* A list of unique subroutines references */ - private LinkedHashMap<Integer, byte[]> uniqueSubs; - private SingleByteFont sbfont = null; + protected LinkedHashMap<Integer, byte[]> uniqueSubs; + private SingleByteFont sbfont; /* New line character */ - private String eol = "\n"; + protected String eol = "\n"; /* An option to determine whether the subroutines are subset */ - private boolean subsetSubroutines = true; + protected boolean subsetSubroutines = true; private byte[] fullFont; //List of parsed Postscript elements - private List<PSElement> headerSection; - private List<PSElement> mainSection; + protected List<PSElement> headerSection; + protected List<PSElement> mainSection; //Determines whether the current font uses standard encoding - private boolean standardEncoding = false; + protected boolean standardEncoding; //Type 1 operators private static final int OP_SEAC = 6; private static final int OP_CALLSUBR = 10; private static final int OP_CALLOTHERSUBR = 16; - public byte[] createSubset(InputStream in, SingleByteFont sbfont, - String fontPrefix) throws IOException { + public byte[] createSubset(InputStream in, SingleByteFont sbfont) throws IOException { fullFont = IOUtils.toByteArray(in); - byte[] subsetFont = createSubset(sbfont, fontPrefix, true); + byte[] subsetFont = createSubset(sbfont, true); //This should never happen but ensure that subset is shorter than original font return (subsetFont.length == 0 || subsetFont.length > fullFont.length) ? fullFont : subsetFont; @@ -84,17 +83,14 @@ public class Type1SubsetFile { /** * Creates a new subset from the given type 1 font input stream - * @param in The type 1 font to subset * @param sbfont The font object containing information such as the * characters from which to create the subset - * @param fontPrefix The prefix used in identifying the subset font - * @param allSubroutines This option will force the subset to include all + * @param subsetSubroutines This option will force the subset to include all * subroutines. * @return Returns the subset as a byte array * @throws IOException */ - private byte[] createSubset(SingleByteFont sbfont, - String fontPrefix, boolean subsetSubroutines) throws IOException { + private byte[] createSubset(SingleByteFont sbfont, boolean subsetSubroutines) throws IOException { this.subsetSubroutines = subsetSubroutines; InputStream in = new ByteArrayInputStream(fullFont); //Initialise resources used for the font creation @@ -132,8 +128,8 @@ public class Type1SubsetFile { //Process and write the main section PSElement charStrings = getElement("/CharStrings", mainSection); - int result = readMainSection(mainSection, decoded, subsetEncodingEntries, charStrings); - if (result == 0) { + boolean result = readMainSection(mainSection, decoded, subsetEncodingEntries, charStrings); + if (!result) { /* This check handles the case where a font uses a postscript method to return a * subroutine index. As there is currently no java postscript interpreter and writing * one would be very difficult it prevents us from handling this eventuality. The way @@ -142,16 +138,16 @@ public class Type1SubsetFile { uniqueSubs.clear(); subsetCharStrings.clear(); charNames.clear(); - return createSubset(sbfont, fontPrefix, false); + return createSubset(sbfont, false); } //Write header section - ByteArrayOutputStream boasHeader = writeHeader(pfbData, encoding, subsetEncodingEntries); + ByteArrayOutputStream boasHeader = writeHeader(pfbData, encoding); ByteArrayOutputStream boasMain = writeMainSection(decoded, mainSection, charStrings); byte[] mainSectionBytes = boasMain.toByteArray(); mainSectionBytes = BinaryCoder.encodeBytes(mainSectionBytes, 55665, 4); - boasMain = new ByteArrayOutputStream(); + boasMain.reset(); boasMain.write(mainSectionBytes); ByteArrayOutputStream baosTrailer = new ByteArrayOutputStream(); @@ -160,8 +156,8 @@ public class Type1SubsetFile { return stitchFont(boasHeader, boasMain, baosTrailer); } - byte[] stitchFont(ByteArrayOutputStream boasHeader, ByteArrayOutputStream boasMain, - ByteArrayOutputStream boasTrailer) throws IOException { + protected byte[] stitchFont(ByteArrayOutputStream boasHeader, ByteArrayOutputStream boasMain, + ByteArrayOutputStream boasTrailer) throws IOException { int headerLength = boasHeader.size(); int mainLength = boasMain.size(); @@ -205,7 +201,7 @@ public class Type1SubsetFile { /* If no matches are found, create a new entry for the character so * that it can be added even if it's not in the current encoding. */ if (matches.size() == 0) { - matches = new ArrayList<String>(); + matches.clear(); if (glyph == 0) { matches.add("dup 0 /.notdef put"); } else { @@ -237,7 +233,7 @@ public class Type1SubsetFile { return subsetEncodingEntries; } - private List<String> searchEntries(HashMap<Integer, String> encodingEntries, int glyph) { + protected List<String> searchEntries(HashMap<Integer, String> encodingEntries, int glyph) { List<String> matches = new ArrayList<String>(); for (Entry<Integer, String> entry : encodingEntries.entrySet()) { String tag = getEntryPart(entry.getValue(), 3); @@ -249,15 +245,13 @@ public class Type1SubsetFile { return matches; } - private ByteArrayOutputStream writeHeader(PFBData pfbData, PSElement encoding, - List<String> subsetEncodingEntries) throws UnsupportedEncodingException, - IOException { + protected ByteArrayOutputStream writeHeader(PFBData pfbData, PSElement encoding) throws IOException { ByteArrayOutputStream boasHeader = new ByteArrayOutputStream(); boasHeader.write(pfbData.getHeaderSegment(), 0, encoding.getStartPoint() - 1); if (!standardEncoding) { //Write out the new encoding table for the subset font - String encodingArray = eol + String.format("/Encoding %d array", 256) + eol + String encodingArray = eol + "/Encoding 256 array" + eol + "0 1 255 {1 index exch /.notdef put } for" + eol; byte[] encodingDefinition = encodingArray.getBytes("ASCII"); boasHeader.write(encodingDefinition, 0, encodingDefinition.length); @@ -287,7 +281,7 @@ public class Type1SubsetFile { return boas; } - private int readMainSection(List<PSElement> mainSection, byte[] decoded, + private boolean readMainSection(List<PSElement> mainSection, byte[] decoded, List<String> subsetEncodingEntries, PSElement charStrings) { subsetEncodingEntries.add(0, "dup 0 /.notdef put"); /* Reads and parses the charStrings section to subset the charString @@ -322,19 +316,19 @@ public class Type1SubsetFile { /* Recursively scan the charString array for subroutines and if found, copy the * entry to our subset entries and update any references. */ charStringEntry = createSubsetCharStrings(decoded, charStringEntry, subroutines, - subsetEncodingEntries, tag); + subsetEncodingEntries); } if (charStringEntry.length == 0) { - return 0; + return false; } charStringEntry = BinaryCoder.encodeBytes(charStringEntry, 4330, skipBytes); subsetCharStrings.put(tag, charStringEntry); } - return 1; + return true; } private byte[] createSubsetCharStrings(byte[] decoded, byte[] data, PSFixedArray subroutines, - List<String> subsetEncodingEntries, String glyphName) { + List<String> subsetEncodingEntries) { List<BytesNumber> operands = new ArrayList<BytesNumber>(); for (int i = 0; i < data.length; i++) { int cur = data[i] & 0xFF; @@ -348,11 +342,11 @@ public class Type1SubsetFile { if (uniqueSubs.get(operands.get(operands.size() - 1).getNumber()) == null) { uniqueSubs.put(operands.get(operands.size() - 1).getNumber(), new byte[0]); data = addSubroutine(subroutines, operands, decoded, subsetEncodingEntries, - glyphName, data, i, 1, -1, operands.get( + data, i, 1, -1, operands.get( operands.size() - 1).getNumber()); } else { data = addSubroutine(subroutines, operands, decoded, subsetEncodingEntries, - glyphName, data, i, 1, getSubrIndex(operands.get( + data, i, 1, getSubrIndex(operands.get( operands.size() - 1).getNumber()), operands.get( operands.size() - 1).getNumber()); } @@ -390,7 +384,7 @@ public class Type1SubsetFile { return new byte[0]; } data = addSubroutine(subroutines, operands, decoded, subsetEncodingEntries, - glyphName, data, i, 2, -1, operands.get(0).getNumber()); + data, i, 2, -1, operands.get(0).getNumber()); } } if (data.length == 0) { @@ -431,14 +425,14 @@ public class Type1SubsetFile { } private byte[] addSubroutine(PSFixedArray subroutines, List<BytesNumber> operands, byte[] decoded, - List<String> subsetEncodingEntries, String glyphName, byte[] data, int i, int opLength, + List<String> subsetEncodingEntries, byte[] data, int i, int opLength, int existingSubrRef, int subrID) { if (existingSubrRef == -1) { int[] subrData = subroutines.getBinaryEntryByIndex(subrID); byte[] subroutine = getBinaryEntry(subrData, decoded); subroutine = BinaryCoder.decodeBytes(subroutine, 4330, 4); subroutine = createSubsetCharStrings(decoded, subroutine, subroutines, - subsetEncodingEntries, glyphName); + subsetEncodingEntries); if (subroutine.length == 0) { return new byte[0]; } @@ -451,8 +445,8 @@ public class Type1SubsetFile { return data; } - private ByteArrayOutputStream writeMainSection(byte[] decoded, List<PSElement> mainSection, - PSElement charStrings) throws IOException { + protected ByteArrayOutputStream writeMainSection(byte[] decoded, List<PSElement> mainSection, + PSElement charStrings) throws IOException { ByteArrayOutputStream main = new ByteArrayOutputStream(); PSElement subrs = getElement("/Subrs", mainSection); @@ -470,11 +464,9 @@ public class Type1SubsetFile { writeString(eol + String.format("/Subrs %d array", uniqueSubs.size()), main); int count = 0; for (Entry<Integer, byte[]> entry : uniqueSubs.entrySet()) { - byte[] newSubrBytes = (eol + String.format("dup %d %d %s ", count++, - entry.getValue().length, rd)).getBytes("ASCII"); - newSubrBytes = concatArray(newSubrBytes, entry.getValue()); - newSubrBytes = concatArray(newSubrBytes, String.format(" %s", np).getBytes("ASCII")); - main.write(newSubrBytes); + writeString(eol + String.format("dup %d %d %s ", count++, entry.getValue().length, rd), main); + main.write(entry.getValue()); + writeString(" " + np, main); } writeString(eol + nd, main); } else { @@ -498,8 +490,8 @@ public class Type1SubsetFile { return main; } - private String findVariable(byte[] decoded, List<PSElement> elements, String[] matches, - String fallback) throws UnsupportedEncodingException { + protected String findVariable(byte[] decoded, List<PSElement> elements, String[] matches, + String fallback) throws UnsupportedEncodingException { for (PSElement element : elements) { if (element instanceof PSSubroutine) { byte[] var = new byte[element.getEndPoint() - element.getStartPoint()]; @@ -575,8 +567,8 @@ public class Type1SubsetFile { sbfont.mapUsedGlyphName(charIndex, charName); } - private void writeString(String entry, ByteArrayOutputStream boas) - throws UnsupportedEncodingException, IOException { + protected void writeString(String entry, ByteArrayOutputStream boas) + throws IOException { byte[] byteEntry = entry.getBytes("ASCII"); boas.write(byteEntry); } @@ -587,7 +579,7 @@ public class Type1SubsetFile { public static final class BytesNumber { private int number; private int numBytes; - private String name = null; + private String name; public BytesNumber(int number, int numBytes) { this.number = number; @@ -696,7 +688,7 @@ public class Type1SubsetFile { * @param decoded The array from which to copy a section of data * @return Returns the copy of the data section */ - byte[] getBinaryEntry(int[] position, byte[] decoded) { + protected byte[] getBinaryEntry(int[] position, byte[] decoded) { int start = position[0]; int finish = position[1]; byte[] line = new byte[finish - start]; @@ -704,7 +696,7 @@ public class Type1SubsetFile { return line; } - private String getEntryPart(String entry, int part) { + protected String getEntryPart(String entry, int part) { Scanner s = new Scanner(entry).useDelimiter(" "); for (int i = 1; i < part; i++) { s.next(); @@ -712,7 +704,7 @@ public class Type1SubsetFile { return s.next(); } - private PSElement getElement(String elementID, List<PSElement> elements) { + protected PSElement getElement(String elementID, List<PSElement> elements) { for (PSElement element : elements) { if (element.getOperator().equals(elementID)) { return element; @@ -722,14 +714,6 @@ public class Type1SubsetFile { } /** - * Gets the list of subset character names - * @return Returns the subset character names - */ - public List<String> getCharNames() { - return charNames; - } - - /** * A class to encode and decode sections of a type 1 font file. See Adobe * Type 1 Font Format Section 7.2 for more details. */ diff --git a/src/java/org/apache/fop/hyphenation/Hyphenator.java b/src/java/org/apache/fop/hyphenation/Hyphenator.java index 31cf8e1c8..9e61263e6 100644 --- a/src/java/org/apache/fop/hyphenation/Hyphenator.java +++ b/src/java/org/apache/fop/hyphenation/Hyphenator.java @@ -45,10 +45,10 @@ public final class Hyphenator { /** logging instance */ protected static final Log log = LogFactory.getLog(Hyphenator.class); - private static HyphenationTreeCache hTreeCache = null; + private static HyphenationTreeCache hTreeCache; /** Enables a dump of statistics. Note: If activated content is sent to System.out! */ - private static boolean statisticsDump = false; + private static boolean statisticsDump; /** * Creates a new hyphenator. diff --git a/src/java/org/apache/fop/hyphenation/PatternParser.java b/src/java/org/apache/fop/hyphenation/PatternParser.java index 1448e6e12..7961b28d9 100644 --- a/src/java/org/apache/fop/hyphenation/PatternParser.java +++ b/src/java/org/apache/fop/hyphenation/PatternParser.java @@ -52,7 +52,7 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { private ArrayList exception; private char hyphenChar; private String errMsg; - private boolean hasClasses = false; + private boolean hasClasses; static final int ELEM_CLASSES = 1; static final int ELEM_EXCEPTIONS = 2; diff --git a/src/java/org/apache/fop/hyphenation/SerializeHyphPattern.java b/src/java/org/apache/fop/hyphenation/SerializeHyphPattern.java index 536c7444a..c5f5ccc60 100644 --- a/src/java/org/apache/fop/hyphenation/SerializeHyphPattern.java +++ b/src/java/org/apache/fop/hyphenation/SerializeHyphPattern.java @@ -31,7 +31,7 @@ import java.io.ObjectOutputStream; */ public class SerializeHyphPattern { - private boolean errorDump = false; + private boolean errorDump; /** * Controls the amount of error information dumped. diff --git a/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java index 635e267c1..8830278b4 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java @@ -39,9 +39,9 @@ public abstract class AbstractBaseLayoutManager implements LayoutManager, PercentBaseContext { /** Indicator if this LM generates reference areas. */ - protected boolean generatesReferenceArea = false; + protected boolean generatesReferenceArea; /** Indicator if this LM generates block areas. */ - protected boolean generatesBlockArea = false; + protected boolean generatesBlockArea; /** The formatting object for this LM. */ protected final FObj fobj; diff --git a/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java b/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java index 408a02b04..f0d9126a8 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java @@ -96,9 +96,9 @@ public abstract class AbstractBreaker { private static final long serialVersionUID = -5348831120146774118L; /** Number of elements to ignore at the beginning of the list. */ - int ignoreAtStart = 0; + int ignoreAtStart; /** Number of elements to ignore at the end of the list. */ - int ignoreAtEnd = 0; + int ignoreAtEnd; /** * startOn represents where on the page/which page layout diff --git a/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java index 53de9e1ed..a1a2735a2 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java @@ -59,9 +59,9 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa protected Page curPage; /** the current page number */ - protected int currentPageNum = 0; + protected int currentPageNum; /** The stating page number */ - protected int startPageNum = 0; + protected int startPageNum; /** * Constructor diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java index 3da6974a6..9ce113d11 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java @@ -66,7 +66,7 @@ public class BlockContainerLayoutManager extends SpacedBorderedPaddedBlockLayout // When viewport should grow with the content. private boolean autoHeight = true; - private boolean inlineElementList = false; + private boolean inlineElementList; /* holds the (one-time use) fo:block space-before and -after properties. Large fo:blocks are split @@ -81,8 +81,8 @@ public class BlockContainerLayoutManager extends SpacedBorderedPaddedBlockLayout private MinOptMax foBlockSpaceAfter; private int horizontalOverflow; - private double contentRectOffsetX = 0; - private double contentRectOffsetY = 0; + private double contentRectOffsetX; + private double contentRectOffsetY; /** * Create a new block container layout manager. diff --git a/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java b/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java index 68d64199a..83c1ae585 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java +++ b/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java @@ -29,7 +29,7 @@ public class BlockKnuthSequence extends KnuthSequence { private static final long serialVersionUID = 1648962416582509095L; - private boolean isClosed = false; + private boolean isClosed; /** * Creates a new and empty list. diff --git a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java index 4cf15f3a0..d57588db8 100644 --- a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java @@ -123,9 +123,9 @@ public abstract class BreakingAlgorithm { /** Force the algorithm to find a set of breakpoints, even if no feasible breakpoints * exist. */ - private boolean force = false; + private boolean force; /** If set to true, doesn't ignore break possibilities which are definitely too short. */ - protected boolean considerTooShort = false; + protected boolean considerTooShort; /** When in forced mode, the best node leading to a too long line. The line will be * too long anyway, but this one will lead to a paragraph with fewest demerits. @@ -162,12 +162,12 @@ public abstract class BreakingAlgorithm { /** * The lowest available line in the set of active nodes. */ - protected int startLine = 0; + protected int startLine; /** * The highest + 1 available line in the set of active nodes. */ - protected int endLine = 0; + protected int endLine; /** * The total width of all elements handled so far. @@ -177,12 +177,12 @@ public abstract class BreakingAlgorithm { /** * The total stretch of all elements handled so far. */ - protected int totalStretch = 0; + protected int totalStretch; /** * The total shrink of all elements handled so far. */ - protected int totalShrink = 0; + protected int totalShrink; /** * Best records. @@ -268,7 +268,7 @@ public abstract class BreakingAlgorithm { * Holds the number of subsequent recovery attempty that are made to get content fit * into a line. */ - public int fitRecoveryCounter = 0; + public int fitRecoveryCounter; /** * Construct node. diff --git a/src/java/org/apache/fop/layoutmgr/ElementListObserver.java b/src/java/org/apache/fop/layoutmgr/ElementListObserver.java index d5c6f5527..17cdd1462 100644 --- a/src/java/org/apache/fop/layoutmgr/ElementListObserver.java +++ b/src/java/org/apache/fop/layoutmgr/ElementListObserver.java @@ -32,7 +32,7 @@ public final class ElementListObserver { private ElementListObserver() { } - private static List activeObservers = null; + private static List activeObservers; /** * Adds a new Observer to the list. diff --git a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java index df84aff20..1b38b9d8f 100644 --- a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java +++ b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java @@ -34,7 +34,7 @@ public class InlineKnuthSequence extends KnuthSequence { private static final long serialVersionUID = 1354774188859946549L; - private boolean isClosed = false; + private boolean isClosed; /** * Creates a new and empty list. diff --git a/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java b/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java index e76a8a06c..530c6609a 100644 --- a/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java +++ b/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java @@ -37,7 +37,7 @@ public class KnuthBlockBox extends KnuthBox { private int bpd; private List<FootnoteBodyLayoutManager> footnoteList; /** List of Knuth elements. This is a list of LinkedList elements. */ - private List elementLists = null; + private List elementLists; /** * Creates a new box. diff --git a/src/java/org/apache/fop/layoutmgr/LMiter.java b/src/java/org/apache/fop/layoutmgr/LMiter.java index d3ad30485..373a61a1c 100644 --- a/src/java/org/apache/fop/layoutmgr/LMiter.java +++ b/src/java/org/apache/fop/layoutmgr/LMiter.java @@ -29,7 +29,7 @@ public class LMiter implements ListIterator<LayoutManager> { /** list of layout managers */ protected List<LayoutManager> listLMs; /** current position in iteration */ - protected int curPos = 0; + protected int curPos; /** The LayoutManager to which this LMiter is attached **/ private LayoutManager lp; diff --git a/src/java/org/apache/fop/layoutmgr/LayoutContext.java b/src/java/org/apache/fop/layoutmgr/LayoutContext.java index 763407132..bb240e637 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutContext.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutContext.java @@ -94,28 +94,28 @@ public final class LayoutContext { private List pendingBeforeMarks; /** Current hyphenation context. May be null. */ - private HyphContext hyphContext = null; + private HyphContext hyphContext; /** Alignment in BP direction */ private int bpAlignment = Constants.EN_START; /** Stretch or shrink value when making areas. */ - private double ipdAdjust = 0.0; + private double ipdAdjust; /** Stretch or shrink value when adding spaces. */ - private double dSpaceAdjust = 0.0; + private double dSpaceAdjust; - private AlignmentContext alignmentContext = null; + private AlignmentContext alignmentContext; /** Amount of space before / start */ - private int spaceBefore = 0; + private int spaceBefore; /** Amount of space after / end */ - private int spaceAfter = 0; + private int spaceAfter; /** Amount of space to reserve at the beginning of each line */ - private int lineStartBorderAndPaddingWidth = 0; + private int lineStartBorderAndPaddingWidth; /** Amount of space to reserve at the end of each line */ - private int lineEndBorderAndPaddingWidth = 0; + private int lineEndBorderAndPaddingWidth; private int breakBefore; private int breakAfter; diff --git a/src/java/org/apache/fop/layoutmgr/LocalBreaker.java b/src/java/org/apache/fop/layoutmgr/LocalBreaker.java index bcb86e501..a37f82643 100644 --- a/src/java/org/apache/fop/layoutmgr/LocalBreaker.java +++ b/src/java/org/apache/fop/layoutmgr/LocalBreaker.java @@ -30,7 +30,7 @@ public abstract class LocalBreaker extends AbstractBreaker { protected BlockStackingLayoutManager lm; private int displayAlign; private int ipd; - private int overflow = 0; + private int overflow; public LocalBreaker(BlockStackingLayoutManager lm, int ipd, int displayAlign) { this.lm = lm; diff --git a/src/java/org/apache/fop/layoutmgr/PageBreaker.java b/src/java/org/apache/fop/layoutmgr/PageBreaker.java index ec0d4e990..faff4ee17 100644 --- a/src/java/org/apache/fop/layoutmgr/PageBreaker.java +++ b/src/java/org/apache/fop/layoutmgr/PageBreaker.java @@ -52,9 +52,9 @@ public class PageBreaker extends AbstractBreaker { * The FlowLayoutManager object, which processes * the single fo:flow of the fo:page-sequence */ - private FlowLayoutManager childFLM = null; + private FlowLayoutManager childFLM; - private StaticContentLayoutManager footnoteSeparatorLM = null; + private StaticContentLayoutManager footnoteSeparatorLM; /** * Construct page breaker. diff --git a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java index be9de298a..cdd9a703a 100644 --- a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java @@ -43,33 +43,33 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { private final PageProvider pageProvider; private final PageBreakingLayoutListener layoutListener; /** List of PageBreakPosition elements. */ - private LinkedList<PageBreakPosition> pageBreaks = null; + private LinkedList<PageBreakPosition> pageBreaks; /** Footnotes which are cited between the currently considered active node (previous * break) and the current considered break. Its type is * List<List<KnuthElement>>, it contains the sequences of KnuthElement * representing the footnotes bodies. */ - private List<List<KnuthElement>> footnotesList = null; + private List<List<KnuthElement>> footnotesList; /** Cumulated bpd of unhandled footnotes. */ - private List<Integer> lengthList = null; + private List<Integer> lengthList; /** Length of all the footnotes which will be put on the current page. */ - private int totalFootnotesLength = 0; + private int totalFootnotesLength; /** * Length of all the footnotes which have already been inserted, up to the currently * considered element. That is, footnotes from the currently considered page plus * footnotes from its preceding pages. */ - private int insertedFootnotesLength = 0; + private int insertedFootnotesLength; /** True if footnote citations have been met since the beginning of the page sequence. */ - private boolean footnotesPending = false; + private boolean footnotesPending; /** True if the elements met after the previous break point contain footnote citations. */ - private boolean newFootnotes = false; + private boolean newFootnotes; /** Index of the first footnote met after the previous break point. */ - private int firstNewFootnoteIndex = 0; + private int firstNewFootnoteIndex; /** Index of the last footnote inserted on the current page. */ - private int footnoteListIndex = 0; + private int footnoteListIndex; /** Index of the last element of the last footnote inserted on the current page. */ private int footnoteElementIndex = -1; @@ -77,20 +77,20 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { private final int splitFootnoteDemerits = 5000; // demerits for a page break that defers a whole footnote to the following page private final int deferredFootnoteDemerits = 10000; - private MinOptMax footnoteSeparatorLength = null; + private MinOptMax footnoteSeparatorLength; // the method noBreakBetween(int, int) uses these variables // to store parameters and result of the last call, in order // to reuse them and take less time private int storedPrevBreakIndex = -1; private int storedBreakIndex = -1; - private boolean storedValue = false; + private boolean storedValue; //Controls whether overflows should be warned about or not - private boolean autoHeight = false; + private boolean autoHeight; //Controls whether a single part should be forced if possible (ex. block-container) - private boolean favorSinglePart = false; + private boolean favorSinglePart; private int ipdDifference; private KnuthNode bestNodeForIPDChange; diff --git a/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java b/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java index 394477658..dd525e16f 100644 --- a/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java +++ b/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java @@ -33,7 +33,7 @@ import org.apache.fop.traits.SpaceVal; public class SpaceSpecifier implements Cloneable { private boolean startsReferenceArea; - private boolean hasForcing = false; + private boolean hasForcing; private List spaceVals = new ArrayList(); /** diff --git a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java index 7caa31cfb..83fa63151 100644 --- a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java @@ -41,7 +41,7 @@ public class StaticContentLayoutManager extends BlockStackingLayoutManager { private Block targetBlock; private SideRegion regionFO; - private int contentAreaIPD = 0; + private int contentAreaIPD; private int contentAreaBPD = -1; /** diff --git a/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java index 7ed910473..c959ee7be 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java @@ -49,7 +49,7 @@ public class CharacterLayoutManager extends LeafNodeLayoutManager { private MinOptMax letterSpaceIPD; private int hyphIPD; private Font font; - private CommonBorderPaddingBackground borderProps = null; + private CommonBorderPaddingBackground borderProps; /** * Constructor diff --git a/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java index c067b040f..83b9502f2 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java @@ -61,7 +61,7 @@ public class ContentLayoutManager extends AbstractBaseLayoutManager private Area holder; private int stackSize; private LayoutManager parentLM; - private InlineLevelLayoutManager childLM = null; + private InlineLevelLayoutManager childLM; /** * Constructs a new ContentLayoutManager diff --git a/src/java/org/apache/fop/layoutmgr/inline/HyphContext.java b/src/java/org/apache/fop/layoutmgr/inline/HyphContext.java index ffc57fa16..fcbde26e5 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/HyphContext.java +++ b/src/java/org/apache/fop/layoutmgr/inline/HyphContext.java @@ -29,8 +29,8 @@ package org.apache.fop.layoutmgr.inline; */ public class HyphContext { private int[] hyphPoints; - private int currentOffset = 0; - private int currentIndex = 0; + private int currentOffset; + private int currentIndex; /** * @param hyphPoints number of hyphenation points diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java index 61dcf45c9..0a0658b4d 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java @@ -72,11 +72,11 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { */ private static Log log = LogFactory.getLog(InlineLayoutManager.class); - private CommonMarginInline inlineProps = null; - private CommonBorderPaddingBackground borderProps = null; + private CommonMarginInline inlineProps; + private CommonBorderPaddingBackground borderProps; - private boolean areaCreated = false; - private LayoutManager lastChildLM = null; // Set when return last breakposs; + private boolean areaCreated; + private LayoutManager lastChildLM; // Set when return last breakposs; private Font font; @@ -93,7 +93,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { /** The keep-together property */ //private KeepProperty keepTogether; - private AlignmentContext alignmentContext = null; + private AlignmentContext alignmentContext; /** * Create an inline layout manager. diff --git a/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java b/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java index e786acdd3..e8bec8f4d 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java +++ b/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java @@ -28,8 +28,8 @@ import org.apache.fop.layoutmgr.Position; */ public class KnuthInlineBox extends KnuthBox { - private FootnoteBodyLayoutManager footnoteBodyLM = null; - private AlignmentContext alignmentContext = null; + private FootnoteBodyLayoutManager footnoteBodyLM; + private AlignmentContext alignmentContext; /** * Create a new KnuthBox. diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java index f0ae4170d..5f65a5969 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java @@ -51,12 +51,12 @@ import org.apache.fop.traits.MinOptMax; */ public class LeaderLayoutManager extends LeafNodeLayoutManager { private Leader fobj; - private Font font = null; + private Font font; - private List contentList = null; - private ContentLayoutManager clm = null; + private List contentList; + private ContentLayoutManager clm; - private int contentAreaIPD = 0; + private int contentAreaIPD; /** * Constructor diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java index 001fde817..ae337b0d0 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java @@ -57,16 +57,16 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager protected static final Log log = LogFactory.getLog(LeafNodeLayoutManager.class); /** The inline area that this leafnode will add. */ - protected InlineArea curArea = null; + protected InlineArea curArea; /** Any border, padding and background properties applying to this area */ - protected CommonBorderPaddingBackground commonBorderPaddingBackground = null; + protected CommonBorderPaddingBackground commonBorderPaddingBackground; /** The alignment context applying to this area */ - protected AlignmentContext alignmentContext = null; + protected AlignmentContext alignmentContext; /** Flag to indicate if something was changed as part of the getChangeKnuthElements sequence */ - protected boolean somethingChanged = false; + protected boolean somethingChanged; /** Our area info for the Knuth elements */ - protected AreaInfo areaInfo = null; + protected AreaInfo areaInfo; /** * Store information about the inline area diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java index 20d04c6d5..aa8815ffc 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java @@ -168,7 +168,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager private LineLayoutPossibilities lineLayouts; private LineLayoutPossibilities[] lineLayoutsList; - private int ipd = 0; + private int ipd; /** * When layout must be re-started due to a change of IPD, there is no need * to perform hyphenation on the remaining Knuth sequence once again. @@ -196,9 +196,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager private static final long serialVersionUID = 5862072380375189105L; /** Number of elements to ignore at the beginning of the list. */ - private int ignoreAtStart = 0; + private int ignoreAtStart; /** Number of elements to ignore at the end of the list. */ - private int ignoreAtEnd = 0; + private int ignoreAtEnd; // space at the end of the last line (in millipoints) private MinOptMax lineFiller; diff --git a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java index 625b43ee5..9d12348ad 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java @@ -98,9 +98,9 @@ public class TextLayoutManager extends LeafNodeLayoutManager { private final MinOptMax[] letterSpaceAdjustArray; //size = textArray.length + 1 /** Font used for the space between words. */ - private Font spaceFont = null; + private Font spaceFont; /** Start index of next TextArea */ - private int nextStart = 0; + private int nextStart; /** size of a space character (U+0020) glyph in current font */ private int spaceCharIPD; private MinOptMax wordSpaceIPD; @@ -108,24 +108,24 @@ public class TextLayoutManager extends LeafNodeLayoutManager { /** size of the hyphen character glyph in current font */ private int hyphIPD; - private boolean hasChanged = false; + private boolean hasChanged; private int[] returnedIndices = {0, 0}; - private int changeOffset = 0; - private int thisStart = 0; - private int tempStart = 0; + private int changeOffset; + private int thisStart; + private int tempStart; private List changeList = new LinkedList(); - private AlignmentContext alignmentContext = null; + private AlignmentContext alignmentContext; /** * The width to be reserved for border and padding at the start of the line. */ - private int lineStartBAP = 0; + private int lineStartBAP; /** * The width to be reserved for border and padding at the end of the line. */ - private int lineEndBAP = 0; + private int lineEndBAP; private boolean keepTogether; diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java index 4df716899..6404e9feb 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java @@ -71,10 +71,10 @@ public class ListItemLayoutManager extends SpacedBorderedPaddedBlockLayoutManage private ListItemContentLayoutManager label; private ListItemContentLayoutManager body; - private Block curBlockArea = null; + private Block curBlockArea; - private List<ListElement> labelList = null; - private List<ListElement> bodyList = null; + private List<ListElement> labelList; + private List<ListElement> bodyList; private Keep keepWithNextPendingOnLabel; private Keep keepWithNextPendingOnBody; diff --git a/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java b/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java index 36d42dbbe..81841b246 100644 --- a/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java +++ b/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java @@ -76,7 +76,7 @@ class ActiveCell { private Keep keepWithNext; - private int spanIndex = 0; + private int spanIndex; private Step previousStep; private Step nextStep; diff --git a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java index 048f83269..a4c8570e8 100644 --- a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java +++ b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java @@ -48,7 +48,7 @@ public abstract class CollapsingBorderModel { //public static final int LAST_ROW_IN_GROUP = 8; //These statics are used singleton-style. No MT issues here. - private static CollapsingBorderModel collapse = null; + private static CollapsingBorderModel collapse; // private static CollapsingBorderModel collapseWithPrecedence = null; /** diff --git a/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java b/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java index 1d1a44349..8fae90849 100644 --- a/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java +++ b/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java @@ -50,7 +50,7 @@ public class ColumnSetup { private List columns = new java.util.ArrayList(); private List colWidths = new java.util.ArrayList(); - private int maxColIndexReferenced = 0; + private int maxColIndexReferenced; /** * Main Constructor. diff --git a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java index 6b0ef6ebb..4c45e62f8 100644 --- a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java +++ b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java @@ -50,9 +50,9 @@ import org.apache.fop.layoutmgr.TraitSetter; class RowPainter { private static Log log = LogFactory.getLog(RowPainter.class); private int colCount; - private int currentRowOffset = 0; + private int currentRowOffset; /** Currently handled row (= last encountered row). */ - private EffRow currentRow = null; + private EffRow currentRow; private LayoutContext layoutContext; /** * Index of the first row of the current part present on the current page. @@ -79,7 +79,7 @@ class RowPainter { private CellPart[] lastCellParts; /** y-offset of the current table part. */ - private int tablePartOffset = 0; + private int tablePartOffset; /** See {@link RowPainter#registerPartBackgroundArea(Block)}. */ private CommonBorderPaddingBackground tablePartBackground; /** See {@link RowPainter#registerPartBackgroundArea(Block)}. */ diff --git a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java index 62324a339..f15ef74ed 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java @@ -69,8 +69,8 @@ public class TableContentLayoutManager implements PercentBaseContext { private TableRowIterator footerIter; private LinkedList headerList; private LinkedList footerList; - private int headerNetHeight = 0; - private int footerNetHeight = 0; + private int headerNetHeight; + private int footerNetHeight; private int startXOffset; private int usedBPD; diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java index 89af63449..c733d1d7e 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -75,7 +75,7 @@ public class TableLayoutManager extends SpacedBorderedPaddedBlockLayoutManager private static Log log = LogFactory.getLog(TableLayoutManager.class); private TableContentLayoutManager contentLM; - private ColumnSetup columns = null; + private ColumnSetup columns; private Block curBlockArea; diff --git a/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java b/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java index 35cba6da6..47561f3c9 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java @@ -51,7 +51,7 @@ public class TableRowIterator { private Iterator rowGroupsIter; - private int rowIndex = 0; + private int rowIndex; /** * Creates a new TableRowIterator. diff --git a/src/java/org/apache/fop/pdf/AbstractPDFStream.java b/src/java/org/apache/fop/pdf/AbstractPDFStream.java index 13bd1bda1..331d4f7a5 100644 --- a/src/java/org/apache/fop/pdf/AbstractPDFStream.java +++ b/src/java/org/apache/fop/pdf/AbstractPDFStream.java @@ -60,7 +60,7 @@ public abstract class AbstractPDFStream extends PDFObject { return dictionary; } - protected Object get(String key) { + public Object get(String key) { return dictionary.get(key); } diff --git a/src/java/org/apache/fop/pdf/BitmapImage.java b/src/java/org/apache/fop/pdf/BitmapImage.java index ac7af1dbd..2f7be57e6 100644 --- a/src/java/org/apache/fop/pdf/BitmapImage.java +++ b/src/java/org/apache/fop/pdf/BitmapImage.java @@ -34,7 +34,7 @@ public class BitmapImage implements PDFImage { private PDFDeviceColorSpace colorSpace; private byte[] bitmaps; private PDFReference maskRef; - private PDFColor transparent = null; + private PDFColor transparent; private String key; private PDFDocument pdfDoc; private PDFFilter pdfFilter; diff --git a/src/java/org/apache/fop/pdf/PDFCFFStream.java b/src/java/org/apache/fop/pdf/PDFCFFStream.java new file mode 100644 index 000000000..4a73c3b4f --- /dev/null +++ b/src/java/org/apache/fop/pdf/PDFCFFStream.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.pdf; + + +import java.io.IOException; +import java.io.OutputStream; + +/** + * Special PDFStream for embeddable CFF fonts. + */ +public class PDFCFFStream extends AbstractPDFFontStream { + private byte[] cffData; + private String type; + + public PDFCFFStream(String type) { + this.type = type; + } + + protected int getSizeHint() throws IOException { + if (this.cffData != null) { + return cffData.length; + } else { + return 0; //no hint available + } + } + + protected void outputRawStreamData(OutputStream out) throws IOException { + out.write(this.cffData); + } + + protected void populateStreamDict(Object lengthEntry) { + put("Subtype", new PDFName(type)); + super.populateStreamDict(lengthEntry); + } + + public void setData(byte[] data) throws IOException { + cffData = data; + } +} diff --git a/src/java/org/apache/fop/pdf/PDFDocument.java b/src/java/org/apache/fop/pdf/PDFDocument.java index bcd54fcb9..a8d3d10c0 100644 --- a/src/java/org/apache/fop/pdf/PDFDocument.java +++ b/src/java/org/apache/fop/pdf/PDFDocument.java @@ -167,6 +167,8 @@ public class PDFDocument { private boolean accessibilityEnabled; + private boolean mergeFontsEnabled; + /** * Creates an empty PDF document. * @@ -1082,6 +1084,14 @@ public class PDFDocument { return trailerDictionary; } + public boolean isMergeFontsEnabled() { + return mergeFontsEnabled; + } + + public void setMergeFontsEnabled(boolean mergeFontsEnabled) { + this.mergeFontsEnabled = mergeFontsEnabled; + } + private interface TrailerOutputHelper { void outputStructureTreeElements(OutputStream stream) throws IOException; diff --git a/src/java/org/apache/fop/pdf/PDFFactory.java b/src/java/org/apache/fop/pdf/PDFFactory.java index ef1f1849f..cad0a405d 100644 --- a/src/java/org/apache/fop/pdf/PDFFactory.java +++ b/src/java/org/apache/fop/pdf/PDFFactory.java @@ -877,9 +877,15 @@ public class PDFFactory { PDFFont font = null; font = PDFFont.createFont(fontname, fonttype, subsetFontName, null); - getDocument().registerObject(font); + if (descriptor instanceof RefPDFFont) { + font.setObjectNumber(((RefPDFFont)descriptor).getRef().getObjectNumber()); + font.setDocument(getDocument()); + getDocument().addObject(font); + } else { + getDocument().registerObject(font); + } - if (fonttype == FontType.TYPE0) { + if ((fonttype == FontType.TYPE0 || fonttype == FontType.CIDTYPE0)) { font.setEncoding(encoding); CIDFont cidMetrics; if (metrics instanceof LazyFont) { @@ -890,16 +896,30 @@ public class PDFFactory { PDFCIDSystemInfo sysInfo = new PDFCIDSystemInfo(cidMetrics.getRegistry(), cidMetrics.getOrdering(), cidMetrics.getSupplement()); sysInfo.setDocument(document); + assert pdfdesc instanceof PDFCIDFontDescriptor; PDFCIDFont cidFont = new PDFCIDFont(subsetFontName, cidMetrics.getCIDType(), cidMetrics.getDefaultWidth(), getFontWidths(cidMetrics), sysInfo, (PDFCIDFontDescriptor) pdfdesc); getDocument().registerObject(cidFont); - PDFCMap cmap = new PDFToUnicodeCMap(cidMetrics.getCIDSet().getChars(), "fop-ucs-H", + + PDFCMap cmap; + if (cidMetrics instanceof MultiByteFont && ((MultiByteFont) cidMetrics).getCmapStream() != null) { + cmap = new PDFCMap("fop-ucs-H", null); + try { + cmap.setData(IOUtils.toByteArray(((MultiByteFont) cidMetrics).getCmapStream())); + } catch (IOException e) { + throw new RuntimeException(e); + } + } else { + cmap = new PDFToUnicodeCMap(cidMetrics.getCIDSet().getChars(), "fop-ucs-H", new PDFCIDSystemInfo("Adobe", "Identity", 0), false); + } getDocument().registerObject(cmap); + assert font instanceof PDFFontType0; ((PDFFontType0)font).setCMAP(cmap); ((PDFFontType0)font).setDescendantFonts(cidFont); } else { + assert font instanceof PDFFontNonBase14; PDFFontNonBase14 nonBase14 = (PDFFontNonBase14)font; nonBase14.setDescriptor(pdfdesc); @@ -965,6 +985,29 @@ public class PDFFactory { font.setEncoding(mapping.getName()); //No ToUnicode CMap necessary if PDF 1.4, chapter 5.9 (page 368) is to be //believed. + } else if (mapping.getName().equals("FOPPDFEncoding")) { + String[] charNameMap = mapping.getCharNameMap(); + char[] intmap = mapping.getUnicodeCharMap(); + PDFArray differences = new PDFArray(); + int len = intmap.length; + if (charNameMap.length < len) { + len = charNameMap.length; + } + int last = 0; + for (int i = 0; i < len; i++) { + if (intmap[i] - 1 != last) { + differences.add(intmap[i]); + } + last = intmap[i]; + differences.add(new PDFName(charNameMap[i])); + } + PDFEncoding pdfEncoding = new PDFEncoding(singleByteFont.getEncodingName()); + getDocument().registerObject(pdfEncoding); + pdfEncoding.setDifferences(differences); + font.setEncoding(pdfEncoding); + if (mapping.getUnicodeCharMap() != null) { + generateToUnicodeCmap(nonBase14, mapping); + } } else { Object pdfEncoding = createPDFEncoding(mapping, singleByteFont.getFontName()); @@ -1028,8 +1071,30 @@ public class PDFFactory { private PDFWArray getFontWidths(CIDFont cidFont) { // Create widths for reencoded chars PDFWArray warray = new PDFWArray(); - int[] widths = cidFont.getCIDSet().getWidths(); - warray.addEntry(0, widths); + if (cidFont instanceof MultiByteFont && ((MultiByteFont)cidFont).getWidthsMap() != null) { + Map<Integer, Integer> map = ((MultiByteFont)cidFont).getWidthsMap(); + for (Map.Entry<Integer, Integer> cid : map.entrySet()) { + warray.addEntry(cid.getKey(), new int[] {cid.getValue()}); + } +// List<Integer> l = new ArrayList<Integer>(map.keySet()); +// for (int i=0; i<map.size(); i++) { +// int cid = l.get(i); +// List<Integer> cids = new ArrayList<Integer>(); +// cids.add(map.get(cid)); +// while (i<map.size()-1 && l.get(i) + 1 == l.get(i + 1)) { +// cids.add(map.get(l.get(i + 1))); +// i++; +// } +// int[] cidsints = new int[cids.size()]; +// for (int j=0; j<cids.size(); j++) { +// cidsints[j] = cids.get(j); +// } +// warray.addEntry(cid, cidsints); +// } + } else { + int[] widths = cidFont.getCIDSet().getWidths(); + warray.addEntry(0, widths); + } return warray; } @@ -1059,7 +1124,7 @@ public class PDFFactory { private PDFFontDescriptor makeFontDescriptor(FontDescriptor desc, String fontPrefix) { PDFFontDescriptor descriptor = null; - if (desc.getFontType() == FontType.TYPE0) { + if (desc.getFontType() == FontType.TYPE0 || desc.getFontType() == FontType.CIDTYPE0) { // CID Font descriptor = new PDFCIDFontDescriptor(fontPrefix + desc.getEmbedFontName(), desc.getFontBBox(), @@ -1143,55 +1208,64 @@ public class PDFFactory { in = font.getInputStream(); if (in == null) { return null; - } else { - AbstractPDFStream embeddedFont = null; - if (desc.getFontType() == FontType.TYPE0) { - MultiByteFont mbfont = (MultiByteFont) font; - FontFileReader reader = new FontFileReader(in); - byte[] fontBytes; - String header = OFFontLoader.readHeader(reader); - boolean isCFF = mbfont.isOTFFile(); - if (font.getEmbeddingMode() == EmbeddingMode.FULL) { - fontBytes = reader.getAllBytes(); - if (isCFF) { - //Ensure version 1.6 for full OTF CFF embedding - document.setPDFVersion(Version.V1_6); - } - } else { - fontBytes = getFontSubsetBytes(reader, mbfont, header, fontPrefix, desc, - isCFF); - } - embeddedFont = getFontStream(font, fontBytes, isCFF); - } else if (desc.getFontType() == FontType.TYPE1) { - if (font.getEmbeddingMode() != EmbeddingMode.SUBSET) { - embeddedFont = fullyEmbedType1Font(in); - } else { - assert font instanceof SingleByteFont; - SingleByteFont sbfont = (SingleByteFont)font; - Type1SubsetFile pfbFile = new Type1SubsetFile(); - byte[] subsetData = pfbFile.createSubset(in, sbfont, fontPrefix); - InputStream subsetStream = new ByteArrayInputStream(subsetData); - PFBParser parser = new PFBParser(); - PFBData pfb = parser.parsePFB(subsetStream); - embeddedFont = new PDFT1Stream(); - ((PDFT1Stream) embeddedFont).setData(pfb); + } + AbstractPDFStream embeddedFont = null; + if (desc.getFontType() == FontType.TYPE0) { + MultiByteFont mbfont = (MultiByteFont) font; + FontFileReader reader = new FontFileReader(in); + byte[] fontBytes; + String header = OFFontLoader.readHeader(reader); + boolean isCFF = mbfont.isOTFFile(); + if (font.getEmbeddingMode() == EmbeddingMode.FULL) { + fontBytes = reader.getAllBytes(); + if (isCFF) { + //Ensure version 1.6 for full OTF CFF embedding + document.setPDFVersion(Version.V1_6); } } else { - byte[] file = IOUtils.toByteArray(in); - embeddedFont = new PDFTTFStream(file.length); - ((PDFTTFStream) embeddedFont).setData(file, file.length); + fontBytes = getFontSubsetBytes(reader, mbfont, header, fontPrefix, desc, + isCFF); } - - /* - embeddedFont.getFilterList().addFilter("flate"); - if (getDocument().isEncryptionActive()) { - getDocument().applyEncryption(embeddedFont); + embeddedFont = getFontStream(font, fontBytes, isCFF); + } else if (desc.getFontType() == FontType.TYPE1) { + if (font.getEmbeddingMode() != EmbeddingMode.SUBSET) { + embeddedFont = fullyEmbedType1Font(in); } else { - embeddedFont.getFilterList().addFilter("ascii-85"); - }*/ - - return embeddedFont; + assert font instanceof SingleByteFont; + SingleByteFont sbfont = (SingleByteFont)font; + Type1SubsetFile pfbFile = new Type1SubsetFile(); + byte[] subsetData = pfbFile.createSubset(in, sbfont); + InputStream subsetStream = new ByteArrayInputStream(subsetData); + PFBParser parser = new PFBParser(); + PFBData pfb = parser.parsePFB(subsetStream); + embeddedFont = new PDFT1Stream(); + ((PDFT1Stream) embeddedFont).setData(pfb); + } + } else if (desc.getFontType() == FontType.TYPE1C) { + byte[] file = IOUtils.toByteArray(in); + PDFCFFStream embeddedFont2 = new PDFCFFStream("Type1C"); + embeddedFont2.setData(file); + return embeddedFont2; + } else if (desc.getFontType() == FontType.CIDTYPE0) { + byte[] file = IOUtils.toByteArray(in); + PDFCFFStream embeddedFont2 = new PDFCFFStream("CIDFontType0C"); + embeddedFont2.setData(file); + return embeddedFont2; + } else { + byte[] file = IOUtils.toByteArray(in); + embeddedFont = new PDFTTFStream(file.length); + ((PDFTTFStream) embeddedFont).setData(file, file.length); } + + /* + embeddedFont.getFilterList().addFilter("flate"); + if (getDocument().isEncryptionActive()) { + getDocument().applyEncryption(embeddedFont); + } else { + embeddedFont.getFilterList().addFilter("ascii-85"); + }*/ + + return embeddedFont; } catch (IOException ioe) { log.error("Failed to embed font [" + desc + "] " + desc.getEmbedFontName(), ioe); return null; diff --git a/src/java/org/apache/fop/pdf/PDFFilter.java b/src/java/org/apache/fop/pdf/PDFFilter.java index 7a02ccb68..98117774d 100644 --- a/src/java/org/apache/fop/pdf/PDFFilter.java +++ b/src/java/org/apache/fop/pdf/PDFFilter.java @@ -45,7 +45,7 @@ public abstract class PDFFilter { /** * Marker to know if this filter has already been applied to the data */ - private boolean applied = false; + private boolean applied; /** * Check if this filter has been applied. diff --git a/src/java/org/apache/fop/pdf/PDFFilterList.java b/src/java/org/apache/fop/pdf/PDFFilterList.java index bfb940c51..19d15d0d2 100644 --- a/src/java/org/apache/fop/pdf/PDFFilterList.java +++ b/src/java/org/apache/fop/pdf/PDFFilterList.java @@ -50,9 +50,9 @@ public class PDFFilterList { private List<PDFFilter> filters = new java.util.ArrayList<PDFFilter>(); - private boolean ignoreASCIIFilters = false; + private boolean ignoreASCIIFilters; - private boolean disableAllFilters = false; + private boolean disableAllFilters; /** * Default constructor. diff --git a/src/java/org/apache/fop/pdf/PDFFont.java b/src/java/org/apache/fop/pdf/PDFFont.java index 9b9d1c129..dcd69d8bc 100644 --- a/src/java/org/apache/fop/pdf/PDFFont.java +++ b/src/java/org/apache/fop/pdf/PDFFont.java @@ -105,10 +105,11 @@ public class PDFFont extends PDFDictionary { public static PDFFont createFont(String fontname, FontType subtype, String basefont, Object encoding) { - if (subtype == FontType.TYPE0) { + if (subtype == FontType.TYPE0 || subtype == FontType.CIDTYPE0) { return new PDFFontType0(fontname, basefont, encoding); } else if ((subtype == FontType.TYPE1) + || (subtype == FontType.TYPE1C) || (subtype == FontType.MMTYPE1)) { return new PDFFontType1(fontname, basefont, encoding); diff --git a/src/java/org/apache/fop/pdf/PDFFontDescriptor.java b/src/java/org/apache/fop/pdf/PDFFontDescriptor.java index 73dbebc3f..50bb107e7 100644 --- a/src/java/org/apache/fop/pdf/PDFFontDescriptor.java +++ b/src/java/org/apache/fop/pdf/PDFFontDescriptor.java @@ -102,7 +102,7 @@ public class PDFFontDescriptor extends PDFDictionary { public void setFontFile(FontType subtype, AbstractPDFStream fontfile) { if (subtype == FontType.TYPE1) { put("FontFile", fontfile); - } else if (fontfile instanceof PDFCFFStreamType0C) { + } else if (fontfile instanceof PDFCFFStreamType0C || subtype == FontType.TYPE1C) { put("FontFile3", fontfile); } else { put("FontFile2", fontfile); diff --git a/src/java/org/apache/fop/pdf/PDFGoTo.java b/src/java/org/apache/fop/pdf/PDFGoTo.java index 784aa4f95..89beac236 100644 --- a/src/java/org/apache/fop/pdf/PDFGoTo.java +++ b/src/java/org/apache/fop/pdf/PDFGoTo.java @@ -32,9 +32,9 @@ public class PDFGoTo extends PDFAction { * the pageReference */ private String pageReference; - private String destination = null; - private float xPosition = 0; - private float yPosition = 0; + private String destination; + private float xPosition; + private float yPosition; /** * create a /GoTo object. diff --git a/src/java/org/apache/fop/pdf/PDFGoToRemote.java b/src/java/org/apache/fop/pdf/PDFGoToRemote.java index 2dccdafce..ef283e6ad 100644 --- a/src/java/org/apache/fop/pdf/PDFGoToRemote.java +++ b/src/java/org/apache/fop/pdf/PDFGoToRemote.java @@ -28,9 +28,9 @@ public class PDFGoToRemote extends PDFAction { * the file specification */ private PDFReference pdfFileSpec; - private int pageReference = 0; - private String destination = null; - private boolean newWindow = false; + private int pageReference; + private String destination; + private boolean newWindow; /** * Create an GoToR object. diff --git a/src/java/org/apache/fop/pdf/PDFInfo.java b/src/java/org/apache/fop/pdf/PDFInfo.java index 4ec980e28..dc7c3bdca 100644 --- a/src/java/org/apache/fop/pdf/PDFInfo.java +++ b/src/java/org/apache/fop/pdf/PDFInfo.java @@ -81,12 +81,12 @@ public class PDFInfo extends PDFObject { */ private String producer; - private String title = null; - private String author = null; - private String subject = null; - private String keywords = null; - private Date creationDate = null; - private Date modDate = null; + private String title; + private String author; + private String subject; + private String keywords; + private Date creationDate; + private Date modDate; private Map<PDFName, String> customProperties; diff --git a/src/java/org/apache/fop/pdf/PDFObject.java b/src/java/org/apache/fop/pdf/PDFObject.java index e0f950154..7ec1e2407 100644 --- a/src/java/org/apache/fop/pdf/PDFObject.java +++ b/src/java/org/apache/fop/pdf/PDFObject.java @@ -46,7 +46,7 @@ public abstract class PDFObject implements PDFWritable { /** * the object's generation (0 in new documents) */ - private int generation = 0; + private int generation; /** * the parent PDFDocument diff --git a/src/java/org/apache/fop/pdf/PDFOutline.java b/src/java/org/apache/fop/pdf/PDFOutline.java index 61c562548..8edea457f 100644 --- a/src/java/org/apache/fop/pdf/PDFOutline.java +++ b/src/java/org/apache/fop/pdf/PDFOutline.java @@ -51,7 +51,7 @@ public class PDFOutline extends PDFObject { private int count; // whether to show this outline item's child outline items - private boolean openItem = false; + private boolean openItem; /** * title to display for the bookmark entry diff --git a/src/java/org/apache/fop/pdf/PDFPages.java b/src/java/org/apache/fop/pdf/PDFPages.java index 98c293a97..b56594926 100644 --- a/src/java/org/apache/fop/pdf/PDFPages.java +++ b/src/java/org/apache/fop/pdf/PDFPages.java @@ -39,7 +39,7 @@ public class PDFPages extends PDFObject { /** * the number of /Page objects */ - protected int count = 0; + protected int count; // private PDFPages parent; diff --git a/src/java/org/apache/fop/pdf/PDFPaintingState.java b/src/java/org/apache/fop/pdf/PDFPaintingState.java index f6528a30c..6278e51a0 100644 --- a/src/java/org/apache/fop/pdf/PDFPaintingState.java +++ b/src/java/org/apache/fop/pdf/PDFPaintingState.java @@ -248,17 +248,17 @@ public class PDFPaintingState extends org.apache.fop.util.AbstractPaintingState private static final long serialVersionUID = 3527950647293177764L; - private Paint paint = null; - private Paint backPaint = null; + private Paint paint; + private Paint backPaint; //private int lineCap = 0; //Disabled the ones that are not used, yet //private int lineJoin = 0; //private float miterLimit = 0; //private int dashOffset = 0; - private Shape clip = null; - private PDFGState gstate = null; + private Shape clip; + private PDFGState gstate; //text state - private float characterSpacing = 0f; + private float characterSpacing; /** {@inheritDoc} */ @Override diff --git a/src/java/org/apache/fop/pdf/PDFPattern.java b/src/java/org/apache/fop/pdf/PDFPattern.java index 49f1a0d0b..7acffa0c9 100644 --- a/src/java/org/apache/fop/pdf/PDFPattern.java +++ b/src/java/org/apache/fop/pdf/PDFPattern.java @@ -38,7 +38,7 @@ public class PDFPattern extends PDFPathPaint { /** * The resources associated with this pattern */ - protected PDFResources resources = null; + protected PDFResources resources; /** * Either one (1) for tiling, or two (2) for shading. @@ -48,7 +48,7 @@ public class PDFPattern extends PDFPathPaint { /** * The name of the pattern such as "Pa1" or "Pattern1" */ - protected String patternName = null; + protected String patternName; /** * 1 for colored pattern, 2 for uncolored @@ -63,7 +63,7 @@ public class PDFPattern extends PDFPathPaint { /** * List of Doubles representing the Bounding box rectangle */ - protected List bBox = null; + protected List bBox; /** * Horizontal spacing @@ -78,29 +78,29 @@ public class PDFPattern extends PDFPathPaint { /** * The Shading object comprising the Type 2 pattern */ - protected PDFShading shading = null; + protected PDFShading shading; /** * List of Integers represetning the Extended unique Identifier */ - protected List xUID = null; + protected List xUID; /** * TODO use PDFGState * String representing the extended Graphics state. * Probably will never be used like this. */ - protected StringBuffer extGState = null; + protected StringBuffer extGState; /** * List of Doubles representing the Transformation matrix. */ - protected List matrix = null; + protected List matrix; /** * The stream of a pattern */ - protected StringBuffer patternDataStream = null; + protected StringBuffer patternDataStream; /** * Create a tiling pattern (type 1). diff --git a/src/java/org/apache/fop/pdf/PDFShading.java b/src/java/org/apache/fop/pdf/PDFShading.java index db9e57c30..e1784c59d 100644 --- a/src/java/org/apache/fop/pdf/PDFShading.java +++ b/src/java/org/apache/fop/pdf/PDFShading.java @@ -42,11 +42,15 @@ public class PDFShading extends PDFObject { /** * The name of the Shading e.g. "Shading1" */ - protected String shadingName = null; + protected String shadingName; private final Shading shading; private final PDFFunction pdfFunction; + /** + * A ColorSpace representing the colorspace. "DeviceRGB" is an example. + */ + protected PDFDeviceColorSpace colorSpace; /** * Constructor for Type 2 and 3 diff --git a/src/java/org/apache/fop/pdf/PDFTextUtil.java b/src/java/org/apache/fop/pdf/PDFTextUtil.java index 8c931ad93..bd7c8c4ae 100644 --- a/src/java/org/apache/fop/pdf/PDFTextUtil.java +++ b/src/java/org/apache/fop/pdf/PDFTextUtil.java @@ -47,7 +47,7 @@ public abstract class PDFTextUtil { /** PDF text rendering mode: Add text to path for clipping */ public static final int TR_CLIP = 7; - private boolean inTextObject = false; + private boolean inTextObject; private String startText; private String endText; private boolean useMultiByte; diff --git a/src/java/org/apache/fop/pdf/RefPDFFont.java b/src/java/org/apache/fop/pdf/RefPDFFont.java new file mode 100644 index 000000000..5870cdcb7 --- /dev/null +++ b/src/java/org/apache/fop/pdf/RefPDFFont.java @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.fop.pdf; + +public interface RefPDFFont { + PDFDictionary getRef(); +} diff --git a/src/java/org/apache/fop/render/AbstractConfigurator.java b/src/java/org/apache/fop/render/AbstractConfigurator.java index c890d0830..eb135dfd2 100644 --- a/src/java/org/apache/fop/render/AbstractConfigurator.java +++ b/src/java/org/apache/fop/render/AbstractConfigurator.java @@ -34,7 +34,7 @@ public abstract class AbstractConfigurator { private static final String MIME = "mime"; /** fop factory configuration */ - protected FOUserAgent userAgent = null; + protected FOUserAgent userAgent; /** * Default constructor diff --git a/src/java/org/apache/fop/render/AbstractRenderer.java b/src/java/org/apache/fop/render/AbstractRenderer.java index 9a94e0cc6..15a792db8 100644 --- a/src/java/org/apache/fop/render/AbstractRenderer.java +++ b/src/java/org/apache/fop/render/AbstractRenderer.java @@ -86,29 +86,29 @@ public abstract class AbstractRenderer /** * user agent */ - protected FOUserAgent userAgent = null; + protected FOUserAgent userAgent; /** * block progression position */ - protected int currentBPPosition = 0; + protected int currentBPPosition; /** * inline progression position */ - protected int currentIPPosition = 0; + protected int currentIPPosition; /** * the block progression position of the containing block used for * absolutely positioned blocks */ - protected int containingBPPosition = 0; + protected int containingBPPosition; /** * the inline progression position of the containing block used for * absolutely positioned blocks */ - protected int containingIPPosition = 0; + protected int containingIPPosition; /** the currently active PageViewport */ protected PageViewport currentPageViewport; diff --git a/src/java/org/apache/fop/render/PrintRenderer.java b/src/java/org/apache/fop/render/PrintRenderer.java index b1ff59c84..620c3e621 100644 --- a/src/java/org/apache/fop/render/PrintRenderer.java +++ b/src/java/org/apache/fop/render/PrintRenderer.java @@ -53,7 +53,7 @@ public abstract class PrintRenderer extends AbstractRenderer { protected FontInfo fontInfo; /** list of fonts */ - protected List<EmbedFontInfo> embedFontInfoList = null; + protected List<EmbedFontInfo> embedFontInfoList; /** * Adds a font list to current list of fonts diff --git a/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java b/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java index 8962da304..092e2a425 100644 --- a/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java +++ b/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java @@ -92,7 +92,7 @@ public class AFPDocumentHandler extends AbstractBinaryWritingIFDocumentHandler private Map<String, String> roundedCornerNameCache = new HashMap<String, String>(); - private int roundedCornerCount = 0; + private int roundedCornerCount; private static enum Location { ELSEWHERE, IN_DOCUMENT_HEADER, FOLLOWING_PAGE_SEQUENCE, IN_PAGE_HEADER diff --git a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java index e05bc007c..aa3ed824d 100644 --- a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java +++ b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java @@ -64,7 +64,7 @@ import org.apache.fop.svg.font.AggregatingFontFamilyResolver; */ public class AFPSVGHandler extends AbstractGenericSVGHandler { - private boolean paintAsBitmap = false; + private boolean paintAsBitmap; /** {@inheritDoc} */ public void handleXML(RendererContext context, diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java b/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java index 1e6aee7d5..49fdf38ed 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java @@ -39,12 +39,12 @@ public class AFPPageOverlay extends AFPExtensionAttachment { /** * The x coordinate */ - private int x = 0; + private int x; /** * The y coordinate */ - private int y = 0; + private int y; /** * Default constructor. diff --git a/src/java/org/apache/fop/render/awt/AWTRenderer.java b/src/java/org/apache/fop/render/awt/AWTRenderer.java index 0ba158631..f10640a09 100644 --- a/src/java/org/apache/fop/render/awt/AWTRenderer.java +++ b/src/java/org/apache/fop/render/awt/AWTRenderer.java @@ -67,7 +67,7 @@ public class AWTRenderer extends Java2DRenderer implements Pageable { /** * Will be notified when rendering progresses */ - protected StatusListener statusListener = null; + protected StatusListener statusListener; /** diff --git a/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java b/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java index ab5d78a64..36ded2f7f 100644 --- a/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java +++ b/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java @@ -116,10 +116,10 @@ public class PreviewPanel extends JPanel { */ protected Renderable renderable; /** The number of the page which is currently selected */ - private int currentPage = 0; + private int currentPage; /** The index of the first page displayed on screen. */ - private int firstPage = 0; + private int firstPage; /** The number of pages concurrently displayed on screen. */ private int pageRange = 1; @@ -128,13 +128,13 @@ public class PreviewPanel extends JPanel { private int displayMode = SINGLE; /** The component(s) that hold the rendered page(s) */ - private ImageProxyPanel[] pagePanels = null; + private ImageProxyPanel[] pagePanels; /** * Panel showing the page panels in a grid. Usually the dimensions * of the grid are 1x1, nx1 or nx2. */ - private JPanel gridPanel = null; + private JPanel gridPanel; /** Asynchronous reloader thread, used when reload() method is called. */ private Reloader reloader; @@ -283,9 +283,9 @@ public class PreviewPanel extends JPanel { /** The viewport to be scrolled */ private final JViewport viewport; /** Starting position of a mouse drag - X co-ordinate */ - private int startPosX = 0; + private int startPosX; /** Starting position of a mouse drag - Y co-ordinate */ - private int startPosY = 0; + private int startPosY; ViewportScroller(JViewport vp) { viewport = vp; diff --git a/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java b/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java index 48da62ef7..619d0625e 100644 --- a/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java +++ b/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java @@ -161,7 +161,7 @@ public class TIFFRenderer extends Java2DRenderer { private int count; - private int current = 0; + private int current; /** * Main constructor diff --git a/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java b/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java index f69fe2091..2c04a0714 100644 --- a/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java +++ b/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java @@ -245,7 +245,7 @@ public abstract class AbstractIFPainter<T extends IFDocumentHandler> implements if (log.isTraceEnabled()) { log.trace("Using ImageHandler: " + handler.getClass().getName()); } - + context.putHint("fontinfo", getFontInfo()); handler.handleImage(context, effImage, rect); } diff --git a/src/java/org/apache/fop/render/intermediate/IFRenderer.java b/src/java/org/apache/fop/render/intermediate/IFRenderer.java index e40a8f6b3..6ec1541c9 100644 --- a/src/java/org/apache/fop/render/intermediate/IFRenderer.java +++ b/src/java/org/apache/fop/render/intermediate/IFRenderer.java @@ -122,7 +122,7 @@ public class IFRenderer extends AbstractPathOrientedRenderer { /** If not null, the XMLRenderer will mimic another renderer by using its font setup. */ protected Renderer mimic; - private boolean inPageSequence = false; + private boolean inPageSequence; private Stack graphicContextStack = new Stack(); private Stack viewportDimensionStack = new Stack(); 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..080a33a81 100644 --- a/src/java/org/apache/fop/render/intermediate/extensions/ActionSet.java +++ b/src/java/org/apache/fop/render/intermediate/extensions/ActionSet.java @@ -29,7 +29,7 @@ import java.util.Map; */ public class ActionSet { - private int lastGeneratedID = 0; + private int lastGeneratedID; private Map actionRegistry = new java.util.HashMap(); /** diff --git a/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java b/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java index 71ee7a0b0..b4b08cc42 100644 --- a/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java +++ b/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java @@ -47,7 +47,7 @@ public class IFConcatenator { private IFDocumentHandler targetHandler; - private int nextPageIndex = 0; + private int nextPageIndex; private boolean inFirstDocument = true; /** @@ -109,7 +109,7 @@ public class IFConcatenator { private class IFPageSequenceFilter extends IFDocumentHandlerProxy { - private boolean inPageSequence = false; + private boolean inPageSequence; public IFPageSequenceFilter(IFDocumentHandler delegate) { super(delegate); diff --git a/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java b/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java index 5e681e9e2..e7f6d989f 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java +++ b/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java @@ -59,29 +59,29 @@ public class Java2DFontMetrics { /** * The width of all 256 character, if requested */ - private int[] width = null; + private int[] width; /** * The typical height of a small cap latter (often derived from "x", value in mpt) */ - private int xHeight = 0; + private int xHeight; /** * The highest point of the font above the baseline (usually derived from "d", value in mpt) */ - private int ascender = 0; + private int ascender; /** * The lowest point of the font under the baseline (usually derived from "p", value in mpt) */ - private int descender = 0; + private int descender; /** * Buffered font. * f1 is bufferd for metric measurements during layout. * fSized is buffered for display purposes */ - private Font f1 = null; // , fSized = null; + private Font f1; // , fSized; /** * The family type of the font last used @@ -91,17 +91,17 @@ public class Java2DFontMetrics { /** * The style of the font last used */ - private int style = 0; + private int style; /** * The size of the font last used */ - private float size = 0; + private float size; /** * The FontMetrics object used to calculate character width etc. */ - private FontMetrics fmt = null; + private FontMetrics fmt; /** A LineMetrics to access high-resolution metrics information. */ private LineMetrics lineMetrics; diff --git a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java index d343c55d8..576f042ce 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java +++ b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java @@ -116,16 +116,16 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem protected double scaleFactor = 1; /** The page width in pixels */ - protected int pageWidth = 0; + protected int pageWidth; /** The page height in pixels */ - protected int pageHeight = 0; + protected int pageHeight; /** List of Viewports */ protected List pageViewportList = new java.util.ArrayList(); /** The 0-based current page number */ - private int currentPageNumber = 0; + private int currentPageNumber; /** true if anti-aliasing is set */ protected boolean antialiasing = true; @@ -134,7 +134,7 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem protected boolean qualityRendering = true; /** false: paints a non-transparent white background, true: for a transparent background */ - protected boolean transparentPageBackground = false; + protected boolean transparentPageBackground; /** The current state, holds a Graphics2D and its context */ protected Java2DGraphicsState state; @@ -144,7 +144,7 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem /** true if the renderer has finished rendering all the pages */ private boolean renderingDone; - private GeneralPath currentPath = null; + private GeneralPath currentPath; /** * Default constructor diff --git a/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java b/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java index a44205d06..4d0efd8ed 100644 --- a/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java +++ b/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java @@ -64,9 +64,9 @@ public class PCLDocumentHandler extends AbstractBinaryWritingIFDocumentHandler private PCLPageDefinition currentPageDefinition; /** contains the pageWith of the last printed page */ - private long pageWidth = 0; + private long pageWidth; /** contains the pageHeight of the last printed page */ - private long pageHeight = 0; + private long pageHeight; /** the current page image (only set when all-bitmap painting is activated) */ private BufferedImage currentImage; diff --git a/src/java/org/apache/fop/render/pcl/PCLGenerator.java b/src/java/org/apache/fop/render/pcl/PCLGenerator.java index 99aa40f22..7b3878627 100644 --- a/src/java/org/apache/fop/render/pcl/PCLGenerator.java +++ b/src/java/org/apache/fop/render/pcl/PCLGenerator.java @@ -831,10 +831,10 @@ public class PCLGenerator { private byte[] rle; //compressed (RLE) private byte[] uncompressed; //uncompressed private int lastcount = -1; - private byte lastbyte = 0; - private int rlewidth = 0; - private byte ib = 0; //current image bits - private int x = 0; + private byte lastbyte; + private int rlewidth; + private byte ib; //current image bits + private int x; private boolean zeroRow = true; public Encoder(RenderedImage img) { diff --git a/src/java/org/apache/fop/render/pcl/PCLGraphics2D.java b/src/java/org/apache/fop/render/pcl/PCLGraphics2D.java index 009306620..9d9118aaa 100644 --- a/src/java/org/apache/fop/render/pcl/PCLGraphics2D.java +++ b/src/java/org/apache/fop/render/pcl/PCLGraphics2D.java @@ -56,7 +56,7 @@ public class PCLGraphics2D extends AbstractGraphics2D { protected PCLGenerator gen; private final boolean failOnUnsupportedFeature = true; - private boolean clippingDisabled = false; + private boolean clippingDisabled; /** * Create a new PCLGraphics2D. diff --git a/src/java/org/apache/fop/render/pcl/PCLPainter.java b/src/java/org/apache/fop/render/pcl/PCLPainter.java index f934eed8c..9f7de4930 100644 --- a/src/java/org/apache/fop/render/pcl/PCLPainter.java +++ b/src/java/org/apache/fop/render/pcl/PCLPainter.java @@ -67,7 +67,7 @@ public class PCLPainter extends AbstractIFPainter<PCLDocumentHandler> implements private PCLGenerator gen; private PCLPageDefinition currentPageDefinition; - private int currentPrintDirection = 0; + private int currentPrintDirection; //private GeneralPath currentPath = null; private Stack<GraphicContext> graphicContextStack = new Stack<GraphicContext>(); diff --git a/src/java/org/apache/fop/render/pcl/PCLRenderingContext.java b/src/java/org/apache/fop/render/pcl/PCLRenderingContext.java index 8ac7fc973..5efa6f4fc 100644 --- a/src/java/org/apache/fop/render/pcl/PCLRenderingContext.java +++ b/src/java/org/apache/fop/render/pcl/PCLRenderingContext.java @@ -35,7 +35,7 @@ public abstract class PCLRenderingContext extends AbstractRenderingContext { private PCLGenerator generator; private PCLRenderingUtil pclUtil; - private boolean sourceTransparency = false; + private boolean sourceTransparency; /** * Main constructor. diff --git a/src/java/org/apache/fop/render/pcl/PCLRenderingUtil.java b/src/java/org/apache/fop/render/pcl/PCLRenderingUtil.java index e01bcdc5f..3fc8b5258 100644 --- a/src/java/org/apache/fop/render/pcl/PCLRenderingUtil.java +++ b/src/java/org/apache/fop/render/pcl/PCLRenderingUtil.java @@ -54,19 +54,19 @@ public class PCLRenderingUtil { * Controls whether all text should be painted as text. This is a fallback setting in case * the mixture of native and bitmapped text does not provide the necessary quality. */ - private boolean allTextAsBitmaps = false; + private boolean allTextAsBitmaps; /** * Controls whether an RGB canvas is used when converting Java2D graphics to bitmaps. * This can be used to work around problems with Apache Batik, for example, but setting * this to true will increase memory consumption. */ - private boolean useColorCanvas = false; + private boolean useColorCanvas; /** * Controls whether the generation of PJL commands gets disabled. */ - private boolean disabledPJL = false; + private boolean disabledPJL; PCLRenderingUtil(FOUserAgent userAgent) { this.userAgent = userAgent; diff --git a/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java b/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java index f158f6a14..877a76d21 100644 --- a/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java +++ b/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java @@ -37,7 +37,7 @@ import org.apache.fop.pdf.PDFFilterList; */ public class ImageRawCCITTFaxAdapter extends AbstractImageAdapter { - private PDFFilter pdfFilter = null; + private PDFFilter pdfFilter; /** * Creates a new PDFImage from an Image instance. diff --git a/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java b/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java index a60c9e92c..d76a805c2 100644 --- a/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java +++ b/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java @@ -46,7 +46,7 @@ import org.apache.fop.pdf.PDFFilterList; */ public class ImageRawJPEGAdapter extends AbstractImageAdapter { - private PDFFilter pdfFilter = null; + private PDFFilter pdfFilter; /** * Creates a new PDFImage from an Image instance. diff --git a/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java b/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java index 1b87958c2..f1e816233 100644 --- a/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java +++ b/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java @@ -52,7 +52,7 @@ public class ImageRenderedAdapter extends AbstractImageAdapter { private ImageEncodingHelper encodingHelper; - private PDFFilter pdfFilter = null; + private PDFFilter pdfFilter; private String maskRef; private PDFReference softMask; diff --git a/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java b/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java index 3f75554fb..6558bddc2 100644 --- a/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java +++ b/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java @@ -281,7 +281,7 @@ public class PDFContentGenerator { } } - private int ocNameIndex = 0; + private int ocNameIndex; private void beginOptionalContent(String layerId) { String name; diff --git a/src/java/org/apache/fop/render/pdf/PDFRendererConfig.java b/src/java/org/apache/fop/render/pdf/PDFRendererConfig.java index 5e87deb6b..f01cdb717 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRendererConfig.java +++ b/src/java/org/apache/fop/render/pdf/PDFRendererConfig.java @@ -56,6 +56,7 @@ import static org.apache.fop.render.pdf.PDFEncryptionOption.OWNER_PASSWORD; import static org.apache.fop.render.pdf.PDFEncryptionOption.USER_PASSWORD; import static org.apache.fop.render.pdf.PDFRendererOption.DISABLE_SRGB_COLORSPACE; import static org.apache.fop.render.pdf.PDFRendererOption.FILTER_LIST; +import static org.apache.fop.render.pdf.PDFRendererOption.MERGE_FONTS; import static org.apache.fop.render.pdf.PDFRendererOption.OUTPUT_PROFILE; import static org.apache.fop.render.pdf.PDFRendererOption.PDF_A_MODE; import static org.apache.fop.render.pdf.PDFRendererOption.PDF_X_MODE; @@ -135,6 +136,7 @@ public final class PDFRendererConfig implements RendererConfig { configureEncryptionParams(cfg, userAgent, strict); parseAndPut(OUTPUT_PROFILE, cfg); parseAndPut(DISABLE_SRGB_COLORSPACE, cfg); + parseAndPut(MERGE_FONTS, cfg); parseAndPut(VERSION, cfg); } catch (ConfigurationException e) { diff --git a/src/java/org/apache/fop/render/pdf/PDFRendererOption.java b/src/java/org/apache/fop/render/pdf/PDFRendererOption.java index 2ebd691fe..9c45f981d 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRendererOption.java +++ b/src/java/org/apache/fop/render/pdf/PDFRendererOption.java @@ -66,6 +66,12 @@ public enum PDFRendererOption implements RendererConfigOption { return Boolean.valueOf(value); } }, + MERGE_FONTS("merge-fonts", false) { + @Override + Boolean deserialize(String value) { + return Boolean.valueOf(value); + } + }, /** Rendering Options key for the ICC profile for the output intent. */ OUTPUT_PROFILE("output-profile") { @Override diff --git a/src/java/org/apache/fop/render/pdf/PDFRendererOptionsConfig.java b/src/java/org/apache/fop/render/pdf/PDFRendererOptionsConfig.java index 71102ecf0..3a1a24339 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRendererOptionsConfig.java +++ b/src/java/org/apache/fop/render/pdf/PDFRendererOptionsConfig.java @@ -31,6 +31,7 @@ import org.apache.fop.pdf.Version; import static org.apache.fop.render.pdf.PDFRendererOption.DISABLE_SRGB_COLORSPACE; import static org.apache.fop.render.pdf.PDFRendererOption.FILTER_LIST; +import static org.apache.fop.render.pdf.PDFRendererOption.MERGE_FONTS; import static org.apache.fop.render.pdf.PDFRendererOption.OUTPUT_PROFILE; import static org.apache.fop.render.pdf.PDFRendererOption.PDF_A_MODE; import static org.apache.fop.render.pdf.PDFRendererOption.PDF_X_MODE; @@ -120,4 +121,8 @@ public final class PDFRendererOptionsConfig { public Version getPDFVersion() { return (Version) properties.get(VERSION); } + + public Boolean getMergeFontsEnabled() { + return (Boolean)properties.get(MERGE_FONTS); + } } diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java b/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java index 411916c74..ef4824c6a 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java @@ -581,6 +581,7 @@ class PDFRenderingUtil { } this.pdfDoc.enableAccessibility(userAgent.isAccessibilityEnabled()); + pdfDoc.setMergeFontsEnabled(rendererConfig.getMergeFontsEnabled()); return this.pdfDoc; } diff --git a/src/java/org/apache/fop/render/pdf/extensions/AbstractPDFExtensionElement.java b/src/java/org/apache/fop/render/pdf/extensions/AbstractPDFExtensionElement.java index b66fe4fad..15be455d4 100644 --- a/src/java/org/apache/fop/render/pdf/extensions/AbstractPDFExtensionElement.java +++ b/src/java/org/apache/fop/render/pdf/extensions/AbstractPDFExtensionElement.java @@ -22,8 +22,6 @@ package org.apache.fop.render.pdf.extensions; import org.apache.fop.fo.FONode; import org.apache.fop.fo.extensions.ExtensionAttachment; -// CSOFF: LineLengthCheck - /** * Base class for the PDF-specific extension elements. */ diff --git a/src/java/org/apache/fop/render/pdf/extensions/PDFElementMapping.java b/src/java/org/apache/fop/render/pdf/extensions/PDFElementMapping.java index f0e838f78..5831b1f2a 100644 --- a/src/java/org/apache/fop/render/pdf/extensions/PDFElementMapping.java +++ b/src/java/org/apache/fop/render/pdf/extensions/PDFElementMapping.java @@ -22,8 +22,6 @@ package org.apache.fop.render.pdf.extensions; import org.apache.fop.fo.ElementMapping; import org.apache.fop.fo.FONode; -// CSOFF: LineLengthCheck - /** * This class provides the element mapping for the PDF-specific extensions. */ diff --git a/src/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileAttachment.java b/src/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileAttachment.java index a62b35a4b..f00fc2635 100644 --- a/src/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileAttachment.java +++ b/src/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileAttachment.java @@ -43,13 +43,13 @@ public class PDFEmbeddedFileAttachment extends PDFExtensionAttachment { private static final String ATT_DESC = "desc"; /** filename attribute */ - private String filename = null; + private String filename; /** description attribute (optional) */ - private String desc = null; + private String desc; /** source name attribute */ - private String src = null; + private String src; /** * No-argument contructor. diff --git a/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionAttachment.java b/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionAttachment.java index 9ac858309..0339f10a2 100644 --- a/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionAttachment.java +++ b/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionAttachment.java @@ -23,8 +23,6 @@ import org.apache.xmlgraphics.util.XMLizable; import org.apache.fop.fo.extensions.ExtensionAttachment; -// CSOFF: LineLengthCheck - public abstract class PDFExtensionAttachment implements ExtensionAttachment, XMLizable { /** The category URI for this extension attachment. */ 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 700f056a6..fb0647fd5 100644 --- a/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionHandler.java +++ b/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionHandler.java @@ -32,8 +32,6 @@ import org.apache.commons.logging.LogFactory; import org.apache.fop.util.ContentHandlerFactory; import org.apache.fop.util.ContentHandlerFactory.ObjectBuiltListener; -// CSOFF: LineLengthCheck - /** * ContentHandler (parser) for restoring PDF extension objects from XML. */ @@ -170,7 +168,8 @@ public class PDFExtensionHandler extends DefaultHandler implements ContentHandle } else if (dictionary.getDictionaryType() != PDFDictionaryType.Dictionary) { this.returnedObject = new PDFDictionaryAttachment(dictionary); } else { - throw new SAXException(new IllegalStateException("generic dictionary not permitted at outer level")); + throw new SAXException( + new IllegalStateException("generic dictionary not permitted at outer level")); } } else { throw new SAXException(new IllegalStateException("collections stack is empty or not a dictionary")); diff --git a/src/java/org/apache/fop/render/print/PageableRenderer.java b/src/java/org/apache/fop/render/print/PageableRenderer.java index 70a7f84a6..7f2f40956 100644 --- a/src/java/org/apache/fop/render/print/PageableRenderer.java +++ b/src/java/org/apache/fop/render/print/PageableRenderer.java @@ -61,7 +61,7 @@ public class PageableRenderer extends Java2DRenderer implements Pageable { /** first valid page number (1-based) */ - protected int startNumber = 0; + protected int startNumber; /** last valid page number (1-based) */ protected int endNumber = -1; diff --git a/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java b/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java index 96886910e..24a48d225 100644 --- a/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java +++ b/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java @@ -71,7 +71,7 @@ import org.apache.fop.svg.font.FOPFontFamilyResolverImpl; public abstract class AbstractPSTranscoder extends AbstractFOPTranscoder { /** the root Graphics2D instance for generating PostScript */ - protected AbstractPSDocumentGraphics2D graphics = null; + protected AbstractPSDocumentGraphics2D graphics; private FontInfo fontInfo; diff --git a/src/java/org/apache/fop/render/ps/NativeTextHandler.java b/src/java/org/apache/fop/render/ps/NativeTextHandler.java index e8f123dc5..b9784d69c 100644 --- a/src/java/org/apache/fop/render/ps/NativeTextHandler.java +++ b/src/java/org/apache/fop/render/ps/NativeTextHandler.java @@ -47,7 +47,7 @@ public class NativeTextHandler implements PSTextHandler { protected Font font; /** Overriding FontState */ - protected Font overrideFont = null; + protected Font overrideFont; /** the current (internal) font name */ protected String currentFontName; diff --git a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java index 897ed8fb8..dcf968e03 100644 --- a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java +++ b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java @@ -89,7 +89,7 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { private static final TempResourceURIGenerator TEMP_URI_GENERATOR = new TempResourceURIGenerator("ps-optimize"); - private int currentPageNumber = 0; + private int currentPageNumber; private PageDefinition currentPageDefinition; /** Is used to determine the document's bounding box */ diff --git a/src/java/org/apache/fop/render/ps/PSFontUtils.java b/src/java/org/apache/fop/render/ps/PSFontUtils.java index 5bb723eea..b98919ca2 100644 --- a/src/java/org/apache/fop/render/ps/PSFontUtils.java +++ b/src/java/org/apache/fop/render/ps/PSFontUtils.java @@ -324,7 +324,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils { boolean embed = true; if (font.getEmbeddingMode() == EmbeddingMode.SUBSET) { Type1SubsetFile subset = new Type1SubsetFile(); - byte[] byteSubset = subset.createSubset(fontStream, font, ""); + byte[] byteSubset = subset.createSubset(fontStream, font); fontStream = new ByteArrayInputStream(byteSubset); } embedType1Font(gen, fontStream); diff --git a/src/java/org/apache/fop/render/ps/PSPainter.java b/src/java/org/apache/fop/render/ps/PSPainter.java index 547662c47..f3fa3cc79 100644 --- a/src/java/org/apache/fop/render/ps/PSPainter.java +++ b/src/java/org/apache/fop/render/ps/PSPainter.java @@ -70,7 +70,7 @@ public class PSPainter extends AbstractIFPainter<PSDocumentHandler> { private BorderPainter borderPainter; - private boolean inTextMode = false; + private boolean inTextMode; /** * Default constructor. diff --git a/src/java/org/apache/fop/render/ps/PSRenderingUtil.java b/src/java/org/apache/fop/render/ps/PSRenderingUtil.java index 4033c304f..47e46da02 100644 --- a/src/java/org/apache/fop/render/ps/PSRenderingUtil.java +++ b/src/java/org/apache/fop/render/ps/PSRenderingUtil.java @@ -46,7 +46,7 @@ public class PSRenderingUtil { private FOUserAgent userAgent; /** Whether or not the safe set page device macro will be used or not */ - private boolean safeSetPageDevice = false; + private boolean safeSetPageDevice; /** * Whether or not PostScript Document Structuring Conventions (DSC) compliant output are @@ -54,11 +54,11 @@ public class PSRenderingUtil { */ private boolean dscCompliant = true; - private boolean autoRotateLandscape = false; + private boolean autoRotateLandscape; private int languageLevel = PSGenerator.DEFAULT_LANGUAGE_LEVEL; /** Determines whether the PS file is generated in two passes to minimize file size */ - private boolean optimizeResources = false; + private boolean optimizeResources; /** * Determines whether the generated PostScript code is optimized for minimum file size diff --git a/src/java/org/apache/fop/render/ps/PSTextPainter.java b/src/java/org/apache/fop/render/ps/PSTextPainter.java index 44b7b08a3..189a6bd8f 100644 --- a/src/java/org/apache/fop/render/ps/PSTextPainter.java +++ b/src/java/org/apache/fop/render/ps/PSTextPainter.java @@ -259,8 +259,8 @@ public class PSTextPainter extends NativeTextPainter { private AffineTransform textTransform; private List<Point2D> relativePositions = new LinkedList<Point2D>(); private StringBuffer currentGlyphs = new StringBuffer(); - private int horizChanges = 0; - private int vertChanges = 0; + private int horizChanges; + private int vertChanges; public void reset() { textTransform = null; diff --git a/src/java/org/apache/fop/render/ps/extensions/PSSetPageDevice.java b/src/java/org/apache/fop/render/ps/extensions/PSSetPageDevice.java index 8bdb2adc0..b463fc3d5 100644 --- a/src/java/org/apache/fop/render/ps/extensions/PSSetPageDevice.java +++ b/src/java/org/apache/fop/render/ps/extensions/PSSetPageDevice.java @@ -37,7 +37,7 @@ public class PSSetPageDevice extends PSExtensionAttachment { /** * name attribute */ - protected String name = null; + protected String name; /** * default constructor diff --git a/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java b/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java index e2236629c..f2d580582 100644 --- a/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java +++ b/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java @@ -37,7 +37,7 @@ public class PSSetupCode extends PSExtensionAttachment { /** * name attribute */ - protected String name = null; + protected String name; /** * No-argument contructor. diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java index 2bb7befc1..eeb1aff06 100644 --- a/src/java/org/apache/fop/render/rtf/RTFHandler.java +++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java @@ -141,13 +141,13 @@ public class RTFHandler extends FOEventHandler { private RtfDocumentArea docArea; private boolean bDefer; //true, if each called handler shall be //processed at later time. - private boolean bPrevHeaderSpecified = false; //true, if there has been a + private boolean bPrevHeaderSpecified; //true, if there has been a //header in any page-sequence - private boolean bPrevFooterSpecified = false; //true, if there has been a + private boolean bPrevFooterSpecified; //true, if there has been a //footer in any page-sequence - private boolean bHeaderSpecified = false; //true, if there is a header + private boolean bHeaderSpecified; //true, if there is a header //in current page-sequence - private boolean bFooterSpecified = false; //true, if there is a footer + private boolean bFooterSpecified; //true, if there is a footer //in current page-sequence private BuilderContext builderContext = new BuilderContext(null); 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 146a8c19c..ce6212a59 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 @@ -35,8 +35,8 @@ package org.apache.fop.render.rtf.rtflib.rtfdoc; public final class ParagraphKeeptogetherContext { - private static int paraKeepTogetherOpen = 0; - private static boolean paraResetProperties = false; + private static int paraKeepTogetherOpen; + private static boolean paraResetProperties; private ParagraphKeeptogetherContext() { } diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java index 5ab3ce26d..6fa84d44c 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java @@ -185,7 +185,7 @@ public class RtfAttributes implements Cloneable { return values.keySet().iterator(); } - private Attributes xslAttributes = null; + private Attributes xslAttributes; /** * Added by Normand Masse diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java index 01f29c7ee..e82a50eca 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java @@ -42,7 +42,7 @@ public class RtfBookmark extends RtfElement { ////////////////////////////////////////////////// /** Name of the bokkmark */ - private String bookmark = null; + private String bookmark; /** Word 2000 supports a length of 40 characters only */ public static final int MAX_BOOKMARK_LENGTH = 40; /** Word 2000 converts '.' in bookmarks to "_", thats why we control this replacement. */ diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java index 7bbe65ef0..9733df1e7 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java @@ -42,7 +42,7 @@ public class RtfBookmarkContainerImpl extends RtfContainer implements IRtfBookma ////////////////////////////////////////////////// /** Rtf bookmark */ - private RtfBookmark mBookmark = null; + private RtfBookmark mBookmark; ////////////////////////////////////////////////// diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java index 3ce0376d6..593b2583f 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java @@ -53,14 +53,14 @@ public final class RtfColorTable { ////////////////////////////////////////////////// /** Singelton instance */ - private static RtfColorTable instance = null; + private static RtfColorTable instance; /** Index table for the colors */ - private Hashtable colorIndex = null; + private Hashtable colorIndex; /** Used colors to this vector */ - private Vector colorTable = null; + private Vector colorTable; /** Map of color names to color numbers */ - private Hashtable namedColors = null; + private Hashtable namedColors; ////////////////////////////////////////////////// diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java index 6540cfd72..040118eb5 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java @@ -226,7 +226,7 @@ public class RtfExternalGraphic extends RtfElement { /** * The url of the image */ - protected URL url = null; + protected URL url; /** * The height of the image (in pixels) @@ -246,7 +246,7 @@ public class RtfExternalGraphic extends RtfElement { /** * Flag whether the desired height is a percentage */ - protected boolean perCentH = false; + protected boolean perCentH; /** * The width of the image (in pixels) @@ -266,12 +266,12 @@ public class RtfExternalGraphic extends RtfElement { /** * Flag whether the desired width is a percentage */ - protected boolean perCentW = false; + protected boolean perCentW; /** * Flag whether the image size shall be adjusted */ - protected boolean scaleUniform = false; + protected boolean scaleUniform; /** cropping on left/top/right/bottom edges for \piccrop*N */ private int[] cropValues = new int[4]; @@ -282,7 +282,7 @@ public class RtfExternalGraphic extends RtfElement { protected int graphicCompressionRate = 80; /** The image data */ - private byte[] imagedata = null; + private byte[] imagedata; /** The image format */ private FormatBase imageformat; diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java index 14418432e..22a2a7462 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java @@ -58,7 +58,7 @@ public class RtfExtraRowSet extends RtfContainer { /** Parent table context * (added by Boris Poudérous on july 2002 in order to process nested tables) */ - private ITableColumnsInfo parentITableColumnsInfo = null; + private ITableColumnsInfo parentITableColumnsInfo; /** While a top-level RtfTableRow is being rendered, we build a list of * RtfTableCells that must be rendered in extra rows. diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java index ceade4ede..cd28a518c 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java @@ -50,7 +50,7 @@ extends RtfContainer { private RtfDocumentArea docArea; // private ConverterLogChannel m_log; private RtfContainer listTableContainer; - private int listNum = 0; + private int listNum; /** * Create an RTF file that outputs to the given Writer diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java index d7a56f00e..0a48d9b37 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java @@ -41,12 +41,12 @@ public final class RtfFontManager { ////////////////////////////////////////////////// /** Singelton instance */ - private static RtfFontManager instance = null; + private static RtfFontManager instance; /** Index table for the fonts */ - private Hashtable fontIndex = null; + private Hashtable fontIndex; /** Used fonts to this vector */ - private Vector fontTable = null; + private Vector fontTable; ////////////////////////////////////////////////// diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java index 1f57ec846..47b6944b5 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java @@ -30,10 +30,10 @@ import java.io.Writer; */ public class RtfFootnote extends RtfContainer implements IRtfTextrunContainer, IRtfListContainer { - RtfTextrun textrunInline = null; - RtfContainer body = null; - RtfList list = null; - boolean bBody = false; + RtfTextrun textrunInline; + RtfContainer body; + RtfList list; + boolean bBody; /** * Create an RTF list item as a child of given container with default attributes. diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java index 816e67f9b..58d93e45d 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java @@ -47,10 +47,10 @@ implements IRtfTextContainer, ////////////////////////////////////////////////// /** The url of the image */ - protected String url = null; + protected String url; /** RtfText */ - protected RtfText mText = null; + protected RtfText mText; ////////////////////////////////////////////////// // @@ Construction diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLeader.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLeader.java index f9835ef0a..66759e060 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLeader.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfLeader.java @@ -46,7 +46,7 @@ public class RtfLeader extends RtfContainer { * \\ululdbwave Double wave underline. */ - private RtfAttributes attrs = null; + private RtfAttributes attrs; /** Private attribute: tab style */ public static final String LEADER_TABLEAD = "tablead"; diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java index b7d01db00..a89159109 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java @@ -42,8 +42,8 @@ public class RtfList extends RtfContainer { private RtfListTable listTable; private final boolean hasTableParent; private RtfListStyle defaultListStyle; - private Integer listTemplateId = null; - private Integer listId = null; + private Integer listTemplateId; + private Integer listId; private static Random listIdGenerator = new Random(0); /** Create an RTF list as a child of given container with given attributes */ diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java index ac1c7e46b..209cbe102 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java @@ -43,7 +43,7 @@ public class RtfListItem extends RtfContainer private RtfList parentList; private RtfParagraph paragraph; private RtfListStyle listStyle; - private int number = 0; + private int number; /** * special RtfParagraph that writes list item setup code before its content diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java index 96fa53d9c..6cd78f03b 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java @@ -49,7 +49,7 @@ public class RtfPageNumberCitation extends RtfContainer { public static final String RTF_FIELD_RESULT = "fldrslt"; // The 'id' of the referenced page - private String id = null; + private String id; /** Create an RTF page number citation as a child of given container with default attributes */ RtfPageNumberCitation(RtfContainer parent, Writer w, String id) diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java index 30f573dd5..4b5554acf 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java @@ -50,8 +50,8 @@ implements IRtfTextContainer, IRtfPageBreakContainer, IRtfHyperLinkContainer, private RtfPageNumber pageNumber; private RtfPageNumberCitation pageNumberCitation; // Above line added by Boris POUDEROUS on 2002/07/09 - private boolean keepn = false; - private boolean resetProperties = false; + private boolean keepn; + private boolean resetProperties; /* needed for importing Rtf into FrameMaker FrameMaker is not as forgiving as word in rtf @@ -59,7 +59,7 @@ implements IRtfTextContainer, IRtfPageBreakContainer, IRtfHyperLinkContainer, after a table. /pard is probably needed in other places also, this is just a hack to make FrameMaker import Jfor rtf correctly */ - private boolean writeForBreak = false; + private boolean writeForBreak; /** Set of attributes that must be copied at the start of a paragraph */ private static final String[] PARA_ATTRIBUTES = {"intbl"}; diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceManager.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceManager.java index da55e54b0..e38a78c95 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceManager.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceManager.java @@ -40,7 +40,7 @@ public class RtfSpaceManager { * inside, then the next block should has increased value of space-before * property. */ - private int accumulatedSpace = 0; + private int accumulatedSpace; /** * Construct a newly allocated <code>RtfSpaceManager</code> object. diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java index 4d45c4859..d72f7ecb5 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java @@ -60,7 +60,7 @@ public final class RtfStyleSheetTable { ////////////////////////////////////////////////// /** Singelton instance */ - private static RtfStyleSheetTable instance = null; + private static RtfStyleSheetTable instance; ////////////////////////////////////////////////// @@ -69,13 +69,13 @@ public final class RtfStyleSheetTable { /** Table of styles */ - private Hashtable styles = null; + private Hashtable styles; /** Used, style attributes to this vector */ - private Hashtable attrTable = null; + private Hashtable attrTable; /** Used, style names to this vector */ - private Vector nameTable = null; + private Vector nameTable; /** Default style */ private String defaultStyleName = STANDARD_STYLE; diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java index ee9923d90..aecf30dce 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java @@ -39,16 +39,16 @@ import org.apache.fop.apps.FOPException; public class RtfTable extends RtfContainer { private RtfTableRow row; - private int highestRow = 0; - private Boolean isNestedTable = null; - private RtfAttributes borderAttributes = null; + private int highestRow; + private Boolean isNestedTable; + private RtfAttributes borderAttributes; /** Added by Boris Poudérous on 07/22/2002 in order to process * number-columns-spanned attribute */ private ITableColumnsInfo tableContext; /** Shows the table depth necessary for nested tables */ - private int nestedTableDepth = 0; + private int nestedTableDepth; /** Create an RTF element as a child of given container */ RtfTable(IRtfTableContainer parent, Writer w, ITableColumnsInfo tc) @@ -154,7 +154,7 @@ public class RtfTable extends RtfContainer { return this.tableContext; } - private RtfAttributes headerAttribs = null; + private RtfAttributes headerAttribs; /** * Added by Normand Masse diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java index 8127d9a15..e37070905 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java @@ -48,7 +48,7 @@ public class RtfTableCell private boolean setCenter; private boolean setRight; private int id; - private RtfParagraphBreak lastBreak = null; + private RtfParagraphBreak lastBreak; private int lastBreakDepth = Integer.MIN_VALUE; private static final String TABLE_CELL_PARAGRAPH = "cell"; diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java index e4f9cd9dc..5013e0958 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java @@ -44,7 +44,7 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { private RtfTableCell cell; // private RtfExtraRowSet extraRowSet; private int id; - private int highestCell = 0; + private int highestCell; /** Create an RTF element as a child of given container */ diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java index 98896d286..f3831da53 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java @@ -36,9 +36,9 @@ import java.io.IOException; public final class RtfTemplate { /** Singelton instance */ - private static RtfTemplate instance = null; + private static RtfTemplate instance; - private String templateFilePath = null; + private String templateFilePath; /** * Constructor. 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 afa4416ed..b0391e7cc 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 @@ -49,7 +49,7 @@ public class RtfTextrun extends RtfContainer { /** Constant for a odd page break */ public static final int BREAK_ODD_PAGE = 4; - private boolean bSuppressLastPar = false; + private boolean bSuppressLastPar; private RtfListItem rtfListItem; /** diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java index 2d0444927..a1d76478c 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java @@ -45,7 +45,7 @@ public class PercentContext implements PercentBaseContext { private Map tableUnitMap = new java.util.HashMap(); /** Variable to check if a base width is set */ - private boolean baseWidthSet = false; + private boolean baseWidthSet; /** * Returns the available width for a specific FObj diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java index 5fa53d750..85f1261f7 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java @@ -69,7 +69,7 @@ public class TableContext implements ITableColumnsInfo { */ private final List colFirstSpanningCol = new java.util.ArrayList(); - private boolean bNextRowBelongsToHeader = false; + private boolean bNextRowBelongsToHeader; /** * diff --git a/src/java/org/apache/fop/render/txt/TXTRenderer.java b/src/java/org/apache/fop/render/txt/TXTRenderer.java index 5b398711f..6f646f813 100644 --- a/src/java/org/apache/fop/render/txt/TXTRenderer.java +++ b/src/java/org/apache/fop/render/txt/TXTRenderer.java @@ -97,7 +97,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer { private final String pageEnding = "\f"; /** Equals true, if current page is first. */ - private boolean firstPage = false; + private boolean firstPage; /** Manager for storing border's information. */ private BorderManager bm; diff --git a/src/java/org/apache/fop/render/txt/TXTStream.java b/src/java/org/apache/fop/render/txt/TXTStream.java index a534d4108..44a237b34 100644 --- a/src/java/org/apache/fop/render/txt/TXTStream.java +++ b/src/java/org/apache/fop/render/txt/TXTStream.java @@ -29,7 +29,7 @@ public class TXTStream { private static final String DEFAULT_ENCODING = "UTF-8"; - private OutputStream out = null; + private OutputStream out; private boolean doOutput = true; private String encoding = DEFAULT_ENCODING; diff --git a/src/java/org/apache/fop/render/xml/XMLRenderer.java b/src/java/org/apache/fop/render/xml/XMLRenderer.java index 68e2e3c62..d6da9d57d 100644 --- a/src/java/org/apache/fop/render/xml/XMLRenderer.java +++ b/src/java/org/apache/fop/render/xml/XMLRenderer.java @@ -112,8 +112,8 @@ public class XMLRenderer extends AbstractXMLRenderer { /** XML MIME type */ public static final String XML_MIME_TYPE = MimeConstants.MIME_FOP_AREA_TREE; - private boolean startedSequence = false; - private boolean compactFormat = false; + private boolean startedSequence; + private boolean compactFormat; /** If not null, the XMLRenderer will mimic another renderer by using its font setup. */ protected Renderer mimic; diff --git a/src/java/org/apache/fop/servlet/FopServlet.java b/src/java/org/apache/fop/servlet/FopServlet.java index c65b6af3b..e1ada281c 100644 --- a/src/java/org/apache/fop/servlet/FopServlet.java +++ b/src/java/org/apache/fop/servlet/FopServlet.java @@ -84,9 +84,9 @@ public class FopServlet extends HttpServlet { protected static final String XSLT_REQUEST_PARAM = "xslt"; /** The TransformerFactory used to create Transformer instances */ - protected TransformerFactory transFactory = null; + protected TransformerFactory transFactory; /** The FopFactory used to create Fop instances */ - protected FopFactory fopFactory = null; + protected FopFactory fopFactory; /** URIResolver for use by this servlet */ protected URIResolver uriResolver; diff --git a/src/java/org/apache/fop/svg/AbstractFOPImageElementBridge.java b/src/java/org/apache/fop/svg/AbstractFOPImageElementBridge.java index b813478a9..42fb729dd 100644 --- a/src/java/org/apache/fop/svg/AbstractFOPImageElementBridge.java +++ b/src/java/org/apache/fop/svg/AbstractFOPImageElementBridge.java @@ -180,7 +180,7 @@ public abstract class AbstractFOPImageElementBridge extends SVGImageElementBridg /** parsed url */ protected final ParsedURL purl; /** original graphics mode */ - protected GraphicsNode origGraphicsNode = null; + protected GraphicsNode origGraphicsNode; /** * Create a new image node for drawing natively handled images diff --git a/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java b/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java index 9b1606953..33f5aecf6 100644 --- a/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java +++ b/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java @@ -90,7 +90,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder implem private Log logger; private EntityResolver resolver; - private Configuration cfg = null; + private Configuration cfg; private ImageManager imageManager; private ImageSessionContext imageSessionContext; diff --git a/src/java/org/apache/fop/svg/PDFGraphics2D.java b/src/java/org/apache/fop/svg/PDFGraphics2D.java index 3906589e3..c9ec79d0d 100644 --- a/src/java/org/apache/fop/svg/PDFGraphics2D.java +++ b/src/java/org/apache/fop/svg/PDFGraphics2D.java @@ -145,13 +145,13 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand /** * The PDF graphics state level that this svg is being drawn into. */ - protected int baseLevel = 0; + protected int baseLevel; /** * The count of natively handled images added to document so they receive * unique keys. */ - protected int nativeCount = 0; + protected int nativeCount; /** * The current font information. @@ -162,7 +162,7 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand * The override font state used when drawing text and the font cannot be * set using java fonts. */ - protected Font ovFontState = null; + protected Font ovFontState; /** * the current stream to add PDF commands to @@ -185,7 +185,7 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand * the pdf document objects to reduce memory. * Especially with images. */ - protected OutputStream outputStream = null; + protected OutputStream outputStream; private TransparencyIgnoredEventListener transparencyIgnoredEventListener; diff --git a/src/java/org/apache/fop/svg/PDFTranscoder.java b/src/java/org/apache/fop/svg/PDFTranscoder.java index 1a3f154cb..f52b18437 100644 --- a/src/java/org/apache/fop/svg/PDFTranscoder.java +++ b/src/java/org/apache/fop/svg/PDFTranscoder.java @@ -75,7 +75,7 @@ import org.apache.fop.svg.font.FOPFontFamilyResolverImpl; public class PDFTranscoder extends AbstractFOPTranscoder { /** Graphics2D instance that is used to paint to */ - protected PDFDocumentGraphics2D graphics = null; + protected PDFDocumentGraphics2D graphics; /** * Constructs a new {@link PDFTranscoder}. diff --git a/src/java/org/apache/fop/svg/SimpleSVGUserAgent.java b/src/java/org/apache/fop/svg/SimpleSVGUserAgent.java index 60a6020fc..03108f819 100644 --- a/src/java/org/apache/fop/svg/SimpleSVGUserAgent.java +++ b/src/java/org/apache/fop/svg/SimpleSVGUserAgent.java @@ -38,9 +38,9 @@ import org.apache.batik.gvt.font.FontFamilyResolver; */ public class SimpleSVGUserAgent extends UserAgentAdapter { - private AffineTransform currentTransform = null; + private AffineTransform currentTransform; - private float pixelUnitToMillimeter = 0.0f; + private float pixelUnitToMillimeter; private final FontFamilyResolver fontFamilyResolver; diff --git a/src/java/org/apache/fop/tools/TestConverter.java b/src/java/org/apache/fop/tools/TestConverter.java index 3ce3eff35..4441f6164 100644 --- a/src/java/org/apache/fop/tools/TestConverter.java +++ b/src/java/org/apache/fop/tools/TestConverter.java @@ -51,17 +51,17 @@ import org.apache.fop.tools.anttasks.FileCompare; */ public class TestConverter { - private boolean failOnly = false; + private boolean failOnly; private String outputFormat = MimeConstants.MIME_FOP_AREA_TREE; private File destdir; - private File compare = null; + private File compare; private String baseDir = "./"; private Map differ = new java.util.HashMap(); /** * logging instance */ - protected SimpleLog logger = null; + protected SimpleLog logger; /** * This main method can be used to run the test converter from diff --git a/src/java/org/apache/fop/tools/anttasks/Fop.java b/src/java/org/apache/fop/tools/anttasks/Fop.java index 4a34ce46d..8ca048da3 100644 --- a/src/java/org/apache/fop/tools/anttasks/Fop.java +++ b/src/java/org/apache/fop/tools/anttasks/Fop.java @@ -79,8 +79,8 @@ public class Fop extends Task { private File userConfig; private int messageType = Project.MSG_VERBOSE; private boolean logFiles = true; - private boolean force = false; - private boolean relativebase = false; + private boolean force; + private boolean relativebase; private boolean throwExceptions = true; /** @@ -389,7 +389,7 @@ class FOPTaskStarter { /** * logging instance */ - protected Log logger = null; + protected Log logger; /** diff --git a/src/java/org/apache/fop/util/ColorUtil.java b/src/java/org/apache/fop/util/ColorUtil.java index 344d7d619..cb42b6813 100644 --- a/src/java/org/apache/fop/util/ColorUtil.java +++ b/src/java/org/apache/fop/util/ColorUtil.java @@ -68,7 +68,7 @@ public final class ColorUtil { * <p> * Important: The use of this color map assumes that all Color instances are immutable! */ - private static Map<String, Color> colorMap = null; + private static Map<String, Color> colorMap; /** Logger instance */ protected static final Log log = LogFactory.getLog(ColorUtil.class); diff --git a/src/java/org/apache/fop/util/XMLResourceBundle.java b/src/java/org/apache/fop/util/XMLResourceBundle.java index 7c391f16a..80aec2d2f 100644 --- a/src/java/org/apache/fop/util/XMLResourceBundle.java +++ b/src/java/org/apache/fop/util/XMLResourceBundle.java @@ -335,7 +335,7 @@ public class XMLResourceBundle extends ResourceBundle { private StringBuffer valueBuffer = new StringBuffer(); private Stack elementStack = new Stack(); - private String currentKey = null; + private String currentKey; private boolean isOwnNamespace(String uri) { return ("".equals(uri)); diff --git a/src/java/org/apache/fop/util/bitmap/JAIMonochromeBitmapConverter.java b/src/java/org/apache/fop/util/bitmap/JAIMonochromeBitmapConverter.java index ab32970fc..1c2b78218 100644 --- a/src/java/org/apache/fop/util/bitmap/JAIMonochromeBitmapConverter.java +++ b/src/java/org/apache/fop/util/bitmap/JAIMonochromeBitmapConverter.java @@ -45,7 +45,7 @@ import javax.media.jai.PlanarImage; public class JAIMonochromeBitmapConverter implements MonochromeBitmapConverter { - private boolean isErrorDiffusion = false; + private boolean isErrorDiffusion; /** {@inheritDoc} */ public void setHint(String name, String value) { diff --git a/src/java/org/apache/fop/util/text/AdvancedMessageFormat.java b/src/java/org/apache/fop/util/text/AdvancedMessageFormat.java index b34d87b27..0eae550dc 100644 --- a/src/java/org/apache/fop/util/text/AdvancedMessageFormat.java +++ b/src/java/org/apache/fop/util/text/AdvancedMessageFormat.java @@ -398,7 +398,7 @@ public class AdvancedMessageFormat { protected List<Part> parts = new java.util.ArrayList<Part>(); private boolean conditional; - private boolean hasSections = false; + private boolean hasSections; public CompositePart(boolean conditional) { this.conditional = conditional; |