From 29e8badcec8bd40eca2ef4940133f08eeefdda11 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Sat, 14 Aug 2010 17:17:00 +0000 Subject: Bugzilla #49733: Resolved compilation (safe one), Checkstyle and many Javadoc warnings. Submitted by: Glenn Adams Changes to patch: - Restored the deprecated Graphics2DAdapter method (to be removed after Barcode4J 2.1 is released). - Restored Renderer.startPageSequence(LineArea) pending discussion about removal. - build.xml: set max VM to 1024MB instead of 2048MB to allow for 32-bit JVMs. - build.xml: restored longer taskdef names. - Restored Checkstyle 4 file for people running older IDEs. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@985537 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java | 3 +++ src/java/org/apache/fop/fo/pagination/PageSequence.java | 9 ++++----- src/java/org/apache/fop/fo/pagination/RegionBody.java | 6 ++++-- src/java/org/apache/fop/fo/pagination/Root.java | 9 +++++++-- 4 files changed, 18 insertions(+), 9 deletions(-) (limited to 'src/java/org/apache/fop/fo/pagination') diff --git a/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java b/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java index dce36f95c..51b24b314 100644 --- a/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java @@ -34,7 +34,9 @@ import org.apache.fop.fo.PropertyList; public abstract class AbstractPageSequence extends FObj { // The value of properties relevant for fo:page-sequence. + /** initial page number */ protected Numeric initialPageNumber; + /** forced page count */ protected int forcePageCount; private String format; private int letterValue; @@ -45,6 +47,7 @@ public abstract class AbstractPageSequence extends FObj { private PageNumberGenerator pageNumberGenerator; + /** starting page number */ protected int startingPageNumber = 0; /** diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java index 26812166d..01ca5863e 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java @@ -151,7 +151,7 @@ public class PageSequence extends AbstractPageSequence { /** * {@inheritDoc} - * @todo see if addChildNode() should also be called for fo's other than + * @asf.todo see if addChildNode() should also be called for fo's other than * fo:flow. */ public void addChildNode(FONode child) throws FOPException { @@ -254,10 +254,9 @@ public class PageSequence extends AbstractPageSequence { * @return the SimplePageMaster to use for this page * @throws PageProductionException if there's a problem determining the page master */ - public SimplePageMaster getNextSimplePageMaster(int page, - boolean isFirstPage, - boolean isLastPage, - boolean isBlank) throws PageProductionException { + public SimplePageMaster getNextSimplePageMaster + (int page, boolean isFirstPage, boolean isLastPage, boolean isBlank) + throws PageProductionException { if (pageSequenceMaster == null) { return simplePageMaster; diff --git a/src/java/org/apache/fop/fo/pagination/RegionBody.java b/src/java/org/apache/fop/fo/pagination/RegionBody.java index 165bb4734..cb265706d 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionBody.java +++ b/src/java/org/apache/fop/fo/pagination/RegionBody.java @@ -106,8 +106,10 @@ public class RegionBody extends Region { * Also the values are resolved relative to the page size * and reference orientation. */ - PercentBaseContext pageWidthContext = getPageWidthContext(LengthBase.CONTAINING_BLOCK_WIDTH); - PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CONTAINING_BLOCK_WIDTH); + PercentBaseContext pageWidthContext + = getPageWidthContext(LengthBase.CONTAINING_BLOCK_WIDTH); + PercentBaseContext pageHeightContext + = getPageHeightContext(LengthBase.CONTAINING_BLOCK_WIDTH); int start; int end; diff --git a/src/java/org/apache/fop/fo/pagination/Root.java b/src/java/org/apache/fop/fo/pagination/Root.java index fcbb54abd..2a634c24a 100644 --- a/src/java/org/apache/fop/fo/pagination/Root.java +++ b/src/java/org/apache/fop/fo/pagination/Root.java @@ -144,7 +144,11 @@ public class Root extends FObj { } - /** @inheritDoc */ + /** + * @param loc location in the source file + * @param child the {@link FONode} to validate against + * @throws ValidationException if the incoming node is not a valid child for the given FO + */ protected void validateChildNode(Locator loc, FONode child) throws ValidationException { if (child instanceof AbstractPageSequence) { pageSequenceFound = true; @@ -207,7 +211,8 @@ public class Root extends FObj { * @param additionalPages the total pages generated by the sequence (for statistics) * @throws IllegalArgumentException for negative additional page counts */ - public void notifyPageSequenceFinished(int lastPageNumber, int additionalPages) { + public void notifyPageSequenceFinished(int lastPageNumber, int additionalPages) + throws IllegalArgumentException { if (additionalPages >= 0) { totalPagesGenerated += additionalPages; -- cgit v1.2.3 From aba436311c935f145aa984c855f88bfd3a9cb1c1 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Sat, 14 Aug 2010 19:28:26 +0000 Subject: Removed many "// CSOK: ConstantName" instances for constants, by converting them to uppercase as they should really be. Fixed some other non-Checkstyle issues on the way, imports mainly. Removed some "log" instances that were not used. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@985571 13f79535-47bb-0310-9956-ffa450edef68 --- .../plan/src/org/apache/fop/plan/PlanHints.java | 18 ++--- .../plan/src/org/apache/fop/plan/PlanRenderer.java | 5 +- .../src/org/apache/fop/plan/SimplePlanDrawer.java | 8 +- src/java/org/apache/fop/afp/AFPDataObjectInfo.java | 5 -- src/java/org/apache/fop/afp/AFPGraphics2D.java | 24 +++--- src/java/org/apache/fop/afp/AFPStreamer.java | 7 +- src/java/org/apache/fop/afp/DataStream.java | 13 ++-- src/java/org/apache/fop/afp/Factory.java | 5 -- .../org/apache/fop/afp/fonts/CharacterSet.java | 1 - src/java/org/apache/fop/afp/fonts/RasterFont.java | 11 ++- .../fop/afp/goca/GraphicsSetProcessColor.java | 2 +- .../apache/fop/afp/modca/AbstractAFPObject.java | 6 +- .../fop/afp/modca/AbstractEnvironmentGroup.java | 2 +- .../fop/afp/modca/AbstractNamedAFPObject.java | 4 +- .../afp/modca/AbstractTripletStructuredObject.java | 4 +- .../fop/afp/modca/ActiveEnvironmentGroup.java | 2 +- .../org/apache/fop/afp/modca/MapCodedFont.java | 4 +- .../org/apache/fop/afp/modca/MapPageOverlay.java | 6 +- .../org/apache/fop/afp/modca/MapPageSegment.java | 6 +- .../apache/fop/afp/ptoca/LineDataInfoProducer.java | 5 +- .../fop/afp/svg/AFPGraphicsConfiguration.java | 8 +- src/java/org/apache/fop/area/IDTracker.java | 15 ++-- .../apache/fop/events/model/EventModelParser.java | 5 +- src/java/org/apache/fop/fo/FOEventHandler.java | 5 +- src/java/org/apache/fop/fo/FObj.java | 4 +- .../fop/fo/extensions/ExtensionElementMapping.java | 16 ++-- src/java/org/apache/fop/fo/flow/Marker.java | 1 - src/java/org/apache/fop/fo/pagination/Region.java | 1 - .../fop/fo/properties/CharacterProperty.java | 4 +- .../apache/fop/fo/properties/ColorProperty.java | 4 +- .../properties/CommonBorderPaddingBackground.java | 12 +-- .../org/apache/fop/fo/properties/CommonFont.java | 4 +- .../fop/fo/properties/CommonHyphenation.java | 10 +-- .../fop/fo/properties/CondLengthProperty.java | 4 +- .../fo/properties/CorrespondingPropertyMaker.java | 2 +- .../org/apache/fop/fo/properties/EnumNumber.java | 4 +- .../org/apache/fop/fo/properties/EnumProperty.java | 4 +- .../org/apache/fop/fo/properties/FixedLength.java | 4 +- .../fop/fo/properties/FontFamilyProperty.java | 4 +- .../org/apache/fop/fo/properties/KeepProperty.java | 4 +- .../apache/fop/fo/properties/NumberProperty.java | 10 +-- .../apache/fop/fo/properties/StringProperty.java | 9 +-- src/java/org/apache/fop/fonts/FontSetup.java | 8 -- .../BalancingColumnBreakingAlgorithm.java | 20 ++--- .../apache/fop/layoutmgr/LayoutManagerMapping.java | 11 +-- .../org/apache/fop/layoutmgr/SpaceResolver.java | 87 +++++++++++----------- src/java/org/apache/fop/layoutmgr/TraitSetter.java | 11 ++- .../AbstractPageNumberCitationLayoutManager.java | 1 - .../layoutmgr/inline/BasicScaledBaselineTable.java | 4 +- .../layoutmgr/inline/LineLayoutPossibilities.java | 10 +-- .../inline/PageNumberCitationLayoutManager.java | 1 - .../fop/layoutmgr/inline/ScaledBaselineTable.java | 2 - .../layoutmgr/table/TableContentLayoutManager.java | 23 +++--- .../fop/layoutmgr/table/TableRowIterator.java | 2 - src/java/org/apache/fop/pdf/PDFEmbeddedFile.java | 6 -- src/java/org/apache/fop/pdf/PDFEncryptionJCE.java | 1 - .../org/apache/fop/pdf/PDFEncryptionManager.java | 19 +++-- .../fop/render/afp/AFPForeignAttributeReader.java | 11 ++- .../fop/render/afp/extensions/AFPPageOverlay.java | 2 - .../intermediate/AbstractIFDocumentHandler.java | 6 -- .../apache/fop/render/java2d/Java2DPainter.java | 6 -- .../org/apache/fop/render/pcl/HardcodedFonts.java | 5 +- src/java/org/apache/fop/render/pcl/PCLPainter.java | 6 -- .../apache/fop/render/pcl/PCLRendererContext.java | 3 - .../apache/fop/render/pdf/PDFBorderPainter.java | 5 +- .../org/apache/fop/render/ps/PSSVGHandler.java | 5 -- .../fop/render/rtf/rtflib/rtfdoc/RtfList.java | 3 +- .../org/apache/fop/render/svg/SVGPainter.java | 8 +- test/java/org/apache/fop/GenericFOPTestCase.java | 13 ++-- .../apache/fop/config/BaseUserConfigTestCase.java | 2 +- test/java/org/apache/fop/events/EventChecker.java | 2 +- test/java/org/apache/fop/memory/Stats.java | 2 +- .../org/apache/fop/render/pdf/PDFCMapTestCase.java | 60 +++++++-------- test/java/org/apache/fop/util/DigestFilter.java | 4 +- 74 files changed, 264 insertions(+), 357 deletions(-) (limited to 'src/java/org/apache/fop/fo/pagination') diff --git a/examples/plan/src/org/apache/fop/plan/PlanHints.java b/examples/plan/src/org/apache/fop/plan/PlanHints.java index 2a2c1333a..a50d91139 100644 --- a/examples/plan/src/org/apache/fop/plan/PlanHints.java +++ b/examples/plan/src/org/apache/fop/plan/PlanHints.java @@ -25,22 +25,22 @@ package org.apache.fop.plan; public interface PlanHints { /** Border attribute */ - public static final String PLAN_BORDER = "border"; + String PLAN_BORDER = "border"; /** Legend attribute */ - public static final String PLAN_LEGEND = "legend"; + String PLAN_LEGEND = "legend"; /** Font family attribute */ - public static final String FONT_FAMILY = "font-family"; + String FONT_FAMILY = "font-family"; /** Font size attribute */ - public static final String FONT_SIZE = "font-size"; + String FONT_SIZE = "font-size"; /** Legent type attribute */ - public static final String LEGEND_TYPE = "legendType"; + String LEGEND_TYPE = "legendType"; /** Locale attribute */ - public static final String LOCALE = "locale"; + String LOCALE = "locale"; /** Label type attribute */ - public static final String LABEL_TYPE = "labelType"; + String LABEL_TYPE = "labelType"; /** Label font size attribute */ - public static final String LABEL_FONT_SIZE = "labelFontSize"; + String LABEL_FONT_SIZE = "labelFontSize"; /** Label font attribute */ - public static final String LABEL_FONT = "labelFont"; + String LABEL_FONT = "labelFont"; } diff --git a/examples/plan/src/org/apache/fop/plan/PlanRenderer.java b/examples/plan/src/org/apache/fop/plan/PlanRenderer.java index 8b7978259..7d41962fb 100644 --- a/examples/plan/src/org/apache/fop/plan/PlanRenderer.java +++ b/examples/plan/src/org/apache/fop/plan/PlanRenderer.java @@ -109,8 +109,8 @@ public class PlanRenderer { hints.put(PlanHints.FONT_FAMILY, fontFamily); hints.put(PlanHints.FONT_SIZE, new Float(fontSize)); hints.put(PlanHints.LOCALE, locale); - Document doc = - planDrawer.createDocument(data, width, height, hints); + Document doc + = planDrawer.createDocument(data, width, height, hints); return doc; } @@ -152,6 +152,7 @@ public class PlanRenderer { } else if (t.equals("grouping")) { data.setType(ActionInfo.GROUPING); } else { + throw new IllegalArgumentException("Unknown action type: " + t); } for (int i = 0; i < childs.getLength(); i++) { diff --git a/examples/plan/src/org/apache/fop/plan/SimplePlanDrawer.java b/examples/plan/src/org/apache/fop/plan/SimplePlanDrawer.java index 46b07601a..a8ba062ed 100644 --- a/examples/plan/src/org/apache/fop/plan/SimplePlanDrawer.java +++ b/examples/plan/src/org/apache/fop/plan/SimplePlanDrawer.java @@ -243,8 +243,8 @@ public class SimplePlanDrawer implements PlanDrawer { - lastWeek.getTime() + 43200000) / 86400000); int days = (int)((end.getTime() - start.getTime() + 43200000) / 86400000); - int daysFromEnd = - (int)((future.getTime() - end.getTime() + int daysFromEnd + = (int)((future.getTime() - end.getTime() + 43200000) / 86400000); Element taskGraphic; switch (type) { @@ -299,8 +299,8 @@ public class SimplePlanDrawer implements PlanDrawer { topEdge = lastTop; } } - int currentDays = - (int)((currentDate.getTime() - lastWeek.getTime() + int currentDays + = (int)((currentDate.getTime() - lastWeek.getTime() + 43200000) / 86400000); text = SVGUtilities.createText(doc, diff --git a/src/java/org/apache/fop/afp/AFPDataObjectInfo.java b/src/java/org/apache/fop/afp/AFPDataObjectInfo.java index 66ef8e595..7589ef4fe 100644 --- a/src/java/org/apache/fop/afp/AFPDataObjectInfo.java +++ b/src/java/org/apache/fop/afp/AFPDataObjectInfo.java @@ -19,9 +19,6 @@ package org.apache.fop.afp; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import org.apache.fop.afp.modca.Registry; import org.apache.fop.afp.modca.triplets.MappingOptionTriplet; @@ -29,8 +26,6 @@ import org.apache.fop.afp.modca.triplets.MappingOptionTriplet; * A list of parameters associated with an AFP data objects */ public class AFPDataObjectInfo { - private static final Log log // CSOK: ConstantName - = LogFactory.getLog("org.apache.xmlgraphics.afp"); /** the object area info */ private AFPObjectAreaInfo objectAreaInfo; diff --git a/src/java/org/apache/fop/afp/AFPGraphics2D.java b/src/java/org/apache/fop/afp/AFPGraphics2D.java index 5fa6bae2d..af58b5471 100644 --- a/src/java/org/apache/fop/afp/AFPGraphics2D.java +++ b/src/java/org/apache/fop/afp/AFPGraphics2D.java @@ -75,7 +75,7 @@ import org.apache.fop.svg.NativeImageHandler; */ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHandler { - private static final Log log = LogFactory.getLog(AFPGraphics2D.class); // CSOK: ConstantName + private static final Log LOG = LogFactory.getLog(AFPGraphics2D.class); private static final int X = 0; @@ -321,7 +321,7 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand graphicsObj.setLineType(type); } } else { - log.warn("Unsupported Stroke: " + stroke.getClass().getName()); + LOG.warn("Unsupported Stroke: " + stroke.getClass().getName()); } } @@ -339,7 +339,7 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand if (paint instanceof Color) { return true; } - log.debug("NYI: applyPaint() " + paint + " fill=" + fill); + LOG.debug("NYI: applyPaint() " + paint + " fill=" + fill); if (paint instanceof TexturePaint) { // TexturePaint texturePaint = (TexturePaint)paint; // BufferedImage bufferedImage = texturePaint.getImage(); @@ -490,7 +490,7 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand currentPosition = new double[]{openingCoords[0], openingCoords[1]}; break; default: - log.debug("Unrecognised path iterator type"); + LOG.debug("Unrecognised path iterator type"); break; } } @@ -498,13 +498,13 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand /** {@inheritDoc} */ public void draw(Shape shape) { - log.debug("draw() shape=" + shape); + LOG.debug("draw() shape=" + shape); doDrawing(shape, false); } /** {@inheritDoc} */ public void fill(Shape shape) { - log.debug("fill() shape=" + shape); + LOG.debug("fill() shape=" + shape); doDrawing(shape, true); } @@ -516,7 +516,7 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand */ public void handleIOException(IOException ioe) { // TODO Surely, there's a better way to do this. - log.error(ioe.getMessage()); + LOG.error(ioe.getMessage()); ioe.printStackTrace(); } @@ -659,29 +659,29 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand /** {@inheritDoc} */ public void drawRenderableImage(RenderableImage img, AffineTransform xform) { - log.debug("drawRenderableImage() NYI: img=" + img + ", xform=" + xform); + LOG.debug("drawRenderableImage() NYI: img=" + img + ", xform=" + xform); } /** {@inheritDoc} */ public FontMetrics getFontMetrics(Font f) { - log.debug("getFontMetrics() NYI: f=" + f); + LOG.debug("getFontMetrics() NYI: f=" + f); return null; } /** {@inheritDoc} */ public void setXORMode(Color col) { - log.debug("setXORMode() NYI: col=" + col); + LOG.debug("setXORMode() NYI: col=" + col); } /** {@inheritDoc} */ public void addNativeImage(org.apache.xmlgraphics.image.loader.Image image, float x, float y, float width, float height) { - log.debug("NYI: addNativeImage() " + "image=" + image + LOG.debug("NYI: addNativeImage() " + "image=" + image + ",x=" + x + ",y=" + y + ",width=" + width + ",height=" + height); } /** {@inheritDoc} */ public void copyArea(int x, int y, int width, int height, int dx, int dy) { - log.debug("copyArea() NYI: "); + LOG.debug("copyArea() NYI: "); } } diff --git a/src/java/org/apache/fop/afp/AFPStreamer.java b/src/java/org/apache/fop/afp/AFPStreamer.java index a24e90cbf..33d1dbf90 100644 --- a/src/java/org/apache/fop/afp/AFPStreamer.java +++ b/src/java/org/apache/fop/afp/AFPStreamer.java @@ -31,6 +31,7 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.apache.fop.afp.modca.ResourceGroup; import org.apache.fop.afp.modca.StreamedResourceGroup; @@ -39,7 +40,7 @@ import org.apache.fop.afp.modca.StreamedResourceGroup; */ public class AFPStreamer implements Streamable { /** Static logging instance */ - private static final Log log = LogFactory.getLog(AFPStreamer.class); // CSOK: ConstantName + private static final Log LOG = LogFactory.getLog(AFPStreamer.class); private static final String AFPDATASTREAM_TEMP_FILE_PREFIX = "AFPDataStream_"; @@ -119,7 +120,7 @@ public class AFPStreamer implements Streamable { if (level.isExternal()) { String filePath = level.getExternalFilePath(); if (filePath == null) { - log.warn("No file path provided for external resource, using default."); + LOG.warn("No file path provided for external resource, using default."); filePath = defaultResourceGroupFilePath; } resourceGroup = (ResourceGroup)pathResourceGroupMap.get(filePath); @@ -128,7 +129,7 @@ public class AFPStreamer implements Streamable { try { os = new BufferedOutputStream(new FileOutputStream(filePath)); } catch (FileNotFoundException fnfe) { - log.error("Failed to create/open external resource group file '" + LOG.error("Failed to create/open external resource group file '" + filePath + "'"); } finally { if (os != null) { diff --git a/src/java/org/apache/fop/afp/DataStream.java b/src/java/org/apache/fop/afp/DataStream.java index 096c2e60e..843e3fa65 100644 --- a/src/java/org/apache/fop/afp/DataStream.java +++ b/src/java/org/apache/fop/afp/DataStream.java @@ -30,8 +30,8 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.fop.afp.fonts.AFPFontAttributes; import org.apache.fop.afp.fonts.AFPFont; +import org.apache.fop.afp.fonts.AFPFontAttributes; import org.apache.fop.afp.fonts.CharacterSet; import org.apache.fop.afp.modca.AbstractPageObject; import org.apache.fop.afp.modca.Document; @@ -42,10 +42,10 @@ import org.apache.fop.afp.modca.PageObject; import org.apache.fop.afp.modca.ResourceGroup; import org.apache.fop.afp.modca.TagLogicalElementBean; import org.apache.fop.afp.modca.triplets.FullyQualifiedNameTriplet; -import org.apache.fop.afp.ptoca.PtocaProducer; import org.apache.fop.afp.ptoca.PtocaBuilder; -import org.apache.fop.util.CharUtilities; +import org.apache.fop.afp.ptoca.PtocaProducer; import org.apache.fop.fonts.Font; +import org.apache.fop.util.CharUtilities; /** * A data stream is a continuous ordered stream of data elements and objects @@ -65,8 +65,7 @@ import org.apache.fop.fonts.Font; public class DataStream { /** Static logging instance */ - protected static final Log log // CSOK: ConstantName - = LogFactory.getLog("org.apache.xmlgraphics.afp"); + protected static final Log LOG = LogFactory.getLog("org.apache.xmlgraphics.afp"); /** Boolean completion indicator */ private boolean complete = false; @@ -163,7 +162,7 @@ public class DataStream { public void endDocument() throws IOException { if (complete) { String msg = "Invalid state - document already ended."; - log.warn("endDocument():: " + msg); + LOG.warn("endDocument():: " + msg); throw new IllegalStateException(msg); } @@ -357,7 +356,7 @@ public class DataStream { * @param letterSpacing letter spacing to draw text with * @param wordSpacing word Spacing to draw text with * @param font is the font to draw text with - * @param charSet is the AFP Character Set to use with the text + * @param charSet is the AFP Character Set to use with the text * @throws UnsupportedEncodingException thrown if character encoding is not supported */ public void createText diff --git a/src/java/org/apache/fop/afp/Factory.java b/src/java/org/apache/fop/afp/Factory.java index f29453cf5..ef68a22fb 100644 --- a/src/java/org/apache/fop/afp/Factory.java +++ b/src/java/org/apache/fop/afp/Factory.java @@ -21,8 +21,6 @@ package org.apache.fop.afp; import java.io.OutputStream; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.fop.afp.goca.GraphicsData; import org.apache.fop.afp.ioca.ImageContent; import org.apache.fop.afp.ioca.ImageRasterData; @@ -65,9 +63,6 @@ import org.apache.fop.afp.util.StringUtils; */ public class Factory { - /** Static logging instance */ - private static final Log log = LogFactory.getLog(Factory.class); // CSOK: ConstantName - private static final String OBJECT_ENVIRONMENT_GROUP_NAME_PREFIX = "OEG"; private static final String ACTIVE_ENVIRONMENT_GROUP_NAME_PREFIX = "AEG"; diff --git a/src/java/org/apache/fop/afp/fonts/CharacterSet.java b/src/java/org/apache/fop/afp/fonts/CharacterSet.java index 22cb52d4d..7123d4138 100644 --- a/src/java/org/apache/fop/afp/fonts/CharacterSet.java +++ b/src/java/org/apache/fop/afp/fonts/CharacterSet.java @@ -21,7 +21,6 @@ package org.apache.fop.afp.fonts; import java.io.File; import java.io.UnsupportedEncodingException; -import java.net.URI; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.CharacterCodingException; diff --git a/src/java/org/apache/fop/afp/fonts/RasterFont.java b/src/java/org/apache/fop/afp/fonts/RasterFont.java index 6ad5375bf..2a4d5d270 100644 --- a/src/java/org/apache/fop/afp/fonts/RasterFont.java +++ b/src/java/org/apache/fop/afp/fonts/RasterFont.java @@ -37,8 +37,7 @@ import org.apache.commons.logging.LogFactory; public class RasterFont extends AFPFont { /** Static logging instance */ - protected static final Log log // CSOK: ConstantName - = LogFactory.getLog("org.apache.fop.afp.fonts"); + protected static final Log LOG = LogFactory.getLog("org.apache.fop.afp.fonts"); private final SortedMap/**/ charSets = new java.util.TreeMap/**/(); @@ -118,7 +117,7 @@ public class RasterFont extends AFPFont { substitutionCharSets.put(requestedSize, csm); String msg = "No " + (size / 1000f) + "pt font " + getFontName() + " found, substituted with " + fontSize.intValue() / 1000f + "pt font"; - log.warn(msg); + LOG.warn(msg); } } @@ -126,7 +125,7 @@ public class RasterFont extends AFPFont { // Still no match -> error String msg = "No font found for font " + getFontName() + " with point size " + size / 1000f; - log.error(msg); + LOG.error(msg); throw new FontRuntimeException(msg); } @@ -145,7 +144,7 @@ public class RasterFont extends AFPFont { return csm.getFirstChar(); } else { String msg = "getFirstChar() - No character set found for font:" + getFontName(); - log.error(msg); + LOG.error(msg); throw new FontRuntimeException(msg); } } @@ -162,7 +161,7 @@ public class RasterFont extends AFPFont { return csm.getLastChar(); } else { String msg = "getLastChar() - No character set found for font:" + getFontName(); - log.error(msg); + LOG.error(msg); throw new FontRuntimeException(msg); } diff --git a/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java b/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java index 4d45b22cb..aba02f76c 100644 --- a/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java +++ b/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java @@ -75,7 +75,7 @@ public class GraphicsSetProcessColor extends AbstractGraphicsDrawingOrder { } else if (colSpaceType == ColorSpace.TYPE_RGB) { colspace = RGB; } else { - log.error("unsupported colorspace " + colSpaceType); + LOG.error("unsupported colorspace " + colSpaceType); colspace = RGB; } diff --git a/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java b/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java index be92ce0b6..4b1439da0 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java +++ b/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java @@ -27,6 +27,7 @@ import java.util.Iterator; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.apache.fop.afp.Streamable; import org.apache.fop.afp.util.BinaryUtils; @@ -38,8 +39,7 @@ import org.apache.fop.afp.util.BinaryUtils; public abstract class AbstractAFPObject implements Streamable { /** Static logging instance */ - protected static final Log log // CSOK: ConstantName - = LogFactory.getLog("org.apache.xmlgraphics.afp.modca"); + protected static final Log LOG = LogFactory.getLog("org.apache.xmlgraphics.afp.modca"); /** the structured field class id */ protected static final byte SF_CLASS = (byte)0xD3; @@ -189,7 +189,7 @@ public abstract class AbstractAFPObject implements Streamable { protected String truncate(String str, int maxLength) { if (str.length() > maxLength) { str = str.substring(0, maxLength); - log.warn("truncated character string '" + LOG.warn("truncated character string '" + str + "', longer than " + maxLength + " chars"); } return str; diff --git a/src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java b/src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java index 19f2c94a3..d06311a47 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java +++ b/src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java @@ -73,7 +73,7 @@ public abstract class AbstractEnvironmentGroup extends AbstractNamedAFPObject { mpo.addOverlay(name); } catch (MaximumSizeExceededException ex) { // Should never happen (but log just in case) - log.error("createOverlay():: resulted in a MaximumSizeExceededException"); + LOG.error("createOverlay():: resulted in a MaximumSizeExceededException"); } } } diff --git a/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java b/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java index 4e0dbc349..b349e1f7d 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java +++ b/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java @@ -73,7 +73,7 @@ public abstract class AbstractNamedAFPObject extends AbstractTripletStructuredOb name = (name + " ").substring(0, afpNameLen); } else if (name.length() > afpNameLen) { String truncatedName = name.substring(nameLen - afpNameLen, nameLen); - log.warn("Constructor:: name '" + name + "'" + LOG.warn("Constructor:: name '" + name + "'" + " truncated to " + afpNameLen + " chars" + " ('" + truncatedName + "')"); name = truncatedName; @@ -83,7 +83,7 @@ public abstract class AbstractNamedAFPObject extends AbstractTripletStructuredOb nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING); } catch (UnsupportedEncodingException usee) { nameBytes = name.getBytes(); - log.warn( + LOG.warn( "Constructor:: UnsupportedEncodingException translating the name " + name); } diff --git a/src/java/org/apache/fop/afp/modca/AbstractTripletStructuredObject.java b/src/java/org/apache/fop/afp/modca/AbstractTripletStructuredObject.java index efc38f3b8..4b269086e 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractTripletStructuredObject.java +++ b/src/java/org/apache/fop/afp/modca/AbstractTripletStructuredObject.java @@ -27,8 +27,6 @@ import java.util.List; import org.apache.fop.afp.modca.Registry.ObjectType; import org.apache.fop.afp.modca.triplets.AbstractTriplet; -import org.apache.fop.afp.modca.triplets.AttributeQualifierTriplet; -import org.apache.fop.afp.modca.triplets.AttributeValueTriplet; import org.apache.fop.afp.modca.triplets.CommentTriplet; import org.apache.fop.afp.modca.triplets.FullyQualifiedNameTriplet; import org.apache.fop.afp.modca.triplets.ObjectClassificationTriplet; @@ -150,7 +148,7 @@ public class AbstractTripletStructuredObject extends AbstractStructuredObject { if (fqNameTriplet != null) { return fqNameTriplet.getFullyQualifiedName(); } - log.warn(this + " has no fully qualified name"); + LOG.warn(this + " has no fully qualified name"); return null; } diff --git a/src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java b/src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java index 4af687a92..696787bc4 100644 --- a/src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java +++ b/src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java @@ -185,7 +185,7 @@ public final class ActiveEnvironmentGroup extends AbstractEnvironmentGroup { mapCodedFont.addFont(fontRef, font, size, orientation); } catch (MaximumSizeExceededException ex) { // Should never happen (but log just in case) - log.error("createFont():: resulted in a MaximumSizeExceededException"); + LOG.error("createFont():: resulted in a MaximumSizeExceededException"); } } } diff --git a/src/java/org/apache/fop/afp/modca/MapCodedFont.java b/src/java/org/apache/fop/afp/modca/MapCodedFont.java index 8d99d8eaa..69d8ccf31 100644 --- a/src/java/org/apache/fop/afp/modca/MapCodedFont.java +++ b/src/java/org/apache/fop/afp/modca/MapCodedFont.java @@ -180,7 +180,7 @@ public class MapCodedFont extends AbstractStructuredObject { if (cs == null) { String msg = "Character set not found for font " + font.getFontName() + " with point size " + size; - log.error(msg); + LOG.error(msg); throw new FontRuntimeException(msg); } @@ -243,7 +243,7 @@ public class MapCodedFont extends AbstractStructuredObject { } else { String msg = "Font of type " + font.getClass().getName() + " not recognized."; - log.error(msg); + LOG.error(msg); throw new FontRuntimeException(msg); } diff --git a/src/java/org/apache/fop/afp/modca/MapPageOverlay.java b/src/java/org/apache/fop/afp/modca/MapPageOverlay.java index 9fd3c7059..6f5855c93 100644 --- a/src/java/org/apache/fop/afp/modca/MapPageOverlay.java +++ b/src/java/org/apache/fop/afp/modca/MapPageOverlay.java @@ -69,14 +69,14 @@ public class MapPageOverlay extends AbstractAFPObject { throw new IllegalArgumentException("The name of overlay " + name + " must be 8 characters"); } - if (log.isDebugEnabled()) { - log.debug("addOverlay():: adding overlay " + name); + if (LOG.isDebugEnabled()) { + LOG.debug("addOverlay():: adding overlay " + name); } try { byte[] data = name.getBytes(AFPConstants.EBCIDIC_ENCODING); getOverlays().add(data); } catch (UnsupportedEncodingException usee) { - log.error("addOverlay():: UnsupportedEncodingException translating the name " + LOG.error("addOverlay():: UnsupportedEncodingException translating the name " + name); } } diff --git a/src/java/org/apache/fop/afp/modca/MapPageSegment.java b/src/java/org/apache/fop/afp/modca/MapPageSegment.java index e2afd0257..8bb7afe46 100644 --- a/src/java/org/apache/fop/afp/modca/MapPageSegment.java +++ b/src/java/org/apache/fop/afp/modca/MapPageSegment.java @@ -67,8 +67,8 @@ public class MapPageSegment extends AbstractAFPObject { throw new IllegalArgumentException("The name of page segment " + name + " must not be longer than 8 characters"); } - if (log.isDebugEnabled()) { - log.debug("addPageSegment():: adding page segment " + name); + if (LOG.isDebugEnabled()) { + LOG.debug("addPageSegment():: adding page segment " + name); } getPageSegments().add(name); } @@ -124,7 +124,7 @@ public class MapPageSegment extends AbstractAFPObject { byte[] nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING); System.arraycopy(nameBytes, 0, data, pos, nameBytes.length); } catch (UnsupportedEncodingException usee) { - log.error("UnsupportedEncodingException translating the name " + LOG.error("UnsupportedEncodingException translating the name " + name); } pos += 8; diff --git a/src/java/org/apache/fop/afp/ptoca/LineDataInfoProducer.java b/src/java/org/apache/fop/afp/ptoca/LineDataInfoProducer.java index ad2a5d716..cf00674fb 100644 --- a/src/java/org/apache/fop/afp/ptoca/LineDataInfoProducer.java +++ b/src/java/org/apache/fop/afp/ptoca/LineDataInfoProducer.java @@ -32,8 +32,7 @@ import org.apache.fop.afp.AFPLineDataInfo; public class LineDataInfoProducer implements PtocaProducer, PtocaConstants { /** Static logging instance */ - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(LineDataInfoProducer.class); + private static final Log LOG = LogFactory.getLog(LineDataInfoProducer.class); private AFPLineDataInfo lineDataInfo; @@ -62,7 +61,7 @@ public class LineDataInfoProducer implements PtocaProducer, PtocaConstants { } else if (x1 == x2) { builder.drawBaxisRule(y2 - y1, thickness); } else { - log.error("Invalid axis rule: unable to draw line"); + LOG.error("Invalid axis rule: unable to draw line"); return; } } diff --git a/src/java/org/apache/fop/afp/svg/AFPGraphicsConfiguration.java b/src/java/org/apache/fop/afp/svg/AFPGraphicsConfiguration.java index b8ed5159a..0a051e675 100644 --- a/src/java/org/apache/fop/afp/svg/AFPGraphicsConfiguration.java +++ b/src/java/org/apache/fop/afp/svg/AFPGraphicsConfiguration.java @@ -109,7 +109,7 @@ public class AFPGraphicsConfiguration extends GraphicsConfiguration { } } - private static final Log log // CSOK: ConstantName + private static final Log LOG = LogFactory.getLog(AFPGraphicsConfiguration.class); private AffineTransform defaultTransform = null; @@ -122,7 +122,7 @@ public class AFPGraphicsConfiguration extends GraphicsConfiguration { * @return the default transform for the configuration */ public AffineTransform getDefaultTransform() { - log.debug("getDefaultTransform()"); + LOG.debug("getDefaultTransform()"); if (defaultTransform == null) { defaultTransform = new AffineTransform(); } @@ -137,7 +137,7 @@ public class AFPGraphicsConfiguration extends GraphicsConfiguration { * @return the normalizing transform for the configuration */ public AffineTransform getNormalizingTransform() { - log.debug("getNormalizingTransform()"); + LOG.debug("getNormalizingTransform()"); if (normalizingTransform == null) { normalizingTransform = new AffineTransform(2, 0, 0, 2, 0, 0); } @@ -146,7 +146,7 @@ public class AFPGraphicsConfiguration extends GraphicsConfiguration { /** {@inheritDoc} */ public GraphicsDevice getDevice() { - log.debug("getDevice()"); + LOG.debug("getDevice()"); return graphicsDevice; } } diff --git a/src/java/org/apache/fop/area/IDTracker.java b/src/java/org/apache/fop/area/IDTracker.java index c0607d1bd..829c8c58d 100644 --- a/src/java/org/apache/fop/area/IDTracker.java +++ b/src/java/org/apache/fop/area/IDTracker.java @@ -34,8 +34,7 @@ import org.apache.commons.logging.LogFactory; */ public class IDTracker { - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(IDTracker.class); + private static final Log LOG = LogFactory.getLog(IDTracker.class); // HashMap of ID's whose area is located on one or more consecutive // PageViewports. Each ID has an arraylist of PageViewports that @@ -59,8 +58,8 @@ public class IDTracker { * @param pv a page viewport that contains the area with this ID */ public void associateIDWithPageViewport(String id, PageViewport pv) { - if (log.isDebugEnabled()) { - log.debug("associateIDWithPageViewport(" + id + ", " + pv + ")"); + if (LOG.isDebugEnabled()) { + LOG.debug("associateIDWithPageViewport(" + id + ", " + pv + ")"); } List pvList = (List) idLocations.get(id); if (pvList == null) { // first time ID located @@ -93,8 +92,8 @@ public class IDTracker { * @param id the id of the object being processed */ public void signalPendingID(String id) { - if (log.isDebugEnabled()) { - log.debug("signalPendingID(" + id + ")"); + if (LOG.isDebugEnabled()) { + LOG.debug("signalPendingID(" + id + ")"); } unfinishedIDs.add(id); } @@ -107,8 +106,8 @@ public class IDTracker { * @param id the id of the formatting object which was just finished */ public void signalIDProcessed(String id) { - if (log.isDebugEnabled()) { - log.debug("signalIDProcessed(" + id + ")"); + if (LOG.isDebugEnabled()) { + LOG.debug("signalIDProcessed(" + id + ")"); } alreadyResolvedIDs.add(id); diff --git a/src/java/org/apache/fop/events/model/EventModelParser.java b/src/java/org/apache/fop/events/model/EventModelParser.java index be7c61790..5441d1c4f 100644 --- a/src/java/org/apache/fop/events/model/EventModelParser.java +++ b/src/java/org/apache/fop/events/model/EventModelParser.java @@ -46,8 +46,7 @@ public final class EventModelParser { } /** Logger instance */ - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(EventModelParser.class); + private static final Log LOG = LogFactory.getLog(EventModelParser.class); private static SAXTransformerFactory tFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); @@ -61,7 +60,7 @@ public final class EventModelParser { public static EventModel parse(Source src) throws TransformerException { Transformer transformer = tFactory.newTransformer(); - transformer.setErrorListener(new DefaultErrorListener(log)); + transformer.setErrorListener(new DefaultErrorListener(LOG)); EventModel model = new EventModel(); SAXResult res = new SAXResult(getContentHandler(model)); diff --git a/src/java/org/apache/fop/fo/FOEventHandler.java b/src/java/org/apache/fop/fo/FOEventHandler.java index 238a4ced6..e280af2d7 100644 --- a/src/java/org/apache/fop/fo/FOEventHandler.java +++ b/src/java/org/apache/fop/fo/FOEventHandler.java @@ -40,11 +40,10 @@ import org.apache.fop.fo.flow.PageNumberCitation; import org.apache.fop.fo.flow.PageNumberCitationLast; import org.apache.fop.fo.flow.table.Table; import org.apache.fop.fo.flow.table.TableBody; -import org.apache.fop.fo.flow.table.TableFooter; -import org.apache.fop.fo.flow.table.TableHeader; -import org.apache.fop.fo.flow.table.TablePart; import org.apache.fop.fo.flow.table.TableCell; import org.apache.fop.fo.flow.table.TableColumn; +import org.apache.fop.fo.flow.table.TableFooter; +import org.apache.fop.fo.flow.table.TableHeader; import org.apache.fop.fo.flow.table.TableRow; import org.apache.fop.fo.pagination.Flow; import org.apache.fop.fo.pagination.PageSequence; diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index 244013c4d..cb265b008 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -44,7 +44,7 @@ import org.apache.fop.fo.properties.PropertyMaker; public abstract class FObj extends FONode implements Constants { /** the list of property makers */ - private static final PropertyMaker[] propertyListTable // CSOK: ConstantName + private static final PropertyMaker[] PROPERTY_LIST_TABLE = FOPropertyMapping.getGenericMappings(); /** @@ -108,7 +108,7 @@ public abstract class FObj extends FONode implements Constants { * @return the requested Property Maker */ public static PropertyMaker getPropertyMakerFor(int propId) { - return propertyListTable[propId]; + return PROPERTY_LIST_TABLE[propId]; } /** {@inheritDoc} */ diff --git a/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java b/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java index 32d0d745c..a12bed0fa 100644 --- a/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java +++ b/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java @@ -37,18 +37,18 @@ public class ExtensionElementMapping extends ElementMapping { /** The FOP extension namespace URI */ public static final String URI = "http://xmlgraphics.apache.org/fop/extensions"; - private static final Set propertyAttributes // CSOK: ConstantName + private static final Set PROPERTY_ATTRIBUTES = new java.util.HashSet(); static { //These are FOP's standard extension properties (fox:*) - propertyAttributes.add("block-progression-unit"); - propertyAttributes.add("widow-content-limit"); - propertyAttributes.add("orphan-content-limit"); - propertyAttributes.add("internal-destination"); - propertyAttributes.add("disable-column-balancing"); + PROPERTY_ATTRIBUTES.add("block-progression-unit"); + PROPERTY_ATTRIBUTES.add("widow-content-limit"); + PROPERTY_ATTRIBUTES.add("orphan-content-limit"); + PROPERTY_ATTRIBUTES.add("internal-destination"); + PROPERTY_ATTRIBUTES.add("disable-column-balancing"); //These are FOP's extension properties for accessibility - propertyAttributes.add("alt-text"); + PROPERTY_ATTRIBUTES.add("alt-text"); } /** @@ -93,7 +93,7 @@ public class ExtensionElementMapping extends ElementMapping { if (!URI.equals(attributeName.getNamespaceURI())) { throw new IllegalArgumentException("The namespace URIs don't match"); } - return propertyAttributes.contains(attributeName.getLocalName()); + return PROPERTY_ATTRIBUTES.contains(attributeName.getLocalName()); } } diff --git a/src/java/org/apache/fop/fo/flow/Marker.java b/src/java/org/apache/fop/fo/flow/Marker.java index e23a13f33..d8f69af28 100644 --- a/src/java/org/apache/fop/fo/flow/Marker.java +++ b/src/java/org/apache/fop/fo/flow/Marker.java @@ -19,7 +19,6 @@ package org.apache.fop.fo.flow; -import java.util.Collections; import java.util.Map; import org.xml.sax.Attributes; diff --git a/src/java/org/apache/fop/fo/pagination/Region.java b/src/java/org/apache/fop/fo/pagination/Region.java index 6f94418be..ea449cdff 100644 --- a/src/java/org/apache/fop/fo/pagination/Region.java +++ b/src/java/org/apache/fop/fo/pagination/Region.java @@ -31,7 +31,6 @@ import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.ValidationException; -import org.apache.fop.fo.expr.PropertyException; import org.apache.fop.fo.properties.CommonBorderPaddingBackground; /** diff --git a/src/java/org/apache/fop/fo/properties/CharacterProperty.java b/src/java/org/apache/fop/fo/properties/CharacterProperty.java index 71b70ebee..5fef57a8b 100644 --- a/src/java/org/apache/fop/fo/properties/CharacterProperty.java +++ b/src/java/org/apache/fop/fo/properties/CharacterProperty.java @@ -51,7 +51,7 @@ public final class CharacterProperty extends Property { } /** cache containing all canonical CharacterProperty instances */ - private static final PropertyCache cache // CSOK: ConstantName + private static final PropertyCache CACHE = new PropertyCache(CharacterProperty.class); private final char character; @@ -69,7 +69,7 @@ public final class CharacterProperty extends Property { * @return the character property instance */ public static CharacterProperty getInstance(char character) { - return (CharacterProperty) cache.fetch( + return (CharacterProperty) CACHE.fetch( new CharacterProperty(character)); } diff --git a/src/java/org/apache/fop/fo/properties/ColorProperty.java b/src/java/org/apache/fop/fo/properties/ColorProperty.java index 95725f3e8..e7b8d5931 100644 --- a/src/java/org/apache/fop/fo/properties/ColorProperty.java +++ b/src/java/org/apache/fop/fo/properties/ColorProperty.java @@ -33,7 +33,7 @@ import org.apache.fop.util.ColorUtil; public final class ColorProperty extends Property { /** cache holding canonical ColorProperty instances */ - private static final PropertyCache cache // CSOK: ConstantName + private static final PropertyCache CACHE = new PropertyCache(ColorProperty.class); /** @@ -103,7 +103,7 @@ public final class ColorProperty extends Property { ColorProperty instance = new ColorProperty( ColorUtil.parseColorString( foUserAgent, value)); - return (ColorProperty)cache.fetch(instance); + return (ColorProperty)CACHE.fetch(instance); } /** diff --git a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java index b3ae7d8cd..d39dc24f0 100644 --- a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java +++ b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java @@ -48,7 +48,7 @@ public class CommonBorderPaddingBackground { // CSOK: FinalCl * cache holding all canonical instances * (w/ absolute background-position-* and padding-*) */ - private static final PropertyCache cache // CSOK: ConstantName + private static final PropertyCache CACHE = new PropertyCache(CommonBorderPaddingBackground.class); private int hash = -1; @@ -102,7 +102,7 @@ public class CommonBorderPaddingBackground { // CSOK: FinalCl public static final class BorderInfo { /** cache holding all canonical instances */ - private static final PropertyCache cache // CSOK: ConstantName + private static final PropertyCache CACHE = new PropertyCache(BorderInfo.class); private int mStyle; // Enum for border style @@ -129,7 +129,7 @@ public class CommonBorderPaddingBackground { // CSOK: FinalCl * @return a cached BorderInfo instance */ public static BorderInfo getInstance(int style, CondLengthProperty width, Color color) { - return cache.fetch(new BorderInfo(style, width, color)); + return CACHE.fetch(new BorderInfo(style, width, color)); } /** @@ -214,7 +214,7 @@ public class CommonBorderPaddingBackground { // CSOK: FinalCl * A border info with style "none". Used as a singleton, in the collapsing-border model, * for elements which don't specify any border on some of their sides. */ - private static final BorderInfo defaultBorderInfo // CSOK: ConstantName + private static final BorderInfo DEFAULT_BORDER_INFO = BorderInfo.getInstance(Constants.EN_NONE, new ConditionalNullLength(), null); /** @@ -276,7 +276,7 @@ public class CommonBorderPaddingBackground { // CSOK: FinalCl * @return a BorderInfo instance with style set to {@link Constants#EN_NONE} */ public static BorderInfo getDefaultBorderInfo() { - return defaultBorderInfo; + return DEFAULT_BORDER_INFO; } private BorderInfo[] borderInfo = new BorderInfo[4]; @@ -366,7 +366,7 @@ public class CommonBorderPaddingBackground { // CSOK: FinalCl || newInstance.backgroundPositionHorizontal.isAbsolute()) && (newInstance.backgroundPositionVertical == null || newInstance.backgroundPositionVertical.isAbsolute())) { - cachedInstance = cache.fetch(newInstance); + cachedInstance = CACHE.fetch(newInstance); } /* for non-cached, or not-yet-cached instances, preload the image */ diff --git a/src/java/org/apache/fop/fo/properties/CommonFont.java b/src/java/org/apache/fop/fo/properties/CommonFont.java index f3f7d3f69..b12f84ad2 100644 --- a/src/java/org/apache/fop/fo/properties/CommonFont.java +++ b/src/java/org/apache/fop/fo/properties/CommonFont.java @@ -37,7 +37,7 @@ public final class CommonFont { /** cache holding canonical CommonFont instances (only those with * absolute font-size and font-size-adjust) */ - private static final PropertyCache cache // CSOK: ConstantName + private static final PropertyCache CACHE = new PropertyCache(CommonFont.class); /** hashcode of this instance */ @@ -129,7 +129,7 @@ public final class CommonFont { fontSize, fontSizeAdjust); - return cache.fetch(commonFont); + return CACHE.fetch(commonFont); } /** @return an array with the font-family names */ diff --git a/src/java/org/apache/fop/fo/properties/CommonHyphenation.java b/src/java/org/apache/fop/fo/properties/CommonHyphenation.java index c65b5b616..65b2cebbd 100644 --- a/src/java/org/apache/fop/fo/properties/CommonHyphenation.java +++ b/src/java/org/apache/fop/fo/properties/CommonHyphenation.java @@ -36,11 +36,9 @@ import org.apache.fop.fonts.Typeface; public final class CommonHyphenation { /** Logger */ - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(CommonHyphenation.class); + private static final Log LOG = LogFactory.getLog(CommonHyphenation.class); - private static final PropertyCache cache // CSOK: ConstantName - = new PropertyCache(CommonHyphenation.class); + private static final PropertyCache CACHE = new PropertyCache(CommonHyphenation.class); private int hash = 0; @@ -119,7 +117,7 @@ public final class CommonHyphenation { hyphenationPushCharacterCount, hyphenationRemainCharacterCount); - return cache.fetch(instance); + return CACHE.fetch(instance); } @@ -168,7 +166,7 @@ public final class CommonHyphenation { } } if (warn) { - log.warn("Substituted specified hyphenation character (0x" + LOG.warn("Substituted specified hyphenation character (0x" + Integer.toHexString(hyphChar) + ") with 0x" + Integer.toHexString(effHyphChar) + " because the font doesn't have the specified hyphenation character: " diff --git a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java index dc7d80c39..1ab7ec3ad 100644 --- a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java +++ b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java @@ -33,7 +33,7 @@ import org.apache.fop.fo.expr.PropertyException; public class CondLengthProperty extends Property implements CompoundDatatype { /** cache holding canonical instances (for absolute conditional lengths) */ - private static final PropertyCache cache // CSOK: ConstantName + private static final PropertyCache CACHE = new PropertyCache(CondLengthProperty.class); /** components */ @@ -159,7 +159,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype { */ public CondLengthProperty getCondLength() { if (this.length.getLength().isAbsolute()) { - CondLengthProperty clp = (CondLengthProperty) cache.fetch(this); + CondLengthProperty clp = (CondLengthProperty) CACHE.fetch(this); if (clp == this) { isCached = true; } diff --git a/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java b/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java index 18c6f09a6..6183b9e56 100644 --- a/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java @@ -19,12 +19,12 @@ package org.apache.fop.fo.properties; -import org.apache.fop.apps.FOPException; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.expr.PropertyException; /** + * Maker class for handling corresponding properties. */ public class CorrespondingPropertyMaker { /** base property maker */ diff --git a/src/java/org/apache/fop/fo/properties/EnumNumber.java b/src/java/org/apache/fop/fo/properties/EnumNumber.java index 6a2879479..153a716df 100644 --- a/src/java/org/apache/fop/fo/properties/EnumNumber.java +++ b/src/java/org/apache/fop/fo/properties/EnumNumber.java @@ -29,7 +29,7 @@ import org.apache.fop.fo.expr.PropertyException; public final class EnumNumber extends Property implements Numeric { /** cache holding all canonical EnumNumber instances */ - private static final PropertyCache cache // CSOK: ConstantName + private static final PropertyCache CACHE = new PropertyCache(EnumNumber.class); private final EnumProperty enumProperty; @@ -50,7 +50,7 @@ public final class EnumNumber extends Property implements Numeric { * @return the canonical instance */ public static EnumNumber getInstance(Property enumProperty) { - return (EnumNumber)cache.fetch( + return (EnumNumber)CACHE.fetch( new EnumNumber((EnumProperty) enumProperty)); } diff --git a/src/java/org/apache/fop/fo/properties/EnumProperty.java b/src/java/org/apache/fop/fo/properties/EnumProperty.java index db26cfdc6..ae704f1c9 100644 --- a/src/java/org/apache/fop/fo/properties/EnumProperty.java +++ b/src/java/org/apache/fop/fo/properties/EnumProperty.java @@ -29,7 +29,7 @@ import org.apache.fop.fo.expr.PropertyException; public final class EnumProperty extends Property { /** cache holding all canonical EnumProperty instances */ - private static final PropertyCache cache // CSOK: ConstantName + private static final PropertyCache CACHE = new PropertyCache(EnumProperty.class); /** @@ -93,7 +93,7 @@ public final class EnumProperty extends Property { * @return an enumeration property */ public static EnumProperty getInstance(int explicitValue, String text) { - return (EnumProperty) cache.fetch( + return (EnumProperty) CACHE.fetch( new EnumProperty(explicitValue, text)); } diff --git a/src/java/org/apache/fop/fo/properties/FixedLength.java b/src/java/org/apache/fop/fo/properties/FixedLength.java index cc4d04c69..c35c6f6c9 100644 --- a/src/java/org/apache/fop/fo/properties/FixedLength.java +++ b/src/java/org/apache/fop/fo/properties/FixedLength.java @@ -45,7 +45,7 @@ public final class FixedLength extends LengthProperty { public static final String MPT = "mpt"; /** cache holding all canonical FixedLength instances */ - private static final PropertyCache cache // CSOK: ConstantName + private static final PropertyCache CACHE = new PropertyCache(FixedLength.class); /** canonical zero-length instance */ @@ -82,7 +82,7 @@ public final class FixedLength extends LengthProperty { if (numUnits == 0.0) { return ZERO_FIXED_LENGTH; } else { - return (FixedLength)cache.fetch( + return (FixedLength)CACHE.fetch( new FixedLength(numUnits, units, sourceResolution)); } diff --git a/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java b/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java index 5b05aa959..330101ee7 100644 --- a/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java +++ b/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java @@ -31,7 +31,7 @@ import org.apache.fop.fo.expr.PropertyException; public final class FontFamilyProperty extends ListProperty { /** cache holding all canonical FontFamilyProperty instances */ - private static final PropertyCache cache // CSOK: ConstantName + private static final PropertyCache CACHE = new PropertyCache(FontFamilyProperty.class); private int hash = 0; @@ -95,7 +95,7 @@ public final class FontFamilyProperty extends ListProperty { prop.addProperty(StringProperty.getInstance(tmpVal)); } } - return cache.fetch(prop); + return CACHE.fetch(prop); } } diff --git a/src/java/org/apache/fop/fo/properties/KeepProperty.java b/src/java/org/apache/fop/fo/properties/KeepProperty.java index 7c5b6124f..0bc44e459 100644 --- a/src/java/org/apache/fop/fo/properties/KeepProperty.java +++ b/src/java/org/apache/fop/fo/properties/KeepProperty.java @@ -30,7 +30,7 @@ import org.apache.fop.fo.expr.PropertyException; public final class KeepProperty extends Property implements CompoundDatatype { /** class holding all canonical KeepProperty instances*/ - private static final PropertyCache cache // CSOK: ConstantName + private static final PropertyCache CACHE = new PropertyCache(KeepProperty.class); private boolean isCachedValue = false; @@ -165,7 +165,7 @@ public final class KeepProperty extends Property implements CompoundDatatype { * this property */ public KeepProperty getKeep() { - KeepProperty keep = (KeepProperty) cache.fetch(this); + KeepProperty keep = (KeepProperty) CACHE.fetch(this); /* make sure setComponent() can never alter cached values */ keep.isCachedValue = true; return keep; diff --git a/src/java/org/apache/fop/fo/properties/NumberProperty.java b/src/java/org/apache/fop/fo/properties/NumberProperty.java index d54161b8d..97844d723 100644 --- a/src/java/org/apache/fop/fo/properties/NumberProperty.java +++ b/src/java/org/apache/fop/fo/properties/NumberProperty.java @@ -106,7 +106,7 @@ public final class NumberProperty extends Property implements Numeric { } /** cache holding all canonical NumberProperty instances */ - private static final PropertyCache cache // CSOK: ConstantName + private static final PropertyCache CACHE = new PropertyCache(NumberProperty.class); private final Number number; @@ -144,7 +144,7 @@ public final class NumberProperty extends Property implements Numeric { * @return the canonical NumberProperty */ public static NumberProperty getInstance(Double num) { - return (NumberProperty)cache.fetch( + return (NumberProperty)CACHE.fetch( new NumberProperty(num.doubleValue())); } @@ -155,7 +155,7 @@ public final class NumberProperty extends Property implements Numeric { * @return the canonical NumberProperty */ public static NumberProperty getInstance(Integer num) { - return (NumberProperty)cache.fetch( + return (NumberProperty)CACHE.fetch( new NumberProperty(num.intValue())); } @@ -166,7 +166,7 @@ public final class NumberProperty extends Property implements Numeric { * @return the canonical NumberProperty */ public static NumberProperty getInstance(double num) { - return (NumberProperty)cache.fetch( + return (NumberProperty)CACHE.fetch( new NumberProperty(num)); } @@ -177,7 +177,7 @@ public final class NumberProperty extends Property implements Numeric { * @return the canonical NumberProperty */ public static NumberProperty getInstance(int num) { - return (NumberProperty)cache.fetch( + return (NumberProperty)CACHE.fetch( new NumberProperty(num)); } diff --git a/src/java/org/apache/fop/fo/properties/StringProperty.java b/src/java/org/apache/fop/fo/properties/StringProperty.java index ab4544c0a..9bbe33070 100644 --- a/src/java/org/apache/fop/fo/properties/StringProperty.java +++ b/src/java/org/apache/fop/fo/properties/StringProperty.java @@ -21,11 +21,6 @@ package org.apache.fop.fo.properties; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; -import org.apache.fop.fo.FOValidationEventProducer; -import org.apache.fop.fo.ValidationException; -import org.apache.fop.fo.expr.PropertyException; - -import java.util.Set; /** * Exists primarily as a container for its Maker inner class, which is @@ -83,7 +78,7 @@ public final class StringProperty extends Property { } /** cache containing all canonical StringProperty instances */ - private static final PropertyCache cache // CSOK: ConstantName + private static final PropertyCache CACHE = new PropertyCache(StringProperty.class); /** canonical instance for empty strings */ @@ -109,7 +104,7 @@ public final class StringProperty extends Property { if ("".equals(str) || str == null) { return EMPTY_STRING_PROPERTY; } else { - return (StringProperty)cache.fetch( + return (StringProperty)CACHE.fetch( new StringProperty(str)); } } diff --git a/src/java/org/apache/fop/fonts/FontSetup.java b/src/java/org/apache/fop/fonts/FontSetup.java index 7ceef5a9c..1f49f7bb5 100644 --- a/src/java/org/apache/fop/fonts/FontSetup.java +++ b/src/java/org/apache/fop/fonts/FontSetup.java @@ -25,8 +25,6 @@ import java.util.List; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.fop.fonts.base14.Courier; import org.apache.fop.fonts.base14.CourierBold; import org.apache.fop.fonts.base14.CourierBoldOblique; @@ -56,12 +54,6 @@ public final class FontSetup { private FontSetup() { } - /** - * logging instance - */ - private static Log log // CSOK: ConstantName - = LogFactory.getLog(FontSetup.class); - /** * Sets up a font info * @param fontInfo font info diff --git a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java index a6fbdd49c..b8bbc0c6c 100644 --- a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java @@ -21,6 +21,7 @@ package org.apache.fop.layoutmgr; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.apache.fop.fo.Constants; import org.apache.fop.traits.MinOptMax; @@ -30,8 +31,7 @@ import org.apache.fop.traits.MinOptMax; */ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm { - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(BalancingColumnBreakingAlgorithm.class); + private static final Log LOG = LogFactory.getLog(BalancingColumnBreakingAlgorithm.class); private int columnCount; private int fullLen; @@ -74,8 +74,8 @@ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm { protected double computeDemerits(KnuthNode activeNode, KnuthElement element, int fitnessClass, double r) { double dem = super.computeDemerits(activeNode, element, fitnessClass, r); - if (log.isTraceEnabled()) { - log.trace("original demerit=" + dem + " " + totalWidth + if (LOG.isTraceEnabled()) { + LOG.trace("original demerit=" + dem + " " + totalWidth + " line=" + activeNode.line + "/" + columnCount + " pos=" + activeNode.position + "/" + (par.size() - 1)); } @@ -91,13 +91,13 @@ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm { if (remParts > 0) { avgRestLen = restLen / remParts; } - if (log.isTraceEnabled()) { - log.trace("remaining parts: " + remParts + " rest len: " + restLen + if (LOG.isTraceEnabled()) { + LOG.trace("remaining parts: " + remParts + " rest len: " + restLen + " avg=" + avgRestLen); } double balance = (idealPartLen - partLen) / 1000f; - if (log.isTraceEnabled()) { - log.trace("balance=" + balance); + if (LOG.isTraceEnabled()) { + LOG.trace("balance=" + balance); } double absBalance = Math.abs(balance); dem = absBalance; @@ -120,8 +120,8 @@ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm { //We don't want more columns than available dem = Double.MAX_VALUE; } - if (log.isTraceEnabled()) { - log.trace("effective dem=" + dem + " " + totalWidth); + if (LOG.isTraceEnabled()) { + LOG.trace("effective dem=" + dem + " " + totalWidth); } return dem; } diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java b/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java index 1a31f8d49..2acf67c1f 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java @@ -67,14 +67,12 @@ import org.apache.fop.fo.pagination.SideRegion; import org.apache.fop.fo.pagination.StaticContent; import org.apache.fop.fo.pagination.Title; import org.apache.fop.layoutmgr.inline.BasicLinkLayoutManager; -import org.apache.fop.layoutmgr.inline.BidiLayoutManager; import org.apache.fop.layoutmgr.inline.CharacterLayoutManager; import org.apache.fop.layoutmgr.inline.ContentLayoutManager; import org.apache.fop.layoutmgr.inline.ExternalGraphicLayoutManager; import org.apache.fop.layoutmgr.inline.FootnoteLayoutManager; import org.apache.fop.layoutmgr.inline.ICLayoutManager; import org.apache.fop.layoutmgr.inline.InlineLayoutManager; -import org.apache.fop.layoutmgr.inline.InlineLevelLayoutManager; import org.apache.fop.layoutmgr.inline.InstreamForeignObjectLM; import org.apache.fop.layoutmgr.inline.LeaderLayoutManager; import org.apache.fop.layoutmgr.inline.PageNumberCitationLastLayoutManager; @@ -93,8 +91,7 @@ import org.apache.fop.util.CharUtilities; public class LayoutManagerMapping implements LayoutManagerMaker { /** logging instance */ - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(LayoutManagerMapping.class); + private static final Log LOG = LogFactory.getLog(LayoutManagerMapping.class); /** The map of LayoutManagerMakers */ private Map makers = new HashMap(); @@ -159,10 +156,10 @@ public class LayoutManagerMapping implements LayoutManagerMaker { Maker maker = (Maker) makers.get(node.getClass()); if (maker == null) { if (FOElementMapping.URI.equals(node.getNamespaceURI())) { - log.error("No LayoutManager maker for class " + node.getClass()); + LOG.error("No LayoutManager maker for class " + node.getClass()); } else { - if (log.isDebugEnabled()) { - log.debug("Skipping the creation of a layout manager for " + node.getClass()); + if (LOG.isDebugEnabled()) { + LOG.debug("Skipping the creation of a layout manager for " + node.getClass()); } } } else { diff --git a/src/java/org/apache/fop/layoutmgr/SpaceResolver.java b/src/java/org/apache/fop/layoutmgr/SpaceResolver.java index c49bb2d9a..6890d4ebc 100644 --- a/src/java/org/apache/fop/layoutmgr/SpaceResolver.java +++ b/src/java/org/apache/fop/layoutmgr/SpaceResolver.java @@ -35,8 +35,7 @@ import org.apache.fop.traits.MinOptMax; public final class SpaceResolver { /** Logger instance */ - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(SpaceResolver.class); + private static final Log LOG = LogFactory.getLog(SpaceResolver.class); private UnresolvedListElementWithLength[] firstPart; private BreakElement breakPoss; @@ -94,25 +93,25 @@ public final class SpaceResolver { //Add pending elements from higher level FOs if (breakPoss != null) { if (breakPoss.getPendingAfterMarks() != null) { - if (log.isTraceEnabled()) { - log.trace(" adding pending before break: " + if (LOG.isTraceEnabled()) { + LOG.trace(" adding pending before break: " + breakPoss.getPendingAfterMarks()); } first.addAll(0, breakPoss.getPendingAfterMarks()); } if (breakPoss.getPendingBeforeMarks() != null) { - if (log.isTraceEnabled()) { - log.trace(" adding pending after break: " + if (LOG.isTraceEnabled()) { + LOG.trace(" adding pending after break: " + breakPoss.getPendingBeforeMarks()); } second.addAll(0, breakPoss.getPendingBeforeMarks()); } } - if (log.isTraceEnabled()) { - log.trace("before: " + first); - log.trace(" break: " + breakPoss); - log.trace("after: " + second); - log.trace("NO-BREAK: " + toString(noBreak, noBreakLengths)); + if (LOG.isTraceEnabled()) { + LOG.trace("before: " + first); + LOG.trace(" break: " + breakPoss); + LOG.trace("after: " + second); + LOG.trace("NO-BREAK: " + toString(noBreak, noBreakLengths)); } if (first != null) { @@ -164,15 +163,15 @@ public final class SpaceResolver { if (elems[effIndex] instanceof BorderOrPaddingElement) { BorderOrPaddingElement bop = (BorderOrPaddingElement)elems[effIndex]; if (bop.isConditional() && !(bop.isFirst() || bop.isLast())) { - if (log.isDebugEnabled()) { - log.debug("Nulling conditional element: " + bop); + if (LOG.isDebugEnabled()) { + LOG.debug("Nulling conditional element: " + bop); } lengths[effIndex] = null; } } } - if (log.isTraceEnabled() && elems.length > 0) { - log.trace("-->Resulting list: " + toString(elems, lengths)); + if (LOG.isTraceEnabled() && elems.length > 0) { + LOG.trace("-->Resulting list: " + toString(elems, lengths)); } } @@ -194,20 +193,20 @@ public final class SpaceResolver { } else if (!elems[effIndex].isConditional()) { break; } - if (log.isDebugEnabled()) { - log.debug("Nulling conditional element using 4.3.1, rule 1: " + elems[effIndex]); + if (LOG.isDebugEnabled()) { + LOG.debug("Nulling conditional element using 4.3.1, rule 1: " + elems[effIndex]); } lengths[effIndex] = null; } - if (log.isTraceEnabled() && elems.length > 0) { - log.trace("-->Resulting list: " + toString(elems, lengths)); + if (LOG.isTraceEnabled() && elems.length > 0) { + LOG.trace("-->Resulting list: " + toString(elems, lengths)); } } private void performSpaceResolutionRules2to3(UnresolvedListElement[] elems, MinOptMax[] lengths, int start, int end) { - if (log.isTraceEnabled()) { - log.trace("rule 2-3: " + start + "-" + end); + if (LOG.isTraceEnabled()) { + LOG.trace("rule 2-3: " + start + "-" + end); } SpaceElement space; int remaining; @@ -236,8 +235,8 @@ public final class SpaceResolver { } space = (SpaceElement)elems[i]; if (!space.isForcing()) { - if (log.isDebugEnabled()) { - log.debug("Nulling non-forcing space-specifier using 4.3.1, rule 2: " + if (LOG.isDebugEnabled()) { + LOG.debug("Nulling non-forcing space-specifier using 4.3.1, rule 2: " + elems[i]); } lengths[i] = null; @@ -256,8 +255,8 @@ public final class SpaceResolver { space = (SpaceElement)elems[i]; highestPrecedence = Math.max(highestPrecedence, space.getPrecedence()); } - if (highestPrecedence != 0 && log.isDebugEnabled()) { - log.debug("Highest precedence is " + highestPrecedence); + if (highestPrecedence != 0 && LOG.isDebugEnabled()) { + LOG.debug("Highest precedence is " + highestPrecedence); } //Suppress space-specifiers with lower precedence remaining = 0; @@ -268,8 +267,8 @@ public final class SpaceResolver { } space = (SpaceElement)elems[i]; if (space.getPrecedence() != highestPrecedence) { - if (log.isDebugEnabled()) { - log.debug("Nulling space-specifier with precedence " + if (LOG.isDebugEnabled()) { + LOG.debug("Nulling space-specifier with precedence " + space.getPrecedence() + " using 4.3.1, rule 3: " + elems[i]); } @@ -279,8 +278,8 @@ public final class SpaceResolver { remaining++; } } - if (log.isDebugEnabled()) { - log.debug("Greatest optimum: " + greatestOptimum); + if (LOG.isDebugEnabled()) { + LOG.debug("Greatest optimum: " + greatestOptimum); } if (remaining <= 1) { return; @@ -293,8 +292,8 @@ public final class SpaceResolver { } space = (SpaceElement)elems[i]; if (space.getLength().getOpt() < greatestOptimum) { - if (log.isDebugEnabled()) { - log.debug("Nulling space-specifier with smaller optimum length " + if (LOG.isDebugEnabled()) { + LOG.debug("Nulling space-specifier with smaller optimum length " + "using 4.3.1, rule 3: " + elems[i]); } @@ -317,8 +316,8 @@ public final class SpaceResolver { min = Math.max(min, space.getLength().getMin()); max = Math.min(max, space.getLength().getMax()); if (remaining > 1) { - if (log.isDebugEnabled()) { - log.debug("Nulling non-last space-specifier using 4.3.1, rule 3, second part: " + if (LOG.isDebugEnabled()) { + LOG.debug("Nulling non-last space-specifier using 4.3.1, rule 3, second part: " + elems[i]); } lengths[i] = null; @@ -328,9 +327,9 @@ public final class SpaceResolver { } } - if (log.isTraceEnabled() && elems.length > 0) { - log.trace("Remaining spaces: " + remaining); - log.trace("-->Resulting list: " + toString(elems, lengths)); + if (LOG.isTraceEnabled() && elems.length > 0) { + LOG.trace("Remaining spaces: " + remaining); + LOG.trace("-->Resulting list: " + toString(elems, lengths)); } } @@ -390,7 +389,7 @@ public final class SpaceResolver { if (hasFirstPart()) { //Now that we've handled isFirst/isLast conditions, we need to look at the //active part in its normal order so swap it back. - log.trace("Swapping first and second parts."); + LOG.trace("Swapping first and second parts."); UnresolvedListElementWithLength[] tempList; MinOptMax[] tempLengths; tempList = secondPart; @@ -598,8 +597,8 @@ public final class SpaceResolver { * @param elems the element list */ public static void resolveElementList(List elems) { - if (log.isTraceEnabled()) { - log.trace(elems); + if (LOG.isTraceEnabled()) { + LOG.trace(elems); } boolean first = true; boolean last = false; @@ -611,8 +610,8 @@ public final class SpaceResolver { while (iter.hasNext()) { ListElement el = (ListElement)iter.next(); if (el.isUnresolvedElement()) { - if (log.isTraceEnabled()) { - log.trace("unresolved found: " + el + " " + first + "/" + last); + if (LOG.isTraceEnabled()) { + LOG.trace("unresolved found: " + el + " " + first + "/" + last); } BreakElement breakPoss = null; //Clear temp lists @@ -649,7 +648,7 @@ public final class SpaceResolver { } //last = !iter.hasNext(); if (breakPoss == null && unresolvedSecond.size() == 0 && !last) { - log.trace("Swap first and second parts in no-break condition," + LOG.trace("Swap first and second parts in no-break condition," + " second part is empty."); //The first list is reversed, so swap if this shouldn't happen List swapList = unresolvedSecond; @@ -657,7 +656,7 @@ public final class SpaceResolver { unresolvedFirst = swapList; } - log.debug("----start space resolution (first=" + first + ", last=" + last + ")..."); + LOG.debug("----start space resolution (first=" + first + ", last=" + last + ")..."); SpaceResolver resolver = new SpaceResolver( unresolvedFirst, breakPoss, unresolvedSecond, first, last); if (!last) { @@ -667,7 +666,7 @@ public final class SpaceResolver { if (!last && skipNextElement) { iter.next(); } - log.debug("----end space resolution."); + LOG.debug("----end space resolution."); } first = false; } diff --git a/src/java/org/apache/fop/layoutmgr/TraitSetter.java b/src/java/org/apache/fop/layoutmgr/TraitSetter.java index 800850177..6039ad941 100644 --- a/src/java/org/apache/fop/layoutmgr/TraitSetter.java +++ b/src/java/org/apache/fop/layoutmgr/TraitSetter.java @@ -45,8 +45,7 @@ public final class TraitSetter { } /** logger */ - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(TraitSetter.class); + private static final Log LOG = LogFactory.getLog(TraitSetter.class); /** * Sets border and padding traits on areas. @@ -343,7 +342,7 @@ public final class TraitSetter { + backProps.backgroundPositionHorizontal.getValue(refContext)); } else { // TODO Area IPD has to be set for this to work - log.warn("Horizontal background image positioning ignored" + LOG.warn("Horizontal background image positioning ignored" + " because the IPD was not set on the area." + " (Yes, it's a bug in FOP)"); } @@ -360,7 +359,7 @@ public final class TraitSetter { + backProps.backgroundPositionVertical.getValue(refContext)); } else { // TODO Area BPD has to be set for this to work - log.warn("Vertical background image positioning ignored" + LOG.warn("Vertical background image positioning ignored" + " because the BPD was not set on the area." + " (Yes, it's a bug in FOP)"); } @@ -411,7 +410,7 @@ public final class TraitSetter { back.setHoriz(horizontal); } else { //TODO Area IPD has to be set for this to work - log.warn("Horizontal background image positioning ignored" + LOG.warn("Horizontal background image positioning ignored" + " because the IPD was not set on the area." + " (Yes, it's a bug in FOP)"); } @@ -435,7 +434,7 @@ public final class TraitSetter { back.setVertical(vertical); } else { //TODO Area BPD has to be set for this to work - log.warn("Vertical background image positioning ignored" + LOG.warn("Vertical background image positioning ignored" + " because the BPD was not set on the area." + " (Yes, it's a bug in FOP)"); } diff --git a/src/java/org/apache/fop/layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java index c2dde9f9e..e090fbae6 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java @@ -30,7 +30,6 @@ import org.apache.fop.fonts.Font; import org.apache.fop.fonts.FontInfo; import org.apache.fop.fonts.FontTriplet; import org.apache.fop.layoutmgr.LayoutContext; -import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.PositionIterator; import org.apache.fop.layoutmgr.TraitSetter; diff --git a/src/java/org/apache/fop/layoutmgr/inline/BasicScaledBaselineTable.java b/src/java/org/apache/fop/layoutmgr/inline/BasicScaledBaselineTable.java index f2664ed1c..467f2e154 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/BasicScaledBaselineTable.java +++ b/src/java/org/apache/fop/layoutmgr/inline/BasicScaledBaselineTable.java @@ -21,9 +21,7 @@ package org.apache.fop.layoutmgr.inline; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.fop.datatypes.Length; -import org.apache.fop.datatypes.LengthBase; -import org.apache.fop.datatypes.SimplePercentBaseContext; + import org.apache.fop.fo.Constants; diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java index 3eed124b2..49c97b7b6 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java @@ -23,6 +23,7 @@ import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.apache.fop.layoutmgr.Position; /** @@ -31,8 +32,7 @@ import org.apache.fop.layoutmgr.Position; public class LineLayoutPossibilities { /** logger instance */ - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(LineLayoutPossibilities.class); + private static final Log LOG = LogFactory.getLog(LineLayoutPossibilities.class); private final class Possibility { private int lineCount; @@ -157,7 +157,7 @@ public class LineLayoutPossibilities { possibilitiesList.set(index, restoredPossibility); } else { // this should not happen - log.error("LineLayoutPossibilities restorePossibilities()," + LOG.error("LineLayoutPossibilities restorePossibilities()," + " min= " + getMinLineCount() + " max= " + getMaxLineCount() + " restored= " + restoredPossibility.getLineCount()); @@ -258,12 +258,12 @@ public class LineLayoutPossibilities { && adj <= (getMaxLineCount() - getChosenLineCount()) && getLineCount(chosenIndex + adj) == getChosenLineCount() + adj) { chosenIndex += adj; - log.debug("chosenLineCount= " + (getChosenLineCount() - adj) + " adjustment= " + adj + LOG.debug("chosenLineCount= " + (getChosenLineCount() - adj) + " adjustment= " + adj + " => chosenLineCount= " + getLineCount(chosenIndex)); return adj; } else { // this should not happen! - log.warn("Cannot apply the desired line count adjustment."); + LOG.warn("Cannot apply the desired line count adjustment."); return 0; } } diff --git a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java index 62041e888..b9f786c97 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java @@ -25,7 +25,6 @@ import org.apache.fop.area.inline.TextArea; import org.apache.fop.area.inline.UnresolvedPageNumber; import org.apache.fop.fo.flow.PageNumberCitation; import org.apache.fop.layoutmgr.LayoutContext; -import org.apache.fop.layoutmgr.LayoutManager; /** * LayoutManager for the fo:page-number-citation formatting object diff --git a/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java b/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java index a2a1dce27..19a1a1f8a 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java +++ b/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java @@ -19,8 +19,6 @@ package org.apache.fop.layoutmgr.inline; -import org.apache.fop.datatypes.Length; - /** * The FOP specific incarnation of the XSL-FO scaled baseline table. * All baseline tables are scaled to the font size of the font they diff --git a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java index 1a3297ad5..db5b4736c 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java @@ -55,8 +55,7 @@ import org.apache.fop.util.BreakUtil; public class TableContentLayoutManager implements PercentBaseContext { /** Logger **/ - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(TableContentLayoutManager.class); + private static final Log LOG = LogFactory.getLog(TableContentLayoutManager.class); private TableLayoutManager tableLM; private TableRowIterator bodyIter; @@ -138,8 +137,8 @@ public class TableContentLayoutManager implements PercentBaseContext { * @see org.apache.fop.layoutmgr.LayoutManager#getNextKnuthElements(LayoutContext, int) */ public List getNextKnuthElements(LayoutContext context, int alignment) { - if (log.isDebugEnabled()) { - log.debug("==> Columns: " + getTableLM().getColumns()); + if (LOG.isDebugEnabled()) { + LOG.debug("==> Columns: " + getTableLM().getColumns()); } KnuthBox headerAsFirst = null; KnuthBox headerAsSecondToLast = null; @@ -149,8 +148,8 @@ public class TableContentLayoutManager implements PercentBaseContext { headerIter, context, alignment, TableRowIterator.HEADER); this.headerNetHeight = ElementListUtils.calcContentLength(this.headerList); - if (log.isDebugEnabled()) { - log.debug("==> Header: " + if (LOG.isDebugEnabled()) { + LOG.debug("==> Header: " + headerNetHeight + " - " + this.headerList); } TableHeaderFooterPosition pos = new TableHeaderFooterPosition( @@ -169,8 +168,8 @@ public class TableContentLayoutManager implements PercentBaseContext { footerIter, context, alignment, TableRowIterator.FOOTER); this.footerNetHeight = ElementListUtils.calcContentLength(this.footerList); - if (log.isDebugEnabled()) { - log.debug("==> Footer: " + if (LOG.isDebugEnabled()) { + LOG.debug("==> Footer: " + footerNetHeight + " - " + this.footerList); } //We can simply add the table footer at the end of the whole list @@ -378,14 +377,14 @@ public class TableContentLayoutManager implements PercentBaseContext { } else if (pos instanceof TableContentPosition) { tablePositions.add(pos); } else { - if (log.isDebugEnabled()) { - log.debug("Ignoring position: " + pos); + if (LOG.isDebugEnabled()) { + LOG.debug("Ignoring position: " + pos); } } } if (lastPos instanceof TableHFPenaltyPosition) { TableHFPenaltyPosition penaltyPos = (TableHFPenaltyPosition)lastPos; - log.debug("Break at penalty!"); + LOG.debug("Break at penalty!"); if (penaltyPos.headerElements != null) { //Header positions for the penalty position are in the last element and need to //be handled first before all other TableContentPositions @@ -411,7 +410,7 @@ public class TableContentLayoutManager implements PercentBaseContext { if (tablePositions.isEmpty()) { // TODO make sure this actually never happens - log.error("tablePositions empty." + LOG.error("tablePositions empty." + " Please send your FO file to fop-users@xmlgraphics.apache.org"); } else { // Here we are sure that posIter iterates only over TableContentPosition instances diff --git a/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java b/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java index 282cd0fd5..35cba6da6 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java @@ -28,8 +28,6 @@ import org.apache.fop.fo.FONode.FONodeIterator; import org.apache.fop.fo.flow.table.EffRow; import org.apache.fop.fo.flow.table.Table; import org.apache.fop.fo.flow.table.TableBody; -import org.apache.fop.fo.flow.table.TablePart; - /** * Iterator that lets the table layout manager step over all the rows of a part of the diff --git a/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java b/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java index db9a49271..24a471e1e 100644 --- a/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java +++ b/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java @@ -21,17 +21,11 @@ package org.apache.fop.pdf; import java.util.Date; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * This class represents an embedded file stream. */ public class PDFEmbeddedFile extends PDFStream { - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(PDFEmbeddedFile.class.getName()); - /** * Creates a new embedded file stream. */ diff --git a/src/java/org/apache/fop/pdf/PDFEncryptionJCE.java b/src/java/org/apache/fop/pdf/PDFEncryptionJCE.java index 90b530774..269f0639d 100644 --- a/src/java/org/apache/fop/pdf/PDFEncryptionJCE.java +++ b/src/java/org/apache/fop/pdf/PDFEncryptionJCE.java @@ -21,7 +21,6 @@ package org.apache.fop.pdf; // Java import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; import java.security.InvalidKeyException; import java.security.MessageDigest; diff --git a/src/java/org/apache/fop/pdf/PDFEncryptionManager.java b/src/java/org/apache/fop/pdf/PDFEncryptionManager.java index 60844c588..3f5ae2a3d 100644 --- a/src/java/org/apache/fop/pdf/PDFEncryptionManager.java +++ b/src/java/org/apache/fop/pdf/PDFEncryptionManager.java @@ -37,8 +37,7 @@ public final class PDFEncryptionManager { } /** logging instance */ - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(PDFEncryptionManager.class); + private static final Log LOG = LogFactory.getLog(PDFEncryptionManager.class); /** * Indicates whether JCE is available. @@ -64,12 +63,12 @@ public final class PDFEncryptionManager { Provider[] providers; providers = Security.getProviders("Cipher.RC4"); if (providers == null) { - log.warn("Cipher provider for RC4 not available."); + LOG.warn("Cipher provider for RC4 not available."); return false; } providers = Security.getProviders("MessageDigest.MD5"); if (providers == null) { - log.warn("MessageDigest provider for MD5 not available."); + LOG.warn("MessageDigest provider for MD5 not available."); return false; } return true; @@ -92,13 +91,13 @@ public final class PDFEncryptionManager { if (params != null) { if (!checkAvailableAlgorithms()) { if (isJCEAvailable()) { - log.warn("PDF encryption has been requested, JCE is " + LOG.warn("PDF encryption has been requested, JCE is " + "available but there's no " + "JCE provider available that provides the " + "necessary algorithms. The PDF won't be " + "encrypted."); } else { - log.warn("PDF encryption has been requested but JCE is " + LOG.warn("PDF encryption has been requested but JCE is " + "unavailable! The PDF won't be encrypted."); } } @@ -123,19 +122,19 @@ public final class PDFEncryptionManager { return (PDFEncryption)obj; } catch (ClassNotFoundException e) { if (checkAvailableAlgorithms()) { - log.warn("JCE and algorithms available, but the " + LOG.warn("JCE and algorithms available, but the " + "implementation class unavailable. Please do a full " + "rebuild."); } return null; } catch (NoSuchMethodException e) { - log.error(e); + LOG.error(e); return null; } catch (IllegalAccessException e) { - log.error(e); + LOG.error(e); return null; } catch (InvocationTargetException e) { - log.error(e); + LOG.error(e); return null; } } diff --git a/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java b/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java index aad31f18e..a03aaf816 100644 --- a/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java +++ b/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java @@ -35,8 +35,7 @@ import org.apache.fop.render.afp.extensions.AFPElementMapping; * Parses any AFP foreign attributes */ public class AFPForeignAttributeReader { - private static final Log log // CSOK: ConstantName - = LogFactory.getLog("org.apache.xmlgraphics.afp"); + private static final Log LOG = LogFactory.getLog("org.apache.xmlgraphics.afp"); /** the resource-name attribute */ public static final QName RESOURCE_NAME = new QName( @@ -95,7 +94,7 @@ public class AFPForeignAttributeReader { = (String)foreignAttributes.get(RESOURCE_GROUP_FILE); if (resourceGroupFile == null) { String msg = RESOURCE_GROUP_FILE + " not specified"; - log.error(msg); + LOG.error(msg); throw new UnsupportedOperationException(msg); } File resourceExternalGroupFile = new File(resourceGroupFile); @@ -107,20 +106,20 @@ public class AFPForeignAttributeReader { } catch (SecurityException ex) { String msg = "unable to gain write access to external resource file: " + resourceGroupFile; - log.error(msg); + LOG.error(msg); } try { boolean exists = resourceExternalGroupFile.exists(); if (exists) { - log.warn("overwriting external resource file: " + LOG.warn("overwriting external resource file: " + resourceGroupFile); } resourceLevel.setExternalFilePath(resourceGroupFile); } catch (SecurityException ex) { String msg = "unable to gain read access to external resource file: " + resourceGroupFile; - log.error(msg); + LOG.error(msg); } } } 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 b14a4eb9d..a82fe3457 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java @@ -19,8 +19,6 @@ package org.apache.fop.render.afp.extensions; -import java.net.URI; - import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; diff --git a/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java b/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java index cd15a9d72..b156b6c3a 100644 --- a/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java +++ b/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java @@ -19,9 +19,6 @@ package org.apache.fop.render.intermediate; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import org.apache.fop.apps.FOUserAgent; /** @@ -29,9 +26,6 @@ import org.apache.fop.apps.FOUserAgent; */ public abstract class AbstractIFDocumentHandler implements IFDocumentHandler { - /** logging instance */ - private static Log log = LogFactory.getLog(AbstractIFDocumentHandler.class); - private IFContext ifContext; /** diff --git a/src/java/org/apache/fop/render/java2d/Java2DPainter.java b/src/java/org/apache/fop/render/java2d/Java2DPainter.java index a2b9c9613..396645768 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DPainter.java +++ b/src/java/org/apache/fop/render/java2d/Java2DPainter.java @@ -33,9 +33,6 @@ import java.util.Stack; import org.w3c.dom.Document; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import org.apache.fop.fonts.Font; import org.apache.fop.fonts.FontInfo; import org.apache.fop.fonts.FontTriplet; @@ -54,9 +51,6 @@ import org.apache.fop.util.CharUtilities; */ public class Java2DPainter extends AbstractIFPainter { - /** logging instance */ - private static Log log = LogFactory.getLog(Java2DPainter.class); - /** the IF context */ protected IFContext ifContext; diff --git a/src/java/org/apache/fop/render/pcl/HardcodedFonts.java b/src/java/org/apache/fop/render/pcl/HardcodedFonts.java index 429d36167..185e1ece5 100644 --- a/src/java/org/apache/fop/render/pcl/HardcodedFonts.java +++ b/src/java/org/apache/fop/render/pcl/HardcodedFonts.java @@ -34,8 +34,7 @@ final class HardcodedFonts { } /** logging instance */ - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(HardcodedFonts.class); + private static final Log LOG = LogFactory.getLog(HardcodedFonts.class); /** * Sets the current font (NOTE: Hard-coded font mappings ATM!) @@ -62,7 +61,7 @@ final class HardcodedFonts { try { fontcode = Integer.parseInt(name.substring(1)); } catch (Exception e) { - log.error(e); + LOG.error(e); } } //Note "(ON" selects ISO 8859-1 symbol set as used by PCLGenerator diff --git a/src/java/org/apache/fop/render/pcl/PCLPainter.java b/src/java/org/apache/fop/render/pcl/PCLPainter.java index d0e82ed7d..00b25a5e3 100644 --- a/src/java/org/apache/fop/render/pcl/PCLPainter.java +++ b/src/java/org/apache/fop/render/pcl/PCLPainter.java @@ -34,9 +34,6 @@ import java.util.Stack; import org.w3c.dom.Document; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import org.apache.xmlgraphics.image.loader.ImageException; import org.apache.xmlgraphics.image.loader.ImageInfo; import org.apache.xmlgraphics.image.loader.ImageProcessingHints; @@ -65,9 +62,6 @@ import org.apache.fop.util.CharUtilities; */ public class PCLPainter extends AbstractIFPainter implements PCLConstants { - /** logging instance */ - private static Log log = LogFactory.getLog(PCLPainter.class); - private static final boolean DEBUG = false; private PCLDocumentHandler parent; diff --git a/src/java/org/apache/fop/render/pcl/PCLRendererContext.java b/src/java/org/apache/fop/render/pcl/PCLRendererContext.java index 6c2c592b1..d54973ac8 100644 --- a/src/java/org/apache/fop/render/pcl/PCLRendererContext.java +++ b/src/java/org/apache/fop/render/pcl/PCLRendererContext.java @@ -19,9 +19,6 @@ package org.apache.fop.render.pcl; -import org.apache.xmlgraphics.util.QName; - -import org.apache.fop.fo.extensions.ExtensionElementMapping; import org.apache.fop.render.ImageHandlerUtil; import org.apache.fop.render.RendererContext; diff --git a/src/java/org/apache/fop/render/pdf/PDFBorderPainter.java b/src/java/org/apache/fop/render/pdf/PDFBorderPainter.java index 10db33b0f..287f89607 100644 --- a/src/java/org/apache/fop/render/pdf/PDFBorderPainter.java +++ b/src/java/org/apache/fop/render/pdf/PDFBorderPainter.java @@ -37,8 +37,7 @@ import org.apache.fop.util.ColorUtil; public class PDFBorderPainter extends BorderPainter { /** logging instance */ - private static final Log log // CSOK: ConstantName - = LogFactory.getLog(PDFBorderPainter.class); + private static final Log LOG = LogFactory.getLog(PDFBorderPainter.class); private PDFContentGenerator generator; @@ -70,7 +69,7 @@ public class PDFBorderPainter extends BorderPainter { float w = x2 - x1; float h = y2 - y1; if ((w < 0) || (h < 0)) { - log.error("Negative extent received (w=" + w + ", h=" + h + LOG.error("Negative extent received (w=" + w + ", h=" + h + "). Border won't be painted."); return; } diff --git a/src/java/org/apache/fop/render/ps/PSSVGHandler.java b/src/java/org/apache/fop/render/ps/PSSVGHandler.java index 5cc1a1b01..66b26fb33 100644 --- a/src/java/org/apache/fop/render/ps/PSSVGHandler.java +++ b/src/java/org/apache/fop/render/ps/PSSVGHandler.java @@ -30,8 +30,6 @@ import org.apache.avalon.framework.configuration.Configuration; import org.apache.batik.bridge.BridgeContext; import org.apache.batik.bridge.GVTBuilder; import org.apache.batik.gvt.GraphicsNode; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.xmlgraphics.java2d.ps.PSGraphics2D; import org.apache.xmlgraphics.ps.PSGenerator; @@ -57,9 +55,6 @@ import org.apache.fop.svg.SVGUserAgent; public class PSSVGHandler extends AbstractGenericSVGHandler implements PSRendererContextConstants { - /** logging instance */ - private static Log log = LogFactory.getLog(PSSVGHandler.class); - /** * Create a new PostScript XML handler for use by the PostScript renderer. */ 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 f44199bee..13748a3bf 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 @@ -26,9 +26,8 @@ package org.apache.fop.render.rtf.rtflib.rtfdoc; * the FOP project. */ -import java.io.Writer; import java.io.IOException; -import java.util.Date; +import java.io.Writer; import java.util.Random; /** diff --git a/src/sandbox/org/apache/fop/render/svg/SVGPainter.java b/src/sandbox/org/apache/fop/render/svg/SVGPainter.java index 2477099a4..bcc3a6913 100644 --- a/src/sandbox/org/apache/fop/render/svg/SVGPainter.java +++ b/src/sandbox/org/apache/fop/render/svg/SVGPainter.java @@ -34,17 +34,14 @@ import org.w3c.dom.Document; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import org.apache.xmlgraphics.image.loader.ImageException; import org.apache.xmlgraphics.image.loader.ImageInfo; import org.apache.xmlgraphics.image.loader.ImageManager; import org.apache.xmlgraphics.image.loader.ImageSessionContext; import org.apache.xmlgraphics.xmp.Metadata; -import org.apache.fop.apps.MimeConstants; import org.apache.fop.ResourceEventProducer; +import org.apache.fop.apps.MimeConstants; import org.apache.fop.render.ImageHandlerUtil; import org.apache.fop.render.RenderingContext; import org.apache.fop.render.intermediate.AbstractIFPainter; @@ -64,9 +61,6 @@ import org.apache.fop.util.XMLUtil; */ public class SVGPainter extends AbstractIFPainter implements SVGConstants { - /** logging instance */ - private static Log log = LogFactory.getLog(SVGPainter.class); - private AbstractSVGDocumentHandler parent; /** The SAX content handler that receives the generated XML events. */ diff --git a/test/java/org/apache/fop/GenericFOPTestCase.java b/test/java/org/apache/fop/GenericFOPTestCase.java index 26053cdad..5b51a34e1 100644 --- a/test/java/org/apache/fop/GenericFOPTestCase.java +++ b/test/java/org/apache/fop/GenericFOPTestCase.java @@ -31,12 +31,13 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; -import org.apache.fop.apps.Fop; +import org.xml.sax.InputSource; + import org.apache.fop.apps.FOUserAgent; +import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; import org.apache.fop.util.DigestFilter; -import org.xml.sax.InputSource; /** * Framework for simple regression testing. @@ -76,8 +77,8 @@ public final class GenericFOPTestCase extends TestCase { public void testSimple() throws Exception { final String digestIn = "17bf13298796065f7775db8707133aeb"; final String digestOut = "e2761f51152f6663911e567901596707"; - final String fo = - "" + final String fo + = "" + " " + " " @@ -118,8 +119,8 @@ public final class GenericFOPTestCase extends TestCase { FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); foUserAgent.setCreationDate(new Date(10000)); MessageDigest outDigest = MessageDigest.getInstance("MD5"); - DigestOutputStream out = - new DigestOutputStream(new ByteArrayOutputStream(), outDigest); + DigestOutputStream out + = new DigestOutputStream(new ByteArrayOutputStream(), outDigest); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out); InputSource source = new InputSource(new StringReader(fo)); DigestFilter filter = new DigestFilter("MD5"); diff --git a/test/java/org/apache/fop/config/BaseUserConfigTestCase.java b/test/java/org/apache/fop/config/BaseUserConfigTestCase.java index 5c803317e..6ce833312 100644 --- a/test/java/org/apache/fop/config/BaseUserConfigTestCase.java +++ b/test/java/org/apache/fop/config/BaseUserConfigTestCase.java @@ -100,7 +100,7 @@ public abstract class BaseUserConfigTestCase extends BasePDFTestCase { /** * @return user config File */ - abstract protected String getUserConfigFilename(); + protected abstract String getUserConfigFilename(); /* * @see junit.framework.TestCase#getName() diff --git a/test/java/org/apache/fop/events/EventChecker.java b/test/java/org/apache/fop/events/EventChecker.java index 767c590ed..afef11d87 100644 --- a/test/java/org/apache/fop/events/EventChecker.java +++ b/test/java/org/apache/fop/events/EventChecker.java @@ -40,7 +40,7 @@ class EventChecker extends Assert implements EventListener { if (event.getEventID().equals(expectedEventID)) { eventReceived = true; } else { - fail("Unexpected event: id = " + event.getEventID() + ": "+ msg); + fail("Unexpected event: id = " + event.getEventID() + ": " + msg); } } diff --git a/test/java/org/apache/fop/memory/Stats.java b/test/java/org/apache/fop/memory/Stats.java index 9e371251d..354952347 100644 --- a/test/java/org/apache/fop/memory/Stats.java +++ b/test/java/org/apache/fop/memory/Stats.java @@ -71,7 +71,7 @@ class Stats { public void dumpFinalStats() { long duration = System.currentTimeMillis() - startTime; System.out.println("Final statistics"); - System.out.println("Pages produced: " +totalPagesProduced); + System.out.println("Pages produced: " + totalPagesProduced); long ppm = 60000 * totalPagesProduced / duration; System.out.println("Average speed: " + ppm + "ppm"); } diff --git a/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java b/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java index f5d2f84cf..bd5c8ade1 100644 --- a/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java +++ b/test/java/org/apache/fop/render/pdf/PDFCMapTestCase.java @@ -27,38 +27,38 @@ import org.apache.fop.pdf.CMapBuilder; /** Simple sanity test of the PDFCmap class */ public class PDFCMapTestCase extends TestCase { + private static final String EOL = "\n"; public void testPDFCMapFillInPDF() throws Exception { - final String EOL = "\n"; - final String expected = - "%!PS-Adobe-3.0 Resource-CMap" + EOL - +"%%DocumentNeededResources: ProcSet (CIDInit)" + EOL - +"%%IncludeResource: ProcSet (CIDInit)" + EOL - +"%%BeginResource: CMap (test)" + EOL - +"%%EndComments" + EOL - +"/CIDInit /ProcSet findresource begin" + EOL - +"12 dict begin" + EOL - +"begincmap" + EOL - +"/CIDSystemInfo 3 dict dup begin" + EOL - +" /Registry (Adobe) def" + EOL - +" /Ordering (Identity) def" + EOL - +" /Supplement 0 def" + EOL - +"end def" + EOL - +"/CMapVersion 1 def" + EOL - +"/CMapType 1 def" + EOL - +"/CMapName /test def" + EOL - +"1 begincodespacerange" + EOL - +"<0000> " + EOL - +"endcodespacerange" + EOL - +"1 begincidrange" + EOL - +"<0000> 0" + EOL - +"endcidrange" + EOL - +"endcmap" + EOL - +"CMapName currentdict /CMap defineresource pop" + EOL - +"end" + EOL - +"end" + EOL - +"%%EndResource" + EOL - +"%%EOF" + EOL + final String expected + = "%!PS-Adobe-3.0 Resource-CMap" + EOL + + "%%DocumentNeededResources: ProcSet (CIDInit)" + EOL + + "%%IncludeResource: ProcSet (CIDInit)" + EOL + + "%%BeginResource: CMap (test)" + EOL + + "%%EndComments" + EOL + + "/CIDInit /ProcSet findresource begin" + EOL + + "12 dict begin" + EOL + + "begincmap" + EOL + + "/CIDSystemInfo 3 dict dup begin" + EOL + + " /Registry (Adobe) def" + EOL + + " /Ordering (Identity) def" + EOL + + " /Supplement 0 def" + EOL + + "end def" + EOL + + "/CMapVersion 1 def" + EOL + + "/CMapType 1 def" + EOL + + "/CMapName /test def" + EOL + + "1 begincodespacerange" + EOL + + "<0000> " + EOL + + "endcodespacerange" + EOL + + "1 begincidrange" + EOL + + "<0000> 0" + EOL + + "endcidrange" + EOL + + "endcmap" + EOL + + "CMapName currentdict /CMap defineresource pop" + EOL + + "end" + EOL + + "end" + EOL + + "%%EndResource" + EOL + + "%%EOF" + EOL ; final StringWriter w = new StringWriter(); diff --git a/test/java/org/apache/fop/util/DigestFilter.java b/test/java/org/apache/fop/util/DigestFilter.java index 0384b42df..94e8d67d2 100644 --- a/test/java/org/apache/fop/util/DigestFilter.java +++ b/test/java/org/apache/fop/util/DigestFilter.java @@ -43,7 +43,7 @@ import org.xml.sax.helpers.XMLFilterImpl; public class DigestFilter extends XMLFilterImpl { private MessageDigest digest; - private byte value[]; + private byte[] value; private boolean isNamespaceAware; public DigestFilter(String algorithm) throws NoSuchAlgorithmException { @@ -133,7 +133,7 @@ public class DigestFilter extends XMLFilterImpl { */ public void setFeature(String feature, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { - if(feature.equals("http://xml.org/sax/features/namespaces")) { + if (feature.equals("http://xml.org/sax/features/namespaces")) { isNamespaceAware = value; } super.setFeature(feature, value); -- cgit v1.2.3 From f7710aa99b02a11b0cdffdc695d1b05ec2dbe6a9 Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Fri, 27 Aug 2010 13:31:41 +0000 Subject: Replaced @asf.todo with normal TODO comment git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@990148 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/area/DestinationData.java | 2 +- src/java/org/apache/fop/fo/FOPropertyMapping.java | 2 +- src/java/org/apache/fop/fo/FObj.java | 2 +- src/java/org/apache/fop/fo/flow/Footnote.java | 4 ++-- src/java/org/apache/fop/fo/flow/Leader.java | 2 +- src/java/org/apache/fop/fo/flow/ListItem.java | 2 +- src/java/org/apache/fop/fo/flow/Marker.java | 2 +- src/java/org/apache/fop/fo/flow/MultiCase.java | 2 +- src/java/org/apache/fop/fo/flow/table/TableAndCaption.java | 2 +- src/java/org/apache/fop/fo/pagination/PageSequence.java | 2 +- src/java/org/apache/fop/fo/properties/CharacterProperty.java | 2 +- src/java/org/apache/fop/hyphenation/ByteVector.java | 4 ++-- src/java/org/apache/fop/hyphenation/HyphenationException.java | 2 +- src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java | 2 +- src/java/org/apache/fop/layoutmgr/LayoutException.java | 2 +- src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java | 2 +- .../fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java | 2 +- .../apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java | 2 +- .../org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java | 2 +- .../org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java | 2 +- 20 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src/java/org/apache/fop/fo/pagination') diff --git a/src/java/org/apache/fop/area/DestinationData.java b/src/java/org/apache/fop/area/DestinationData.java index 75b981fb7..f8d906b91 100644 --- a/src/java/org/apache/fop/area/DestinationData.java +++ b/src/java/org/apache/fop/area/DestinationData.java @@ -98,7 +98,7 @@ public class DestinationData extends AbstractOffDocumentItem implements Resolvab * object that corresponds to the IDRef * * {@inheritDoc} List) - * @asf.todo check to make sure it works if multiple bookmark-items + * TODO check to make sure it works if multiple bookmark-items * have the same idref */ public void resolveIDRef(String id, List pages) { diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java index 8293180cf..c711a76c0 100644 --- a/src/java/org/apache/fop/fo/FOPropertyMapping.java +++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java @@ -72,7 +72,7 @@ import org.apache.fop.fo.properties.XMLLangShorthandParser; * This class creates and returns an array of Property.Maker instances * indexed by the PR_* propId from Constants.java. * - * @asf.todo Check multi-threading safety of the statics below + * TODO Check multi-threading safety of the statics below */ public final class FOPropertyMapping implements Constants { diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index cb265b008..34e29a58a 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -255,7 +255,7 @@ public abstract class FObj extends FONode implements Constants { /** * Check if this formatting object generates reference areas. * @return true if generates reference areas - * @asf.todo see if needed + * TODO see if needed */ public boolean generatesReferenceAreas() { return false; diff --git a/src/java/org/apache/fop/fo/flow/Footnote.java b/src/java/org/apache/fop/fo/flow/Footnote.java index 9967a54d8..51d2581cd 100644 --- a/src/java/org/apache/fop/fo/flow/Footnote.java +++ b/src/java/org/apache/fop/fo/flow/Footnote.java @@ -76,9 +76,9 @@ public class Footnote extends FObj { /** * {@inheritDoc} *
XSL Content Model: (inline,footnote-body) - * @asf.todo implement additional constraint: A fo:footnote is not permitted + * TODO implement additional constraint: A fo:footnote is not permitted * to have a fo:float, fo:footnote, or fo:marker as a descendant. - * @asf.todo implement additional constraint: A fo:footnote is not + * TODO implement additional constraint: A fo:footnote is not * permitted to have as a descendant a fo:block-container that * generates an absolutely positioned area. */ diff --git a/src/java/org/apache/fop/fo/flow/Leader.java b/src/java/org/apache/fop/fo/flow/Leader.java index 1b32e3f1e..54027514c 100644 --- a/src/java/org/apache/fop/fo/flow/Leader.java +++ b/src/java/org/apache/fop/fo/flow/Leader.java @@ -30,7 +30,7 @@ import org.apache.fop.fo.properties.LengthRangeProperty; * fo:leader object. * The main property of fo:leader is leader-pattern. * The following patterns are treated: rule, space, dots and use-content. - * @asf.todo implement validateChildNode() + * TODO implement validateChildNode() */ public class Leader extends InlineLevel { // The value of properties relevant for fo:leader. diff --git a/src/java/org/apache/fop/fo/flow/ListItem.java b/src/java/org/apache/fop/fo/flow/ListItem.java index 3f714dbd8..c4a2aa64b 100644 --- a/src/java/org/apache/fop/fo/flow/ListItem.java +++ b/src/java/org/apache/fop/fo/flow/ListItem.java @@ -119,7 +119,7 @@ public class ListItem extends FObj implements BreakPropertySet { /** * {@inheritDoc} - * @asf.todo see if can/should rely on base class for this + * TODO see if can/should rely on base class for this * (i.e., add to childNodes instead) */ public void addChildNode(FONode child) { diff --git a/src/java/org/apache/fop/fo/flow/Marker.java b/src/java/org/apache/fop/fo/flow/Marker.java index d8f69af28..4588a9df3 100644 --- a/src/java/org/apache/fop/fo/flow/Marker.java +++ b/src/java/org/apache/fop/fo/flow/Marker.java @@ -110,7 +110,7 @@ public class Marker extends FObjMixed { *
Additionally: "An fo:marker may contain any formatting objects that * are permitted as a replacement of any fo:retrieve-marker that retrieves * the fo:marker's children." - * @asf.todo implement "additional" constraint, possibly within fo:retrieve-marker + * TODO implement "additional" constraint, possibly within fo:retrieve-marker */ protected void validateChildNode(Locator loc, String nsURI, String localName) throws ValidationException { diff --git a/src/java/org/apache/fop/fo/flow/MultiCase.java b/src/java/org/apache/fop/fo/flow/MultiCase.java index 76bded0be..ac965dffb 100644 --- a/src/java/org/apache/fop/fo/flow/MultiCase.java +++ b/src/java/org/apache/fop/fo/flow/MultiCase.java @@ -27,7 +27,7 @@ import org.apache.fop.fo.PropertyList; /** * Class modelling the * fo:multi-case object. - * @asf.todo implement validateChildNode() + * TODO implement validateChildNode() */ public class MultiCase extends FObj { // The value of properties relevant for fo:multi-case. 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 5ee5e78ad..634460ec4 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java +++ b/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java @@ -30,7 +30,7 @@ import org.apache.fop.fo.ValidationException; /** * Class modelling the * fo:table-and-caption property. - * @asf.todo needs implementation + * TODO needs implementation */ public class TableAndCaption extends FObj /*implements BreakPropertySet*/ { // The value of properties relevant for fo:table-and-caption. diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java index 01ca5863e..74b85e78c 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java @@ -151,7 +151,7 @@ public class PageSequence extends AbstractPageSequence { /** * {@inheritDoc} - * @asf.todo see if addChildNode() should also be called for fo's other than + * TODO see if addChildNode() should also be called for fo's other than * fo:flow. */ public void addChildNode(FONode child) throws FOPException { diff --git a/src/java/org/apache/fop/fo/properties/CharacterProperty.java b/src/java/org/apache/fop/fo/properties/CharacterProperty.java index 5fef57a8b..ebded4b50 100644 --- a/src/java/org/apache/fop/fo/properties/CharacterProperty.java +++ b/src/java/org/apache/fop/fo/properties/CharacterProperty.java @@ -24,7 +24,7 @@ import org.apache.fop.fo.PropertyList; /** * Superclass for properties that wrap a character value - * @asf.todo convert character value to int in order to denote unicode scalar value + * TODO convert character value to int in order to denote unicode scalar value * instead of a single UTF-16 code element */ public final class CharacterProperty extends Property { diff --git a/src/java/org/apache/fop/hyphenation/ByteVector.java b/src/java/org/apache/fop/hyphenation/ByteVector.java index 920089684..d1448abdc 100644 --- a/src/java/org/apache/fop/hyphenation/ByteVector.java +++ b/src/java/org/apache/fop/hyphenation/ByteVector.java @@ -69,7 +69,7 @@ public class ByteVector implements Serializable { /** * Construct byte vector instance. * @param a byte array to use - * @asf.todo should n should be initialized to a.length to be consistent with + * TODO should n should be initialized to a.length to be consistent with * CharVector behavior? [GA] */ public ByteVector(byte[] a) { @@ -82,7 +82,7 @@ public class ByteVector implements Serializable { * Construct byte vector instance. * @param a byte array to use * @param capacity initial block size - * @asf.todo should n should be initialized to a.length to be consistent with + * TODO should n should be initialized to a.length to be consistent with * CharVector behavior? [GA] */ public ByteVector(byte[] a, int capacity) { diff --git a/src/java/org/apache/fop/hyphenation/HyphenationException.java b/src/java/org/apache/fop/hyphenation/HyphenationException.java index e109cadf9..484d01cbd 100644 --- a/src/java/org/apache/fop/hyphenation/HyphenationException.java +++ b/src/java/org/apache/fop/hyphenation/HyphenationException.java @@ -22,7 +22,7 @@ package org.apache.fop.hyphenation; /** * An hyphenation exception. * @author Carlos Villegas - * @asf.todo Derive from FOPException + * TODO Derive from FOPException */ public class HyphenationException extends Exception { diff --git a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java index 2e6f6926a..a29398b93 100644 --- a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java @@ -36,7 +36,7 @@ import org.apache.fop.fo.pagination.Flow; * Its parent LM is the PageSequenceLayoutManager. * This LM is responsible for getting columns of the appropriate size * and filling them with block-level areas generated by its children. - * @asf.todo Reintroduce emergency counter (generate error to avoid endless loop) + * TODO Reintroduce emergency counter (generate error to avoid endless loop) */ public class FlowLayoutManager extends BlockStackingLayoutManager implements BlockLevelLayoutManager { diff --git a/src/java/org/apache/fop/layoutmgr/LayoutException.java b/src/java/org/apache/fop/layoutmgr/LayoutException.java index 280266003..2638d0210 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutException.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutException.java @@ -29,7 +29,7 @@ import org.apache.fop.events.EventExceptionManager.ExceptionFactory; * Exception thrown by FOP if an unrecoverable layout error occurs. An example: An area overflows * a viewport that has overflow="error-if-overflow". * - * @asf.todo Discuss if this should become a checked exception. + * TODO Discuss if this should become a checked exception. */ public class LayoutException extends RuntimeException { diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java index f5a0a51f8..df7371fe5 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java @@ -48,7 +48,7 @@ import org.apache.fop.traits.MinOptMax; * an exception to this rule.) * This class can be extended to handle the creation and adding of the * inline area. - * @asf.todo [GA] replace use of hungarian notation with normalized java naming + * TODO [GA] replace use of hungarian notation with normalized java naming */ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager implements InlineLevelLayoutManager { diff --git a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java index f3e8784c1..56bcdaa3b 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java @@ -37,7 +37,7 @@ public class PageNumberCitationLastLayoutManager extends AbstractPageNumberCitat * Constructor * * @param node the formatting object that creates this area - * @asf.todo better retrieval of font info + * TODO better retrieval of font info */ public PageNumberCitationLastLayoutManager(PageNumberCitationLast node) { super(node); diff --git a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java index b9f786c97..958a854ac 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java @@ -35,7 +35,7 @@ public class PageNumberCitationLayoutManager extends AbstractPageNumberCitationL * Constructor * * @param node the formatting object that creates this area - * @asf.todo better retrieval of font info + * TODO better retrieval of font info */ public PageNumberCitationLayoutManager(PageNumberCitation node) { super(node); diff --git a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java index ab37248ea..fc35a8069 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java @@ -33,7 +33,7 @@ import org.apache.fop.layoutmgr.PositionIterator; * The caption contains blocks that are positioned next to the * table on the caption side. * The caption blocks have an implicit keep with the table. - * @asf.todo Implement getNextKnuthElements() + * TODO Implement getNextKnuthElements() */ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager { diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java index 96ffc0a90..7ba0b5970 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java @@ -31,7 +31,7 @@ import org.apache.fop.layoutmgr.PositionIterator; * LayoutManager for a table-caption FO. * The table caption contains blocks that are placed beside the * table. - * @asf.todo Implement getNextKnuthElements() + * TODO Implement getNextKnuthElements() */ public class TableCaptionLayoutManager extends BlockStackingLayoutManager { -- cgit v1.2.3 From 41b4797e3a14ff13b1479e48e3d81c5086644142 Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Fri, 3 Sep 2010 17:26:28 +0000 Subject: Fixed typos and source code indentation issues. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@992386 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/afp/DataStream.java | 6 +-- .../org/apache/fop/afp/modca/ObjectContainer.java | 2 +- src/java/org/apache/fop/datatypes/Numeric.java | 12 ++--- src/java/org/apache/fop/fo/expr/NumericOp.java | 44 +++++++----------- .../org/apache/fop/fo/flow/table/TableFObj.java | 14 +++--- src/java/org/apache/fop/fo/pagination/Root.java | 2 +- .../fo/properties/BackgroundPositionShorthand.java | 2 +- .../fo/properties/BorderWidthPropertyMaker.java | 5 +- .../apache/fop/fo/properties/ColorProperty.java | 2 +- .../fop/fo/properties/CommonHyphenation.java | 2 +- .../fop/fo/properties/CompoundPropertyMaker.java | 7 ++- .../fop/fo/properties/FontFamilyProperty.java | 2 +- .../fop/fo/properties/FontSizePropertyMaker.java | 2 +- .../org/apache/fop/fo/properties/KeepProperty.java | 2 +- .../fop/fo/properties/PageDimensionMaker.java | 2 +- .../fop/fo/properties/ToBeImplementedProperty.java | 2 +- src/java/org/apache/fop/layoutmgr/PageBreaker.java | 2 +- src/java/org/apache/fop/tools/anttasks/Fop.java | 34 +++++++------- src/java/org/apache/fop/traits/MinOptMax.java | 53 ++++++++++------------ 19 files changed, 87 insertions(+), 110 deletions(-) (limited to 'src/java/org/apache/fop/fo/pagination') diff --git a/src/java/org/apache/fop/afp/DataStream.java b/src/java/org/apache/fop/afp/DataStream.java index 843e3fa65..a437c3004 100644 --- a/src/java/org/apache/fop/afp/DataStream.java +++ b/src/java/org/apache/fop/afp/DataStream.java @@ -359,9 +359,9 @@ public class DataStream { * @param charSet is the AFP Character Set to use with the text * @throws UnsupportedEncodingException thrown if character encoding is not supported */ - public void createText - ( final AFPTextDataInfo textDataInfo, final int letterSpacing, final int wordSpacing, - final Font font, final CharacterSet charSet) throws UnsupportedEncodingException { + public void createText(final AFPTextDataInfo textDataInfo, final int letterSpacing, + final int wordSpacing, final Font font, final CharacterSet charSet) + throws UnsupportedEncodingException { int rotation = paintingState.getRotation(); if (rotation != 0) { textDataInfo.setRotation(rotation); diff --git a/src/java/org/apache/fop/afp/modca/ObjectContainer.java b/src/java/org/apache/fop/afp/modca/ObjectContainer.java index 515425906..9bc8dc594 100644 --- a/src/java/org/apache/fop/afp/modca/ObjectContainer.java +++ b/src/java/org/apache/fop/afp/modca/ObjectContainer.java @@ -113,7 +113,7 @@ public class ObjectContainer extends AbstractDataObject { } /** - * Sets the data for the the object container + * Sets the data for the object container * * @param data a byte array */ diff --git a/src/java/org/apache/fop/datatypes/Numeric.java b/src/java/org/apache/fop/datatypes/Numeric.java index c26cacd7c..2004c6721 100644 --- a/src/java/org/apache/fop/datatypes/Numeric.java +++ b/src/java/org/apache/fop/datatypes/Numeric.java @@ -29,15 +29,15 @@ import org.apache.fop.fo.expr.PropertyException; * Numerics can be either absolute or relative. Relative numerics * must be resolved against base value before the value can be used. *

- * To support relative numerics internally in the expresion parser and - * during evaulation one additional methods exists: isAbsolute() which + * To support relative numerics internally in the expression parser and + * during evaluation one additional methods exists: isAbsolute() which * return true for absolute numerics and false for relative numerics. */ public interface Numeric { /** * Return the value of this Numeric * @return the computed value. - * @throws PropertyException if a propert exception occurs + * @throws PropertyException if a property exception occurs */ double getNumericValue() throws PropertyException; @@ -45,7 +45,7 @@ public interface Numeric { * Return the value of this Numeric * @param context The context for the length calculation (for percentage based lengths) * @return the computed value. - * @throws PropertyException if a propert exception occurs + * @throws PropertyException if a property exception occurs */ double getNumericValue(PercentBaseContext context) throws PropertyException; @@ -78,9 +78,9 @@ public interface Numeric { int getValue(PercentBaseContext context); /** - * Return the resolved value. This method will becalled during evaluation + * Return the resolved value. This method will be called during evaluation * of the expression tree and relative numerics can then return a - * resolved absolute Numeric. Absolute numerics can just return themself. + * resolved absolute Numeric. Absolute numerics can just return themselves. * * @return A resolved value. * @throws PropertyException diff --git a/src/java/org/apache/fop/fo/expr/NumericOp.java b/src/java/org/apache/fop/fo/expr/NumericOp.java index d1f91d509..a2b203330 100644 --- a/src/java/org/apache/fop/fo/expr/NumericOp.java +++ b/src/java/org/apache/fop/fo/expr/NumericOp.java @@ -19,8 +19,8 @@ package org.apache.fop.fo.expr; -import org.apache.fop.datatypes.PercentBaseContext; import org.apache.fop.datatypes.Numeric; +import org.apache.fop.datatypes.PercentBaseContext; /** * This class contains static methods to evaluate operations on Numeric @@ -43,8 +43,7 @@ public final class NumericOp { * @throws PropertyException If the dimension of the operand is different * from the dimension of this Numeric. */ - public static Numeric addition(Numeric op1, Numeric op2) - throws PropertyException { + public static Numeric addition(Numeric op1, Numeric op2) throws PropertyException { if (op1.isAbsolute() && op2.isAbsolute()) { return addition2(op1, op2, null); } else { @@ -80,8 +79,7 @@ public final class NumericOp { * @throws PropertyException If the dimension of the operand is different * from the dimension of this Numeric. */ - public static Numeric subtraction(Numeric op1, Numeric op2) - throws PropertyException { + public static Numeric subtraction(Numeric op1, Numeric op2) throws PropertyException { if (op1.isAbsolute() && op2.isAbsolute()) { return subtraction2(op1, op2, null); } else { @@ -100,7 +98,7 @@ public final class NumericOp { * from the dimension of this Numeric. */ public static Numeric subtraction2(Numeric op1, Numeric op2, PercentBaseContext context) - throws PropertyException { + throws PropertyException { if (op1.getDimension() != op2.getDimension()) { throw new PropertyException("Can't subtract Numerics of different dimensions"); } @@ -117,8 +115,7 @@ public final class NumericOp { * @throws PropertyException If the dimension of the operand is different * from the dimension of this Numeric. */ - public static Numeric multiply(Numeric op1, Numeric op2) - throws PropertyException { + public static Numeric multiply(Numeric op1, Numeric op2) throws PropertyException { if (op1.isAbsolute() && op2.isAbsolute()) { return multiply2(op1, op2, null); } else { @@ -137,7 +134,7 @@ public final class NumericOp { * from the dimension of this Numeric. */ public static Numeric multiply2(Numeric op1, Numeric op2, PercentBaseContext context) - throws PropertyException { + throws PropertyException { return numeric(op1.getNumericValue(context) * op2.getNumericValue(context), op1.getDimension() + op2.getDimension()); } @@ -171,7 +168,7 @@ public final class NumericOp { * from the dimension of this Numeric. */ public static Numeric divide2(Numeric op1, Numeric op2, PercentBaseContext context) - throws PropertyException { + throws PropertyException { return numeric(op1.getNumericValue(context) / op2.getNumericValue(context), op1.getDimension() - op2.getDimension()); } @@ -183,8 +180,7 @@ public final class NumericOp { * @return A new Numeric object representing the absolute value. * @throws PropertyException if a property exception occurs */ - public static Numeric modulo(Numeric op1, Numeric op2) - throws PropertyException { + public static Numeric modulo(Numeric op1, Numeric op2) throws PropertyException { if (op1.isAbsolute() && op2.isAbsolute()) { return modulo2(op1, op2, null); } else { @@ -202,7 +198,7 @@ public final class NumericOp { * from the dimension of this Numeric. */ public static Numeric modulo2(Numeric op1, Numeric op2, PercentBaseContext context) - throws PropertyException { + throws PropertyException { return numeric(op1.getNumericValue(context) % op2.getNumericValue(context), op1.getDimension()); } @@ -213,8 +209,7 @@ public final class NumericOp { * @return a new Numeric object representing the absolute value of the operand. * @throws PropertyException if a property exception occurs */ - public static Numeric abs(Numeric op) - throws PropertyException { + public static Numeric abs(Numeric op) throws PropertyException { if (op.isAbsolute()) { return abs2(op, null); } else { @@ -230,8 +225,7 @@ public final class NumericOp { * @throws PropertyException If the dimension of the operand is different * from the dimension of this Numeric. */ - public static Numeric abs2(Numeric op, PercentBaseContext context) - throws PropertyException { + public static Numeric abs2(Numeric op, PercentBaseContext context) throws PropertyException { return numeric(Math.abs(op.getNumericValue(context)), op.getDimension()); } @@ -241,8 +235,7 @@ public final class NumericOp { * @return a new Numeric object representing the negation of the operand. * @throws PropertyException if a property exception occurs */ - public static Numeric negate(Numeric op) - throws PropertyException { + public static Numeric negate(Numeric op) throws PropertyException { if (op.isAbsolute()) { return negate2(op, null); } else { @@ -259,8 +252,7 @@ public final class NumericOp { * @throws PropertyException If the dimension of the operand is different * from the dimension of this Numeric. */ - public static Numeric negate2(Numeric op, PercentBaseContext context) - throws PropertyException { + public static Numeric negate2(Numeric op, PercentBaseContext context) throws PropertyException { return numeric(-op.getNumericValue(context), op.getDimension()); } @@ -271,8 +263,7 @@ public final class NumericOp { * @return a Numeric which is the maximum of the two operands. * @throws PropertyException if the dimensions or value types of the operands are different. */ - public static Numeric max(Numeric op1, Numeric op2) - throws PropertyException { + public static Numeric max(Numeric op1, Numeric op2) throws PropertyException { if (op1.isAbsolute() && op2.isAbsolute()) { return max2(op1, op2, null); } else { @@ -290,7 +281,7 @@ public final class NumericOp { * from the dimension of this Numeric. */ public static Numeric max2(Numeric op1, Numeric op2, PercentBaseContext context) - throws PropertyException { + throws PropertyException { if (op1.getDimension() != op2.getDimension()) { throw new PropertyException("Arguments to max() must have same dimensions"); } @@ -304,8 +295,7 @@ public final class NumericOp { * @return a Numeric which is the minimum of the two operands. * @throws PropertyException if the dimensions or value types of the operands are different. */ - public static Numeric min(Numeric op1, Numeric op2) - throws PropertyException { + public static Numeric min(Numeric op1, Numeric op2) throws PropertyException { if (op1.isAbsolute() && op2.isAbsolute()) { return min2(op1, op2, null); } else { @@ -323,7 +313,7 @@ public final class NumericOp { * from the dimension of this Numeric. */ public static Numeric min2(Numeric op1, Numeric op2, PercentBaseContext context) - throws PropertyException { + throws PropertyException { if (op1.getDimension() != op2.getDimension()) { throw new PropertyException("Arguments to min() must have same dimensions"); } diff --git a/src/java/org/apache/fop/fo/flow/table/TableFObj.java b/src/java/org/apache/fop/fo/flow/table/TableFObj.java index 6ba763933..fce82dcff 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableFObj.java +++ b/src/java/org/apache/fop/fo/flow/table/TableFObj.java @@ -217,11 +217,10 @@ public abstract class TableFObj extends FObj implements StructurePointerProperty */ i = 1; } - TableEventProducer eventProducer - = TableEventProducer.Provider.get(fo.getUserAgent().getEventBroadcaster()); - eventProducer.forceNextColumnNumber - (this, propertyList.getFObj().getName(), - val, i, propertyList.getFObj().getLocator()); + TableEventProducer eventProducer = TableEventProducer.Provider.get( + fo.getUserAgent().getEventBroadcaster()); + eventProducer.forceNextColumnNumber(this, propertyList.getFObj().getName(), + val, i, propertyList.getFObj().getLocator()); } return NumberProperty.getInstance(i); } @@ -231,9 +230,8 @@ public abstract class TableFObj extends FObj implements StructurePointerProperty } /** {@inheritDoc} */ - public void processNode - (String elementName, Locator locator, Attributes attlist, PropertyList pList) - throws FOPException { + public void processNode(String elementName, Locator locator, Attributes attlist, + PropertyList pList) throws FOPException { super.processNode(elementName, locator, attlist, pList); Table table = getTable(); if (!inMarker() && !table.isSeparateBorderModel()) { diff --git a/src/java/org/apache/fop/fo/pagination/Root.java b/src/java/org/apache/fop/fo/pagination/Root.java index 2a634c24a..8f8e0a509 100644 --- a/src/java/org/apache/fop/fo/pagination/Root.java +++ b/src/java/org/apache/fop/fo/pagination/Root.java @@ -212,7 +212,7 @@ public class Root extends FObj { * @throws IllegalArgumentException for negative additional page counts */ public void notifyPageSequenceFinished(int lastPageNumber, int additionalPages) - throws IllegalArgumentException { + throws IllegalArgumentException { if (additionalPages >= 0) { totalPagesGenerated += additionalPages; diff --git a/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java b/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java index 58f1ac210..3c0118181 100644 --- a/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java +++ b/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java @@ -58,7 +58,7 @@ public class BackgroundPositionShorthand extends ListProperty { * to "50%". */ public Property make(PropertyList propertyList, String value, FObj fo) - throws PropertyException { + throws PropertyException { Property p = super.make(propertyList, value, fo); if (p.getList().size() == 1) { /* only background-position-horizontal specified diff --git a/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java b/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java index 467682878..d2bab22ab 100644 --- a/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java @@ -54,9 +54,8 @@ public class BorderWidthPropertyMaker extends LengthProperty.Maker { * {@inheritDoc} */ - public Property get(int subpropId, PropertyList propertyList, - boolean bTryInherit, boolean bTryDefault) - throws PropertyException { + public Property get(int subpropId, PropertyList propertyList, boolean bTryInherit, + boolean bTryDefault) throws PropertyException { Property p = super.get(subpropId, propertyList, bTryInherit, bTryDefault); diff --git a/src/java/org/apache/fop/fo/properties/ColorProperty.java b/src/java/org/apache/fop/fo/properties/ColorProperty.java index e7b8d5931..293f31577 100644 --- a/src/java/org/apache/fop/fo/properties/ColorProperty.java +++ b/src/java/org/apache/fop/fo/properties/ColorProperty.java @@ -99,7 +99,7 @@ public final class ColorProperty extends Property { * @see ColorUtil#parseColorString(FOUserAgent, String) */ public static ColorProperty getInstance(FOUserAgent foUserAgent, String value) - throws PropertyException { + throws PropertyException { ColorProperty instance = new ColorProperty( ColorUtil.parseColorString( foUserAgent, value)); diff --git a/src/java/org/apache/fop/fo/properties/CommonHyphenation.java b/src/java/org/apache/fop/fo/properties/CommonHyphenation.java index 65b2cebbd..7b9b5bc82 100644 --- a/src/java/org/apache/fop/fo/properties/CommonHyphenation.java +++ b/src/java/org/apache/fop/fo/properties/CommonHyphenation.java @@ -92,7 +92,7 @@ public final class CommonHyphenation { * @throws PropertyException if a a property exception occurs */ public static CommonHyphenation getInstance(PropertyList propertyList) - throws PropertyException { + throws PropertyException { StringProperty language = (StringProperty) propertyList.get(Constants.PR_LANGUAGE); StringProperty country diff --git a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java index 3edb84009..cbd34c9b3 100644 --- a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java @@ -139,9 +139,8 @@ public class CompoundPropertyMaker extends PropertyMaker { * @return the property * @throws PropertyException if a property exception occurs */ - public Property get(int subpropertyId, PropertyList propertyList, - boolean tryInherit, boolean tryDefault) - throws PropertyException { + public Property get(int subpropertyId, PropertyList propertyList, boolean tryInherit, + boolean tryDefault) throws PropertyException { Property p = super.get(subpropertyId, propertyList, tryInherit, tryDefault); if (subpropertyId != 0 && p != null) { p = getSubprop(p, subpropertyId); @@ -254,7 +253,7 @@ public class CompoundPropertyMaker extends PropertyMaker { * @throws PropertyException ... */ protected Property makeCompound(PropertyList propertyList, FObj parentFO) - throws PropertyException { + throws PropertyException { Property p = makeNewProperty(); CompoundDatatype data = (CompoundDatatype) p.getObject(); for (int i = 0; i < Constants.COMPOUND_COUNT; i++) { diff --git a/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java b/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java index 330101ee7..f6fa806c9 100644 --- a/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java +++ b/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java @@ -52,7 +52,7 @@ public final class FontFamilyProperty extends ListProperty { * {@inheritDoc} */ public Property make(PropertyList propertyList, String value, FObj fo) - throws PropertyException { + throws PropertyException { if ("inherit".equals(value)) { return super.make(propertyList, value, fo); } else { diff --git a/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java b/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java index 60ef955ba..72884a177 100644 --- a/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java @@ -51,7 +51,7 @@ public class FontSizePropertyMaker * it is immediately replaced by the resolved {@link FixedLength}. */ public Property make(PropertyList propertyList, String value, FObj fo) - throws PropertyException { + throws PropertyException { Property p = super.make(propertyList, value, fo); if (p instanceof PercentLength) { Property pp = propertyList.getFromParent(this.propId); diff --git a/src/java/org/apache/fop/fo/properties/KeepProperty.java b/src/java/org/apache/fop/fo/properties/KeepProperty.java index 0bc44e459..9d04ce780 100644 --- a/src/java/org/apache/fop/fo/properties/KeepProperty.java +++ b/src/java/org/apache/fop/fo/properties/KeepProperty.java @@ -62,7 +62,7 @@ public final class KeepProperty extends Property implements CompoundDatatype { * {@inheritDoc} */ public Property convertProperty(Property p, PropertyList propertyList, FObj fo) - throws PropertyException { + throws PropertyException { if (p instanceof KeepProperty) { return p; } diff --git a/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java b/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java index 919dd84d0..c0c6a2ed7 100644 --- a/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java +++ b/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java @@ -44,7 +44,7 @@ public class PageDimensionMaker extends LengthProperty.Maker { * Return the default or user-defined fallback in case the value * was specified as "auto" * @param subpropId The subproperty id of the property being retrieved. - * Is 0 when retriving a base property. + * Is 0 when retrieving a base property. * @param propertyList The PropertyList object being built for this FO. * @param tryInherit true if inherited properties should be examined. * @param tryDefault true if the default value should be returned. diff --git a/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java b/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java index 387355623..59a6cafef 100644 --- a/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java +++ b/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java @@ -23,7 +23,7 @@ import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; /** - * A special property for representing an as yet implemented implemented property. + * A special property for representing an as yet unimplemented property. */ public class ToBeImplementedProperty extends Property { diff --git a/src/java/org/apache/fop/layoutmgr/PageBreaker.java b/src/java/org/apache/fop/layoutmgr/PageBreaker.java index 171b3fd4f..b65433bd7 100644 --- a/src/java/org/apache/fop/layoutmgr/PageBreaker.java +++ b/src/java/org/apache/fop/layoutmgr/PageBreaker.java @@ -554,7 +554,7 @@ public class PageBreaker extends AbstractBreaker { */ private boolean needBlankPageBeforeNew(int breakVal) { if (breakVal == Constants.EN_PAGE - || (pslm.getCurrentPage().getPageViewport().getPage().isEmpty())) { + || (pslm.getCurrentPage().getPageViewport().getPage().isEmpty())) { // any page is OK or we already have an empty page return false; } else { diff --git a/src/java/org/apache/fop/tools/anttasks/Fop.java b/src/java/org/apache/fop/tools/anttasks/Fop.java index c0a1ba9f7..58dd1fb5b 100644 --- a/src/java/org/apache/fop/tools/anttasks/Fop.java +++ b/src/java/org/apache/fop/tools/anttasks/Fop.java @@ -20,14 +20,6 @@ package org.apache.fop.tools.anttasks; // Ant -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.DirectoryScanner; -import org.apache.tools.ant.Project; -import org.apache.tools.ant.Task; -import org.apache.tools.ant.types.FileSet; -import org.apache.tools.ant.util.GlobPatternMapper; - -// Java import java.io.BufferedOutputStream; import java.io.File; import java.io.IOException; @@ -36,17 +28,23 @@ import java.net.MalformedURLException; import java.util.List; import java.util.Vector; -// FOP +import org.xml.sax.SAXException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.impl.SimpleLog; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.DirectoryScanner; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.Task; +import org.apache.tools.ant.types.FileSet; +import org.apache.tools.ant.util.GlobPatternMapper; + import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.MimeConstants; import org.apache.fop.cli.InputHandler; -import org.apache.commons.logging.impl.SimpleLog; -import org.apache.commons.logging.Log; -import org.xml.sax.SAXException; - /** * Wrapper for FOP which allows it to be accessed from within an Ant task. * Accepts the inputs: @@ -156,7 +154,7 @@ public class Fop extends Task { } /** - * Sets the XSLT parameters + * Sets the XSLT parameters * @param xsltParams the XSLT parameters */ public void setXsltParams(String xsltParams) { @@ -267,7 +265,7 @@ public class Fop extends Task { /** * Set whether exceptions are thrown. * default is false. - * @param throwExceptions true if should be thrown + * @param throwExceptions true if exceptions should be thrown */ public void setThrowexceptions(boolean throwExceptions) { this.throwExceptions = throwExceptions; @@ -553,7 +551,7 @@ class FOPTaskStarter { // OR output file doesn't exist OR // output file is older than input file if (task.getForce() || !outf.exists() - || (task.getXmlFile().lastModified() > outf.lastModified() + || (task.getXmlFile().lastModified() > outf.lastModified() || task.getXsltFile().lastModified() > outf.lastModified())) { render(task.getXmlFile(), task.getXsltFile(), outf, outputFormat); actioncount++; @@ -639,8 +637,8 @@ class FOPTaskStarter { } } - private void renderInputHandler - (InputHandler inputHandler, File outFile, String outputFormat) throws Exception { + private void renderInputHandler(InputHandler inputHandler, File outFile, String outputFormat) + throws Exception { OutputStream out = null; try { out = new java.io.FileOutputStream(outFile); diff --git a/src/java/org/apache/fop/traits/MinOptMax.java b/src/java/org/apache/fop/traits/MinOptMax.java index 99fab1adf..45b55695f 100644 --- a/src/java/org/apache/fop/traits/MinOptMax.java +++ b/src/java/org/apache/fop/traits/MinOptMax.java @@ -56,8 +56,7 @@ public final class MinOptMax implements Serializable { * @return the corresponding instance * @throws IllegalArgumentException if min > opt || max < opt. */ - public static MinOptMax getInstance(int min, int opt, int max) - throws IllegalArgumentException { + public static MinOptMax getInstance(int min, int opt, int max) throws IllegalArgumentException { if (min > opt) { throw new IllegalArgumentException("min (" + min + ") > opt (" + opt + ")"); } @@ -168,8 +167,7 @@ public final class MinOptMax implements Serializable { * @throws ArithmeticException if this instance has strictly less shrink or stretch * than the operand */ - public MinOptMax minus(MinOptMax operand) - throws ArithmeticException { + public MinOptMax minus(MinOptMax operand) throws ArithmeticException { checkCompatibility(getShrink(), operand.getShrink(), "shrink"); checkCompatibility(getStretch(), operand.getStretch(), "stretch"); return new MinOptMax(min - operand.min, opt - operand.opt, max - operand.max); @@ -194,58 +192,54 @@ public final class MinOptMax implements Serializable { } /** - * Returns an instance with the given value added to the minimal value. + * Do not use, backwards compatibility only. Returns an instance with the + * given value added to the minimal value. * * @param minOperand the minimal value to be added. * @return an instance with the given value added to the minimal value. - * @throws IllegalArgumentException if min + minOperand > opt || max < opt. + * @throws IllegalArgumentException if + * min + minOperand > opt || max < opt. */ - // [GA] remove deprecation - no alternative specified - // @deprecated Do not use! It's only for backwards compatibility. - public MinOptMax plusMin(int minOperand) - throws IllegalArgumentException { + public MinOptMax plusMin(int minOperand) throws IllegalArgumentException { return getInstance(min + minOperand, opt, max); } /** - * Returns an instance with the given value subtracted to the minimal value. + * Do not use, backwards compatibility only. Returns an instance with the + * given value subtracted to the minimal value. * * @param minOperand the minimal value to be subtracted. * @return an instance with the given value subtracted to the minimal value. - * @throws IllegalArgumentException if min - minOperand > opt || max < opt. + * @throws IllegalArgumentException if + * min - minOperand > opt || max < opt. */ - // [GA] remove deprecation - no alternative specified - // @deprecated Do not use! It's only for backwards compatibility. - public MinOptMax minusMin(int minOperand) - throws IllegalArgumentException { + public MinOptMax minusMin(int minOperand) throws IllegalArgumentException { return getInstance(min - minOperand, opt, max); } /** - * Returns an instance with the given value added to the maximal value. + * Do not use, backwards compatibility only. Returns an instance with the + * given value added to the maximal value. * * @param maxOperand the maximal value to be added. * @return an instance with the given value added to the maximal value. - * @throws IllegalArgumentException if min > opt || max < opt + maxOperand. + * @throws IllegalArgumentException if + * min > opt || max < opt + maxOperand. */ - // [GA] remove deprecation - no alternative specified - // @deprecated Do not use! It's only for backwards compatibility. - public MinOptMax plusMax(int maxOperand) - throws IllegalArgumentException { + public MinOptMax plusMax(int maxOperand) throws IllegalArgumentException { return getInstance(min, opt, max + maxOperand); } /** - * Returns an instance with the given value subtracted to the maximal value. + * Do not use, backwards compatibility only. Returns an instance with the + * given value subtracted to the maximal value. * * @param maxOperand the maximal value to be subtracted. * @return an instance with the given value subtracted to the maximal value. - * @throws IllegalArgumentException if min > opt || max < opt - maxOperand. + * @throws IllegalArgumentException if + * min > opt || max < opt - maxOperand. */ - // [GA] remove deprecation - no alternative specified - // @deprecated Do not use! It's only for backwards compatibility. - public MinOptMax minusMax(int maxOperand) - throws IllegalArgumentException { + public MinOptMax minusMax(int maxOperand) throws IllegalArgumentException { return getInstance(min, opt, max - maxOperand); } @@ -256,8 +250,7 @@ public final class MinOptMax implements Serializable { * @return the product of this MinOptMax and the given factor * @throws IllegalArgumentException if the factor is negative */ - public MinOptMax mult(int factor) - throws IllegalArgumentException { + public MinOptMax mult(int factor) throws IllegalArgumentException { if (factor < 0) { throw new IllegalArgumentException("factor < 0; was: " + factor); } else if (factor == 1) { -- cgit v1.2.3 From e5e7806fd2c179759902a4fa90c8cd58849835be Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Sun, 9 Jan 2011 01:26:33 +0000 Subject: Commit changes forgotten in r757256... git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1056861 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/fo/pagination/RegionBefore.java | 24 ++++------------------ 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'src/java/org/apache/fop/fo/pagination') diff --git a/src/java/org/apache/fop/fo/pagination/RegionBefore.java b/src/java/org/apache/fop/fo/pagination/RegionBefore.java index 71ea26818..728336c98 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionBefore.java +++ b/src/java/org/apache/fop/fo/pagination/RegionBefore.java @@ -25,7 +25,7 @@ import java.awt.Rectangle; // FOP import org.apache.fop.datatypes.FODimension; import org.apache.fop.datatypes.LengthBase; -import org.apache.fop.datatypes.SimplePercentBaseContext; +import org.apache.fop.datatypes.PercentBaseContext; import org.apache.fop.fo.FONode; /** @@ -53,25 +53,9 @@ public class RegionBefore extends RegionBA { /* Special rules apply to resolving extent as values are resolved relative * to the page size and reference orientation. */ - SimplePercentBaseContext pageWidthContext; - SimplePercentBaseContext pageHeightContext; - if (spm.getReferenceOrientation() % 180 == 0) { - pageWidthContext = new SimplePercentBaseContext(null, - LengthBase.CUSTOM_BASE, - spm.getPageWidth().getValue()); - pageHeightContext = new SimplePercentBaseContext(null, - LengthBase.CUSTOM_BASE, - spm.getPageHeight().getValue()); - } else { - // invert width and height since top left are rotated by 90 (cl or ccl) - pageWidthContext = new SimplePercentBaseContext(null, - LengthBase.CUSTOM_BASE, - spm.getPageHeight().getValue()); - pageHeightContext = new SimplePercentBaseContext(null, - LengthBase.CUSTOM_BASE, - spm.getPageWidth().getValue()); - } - SimplePercentBaseContext neighbourContext; + PercentBaseContext pageWidthContext = getPageWidthContext(LengthBase.CUSTOM_BASE); + PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE); + PercentBaseContext neighbourContext; Rectangle vpRect; if (spm.getWritingMode() == EN_LR_TB || spm.getWritingMode() == EN_RL_TB) { neighbourContext = pageWidthContext; -- cgit v1.2.3 From 2fb9c63eea373b6ec707b116286e97cfc72a594b Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Sun, 9 Jan 2011 12:11:07 +0000 Subject: Simplify Region.getViewportRectangle(): no reason to pass the SinglePageMaster as a parameter, as Regions have access to it git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1056923 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/area/Page.java | 10 ++++------ src/java/org/apache/fop/fo/pagination/Region.java | 6 ++---- src/java/org/apache/fop/fo/pagination/RegionAfter.java | 7 ++++--- src/java/org/apache/fop/fo/pagination/RegionBefore.java | 6 +++--- src/java/org/apache/fop/fo/pagination/RegionBody.java | 4 ++-- src/java/org/apache/fop/fo/pagination/RegionEnd.java | 6 +++--- src/java/org/apache/fop/fo/pagination/RegionStart.java | 6 +++--- 7 files changed, 21 insertions(+), 24 deletions(-) (limited to 'src/java/org/apache/fop/fo/pagination') diff --git a/src/java/org/apache/fop/area/Page.java b/src/java/org/apache/fop/area/Page.java index 242123baa..715bcfe85 100644 --- a/src/java/org/apache/fop/area/Page.java +++ b/src/java/org/apache/fop/area/Page.java @@ -123,7 +123,7 @@ public class Page extends AreaTreeObject implements Serializable, Cloneable { for (Iterator regenum = spm.getRegions().values().iterator(); regenum.hasNext();) { Region r = (Region)regenum.next(); - RegionViewport rvp = makeRegionViewport(r, reldims, pageCTM, spm); + RegionViewport rvp = makeRegionViewport(r, reldims, pageCTM); if (r.getNameId() == Constants.FO_REGION_BODY) { rr = new BodyRegion((RegionBody) r, rvp); } else { @@ -138,7 +138,7 @@ public class Page extends AreaTreeObject implements Serializable, Cloneable { setRegionReferencePosition(rr, r, rvp.getViewArea()); rvp.setRegionReference(rr); setRegionViewport(r.getNameId(), rvp); - } + } } /** @@ -153,12 +153,10 @@ public class Page extends AreaTreeObject implements Serializable, Cloneable { * @param r the region the viewport is to be created for * @param reldims relative dimensions * @param pageCTM page coordinate transformation matrix - * @param spm the simple-page-master for this page * @return the new region viewport */ - private RegionViewport makeRegionViewport(Region r, FODimension reldims, CTM pageCTM, - SimplePageMaster spm) { - Rectangle2D relRegionRect = r.getViewportRectangle(reldims, spm); + private RegionViewport makeRegionViewport(Region r, FODimension reldims, CTM pageCTM) { + Rectangle2D relRegionRect = r.getViewportRectangle(reldims); Rectangle2D absRegionRect = pageCTM.transform(relRegionRect); // Get the region viewport rectangle in absolute coords by // transforming it using the page CTM diff --git a/src/java/org/apache/fop/fo/pagination/Region.java b/src/java/org/apache/fop/fo/pagination/Region.java index ea449cdff..fe5a95749 100644 --- a/src/java/org/apache/fop/fo/pagination/Region.java +++ b/src/java/org/apache/fop/fo/pagination/Region.java @@ -47,7 +47,7 @@ public abstract class Region extends FObj { private int writingMode; // End of property values - private SimplePageMaster layoutMaster; + protected final SimplePageMaster layoutMaster; /** * Base constructor @@ -102,11 +102,9 @@ public abstract class Region extends FObj { /** * @param pageRefRect reference dimension of the page area. - * @param spm the simple page master this region belongs to. * @return the rectangle for the viewport area */ - public abstract Rectangle getViewportRectangle(FODimension pageRefRect - , SimplePageMaster spm); + public abstract Rectangle getViewportRectangle(FODimension pageRefRect); /** * Returns the default region name (xsl-region-before, xsl-region-start, diff --git a/src/java/org/apache/fop/fo/pagination/RegionAfter.java b/src/java/org/apache/fop/fo/pagination/RegionAfter.java index 841bff0d6..bab5d46b8 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionAfter.java +++ b/src/java/org/apache/fop/fo/pagination/RegionAfter.java @@ -44,7 +44,7 @@ public class RegionAfter extends RegionBA { } /** {@inheritDoc} */ - public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) { + public Rectangle getViewportRectangle (FODimension reldims) { /* Special rules apply to resolving extent as values are resolved relative * to the page size and reference orientation. */ @@ -52,7 +52,8 @@ public class RegionAfter extends RegionBA { PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE); PercentBaseContext neighbourContext; Rectangle vpRect; - if (spm.getWritingMode() == EN_LR_TB || spm.getWritingMode() == EN_RL_TB) { + if (layoutMaster.getWritingMode() == EN_LR_TB + || layoutMaster.getWritingMode() == EN_RL_TB) { neighbourContext = pageWidthContext; vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(pageHeightContext) , reldims.ipd, getExtent().getValue(pageHeightContext)); @@ -62,7 +63,7 @@ public class RegionAfter extends RegionBA { , getExtent().getValue(pageWidthContext), reldims.ipd); } if (getPrecedence() == EN_FALSE) { - adjustIPD(vpRect, spm.getWritingMode(), neighbourContext); + adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext); } return vpRect; } diff --git a/src/java/org/apache/fop/fo/pagination/RegionBefore.java b/src/java/org/apache/fop/fo/pagination/RegionBefore.java index 728336c98..6d12e6e4e 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionBefore.java +++ b/src/java/org/apache/fop/fo/pagination/RegionBefore.java @@ -49,7 +49,7 @@ public class RegionBefore extends RegionBA { } /** {@inheritDoc} */ - public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) { + public Rectangle getViewportRectangle (FODimension reldims) { /* Special rules apply to resolving extent as values are resolved relative * to the page size and reference orientation. */ @@ -57,7 +57,7 @@ public class RegionBefore extends RegionBA { PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE); PercentBaseContext neighbourContext; Rectangle vpRect; - if (spm.getWritingMode() == EN_LR_TB || spm.getWritingMode() == EN_RL_TB) { + if (layoutMaster.getWritingMode() == EN_LR_TB || layoutMaster.getWritingMode() == EN_RL_TB) { neighbourContext = pageWidthContext; vpRect = new Rectangle(0, 0, reldims.ipd, getExtent().getValue(pageHeightContext)); } else { @@ -65,7 +65,7 @@ public class RegionBefore extends RegionBA { vpRect = new Rectangle(0, 0, getExtent().getValue(pageWidthContext), reldims.ipd); } if (getPrecedence() == EN_FALSE) { - adjustIPD(vpRect, spm.getWritingMode(), neighbourContext); + adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext); } return vpRect; } diff --git a/src/java/org/apache/fop/fo/pagination/RegionBody.java b/src/java/org/apache/fop/fo/pagination/RegionBody.java index cb265706d..5eed36061 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionBody.java +++ b/src/java/org/apache/fop/fo/pagination/RegionBody.java @@ -96,7 +96,7 @@ public class RegionBody extends Region { } /** {@inheritDoc} */ - public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) { + public Rectangle getViewportRectangle (FODimension reldims) { /* Special rules apply to resolving margins in the page context. * Contrary to normal margins in this case top and bottom margin * are resolved relative to the height. In the property subsystem @@ -113,7 +113,7 @@ public class RegionBody extends Region { int start; int end; - if (spm.getWritingMode() == EN_LR_TB) { // Left-to-right + if (layoutMaster.getWritingMode() == EN_LR_TB) { // Left-to-right start = commonMarginBlock.marginLeft.getValue(pageWidthContext); end = commonMarginBlock.marginRight.getValue(pageWidthContext); } else { // all other supported modes are right-to-left diff --git a/src/java/org/apache/fop/fo/pagination/RegionEnd.java b/src/java/org/apache/fop/fo/pagination/RegionEnd.java index 8b348ed5d..4a054ad4e 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionEnd.java +++ b/src/java/org/apache/fop/fo/pagination/RegionEnd.java @@ -44,7 +44,7 @@ public class RegionEnd extends RegionSE { } /** {@inheritDoc} */ - public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) { + public Rectangle getViewportRectangle (FODimension reldims) { /* Special rules apply to resolving extent as values are resolved relative * to the page size and reference orientation. */ @@ -52,7 +52,7 @@ public class RegionEnd extends RegionSE { PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE); PercentBaseContext neighbourContext; Rectangle vpRect; - if (spm.getWritingMode() == EN_LR_TB || spm.getWritingMode() == EN_RL_TB) { + if (layoutMaster.getWritingMode() == EN_LR_TB || layoutMaster.getWritingMode() == EN_RL_TB) { neighbourContext = pageHeightContext; vpRect = new Rectangle(reldims.ipd - getExtent().getValue(pageWidthContext), 0, getExtent().getValue(pageWidthContext), reldims.bpd); @@ -62,7 +62,7 @@ public class RegionEnd extends RegionSE { vpRect = new Rectangle(reldims.ipd - getExtent().getValue(pageHeightContext), 0, reldims.bpd, getExtent().getValue(pageHeightContext)); } - adjustIPD(vpRect, spm.getWritingMode(), neighbourContext); + adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext); return vpRect; } diff --git a/src/java/org/apache/fop/fo/pagination/RegionStart.java b/src/java/org/apache/fop/fo/pagination/RegionStart.java index afe9ddfe1..c0a57a0f7 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionStart.java +++ b/src/java/org/apache/fop/fo/pagination/RegionStart.java @@ -44,7 +44,7 @@ public class RegionStart extends RegionSE { } /** {@inheritDoc} */ - public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) { + public Rectangle getViewportRectangle (FODimension reldims) { /* Special rules apply to resolving extent as values are resolved relative * to the page size and reference orientation. */ @@ -52,14 +52,14 @@ public class RegionStart extends RegionSE { PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE); PercentBaseContext neighbourContext; Rectangle vpRect; - if (spm.getWritingMode() == EN_LR_TB || spm.getWritingMode() == EN_RL_TB) { + if (layoutMaster.getWritingMode() == EN_LR_TB || layoutMaster.getWritingMode() == EN_RL_TB) { neighbourContext = pageHeightContext; vpRect = new Rectangle(0, 0, getExtent().getValue(pageWidthContext), reldims.bpd); } else { neighbourContext = pageWidthContext; vpRect = new Rectangle(0, 0, reldims.bpd, getExtent().getValue(pageHeightContext)); } - adjustIPD(vpRect, spm.getWritingMode(), neighbourContext); + adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext); return vpRect; } -- cgit v1.2.3 From f7d9c3fa72b7b68b9b0af4ab71defd2c5dfc3e24 Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Sun, 9 Jan 2011 12:16:18 +0000 Subject: Fix minor bug in validateChildNode() + make regions Map type-safe git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1056924 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/fo/pagination/SimplePageMaster.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/java/org/apache/fop/fo/pagination') diff --git a/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java b/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java index 8c95e1b8a..bd186db78 100644 --- a/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java +++ b/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java @@ -56,7 +56,7 @@ public class SimplePageMaster extends FObj { /** * Page regions (regionClass, Region) */ - private Map regions; + private Map regions; // used for node validation private boolean hasRegionBody = false; @@ -99,7 +99,7 @@ public class SimplePageMaster extends FObj { } //Well, there are only 5 regions so we can save a bit of memory here - regions = new HashMap(5); + regions = new HashMap(5); } /** {@inheritDoc} */ @@ -135,7 +135,7 @@ public class SimplePageMaster extends FObj { } else if (hasRegionEnd) { nodesOutOfOrderError(loc, "fo:region-before", "fo:region-end"); } else { - hasRegionBody = true; + hasRegionBefore = true; } } else if (localName.equals("region-after")) { if (!hasRegionBody) { @@ -192,8 +192,7 @@ public class SimplePageMaster extends FObj { * @param region region to add */ protected void addRegion(Region region) { - String key = String.valueOf(region.getNameId()); - regions.put(key, region); + regions.put(String.valueOf(region.getNameId()), region); } /** @@ -240,14 +239,14 @@ public class SimplePageMaster extends FObj { * @return the region, null if it doesn't exist */ public Region getRegion(int regionId) { - return (Region) regions.get(String.valueOf(regionId)); + return regions.get(String.valueOf(regionId)); } /** * Returns a Map of regions associated with this simple-page-master * @return the regions */ - public Map getRegions() { + public Map getRegions() { return regions; } @@ -258,9 +257,7 @@ public class SimplePageMaster extends FObj { * @return True if a region with this name exists */ protected boolean regionNameExists(String regionName) { - for (Iterator regenum = regions.values().iterator(); - regenum.hasNext();) { - Region r = (Region) regenum.next(); + for (Region r : regions.values()) { if (r.getRegionName().equals(regionName)) { return true; } -- cgit v1.2.3 From aaf2ae529ec3f02e0062fd0f26ef8c98e4a634d0 Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Sun, 9 Jan 2011 12:20:21 +0000 Subject: Switch to type-safe collections (+ related cleanup of redundant casts, for-loops...) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1056926 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/fo/pagination/Declarations.java | 6 ++-- .../apache/fop/fo/pagination/LayoutMasterSet.java | 34 +++++++++------------- .../org/apache/fop/fo/pagination/PageSequence.java | 8 ++--- .../fop/fo/pagination/PageSequenceMaster.java | 13 ++++----- .../RepeatablePageMasterAlternatives.java | 8 ++--- src/java/org/apache/fop/fo/pagination/Root.java | 10 +++---- .../fop/fo/pagination/SubSequenceSpecifier.java | 1 + 7 files changed, 36 insertions(+), 44 deletions(-) (limited to 'src/java/org/apache/fop/fo/pagination') diff --git a/src/java/org/apache/fop/fo/pagination/Declarations.java b/src/java/org/apache/fop/fo/pagination/Declarations.java index 1385bccc9..9c68043ff 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 colorProfiles = null; + private Map colorProfiles = null; /** * @param parent FONode that is the parent of this object @@ -98,7 +98,7 @@ public class Declarations extends FObj { private void addColorProfile(ColorProfile cp) { if (colorProfiles == null) { - colorProfiles = new java.util.HashMap(); + colorProfiles = new java.util.HashMap(); } if (colorProfiles.get(cp.getColorProfileName()) != null) { // duplicate names @@ -132,7 +132,7 @@ public class Declarations extends FObj { public ColorProfile getColorProfile(String cpName) { ColorProfile profile = null; if (this.colorProfiles != null) { - profile = (ColorProfile)this.colorProfiles.get(cpName); + profile = this.colorProfiles.get(cpName); } return profile; } diff --git a/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java b/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java index 482ec83c4..c4189d0c4 100644 --- a/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java +++ b/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java @@ -44,8 +44,8 @@ import org.apache.fop.fo.ValidationException; */ public class LayoutMasterSet extends FObj { - private Map simplePageMasters; - private Map pageSequenceMasters; + private Map simplePageMasters; + private Map pageSequenceMasters; /** * Create a LayoutMasterSet instance that is a child of the given @@ -65,8 +65,8 @@ public class LayoutMasterSet extends FObj { /** {@inheritDoc} */ protected void startOfNode() throws FOPException { getRoot().setLayoutMasterSet(this); - simplePageMasters = new java.util.HashMap(); - pageSequenceMasters = new java.util.HashMap(); + simplePageMasters = new java.util.HashMap(); + pageSequenceMasters = new java.util.HashMap(); } /** {@inheritDoc} */ @@ -98,18 +98,13 @@ public class LayoutMasterSet extends FObj { */ private void checkRegionNames() throws ValidationException { // (user-entered) region-name to default region map. - Map allRegions = new java.util.HashMap(); - for (Iterator spm = simplePageMasters.values().iterator(); - spm.hasNext();) { - SimplePageMaster simplePageMaster - = (SimplePageMaster)spm.next(); - Map spmRegions = simplePageMaster.getRegions(); - for (Iterator e = spmRegions.values().iterator(); - e.hasNext();) { - Region region = (Region) e.next(); + Map allRegions = new java.util.HashMap(); + for (SimplePageMaster simplePageMaster : simplePageMasters.values()) { + Map spmRegions = simplePageMaster.getRegions(); + for (Region region : spmRegions.values()) { if (allRegions.containsKey(region.getRegionName())) { String defaultRegionName - = (String) allRegions.get(region.getRegionName()); + = allRegions.get(region.getRegionName()); if (!defaultRegionName.equals(region.getDefaultRegionName())) { getFOValidationEventProducer().regionNameMappedToMultipleRegionClasses(this, region.getRegionName(), @@ -118,7 +113,7 @@ public class LayoutMasterSet extends FObj { } } allRegions.put(region.getRegionName(), - region.getDefaultRegionName()); + region.getDefaultRegionName()); } } } @@ -155,7 +150,7 @@ public class LayoutMasterSet extends FObj { * @return the requested simple-page-master */ public SimplePageMaster getSimplePageMaster(String masterName) { - return (SimplePageMaster)this.simplePageMasters.get(masterName); + return this.simplePageMasters.get(masterName); } /** @@ -185,7 +180,7 @@ public class LayoutMasterSet extends FObj { * @return the requested PageSequenceMaster instance */ public PageSequenceMaster getPageSequenceMaster(String masterName) { - return (PageSequenceMaster)this.pageSequenceMasters.get(masterName); + return this.pageSequenceMasters.get(masterName); } /** @@ -194,9 +189,8 @@ public class LayoutMasterSet extends FObj { * @return true when the region name specified has a region in this LayoutMasterSet */ public boolean regionNameExists(String regionName) { - for (Iterator e = simplePageMasters.values().iterator(); - e.hasNext();) { - if (((SimplePageMaster)e.next()).regionNameExists(regionName)) { + for (SimplePageMaster spm : simplePageMasters.values()) { + if (spm.regionNameExists(regionName)) { return true; } } diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java index 74b85e78c..ee78bb8ba 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java @@ -48,7 +48,7 @@ public class PageSequence extends AbstractPageSequence { // the set of flows includes StaticContent flows also /** Map of flows to their flow name (flow-name, Flow) */ - private Map/**/ flowMap; + private Map flowMap; /** * The currentSimplePageMaster is either the page master for the @@ -96,7 +96,7 @@ public class PageSequence extends AbstractPageSequence { /** {@inheritDoc} */ protected void startOfNode() throws FOPException { super.startOfNode(); - flowMap = new java.util.HashMap/**/(); + flowMap = new java.util.HashMap(); this.simplePageMaster = getRoot().getLayoutMasterSet().getSimplePageMaster(masterReference); @@ -167,7 +167,7 @@ public class PageSequence extends AbstractPageSequence { break; case FO_STATIC_CONTENT: addFlow((StaticContent)child); - flowMap.put(((StaticContent)child).getFlowName(), child); + flowMap.put(((Flow)child).getFlowName(), (Flow)child); break; default: super.addChildNode(child); @@ -239,7 +239,7 @@ public class PageSequence extends AbstractPageSequence { } /** @return the flow map for this page-sequence */ - public Map getFlowMap() { + public Map getFlowMap() { return this.flowMap; } diff --git a/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java index 705b955e9..5b71525d3 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java @@ -44,7 +44,7 @@ public class PageSequenceMaster extends FObj { // End of property values private LayoutMasterSet layoutMasterSet; - private List subSequenceSpecifiers; + private List subSequenceSpecifiers; private SubSequenceSpecifier currentSubSequence; private int currentSubSequenceNumber = -1; @@ -76,7 +76,7 @@ public class PageSequenceMaster extends FObj { /** {@inheritDoc} */ protected void startOfNode() throws FOPException { - subSequenceSpecifiers = new java.util.ArrayList(); + subSequenceSpecifiers = new java.util.ArrayList(); layoutMasterSet = parent.getRoot().getLayoutMasterSet(); layoutMasterSet.addPageSequenceMaster(masterName, this); } @@ -121,8 +121,7 @@ public class PageSequenceMaster extends FObj { currentSubSequenceNumber++; if (currentSubSequenceNumber >= 0 && currentSubSequenceNumber < subSequenceSpecifiers.size()) { - return (SubSequenceSpecifier)subSequenceSpecifiers - .get(currentSubSequenceNumber); + return subSequenceSpecifiers.get(currentSubSequenceNumber); } return null; } @@ -134,8 +133,8 @@ public class PageSequenceMaster extends FObj { currentSubSequenceNumber = -1; currentSubSequence = null; if (subSequenceSpecifiers != null) { - for (int i = 0; i < subSequenceSpecifiers.size(); i++) { - ((SubSequenceSpecifier)subSequenceSpecifiers.get(i)).reset(); + for (SubSequenceSpecifier subSequenceSpecifier : subSequenceSpecifiers) { + subSequenceSpecifier.reset(); } } } @@ -150,7 +149,7 @@ public class PageSequenceMaster extends FObj { if (!success) { if (currentSubSequenceNumber > 0) { currentSubSequenceNumber--; - currentSubSequence = (SubSequenceSpecifier)subSequenceSpecifiers + currentSubSequence = subSequenceSpecifiers .get(currentSubSequenceNumber); } else { currentSubSequence = null; diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java index 9b4c6544f..629d7d59d 100644 --- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java +++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java @@ -48,7 +48,7 @@ public class RepeatablePageMasterAlternatives extends FObj private int numberConsumed = 0; - private List conditionalPageMasterRefs; + private List conditionalPageMasterRefs; private boolean hasPagePositionLast = false; private boolean hasPagePositionOnly = false; @@ -68,7 +68,7 @@ public class RepeatablePageMasterAlternatives extends FObj /** {@inheritDoc} */ protected void startOfNode() throws FOPException { - conditionalPageMasterRefs = new java.util.ArrayList(); + conditionalPageMasterRefs = new java.util.ArrayList(); assert parent.getName().equals("fo:page-sequence-master"); //Validation by the parent PageSequenceMaster pageSequenceMaster = (PageSequenceMaster)parent; @@ -128,9 +128,7 @@ public class RepeatablePageMasterAlternatives extends FObj numberConsumed++; } - for (int i = 0; i < conditionalPageMasterRefs.size(); i++) { - ConditionalPageMasterReference cpmr - = (ConditionalPageMasterReference)conditionalPageMasterRefs.get(i); + for (ConditionalPageMasterReference cpmr : conditionalPageMasterRefs) { if (cpmr.isValid(isOddPage, isFirstPage, isLastPage, isBlankPage)) { return cpmr.getMasterReference(); } diff --git a/src/java/org/apache/fop/fo/pagination/Root.java b/src/java/org/apache/fop/fo/pagination/Root.java index 8f8e0a509..b413d9224 100644 --- a/src/java/org/apache/fop/fo/pagination/Root.java +++ b/src/java/org/apache/fop/fo/pagination/Root.java @@ -47,8 +47,8 @@ public class Root extends FObj { private LayoutMasterSet layoutMasterSet; private Declarations declarations; private BookmarkTree bookmarkTree = null; - private List destinationList; - private List pageSequences; + private List destinationList; + private List pageSequences; // temporary until above list populated private boolean pageSequenceFound = false; @@ -77,7 +77,7 @@ public class Root extends FObj { */ public Root(FONode parent) { super(parent); - pageSequences = new java.util.ArrayList(); + pageSequences = new java.util.ArrayList(); } /** {@inheritDoc} */ @@ -243,7 +243,7 @@ public class Root extends FObj { return null; } if (currentIndex < (pageSequences.size() - 1)) { - return (PageSequence)pageSequences.get(currentIndex + 1); + return pageSequences.get(currentIndex + 1); } else { return null; } @@ -295,7 +295,7 @@ public class Root extends FObj { */ public void addDestination(Destination destination) { if (destinationList == null) { - destinationList = new java.util.ArrayList(); + destinationList = new java.util.ArrayList(); } destinationList.add(destination); } diff --git a/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java b/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java index aa2c2bb8b..2bb891cd9 100644 --- a/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java +++ b/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java @@ -28,6 +28,7 @@ public interface SubSequenceSpecifier { /** * Returns the name of the next page master. + * * @param isOddPage True if the next page number is odd * @param isFirstPage True if the next page is the first * @param isLastPage True if the next page is the last -- cgit v1.2.3 From af425f58c3f7b9bb0d94fa13731cc5d0d88ed1e5 Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Tue, 11 Jan 2011 23:38:25 +0000 Subject: CheckStyle fixup... git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1057931 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/pagination/Region.java | 1 + src/java/org/apache/fop/fo/pagination/RegionBefore.java | 3 ++- src/java/org/apache/fop/fo/pagination/RegionEnd.java | 3 ++- src/java/org/apache/fop/fo/pagination/RegionStart.java | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/java/org/apache/fop/fo/pagination') diff --git a/src/java/org/apache/fop/fo/pagination/Region.java b/src/java/org/apache/fop/fo/pagination/Region.java index fe5a95749..a3c259aa7 100644 --- a/src/java/org/apache/fop/fo/pagination/Region.java +++ b/src/java/org/apache/fop/fo/pagination/Region.java @@ -47,6 +47,7 @@ public abstract class Region extends FObj { private int writingMode; // End of property values + /** the parent {@link SimplePageMaster} */ protected final SimplePageMaster layoutMaster; /** diff --git a/src/java/org/apache/fop/fo/pagination/RegionBefore.java b/src/java/org/apache/fop/fo/pagination/RegionBefore.java index 6d12e6e4e..4aa29ec90 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionBefore.java +++ b/src/java/org/apache/fop/fo/pagination/RegionBefore.java @@ -57,7 +57,8 @@ public class RegionBefore extends RegionBA { PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE); PercentBaseContext neighbourContext; Rectangle vpRect; - if (layoutMaster.getWritingMode() == EN_LR_TB || layoutMaster.getWritingMode() == EN_RL_TB) { + if (layoutMaster.getWritingMode() == EN_LR_TB + || layoutMaster.getWritingMode() == EN_RL_TB) { neighbourContext = pageWidthContext; vpRect = new Rectangle(0, 0, reldims.ipd, getExtent().getValue(pageHeightContext)); } else { diff --git a/src/java/org/apache/fop/fo/pagination/RegionEnd.java b/src/java/org/apache/fop/fo/pagination/RegionEnd.java index 4a054ad4e..2533763a5 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionEnd.java +++ b/src/java/org/apache/fop/fo/pagination/RegionEnd.java @@ -52,7 +52,8 @@ public class RegionEnd extends RegionSE { PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE); PercentBaseContext neighbourContext; Rectangle vpRect; - if (layoutMaster.getWritingMode() == EN_LR_TB || layoutMaster.getWritingMode() == EN_RL_TB) { + if (layoutMaster.getWritingMode() == EN_LR_TB + || layoutMaster.getWritingMode() == EN_RL_TB) { neighbourContext = pageHeightContext; vpRect = new Rectangle(reldims.ipd - getExtent().getValue(pageWidthContext), 0, getExtent().getValue(pageWidthContext), reldims.bpd); diff --git a/src/java/org/apache/fop/fo/pagination/RegionStart.java b/src/java/org/apache/fop/fo/pagination/RegionStart.java index c0a57a0f7..fdb423c51 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionStart.java +++ b/src/java/org/apache/fop/fo/pagination/RegionStart.java @@ -52,7 +52,8 @@ public class RegionStart extends RegionSE { PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE); PercentBaseContext neighbourContext; Rectangle vpRect; - if (layoutMaster.getWritingMode() == EN_LR_TB || layoutMaster.getWritingMode() == EN_RL_TB) { + if (layoutMaster.getWritingMode() == EN_LR_TB + || layoutMaster.getWritingMode() == EN_RL_TB) { neighbourContext = pageHeightContext; vpRect = new Rectangle(0, 0, getExtent().getValue(pageWidthContext), reldims.bpd); } else { -- cgit v1.2.3 From 1eaae07e7db29a870d7dd037083a3e0fc9f7dc8c Mon Sep 17 00:00:00 2001 From: Simon Pepping Date: Fri, 14 Jan 2011 12:58:53 +0000 Subject: Fix deprecation warnings; add some type safety git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1058988 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/events/Event.java | 13 ++-- .../apache/fop/events/EventExceptionManager.java | 11 ++-- .../fop/events/PropertyExceptionFactory.java | 2 +- .../UnsupportedOperationExceptionFactory.java | 2 +- .../fop/events/ValidationExceptionFactory.java | 2 +- .../fop/fo/pagination/PageProductionException.java | 2 +- .../org/apache/fop/layoutmgr/LayoutException.java | 2 +- .../fop/render/AbstractGraphics2DAdapter.java | 5 +- .../org/apache/fop/render/AbstractRenderer.java | 8 ++- .../apache/fop/render/pdf/PDFDocumentHandler.java | 4 +- src/java/org/apache/fop/util/ColorUtil.java | 11 ++-- .../fop/util/text/AdvancedMessageFormat.java | 73 +++++++++++----------- .../org/apache/fop/traits/BorderPropsTestCase.java | 3 +- .../org/apache/fop/util/ColorUtilTestCase.java | 10 +-- 14 files changed, 80 insertions(+), 68 deletions(-) (limited to 'src/java/org/apache/fop/fo/pagination') diff --git a/src/java/org/apache/fop/events/Event.java b/src/java/org/apache/fop/events/Event.java index c48530c1c..ffec9473e 100644 --- a/src/java/org/apache/fop/events/Event.java +++ b/src/java/org/apache/fop/events/Event.java @@ -38,7 +38,7 @@ public class Event extends EventObject { private String eventKey; private EventSeverity severity; - private Map params; + private Map params; /** * Creates a new Event. @@ -47,7 +47,8 @@ public class Event extends EventObject { * @param severity the severity level * @param params the event parameters (a map of name/value pairs) */ - public Event(Object source, String eventID, EventSeverity severity, Map params) { + public Event(Object source, String eventID, EventSeverity severity, Map params) + { super(source); int pos = eventID.lastIndexOf('.'); if (pos < 0 || pos == eventID.length() - 1) { @@ -122,7 +123,7 @@ public class Event extends EventObject { * Returns an unmodifiable {@link java.util.Map} with all event parameters. * @return the parameter map */ - public Map getParams() { + public Map getParams() { return Collections.unmodifiableMap(this.params); } @@ -138,7 +139,7 @@ public class Event extends EventObject { * This class is a fluent builder class for building up the parameter map. */ public static class ParamsBuilder { - private Map params; + private Map params; /** * Adds a new parameter (a name/value pair). @@ -148,7 +149,7 @@ public class Event extends EventObject { */ public ParamsBuilder param(String name, Object value) { if (this.params == null) { - this.params = new java.util.HashMap(); + this.params = new java.util.HashMap(); } this.params.put(name, value); return this; @@ -158,7 +159,7 @@ public class Event extends EventObject { * Returns the accumulated parameter map. * @return the accumulated parameter map */ - public Map build() { + public Map build() { return this.params; } } diff --git a/src/java/org/apache/fop/events/EventExceptionManager.java b/src/java/org/apache/fop/events/EventExceptionManager.java index f7d679282..3494dc560 100644 --- a/src/java/org/apache/fop/events/EventExceptionManager.java +++ b/src/java/org/apache/fop/events/EventExceptionManager.java @@ -32,11 +32,12 @@ public final class EventExceptionManager { private EventExceptionManager() { } - private static final Map EXCEPTION_FACTORIES = new java.util.HashMap(); + private static final Map EXCEPTION_FACTORIES + = new java.util.HashMap(); static { - Iterator iter; - iter = Service.providers(ExceptionFactory.class, true); + Iterator iter; + iter = Service.providers(ExceptionFactory.class); while (iter.hasNext()) { ExceptionFactory factory = (ExceptionFactory)iter.next(); EXCEPTION_FACTORIES.put(factory.getExceptionClass().getName(), factory); @@ -63,7 +64,7 @@ public final class EventExceptionManager { String msg = EventFormatter.format(event); //Get original exception as cause if it is given as one of the parameters Throwable t = null; - Iterator iter = event.getParams().values().iterator(); + Iterator iter = event.getParams().values().iterator(); while (iter.hasNext()) { Object o = iter.next(); if (o instanceof Throwable) { @@ -96,6 +97,6 @@ public final class EventExceptionManager { * Returns the {@link Exception} class created by this factory. * @return the exception class */ - Class getExceptionClass(); + Class getExceptionClass(); } } diff --git a/src/java/org/apache/fop/events/PropertyExceptionFactory.java b/src/java/org/apache/fop/events/PropertyExceptionFactory.java index 753019b31..d8c7f39fb 100644 --- a/src/java/org/apache/fop/events/PropertyExceptionFactory.java +++ b/src/java/org/apache/fop/events/PropertyExceptionFactory.java @@ -40,7 +40,7 @@ public class PropertyExceptionFactory implements ExceptionFactory { } /** {@inheritDoc} */ - public Class getExceptionClass() { + public Class getExceptionClass() { return PropertyException.class; } diff --git a/src/java/org/apache/fop/events/UnsupportedOperationExceptionFactory.java b/src/java/org/apache/fop/events/UnsupportedOperationExceptionFactory.java index 7ec9d19b2..570fcbd64 100644 --- a/src/java/org/apache/fop/events/UnsupportedOperationExceptionFactory.java +++ b/src/java/org/apache/fop/events/UnsupportedOperationExceptionFactory.java @@ -36,7 +36,7 @@ public class UnsupportedOperationExceptionFactory implements ExceptionFactory { } /** {@inheritDoc} */ - public Class getExceptionClass() { + public Class getExceptionClass() { return UnsupportedOperationException.class; } diff --git a/src/java/org/apache/fop/events/ValidationExceptionFactory.java b/src/java/org/apache/fop/events/ValidationExceptionFactory.java index 760c4ec58..2c7c69ce9 100644 --- a/src/java/org/apache/fop/events/ValidationExceptionFactory.java +++ b/src/java/org/apache/fop/events/ValidationExceptionFactory.java @@ -43,7 +43,7 @@ public class ValidationExceptionFactory implements ExceptionFactory { } /** {@inheritDoc} */ - public Class getExceptionClass() { + public Class getExceptionClass() { return ValidationException.class; } diff --git a/src/java/org/apache/fop/fo/pagination/PageProductionException.java b/src/java/org/apache/fop/fo/pagination/PageProductionException.java index bb09db6f4..39060f3d4 100644 --- a/src/java/org/apache/fop/fo/pagination/PageProductionException.java +++ b/src/java/org/apache/fop/fo/pagination/PageProductionException.java @@ -98,7 +98,7 @@ public class PageProductionException extends RuntimeException { } /** {@inheritDoc} */ - public Class getExceptionClass() { + public Class getExceptionClass() { return PageProductionException.class; } diff --git a/src/java/org/apache/fop/layoutmgr/LayoutException.java b/src/java/org/apache/fop/layoutmgr/LayoutException.java index 2638d0210..f22d34bd8 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutException.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutException.java @@ -97,7 +97,7 @@ public class LayoutException extends RuntimeException { } /** {@inheritDoc} */ - public Class getExceptionClass() { + public Class getExceptionClass() { return LayoutException.class; } diff --git a/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java b/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java index f5a51b058..913a72b0d 100644 --- a/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java +++ b/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java @@ -148,7 +148,10 @@ public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter { RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * @deprecated + */ public void paintImage(Graphics2DImagePainter painter, RendererContext context, int x, int y, int width, int height) throws IOException { diff --git a/src/java/org/apache/fop/render/AbstractRenderer.java b/src/java/org/apache/fop/render/AbstractRenderer.java index d70d8113f..273f0bc16 100644 --- a/src/java/org/apache/fop/render/AbstractRenderer.java +++ b/src/java/org/apache/fop/render/AbstractRenderer.java @@ -208,15 +208,17 @@ public abstract class AbstractRenderer return sb.toString(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * @deprecated + */ public void startPageSequence(LineArea seqTitle) { //do nothing } /** {@inheritDoc} */ public void startPageSequence(PageSequence pageSequence) { - //TODO Discuss removing old deprecated method startPageSequence(LineArea) - startPageSequence(pageSequence.getTitle()); + // do nothing } // normally this would be overriden to create a page in the diff --git a/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java b/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java index 1cf291112..c1d959dd1 100644 --- a/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java +++ b/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java @@ -92,8 +92,8 @@ public class PDFDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { protected PageReference currentPageRef; /** Used for bookmarks/outlines. */ - protected Map pageReferences = - new java.util.HashMap(); + protected Map pageReferences + = new java.util.HashMap(); private final PDFDocumentNavigationHandler documentNavigationHandler = new PDFDocumentNavigationHandler(this); diff --git a/src/java/org/apache/fop/util/ColorUtil.java b/src/java/org/apache/fop/util/ColorUtil.java index 21277d60a..674079369 100644 --- a/src/java/org/apache/fop/util/ColorUtil.java +++ b/src/java/org/apache/fop/util/ColorUtil.java @@ -27,6 +27,7 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.xmlgraphics.java2d.color.ColorSpaces; import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace; import org.apache.fop.apps.FOUserAgent; @@ -50,7 +51,7 @@ public final class ColorUtil { * This map is used to predefine given colors, as well as speeding up * parsing of already parsed colors. */ - private static Map colorMap = null; + private static Map colorMap = null; /** Logger instance */ protected static final Log log = LogFactory.getLog(ColorUtil.class); @@ -328,7 +329,7 @@ public final class ColorUtil { String iccProfileSrc = null; if (isPseudoProfile(iccProfileName)) { if (CMYK_PSEUDO_PROFILE.equalsIgnoreCase(iccProfileName)) { - colorSpace = DeviceCMYKColorSpace.getInstance(); + colorSpace = ColorSpaces.getDeviceCMYKColorSpace(); } else { assert false : "Incomplete implementation"; } @@ -453,7 +454,7 @@ public final class ColorUtil { + "Arguments to cmyk() must be in the range [0%-100%] or [0.0-1.0]"); } float[] cmyk = new float[] {cyan, magenta, yellow, black}; - DeviceCMYKColorSpace cmykCs = DeviceCMYKColorSpace.getInstance(); + DeviceCMYKColorSpace cmykCs = ColorSpaces.getDeviceCMYKColorSpace(); float[] rgb = cmykCs.toRGB(cmyk); parsedColor = ColorExt.createFromFoRgbIcc(rgb[0], rgb[1], rgb[2], CMYK_PSEUDO_PROFILE, null, cmykCs, cmyk); @@ -521,7 +522,7 @@ public final class ColorUtil { * Initializes the colorMap with some predefined values. */ private static void initializeColorMap() { // CSOK: MethodLength - colorMap = Collections.synchronizedMap(new java.util.HashMap()); + colorMap = Collections.synchronizedMap(new java.util.HashMap()); colorMap.put("aliceblue", new Color(240, 248, 255)); colorMap.put("antiquewhite", new Color(250, 235, 215)); @@ -710,7 +711,7 @@ public final class ColorUtil { */ public static Color toCMYKGrayColor(float black) { float[] cmyk = new float[] {0f, 0f, 0f, 1.0f - black}; - DeviceCMYKColorSpace cmykCs = DeviceCMYKColorSpace.getInstance(); + DeviceCMYKColorSpace cmykCs = ColorSpaces.getDeviceCMYKColorSpace(); float[] rgb = cmykCs.toRGB(cmyk); return ColorExt.createFromFoRgbIcc(rgb[0], rgb[1], rgb[2], CMYK_PSEUDO_PROFILE, null, cmykCs, cmyk); diff --git a/src/java/org/apache/fop/util/text/AdvancedMessageFormat.java b/src/java/org/apache/fop/util/text/AdvancedMessageFormat.java index 002b3f95c..41b70046c 100644 --- a/src/java/org/apache/fop/util/text/AdvancedMessageFormat.java +++ b/src/java/org/apache/fop/util/text/AdvancedMessageFormat.java @@ -46,24 +46,27 @@ public class AdvancedMessageFormat { /** Regex that matches "," but not "\," (escaped comma) */ static final Pattern COMMA_SEPARATOR_REGEX = Pattern.compile("(? PART_FACTORIES + = new java.util.HashMap(); + private static final List OBJECT_FORMATTERS + = new java.util.ArrayList(); + private static final Map FUNCTIONS + = new java.util.HashMap(); private CompositePart rootPart; static { - Iterator iter; - iter = Service.providers(PartFactory.class, true); + Iterator iter; + iter = Service.providers(PartFactory.class); while (iter.hasNext()) { PartFactory factory = (PartFactory)iter.next(); PART_FACTORIES.put(factory.getFormat(), factory); } - iter = Service.providers(ObjectFormatter.class, true); + iter = Service.providers(ObjectFormatter.class); while (iter.hasNext()) { OBJECT_FORMATTERS.add((ObjectFormatter)iter.next()); } - iter = Service.providers(Function.class, true); + iter = Service.providers(Function.class); while (iter.hasNext()) { Function function = (Function)iter.next(); FUNCTIONS.put(function.getName(), function); @@ -189,7 +192,7 @@ public class AdvancedMessageFormat { * @param params a Map of named parameters (Contents: ) * @return the formatted message */ - public String format(Map params) { + public String format(Map params) { StringBuffer sb = new StringBuffer(); format(params, sb); return sb.toString(); @@ -200,7 +203,7 @@ public class AdvancedMessageFormat { * @param params a Map of named parameters (Contents: ) * @param target the target StringBuffer to write the formatted message to */ - public void format(Map params, StringBuffer target) { + public void format(Map params, StringBuffer target) { rootPart.write(target, params); } @@ -215,14 +218,14 @@ public class AdvancedMessageFormat { * @param sb the target string buffer * @param params the parameters to work with */ - void write(StringBuffer sb, Map params); + void write(StringBuffer sb, Map params); /** * Indicates whether there is any content that is generated by this message part. * @param params the parameters to work with * @return true if the part has content */ - boolean isGenerated(Map params); + boolean isGenerated(Map params); } /** @@ -277,7 +280,7 @@ public class AdvancedMessageFormat { * @param params the message parameters * @return the function result */ - Object evaluate(Map params); + Object evaluate(Map params); /** * Returns the name of the function. @@ -294,11 +297,11 @@ public class AdvancedMessageFormat { this.text = text; } - public void write(StringBuffer sb, Map params) { + public void write(StringBuffer sb, Map params) { sb.append(text); } - public boolean isGenerated(Map params) { + public boolean isGenerated(Map params) { return true; } @@ -316,7 +319,7 @@ public class AdvancedMessageFormat { this.fieldName = fieldName; } - public void write(StringBuffer sb, Map params) { + public void write(StringBuffer sb, Map params) { if (!params.containsKey(fieldName)) { throw new IllegalArgumentException( "Message pattern contains unsupported field name: " + fieldName); @@ -325,7 +328,7 @@ public class AdvancedMessageFormat { formatObject(obj, sb); } - public boolean isGenerated(Map params) { + public boolean isGenerated(Map params) { Object obj = params.get(fieldName); return obj != null; } @@ -349,9 +352,9 @@ public class AdvancedMessageFormat { target.append(obj); } else { boolean handled = false; - Iterator iter = OBJECT_FORMATTERS.iterator(); + Iterator iter = OBJECT_FORMATTERS.iterator(); while (iter.hasNext()) { - ObjectFormatter formatter = (ObjectFormatter)iter.next(); + ObjectFormatter formatter = iter.next(); if (formatter.supportsObject(obj)) { formatter.format(target, obj); handled = true; @@ -375,12 +378,12 @@ public class AdvancedMessageFormat { } } - public void write(StringBuffer sb, Map params) { + public void write(StringBuffer sb, Map params) { Object obj = this.function.evaluate(params); formatObject(obj, sb); } - public boolean isGenerated(Map params) { + public boolean isGenerated(Map params) { Object obj = this.function.evaluate(params); return obj != null; } @@ -393,7 +396,7 @@ public class AdvancedMessageFormat { private static class CompositePart implements Part { - protected List parts = new java.util.ArrayList(); + protected List parts = new java.util.ArrayList(); private boolean conditional; private boolean hasSections = false; @@ -401,7 +404,7 @@ public class AdvancedMessageFormat { this.conditional = conditional; } - private CompositePart(List parts) { + private CompositePart(List parts) { this.parts.addAll(parts); this.conditional = true; } @@ -411,7 +414,7 @@ public class AdvancedMessageFormat { throw new NullPointerException("part must not be null"); } if (hasSections) { - CompositePart composite = (CompositePart)this.parts.get(this.parts.size() - 1); + CompositePart composite = (CompositePart) this.parts.get(this.parts.size() - 1); composite.addChild(part); } else { this.parts.add(part); @@ -420,20 +423,20 @@ public class AdvancedMessageFormat { public void newSection() { if (!hasSections) { - List p = this.parts; + List p = this.parts; //Dropping into a different mode... - this.parts = new java.util.ArrayList(); + this.parts = new java.util.ArrayList(); this.parts.add(new CompositePart(p)); hasSections = true; } this.parts.add(new CompositePart(true)); } - public void write(StringBuffer sb, Map params) { + public void write(StringBuffer sb, Map params) { if (hasSections) { - Iterator iter = this.parts.iterator(); + Iterator iter = this.parts.iterator(); while (iter.hasNext()) { - CompositePart part = (CompositePart)iter.next(); + Part part = iter.next(); if (part.isGenerated(params)) { part.write(sb, params); break; @@ -441,20 +444,20 @@ public class AdvancedMessageFormat { } } else { if (isGenerated(params)) { - Iterator iter = this.parts.iterator(); + Iterator iter = this.parts.iterator(); while (iter.hasNext()) { - Part part = (Part)iter.next(); + Part part = iter.next(); part.write(sb, params); } } } } - public boolean isGenerated(Map params) { + public boolean isGenerated(Map params) { if (hasSections) { - Iterator iter = this.parts.iterator(); + Iterator iter = this.parts.iterator(); while (iter.hasNext()) { - Part part = (Part)iter.next(); + Part part = iter.next(); if (part.isGenerated(params)) { return true; } @@ -462,9 +465,9 @@ public class AdvancedMessageFormat { return false; } else { if (conditional) { - Iterator iter = this.parts.iterator(); + Iterator iter = this.parts.iterator(); while (iter.hasNext()) { - Part part = (Part)iter.next(); + Part part = iter.next(); if (!part.isGenerated(params)) { return false; } diff --git a/test/java/org/apache/fop/traits/BorderPropsTestCase.java b/test/java/org/apache/fop/traits/BorderPropsTestCase.java index be7714ba2..e142a4358 100644 --- a/test/java/org/apache/fop/traits/BorderPropsTestCase.java +++ b/test/java/org/apache/fop/traits/BorderPropsTestCase.java @@ -23,6 +23,7 @@ import java.awt.Color; import junit.framework.TestCase; +import org.apache.xmlgraphics.java2d.color.ColorSpaces; import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace; import org.apache.fop.fo.Constants; @@ -50,7 +51,7 @@ public class BorderPropsTestCase extends TestCase { assertEquals(b1, b2); float[] cmyk = new float[] {1.0f, 1.0f, 0.5f, 1.0f}; - DeviceCMYKColorSpace cmykCs = DeviceCMYKColorSpace.getInstance(); + DeviceCMYKColorSpace cmykCs = ColorSpaces.getDeviceCMYKColorSpace(); float[] rgb = cmykCs.toRGB(cmyk); col = ColorExt.createFromFoRgbIcc(rgb[0], rgb[1], rgb[2], "#CMYK", null, cmykCs, cmyk); diff --git a/test/java/org/apache/fop/util/ColorUtilTestCase.java b/test/java/org/apache/fop/util/ColorUtilTestCase.java index aefd2a76a..c2fb0fbc9 100644 --- a/test/java/org/apache/fop/util/ColorUtilTestCase.java +++ b/test/java/org/apache/fop/util/ColorUtilTestCase.java @@ -24,7 +24,7 @@ import java.awt.color.ColorSpace; import junit.framework.TestCase; -import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace; +import org.apache.xmlgraphics.java2d.color.ColorSpaces; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.FopFactory; @@ -156,7 +156,7 @@ public class ColorUtilTestCase extends TestCase { assertEquals(255, colActual.getRed()); assertEquals(255, colActual.getGreen()); assertEquals(0, colActual.getBlue()); - assertEquals(DeviceCMYKColorSpace.getInstance(), colActual.getColorSpace()); + assertEquals(ColorSpaces.getDeviceCMYKColorSpace(), colActual.getColorSpace()); float[] comps = colActual.getColorComponents(null); assertEquals(4, comps.length); assertEquals(0f, comps[0], 0); @@ -171,7 +171,7 @@ public class ColorUtilTestCase extends TestCase { assertEquals(248, colActual.getRed()); assertEquals(199, colActual.getGreen()); assertEquals(172, colActual.getBlue()); - assertEquals(DeviceCMYKColorSpace.getInstance(), colActual.getColorSpace()); + assertEquals(ColorSpaces.getDeviceCMYKColorSpace(), colActual.getColorSpace()); comps = colActual.getColorComponents(null); assertEquals(0.0274f, comps[0], 0.001); assertEquals(0.2196f, comps[1], 0.001); @@ -185,7 +185,7 @@ public class ColorUtilTestCase extends TestCase { assertEquals(255, colActual.getRed()); assertEquals(255, colActual.getGreen()); assertEquals(0, colActual.getBlue()); - assertEquals(DeviceCMYKColorSpace.getInstance(), colActual.getColorSpace()); + assertEquals(ColorSpaces.getDeviceCMYKColorSpace(), colActual.getColorSpace()); comps = colActual.getColorComponents(null); assertEquals(4, comps.length); assertEquals(0f, comps[0], 0); @@ -200,7 +200,7 @@ public class ColorUtilTestCase extends TestCase { assertEquals(127, colActual.getRed()); assertEquals(127, colActual.getGreen()); assertEquals(127, colActual.getBlue()); - assertEquals(DeviceCMYKColorSpace.getInstance(), colActual.getColorSpace()); + assertEquals(ColorSpaces.getDeviceCMYKColorSpace(), colActual.getColorSpace()); comps = colActual.getColorComponents(null); assertEquals(4, comps.length); assertEquals(0f, comps[0], 0); -- cgit v1.2.3 From b10e0688b12b294884feead6bab0ee1420d91676 Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Sat, 15 Jan 2011 18:42:50 +0000 Subject: Enable id property on fo:root. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1059387 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/pagination/Root.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/java/org/apache/fop/fo/pagination') diff --git a/src/java/org/apache/fop/fo/pagination/Root.java b/src/java/org/apache/fop/fo/pagination/Root.java index b413d9224..fb69dc2f1 100644 --- a/src/java/org/apache/fop/fo/pagination/Root.java +++ b/src/java/org/apache/fop/fo/pagination/Root.java @@ -82,6 +82,7 @@ public class Root extends FObj { /** {@inheritDoc} */ public void bind(PropertyList pList) throws FOPException { + super.bind(pList); mediaUsage = pList.get(PR_MEDIA_USAGE).getEnum(); } -- cgit v1.2.3