]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Addressed findbugs and checkstyle regressions Temp_ImproveAccessibility Temp_ImproveAccessibility
authorPeter Hancock <phancock@apache.org>
Mon, 6 Feb 2012 10:18:09 +0000 (10:18 +0000)
committerPeter Hancock <phancock@apache.org>
Mon, 6 Feb 2012 10:18:09 +0000 (10:18 +0000)
Findbugs report generated with version 1.3.9.
Checkstyle report generated with version 5.5.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ImproveAccessibility@1240963 13f79535-47bb-0310-9956-ffa450edef68

42 files changed:
findbugs-exclude.xml
src/java/org/apache/fop/accessibility/DummyStructureTreeEventHandler.java
src/java/org/apache/fop/accessibility/StructureTree2SAXEventAdapter.java
src/java/org/apache/fop/accessibility/StructureTreeElement.java
src/java/org/apache/fop/accessibility/fo/StructureTreeEventTrigger.java
src/java/org/apache/fop/apps/FOUserAgent.java
src/java/org/apache/fop/area/AreaTreeParser.java
src/java/org/apache/fop/fo/FOEventHandler.java
src/java/org/apache/fop/fo/FONode.java
src/java/org/apache/fop/fo/FOText.java
src/java/org/apache/fop/fo/flow/AbstractGraphics.java
src/java/org/apache/fop/fo/flow/AbstractListItemPart.java
src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
src/java/org/apache/fop/fo/flow/Block.java
src/java/org/apache/fop/fo/flow/Footnote.java
src/java/org/apache/fop/fo/flow/FootnoteBody.java
src/java/org/apache/fop/fo/flow/InitialPropertySet.java
src/java/org/apache/fop/fo/flow/InlineLevel.java
src/java/org/apache/fop/fo/flow/ListBlock.java
src/java/org/apache/fop/fo/flow/ListItem.java
src/java/org/apache/fop/fo/flow/PageNumber.java
src/java/org/apache/fop/fo/flow/table/Table.java
src/java/org/apache/fop/fo/flow/table/TableAndCaption.java
src/java/org/apache/fop/fo/flow/table/TableCaption.java
src/java/org/apache/fop/fo/flow/table/TableCell.java
src/java/org/apache/fop/fo/flow/table/TableCellContainer.java
src/java/org/apache/fop/fo/pagination/Root.java
src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java
src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTitle.java
src/java/org/apache/fop/layoutmgr/TraitSetter.java
src/java/org/apache/fop/pdf/PDFRoot.java
src/java/org/apache/fop/pdf/PDFStructElem.java
src/java/org/apache/fop/render/intermediate/IFConstants.java
src/java/org/apache/fop/render/intermediate/IFParser.java
src/java/org/apache/fop/render/intermediate/IFRenderer.java
src/java/org/apache/fop/render/intermediate/IFSerializer.java
src/java/org/apache/fop/render/intermediate/IFStructureTreeBuilder.java
src/java/org/apache/fop/render/intermediate/extensions/DocumentNavigationHandler.java
src/java/org/apache/fop/render/pdf/FOToPDFRoleMap.java
src/java/org/apache/fop/render/rtf/RTFHandler.java
src/java/org/apache/fop/render/xml/XMLRenderer.java
src/java/org/apache/fop/util/LanguageTags.java

index 67220fc1e695b8691cd1a55d501c997840dfa773..ba6b3abc0fc4b09597ebd5f55e2b1117b5e3a0ef 100644 (file)
@@ -1,6 +1,38 @@
 <?xml version="1.0" encoding="utf-8"?>
 <FindBugsFilter>
-   <!-- The names of public methods will not be modified -->
+   <Match>
+      <Class name="org.apache.fop.render.intermediate.IFStructureTreeBuilder"/>
+      <Field name="delegate"/>
+      <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+   </Match>
+   <Match>
+      <Class name="org.apache.fop.render.pdf.PDFLogicalStructureHandler"/>
+      <Field name="currentPage"/>
+      <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+   </Match>
+   <Match>
+      <Class name="org.apache.fop.render.pdf.PDFLogicalStructureHandler"/>
+      <Field name="pageParentTreeArray"/>
+      <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+   </Match>
+   <Match>
+      <Class name="org.apache.fop.render.pdf.PDFStructureTreeBuilder"/>
+      <Field name="logicalStructureHandler"/>
+      <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+   </Match>
+   <Match>
+      <Class name="org.apache.fop.render.pdf.PDFStructureTreeBuilder"/>
+      <Field name="pdfFactory"/>
+      <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+   </Match>
+   <Match>
+      <Class name="org.apache.fop.accessibility.fo.FO2StructureTreeConverter$1"/>
+      <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
+   </Match>
+   <Match>
+      <Class name="~org.apache.fop.accessibility.fo.FOEventRecorder.*"/>
+      <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
+   </Match>
    <Match>
       <Class name="org.apache.fop.afp.AFPDataObjectInfo"/>
       <Method name="getUri"/>
         <Bug pattern="REC_CATCH_EXCEPTION"/>
    </Match>
    <!-- /Automatically generated list of exclusions on 18 February 2011 -->
-</FindBugsFilter>
\ No newline at end of file
+</FindBugsFilter>
index f8507a64ffc513682b886cd306a397369fee5ba7..66eaece89e843dbe305d306d197bf012b5408f6b 100644 (file)
@@ -33,23 +33,29 @@ public final class DummyStructureTreeEventHandler implements StructureTreeEventH
 
     private DummyStructureTreeEventHandler() { }
 
+    /** {@inheritDoc} */
     public void startPageSequence(Locale locale) {
     }
 
+    /** {@inheritDoc} */
     public void endPageSequence() {
     }
 
+    /** {@inheritDoc} */
     public StructureTreeElement startNode(String name, Attributes attributes) {
         return null;
     }
 
+    /** {@inheritDoc} */
     public void endNode(String name) {
     }
 
+    /** {@inheritDoc} */
     public StructureTreeElement startImageNode(String name, Attributes attributes) {
         return null;
     }
 
+    /** {@inheritDoc} */
     public StructureTreeElement startReferencedNode(String name, Attributes attributes) {
         return null;
     }
index 6578b452e4e3c9b2e2286678ae8dea4eba1c94ca..79c589f9b71206d7208a329e6e39b3387c127383 100644 (file)
@@ -45,11 +45,13 @@ public final class StructureTree2SAXEventAdapter implements StructureTreeEventHa
     /**
      * Factory method that creates a new instance.
      * @param contentHandler The handler that receives SAX events
+     * @return -
      */
     public static StructureTreeEventHandler newInstance(ContentHandler contentHandler) {
         return new StructureTree2SAXEventAdapter(contentHandler);
     }
 
+    /** {@inheritDoc} */
     public void startPageSequence(Locale locale) {
         try {
 
@@ -65,6 +67,7 @@ public final class StructureTree2SAXEventAdapter implements StructureTreeEventHa
         }
     }
 
+    /** {@inheritDoc} */
     public void endPageSequence() {
         try {
             contentHandler.endElement(IFConstants.NAMESPACE, IFConstants.EL_STRUCTURE_TREE,
@@ -79,6 +82,7 @@ public final class StructureTree2SAXEventAdapter implements StructureTreeEventHa
         }
     }
 
+    /** {@inheritDoc} */
     public StructureTreeElement startNode(String name, Attributes attributes) {
         try {
             if (name.equals("#PCDATA")) {
@@ -96,6 +100,7 @@ public final class StructureTree2SAXEventAdapter implements StructureTreeEventHa
         }
     }
 
+    /** {@inheritDoc} */
     public void endNode(String name) {
         try {
             contentHandler.endElement(FOElementMapping.URI, name,
@@ -105,10 +110,12 @@ public final class StructureTree2SAXEventAdapter implements StructureTreeEventHa
         }
     }
 
+    /** {@inheritDoc} */
     public StructureTreeElement startImageNode(String name, Attributes attributes) {
         return startNode(name, attributes);
     }
 
+    /** {@inheritDoc} */
     public StructureTreeElement startReferencedNode(String name, Attributes attributes) {
         return startNode(name, attributes);
     }
index 3a691c42cd7be24a94fa2b3198059d45bfd6ccab..ebed2c8ffe3b2a88c2bef9f0b811dea016718d55 100644 (file)
@@ -17,9 +17,6 @@
 
 /* $Id$ */
 
-/**
- *
- */
 package org.apache.fop.accessibility;
 
 /**
index b5cd0a5a4294f1ad81ee5d3b6bd792e6bd078757..957f408700d4fa05d5cc144fba64f815e2605396 100644 (file)
@@ -362,7 +362,8 @@ class StructureTreeEventTrigger extends FOEventHandler {
         if (node instanceof CommonAccessibilityHolder) {
             addRole((CommonAccessibilityHolder) node, attributes);
         }
-        node.setStructureTreeElement(structureTreeEventHandler.startReferencedNode(localName, attributes));
+        node.setStructureTreeElement(
+                structureTreeEventHandler.startReferencedNode(localName, attributes));
     }
 
     private void startElementWithIDAndAltText(AbstractGraphics node) {
@@ -371,7 +372,8 @@ class StructureTreeEventTrigger extends FOEventHandler {
         addRole(node, attributes);
         addAttribute(attributes, ExtensionElementMapping.URI, "alt-text",
                 ExtensionElementMapping.STANDARD_PREFIX, node.getAltText());
-        node.setStructureTreeElement(structureTreeEventHandler.startImageNode(localName, attributes));
+        node.setStructureTreeElement(
+                structureTreeEventHandler.startImageNode(localName, attributes));
     }
 
     private StructureTreeElement startElement(FONode node, AttributesImpl attributes) {
index d5cc695c880daf4afa2f67016317d35d67d8bfbe..7d173658633a32403372a6ffe52b517479e5d052 100644 (file)
@@ -102,7 +102,8 @@ public class FOUserAgent {
     private boolean locatorEnabled = true; // true by default (for error messages).
     private boolean conserveMemoryPolicy = false;
     private EventBroadcaster eventBroadcaster = new FOPEventBroadcaster();
-    private StructureTreeEventHandler structureTreeEventHandler = DummyStructureTreeEventHandler.INSTANCE;
+    private StructureTreeEventHandler structureTreeEventHandler
+            = DummyStructureTreeEventHandler.INSTANCE;
 
     /** Producer:  Metadata element for the system/software that produces
      * the document. (Some renderers can store this in the document.)
index 29a3634958b60d087849135b79fc2a80a7b25f35..d8c22f2e8a6e53aa76d9e621981f022ada9713f5 100644 (file)
@@ -163,8 +163,6 @@ public class AreaTreeParser {
         private DOMImplementation domImplementation;
         private Locator locator;
 
-        private Attributes pageSequenceAttributes;
-
         public Handler(AreaTreeModel treeModel, FOUserAgent userAgent,
                 ElementMappingRegistry elementMappingRegistry) {
             this.treeModel = treeModel;
index bed1f3677770e26755a724deaf3434d68a3360f7..b7bcd4215e411da1c2a4259a19d3529d3973fe33 100644 (file)
@@ -122,9 +122,11 @@ public abstract class FOEventHandler {
     public void endDocument() throws SAXException {
     }
 
+    /** {@inheritDoc} */
     public void startRoot(Root root) {
     }
 
+    /** {@inheritDoc} */
     public void endRoot(Root root) {
     }
 
index 622ff86d48cedaafaede180ceb31e338876586d4..b63c49ae28b958599f968fdbe88f56186a732002 100644 (file)
@@ -913,6 +913,11 @@ public abstract class FONode implements Cloneable {
 
     }
 
+    /**
+     * Sets the structure tree element.
+     *
+     * @param structureTreeElement set.
+     */
     public void setStructureTreeElement(StructureTreeElement structureTreeElement) {
         throw new UnsupportedOperationException();
     }
index 3858cdea9eafbcf982682af990861362b1e3b72e..43b58685f17349809a35414d3b61eaee3adff913 100644 (file)
@@ -667,6 +667,7 @@ public class FOText extends FONode implements CharSequence {
         this.structureTreeElement = structureTreeElement;
     }
 
+    /** @return the structure tree element. */
     public StructureTreeElement getStructureTreeElement() {
         return structureTreeElement;
     }
index 2b8fa8a0bc65ad2395214ac65d2e2a1bbf17da77..d5fe2b50091b69a4838ebce4ba951b135ff4e6ef 100644 (file)
@@ -119,6 +119,7 @@ public abstract class AbstractGraphics extends FObj
         }
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
@@ -236,6 +237,7 @@ public abstract class AbstractGraphics extends FObj
         return structureTreeElement;
     }
 
+    /** @return  the alternative text property. */
     public String getAltText() {
         return altText;
     }
index 3ee44ac4fd60aaa8676e474ecfd498ecdf8ebb8b..0e99bfe96bdd7786e9f9ddeb78948d69bb4fedfe 100644 (file)
@@ -91,6 +91,7 @@ public abstract class AbstractListItemPart extends FObj implements CommonAccessi
         }
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index 108896d913dd85957871c1e95ea4477ba3847471..5a6893b552bee78a85de9d6b688e6f38e03cab5a 100644 (file)
@@ -132,6 +132,7 @@ public abstract class AbstractPageNumberCitation extends FObj
         }
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index 4e5b6f15fe4bf0199beba811930660664d5f2360..84f1abc1b8b950fadfaab2df25999209ab23cf50 100644 (file)
@@ -151,6 +151,7 @@ public class Block extends FObjMixed implements BreakPropertySet,
         getFOEventHandler().endBlock(this);
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index 61149b0342a9c83e81a1f816b1a43d9ebbdffcbe..5953363ed8b3d6821ad37156dde64f5ecc90d20f 100644 (file)
@@ -111,6 +111,7 @@ public class Footnote extends FObj implements CommonAccessibilityHolder {
         }
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index 24edaf5d272529c8f0cb2b8de1e8afc7e99a31ac..1c103b6b5da080ba7e82c0ea17012d43a6bb4329 100644 (file)
@@ -36,6 +36,7 @@ import org.apache.fop.fo.properties.CommonAccessibilityHolder;
  */
 public class FootnoteBody extends FObj implements CommonAccessibilityHolder {
 
+    /** {@inheritDoc} */
     private CommonAccessibility commonAccessibility;
 
     /**
@@ -96,6 +97,7 @@ public class FootnoteBody extends FObj implements CommonAccessibilityHolder {
         return FO_FOOTNOTE_BODY;
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index 47ce749fe3f5eb4c466a7773d3f5f7c50c9d4104..b41021b75bbae750c3bba2f89830ccd1bbddeaa8 100644 (file)
@@ -101,6 +101,7 @@ public class InitialPropertySet extends FObj implements CommonAccessibilityHolde
         return FO_INITIAL_PROPERTY_SET;
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index d23b775f0d6a48badbb36072f100678d7b4e5aae..0da7690808907e855bb4f61ce63c0428b2cc97e6 100644 (file)
@@ -72,6 +72,7 @@ public abstract class InlineLevel extends FObjMixed implements CommonAccessibili
         lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index 390978c194fad00d7cb563a7c18538cc01258f95..35288ec80e208960cb8f50c3c9b2474ca8e1152f 100644 (file)
@@ -126,6 +126,7 @@ public class ListBlock extends FObj implements BreakPropertySet, CommonAccessibi
         }
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index dfd74f9d172e9f05864c37b5cc80f13e9b29e005..aa177777c2d3dbeeb9b96e91346cc888ef8d0c56 100644 (file)
@@ -137,6 +137,7 @@ public class ListItem extends FObj implements BreakPropertySet, CommonAccessibil
         }
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index 0e5ce5071dae9d40fdb39bdc41fbdc3610513986..59169c2d3b5884a6b66adf9bcc581a6a022ff301 100644 (file)
@@ -127,6 +127,7 @@ public class PageNumber extends FObj
         }
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index ae7b8e4a1d67e9a6d1484deaa3e47c94e863615d..c78f9f95913309c4c00f3d96a487b889d9762d41 100644 (file)
@@ -305,6 +305,7 @@ public class Table extends TableFObj implements ColumnNumberManagerHolder, Break
         }
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index 62acc579c08a01075db9d4dc28fcbde4879ef2e9..51db27e4ebfde8425aca5eb993a6eb06afceef49 100644 (file)
@@ -140,6 +140,7 @@ public class TableAndCaption extends FObj implements CommonAccessibilityHolder {
         return FO_TABLE_AND_CAPTION;
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index 127c09802f8334ec5936d1ed2653bd9d8d9102f3..380b27f34f0e0301cb794d1deba83404207e57af 100644 (file)
@@ -116,6 +116,7 @@ public class TableCaption extends FObj implements CommonAccessibilityHolder {
         return FO_TABLE_CAPTION;
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index 549377ffd736e96d3f7b93a9e3003d68f38dd6a2..c4f9c2aa62fbcfeb7d68acd4efbc1a1156f9064a 100644 (file)
@@ -148,6 +148,7 @@ public class TableCell extends TableFObj implements CommonAccessibilityHolder {
         return true;
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index 4b2a5101f26f80d41ff76bb808490bf339af47e0..89ecd159a577555927f161dfc00c02b8c860fc83 100644 (file)
@@ -128,6 +128,7 @@ public abstract class TableCellContainer extends TableFObj
         return columnNumberManager;
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index 6df6e95370e6c2df3f7622faa60aa6448a556dc9..1a2ce718beee3f654f8e7a92bbca4b4b62386d6c 100644 (file)
@@ -181,6 +181,7 @@ public class Root extends FObj implements CommonAccessibilityHolder {
         }
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
@@ -365,6 +366,7 @@ public class Root extends FObj implements CommonAccessibilityHolder {
     }
 
 
+    /** @return locale proprty. */
     public Locale getLocale() {
         return locale;
     }
index 5348e88e3fc0a2a9017104f57d7bf730bfe7e654..9e7d80ceaf75f997c4582b911c3f0fb079f51c4c 100644 (file)
@@ -117,6 +117,7 @@ public class Bookmark extends FObj implements CommonAccessibilityHolder {
         }
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index f4441934d0e05ddf2f16d68f7dfc306bb99faaf3..1db7d84cadfbd956c623a5bc48ee389314fbded4 100644 (file)
@@ -84,6 +84,7 @@ public class BookmarkTitle extends FObj implements CommonAccessibilityHolder {
         }
     }
 
+    /** {@inheritDoc} */
     public CommonAccessibility getCommonAccessibility() {
         return commonAccessibility;
     }
index da548c23cb0c2c117b43a561b2097d20ea821b44..0ae4994787af882defae022cb9a43ac4a5f01838 100644 (file)
@@ -597,7 +597,8 @@ public final class TraitSetter {
      * @param area the area to set the traits on
      * @param structureTreeElement the element the area is associated to in the document structure
      */
-    public static void addStructureTreeElement(Area area, StructureTreeElement structureTreeElement) {
+    public static void addStructureTreeElement(Area area,
+            StructureTreeElement structureTreeElement) {
         if (structureTreeElement != null) {
             area.addTrait(Trait.STRUCTURE_TREE_ELEMENT, structureTreeElement);
         }
index 177ca4b2dba4215ad1a18896f9a73405ac74f364..76f2587def77483e82ad5c8d74340e8424b58ed8 100644 (file)
@@ -255,8 +255,8 @@ public class PDFRoot extends PDFDictionary {
     }
 
     /**
-     * Sets the language identifier of the document.
-     * @param lang the language identifier of the document.
+     * Sets the locale of the document.
+     * @param locale the locale of the document.
      */
     public void setLanguage(Locale locale) {
         if (locale == null) {
index 44622638d32812663e16cd348074127df20d1775..d2b3be6aae04119c474bf3b428c705a742d010d7 100644 (file)
@@ -179,6 +179,9 @@ public class PDFStructElem extends PDFDictionary implements StructureTreeElement
         return kidsAttached;
     }
 
+    /**
+     * Class representing a placeholder for a PDF Structure Element.
+     */
     public static class Placeholder extends PDFStructElem {
 
         @Override
@@ -195,6 +198,11 @@ public class PDFStructElem extends PDFDictionary implements StructureTreeElement
             }
         }
 
+        /**
+         * Constructor
+         * @param parent -
+         * @param name -
+         */
         public Placeholder(PDFObject parent, String name) {
             super(parent, new PDFName(name));
         }
index dba39bec09f94ac5698f37fe9a632bb45f9af529..c7bf13e31dcca35c71aa5e72e30deca26ea8adda 100644 (file)
@@ -39,6 +39,7 @@ public interface IFConstants extends XMLConstants {
     String EL_HEADER = "header";
     /** element name trailer */
     String EL_TRAILER = "trailer";
+    /** element name locale */
     String EL_LOCALE = "locale";
     /** element name page-sequence */
     String EL_PAGE_SEQUENCE = "page-sequence";
index 1a384c6e91f37cc9203df0763554c8979733be7b..36f1fd8412cb3ad6c3b9be8c973f2e1bfeeb7510 100644 (file)
@@ -160,8 +160,8 @@ public class IFParser implements IFConstants {
 
         private Attributes pageSequenceAttributes;
 
-        private Map<String, StructureTreeElement> structureTreeElements =
-                new HashMap<String, StructureTreeElement>();
+        private Map<String, StructureTreeElement> structureTreeElements
+                new HashMap<String, StructureTreeElement>();
 
         private final class StructureTreeHandler extends DefaultHandler {
 
@@ -191,12 +191,12 @@ public class IFParser implements IFConstants {
                         structureTreeEventHandler.startNode(localName, attributes);
                     } else if (localName.equals("external-graphic")
                             || localName.equals("instream-foreign-object")) {
-                        StructureTreeElement structureTreeElement =
-                            structureTreeEventHandler.startImageNode(localName, attributes);
+                        StructureTreeElement structureTreeElement
+                                = structureTreeEventHandler.startImageNode(localName, attributes);
                         structureTreeElements.put(structID, structureTreeElement);
                     } else {
-                        StructureTreeElement structureTreeElement =
-                            structureTreeEventHandler.startReferencedNode(localName, attributes);
+                        StructureTreeElement structureTreeElement = structureTreeEventHandler
+                                    .startReferencedNode(localName, attributes);
                         structureTreeElements.put(structID, structureTreeElement);
                     }
                 }
@@ -289,7 +289,8 @@ public class IFParser implements IFConstants {
                 } else if (DocumentNavigationExtensionConstants.NAMESPACE.equals(uri)) {
                     if (this.navParser == null) {
                         this.navParser = new DocumentNavigationHandler(
-                                this.documentHandler.getDocumentNavigationHandler(), structureTreeElements);
+                                this.documentHandler.getDocumentNavigationHandler(),
+                                        structureTreeElements);
                     }
                     delegate = this.navParser;
                     delegateDepth++;
index a2d8a0bea87a53f1b01945aae718158687144d8e..4657c8856cb1814bbdb776a319090b8e0adbcd2c 100644 (file)
@@ -852,8 +852,8 @@ public class IFRenderer extends AbstractPathOrientedRenderer {
 
     /** {@inheritDoc} */
     public void renderInlineViewport(InlineViewport viewport) {
-        StructureTreeElement structElem =
-                (StructureTreeElement) viewport.getTrait(Trait.STRUCTURE_TREE_ELEMENT);
+        StructureTreeElement structElem
+                (StructureTreeElement) viewport.getTrait(Trait.STRUCTURE_TREE_ELEMENT);
         establishStructureTreeElement(structElem);
         pushdID(viewport);
         Dimension dim = new Dimension(viewport.getIPD(), viewport.getBPD());
@@ -957,8 +957,8 @@ public class IFRenderer extends AbstractPathOrientedRenderer {
 
         // warn if link trait found but not allowed, else create link
         if (linkTraitFound) {
-            StructureTreeElement structElem =
-                    (StructureTreeElement) ip.getTrait(Trait.STRUCTURE_TREE_ELEMENT);
+            StructureTreeElement structElem 
+                    (StructureTreeElement) ip.getTrait(Trait.STRUCTURE_TREE_ELEMENT);
             action.setStructureTreeElement(structElem);
             Link link = new Link(action, ipRect);
             this.deferredLinks.add(link);
@@ -1012,7 +1012,8 @@ public class IFRenderer extends AbstractPathOrientedRenderer {
 
         String fontName = getInternalFontNameForArea(text);
         int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
-        StructureTreeElement structElem = (StructureTreeElement) text.getTrait(Trait.STRUCTURE_TREE_ELEMENT);
+        StructureTreeElement structElem
+                = (StructureTreeElement) text.getTrait(Trait.STRUCTURE_TREE_ELEMENT);
         establishStructureTreeElement(structElem);
 
         // This assumes that *all* CIDFonts use a /ToUnicode mapping
index c6bf9af9e625420b763d4c08e2a1517fa0fe0773..7b9d95849d090a92f9ecaca4be153b6edeebb1a6 100644 (file)
@@ -165,7 +165,8 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
             handler.startPrefixMapping(XLINK_PREFIX, XLINK_NAMESPACE);
             handler.startPrefixMapping(DocumentNavigationExtensionConstants.PREFIX,
                     DocumentNavigationExtensionConstants.NAMESPACE);
-            handler.startPrefixMapping(InternalElementMapping.STANDARD_PREFIX, InternalElementMapping.URI);
+            handler.startPrefixMapping(InternalElementMapping.STANDARD_PREFIX,
+                    InternalElementMapping.URI);
             handler.startElement(EL_DOCUMENT);
         } catch (SAXException e) {
             throw new IFException("SAX error in startDocument()", e);
@@ -686,10 +687,10 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
     }
 
     private void addStructureReference(AttributesImpl atts) {
-        IFStructureTreeElement structureTreeElement =
-                (IFStructureTreeElement) getContext().getStructureTreeElement();
+        IFStructureTreeElement structureTreeElement
+                (IFStructureTreeElement) getContext().getStructureTreeElement();
         if (structureTreeElement != null) {
-            addStructRefAttribute(atts, structureTreeElement.id);
+            addStructRefAttribute(atts, structureTreeElement.getId());
         }
     }
 
@@ -786,7 +787,7 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
                 XMLConstants.CDATA, IFUtil.toString(link.getTargetRect()));
         if (getUserAgent().isAccessibilityEnabled()) {
             addStructRefAttribute(atts,
-                    ((IFStructureTreeElement) link.getAction().getStructureTreeElement()).id);
+                    ((IFStructureTreeElement) link.getAction().getStructureTreeElement()).getId());
         }
         try {
             handler.startElement(DocumentNavigationExtensionConstants.LINK, atts);
index b78ae35bcd7f628736525f45ab77c06be65d8bad..3d98859148099cf4c91a5db9d39a467086ee1a33 100644 (file)
@@ -43,7 +43,7 @@ final class IFStructureTreeBuilder implements StructureTreeEventHandler {
 
     static final class IFStructureTreeElement implements StructureTreeElement {
 
-        final String id;
+        private final String id;
 
         IFStructureTreeElement() {
             this.id = null;
@@ -52,6 +52,10 @@ final class IFStructureTreeBuilder implements StructureTreeEventHandler {
         IFStructureTreeElement(String id) {
             this.id = id;
         }
+
+        public String getId() {
+            return id;
+        }
     }
 
     /** A SAX handler that records events to replay them later. */
@@ -106,8 +110,8 @@ final class IFStructureTreeBuilder implements StructureTreeEventHandler {
 
         private static final class StartPrefixMapping extends SAXEventRecorder.Event {
 
-            protected final String prefix;
-            protected final String uri;
+            private final String prefix;
+            private final String uri;
 
             private StartPrefixMapping(String prefix, String uri) {
                 this.prefix = prefix;
@@ -122,7 +126,7 @@ final class IFStructureTreeBuilder implements StructureTreeEventHandler {
 
         private static final class EndPrefixMapping extends SAXEventRecorder.Event {
 
-            protected final String prefix;
+            private final String prefix;
 
             private EndPrefixMapping(String prefix) {
                 this.prefix = prefix;
@@ -169,7 +173,8 @@ final class IFStructureTreeBuilder implements StructureTreeEventHandler {
 
     private StructureTreeEventHandler delegate;
 
-    private final List<SAXEventRecorder> pageSequenceEventRecorders = new ArrayList<SAXEventRecorder>();
+    private final List<SAXEventRecorder> pageSequenceEventRecorders
+            = new ArrayList<SAXEventRecorder>();
 
     private int idCounter;
 
index 693497b73145c04d637a52fdbcafddb646fb06cb..c174a74a9dee4d2263e44070125a0dec72956eea 100644 (file)
@@ -107,8 +107,8 @@ public class DocumentNavigationHandler extends DefaultHandler
                     throw new SAXException(localName + " must be the root element!");
                 }
                 Rectangle targetRect = XMLUtil.getAttributeAsRectangle(attributes, "rect");
-                structureTreeElement = structureTreeElements.get(
-                        attributes.getValue(InternalElementMapping.URI, InternalElementMapping.STRUCT_REF));
+                structureTreeElement = structureTreeElements.get(attributes.getValue(
+                        InternalElementMapping.URI, InternalElementMapping.STRUCT_REF));
                 Link link = new Link(null, targetRect);
                 objectStack.push(link);
             } else if (GOTO_XY.getLocalName().equals(localName)) {
index c773b133916ed0d6d1d66f9795f87f6d7861145b..9b76d0620d9871bd811ebde9dddc0e7a2bbff164 100644 (file)
@@ -35,9 +35,11 @@ final class FOToPDFRoleMap {
     /**
      * Standard structure types defined by the PDF Reference, Fourth Edition (PDF 1.5).
      */
-    private static final Map<String, PDFName> STANDARD_STRUCTURE_TYPES = new HashMap<String, PDFName>();
+    private static final Map<String, PDFName> STANDARD_STRUCTURE_TYPES
+            = new HashMap<String, PDFName>();
 
-    private static final Map<String, Mapper> DEFAULT_MAPPINGS = new java.util.HashMap<String, Mapper>();
+    private static final Map<String, Mapper> DEFAULT_MAPPINGS
+            = new java.util.HashMap<String, Mapper>();
 
     private static final PDFName THEAD;
     private static final PDFName NON_STRUCT;
index a3e3db461fda27f19933ff59fae9856b9790dbcb..dea5dcbecefab3d947949d37048fd946d913ecf7 100644 (file)
@@ -1353,8 +1353,10 @@ public class RTFHandler extends FOEventHandler {
             RtfTextrun textrun = container.getTextrun();
 
             textrun.addLeader(rtfAttr);
-
-        } catch (Exception e) {
+        } catch (IOException e) {
+            log.error("startLeader: " + e.getMessage());
+            throw new RuntimeException(e.getMessage());
+        } catch (FOPException e) {
             log.error("startLeader: " + e.getMessage());
             throw new RuntimeException(e.getMessage());
         }
index 2a62d2cea334e1fa12eb23c31edbe5f70616e6c2..5029346c07442f14676866f69c1fd744b129777b 100644 (file)
@@ -105,8 +105,6 @@ public class XMLRenderer extends AbstractXMLRenderer {
     /** If not null, the XMLRenderer will mimic another renderer by using its font setup. */
     protected Renderer mimic;
 
-    private int pageSequenceIndex;
-
     /**
      * Creates a new XML renderer.
      */
index 070fa15db616b62255cd758d35838d74e03e748d..662fab90863729cd503cf5ad1cc5ecb2410755a0 100644 (file)
@@ -37,7 +37,6 @@ public final class LanguageTags {
      *
      * @param locale a locale
      * @return the corresponding language tag
-     * @throws NullPointerException if the specified locale is null
      */
     public static String toLanguageTag(Locale locale) {
         StringBuffer sb = new StringBuffer(5);
@@ -53,7 +52,8 @@ public final class LanguageTags {
     /**
      * Converts an RFC 3066 compliant language tag to a locale.
      *
-     * @throws NullPointerException if the specified language tag is null
+     * @param languageTag language tag to convert
+     * @return the corresponding locale
      */
     public static Locale toLocale(String languageTag) {
         String[] parts = languageTag.split("-");