Author: ssteiner
Date: Tue May 26 07:58:18 2015
New Revision: 1681707
URL: http://svn.apache.org/r1681707
Log:
Merge from trunk
Added:
xmlgraphics/fop/branches/fop-2_0/test/layoutengine/standard-testcases/footnote_id.xml
- copied unchanged from r1681699,
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_id.xml
Modified:
xmlgraphics/fop/branches/fop-2_0/build.xml
xmlgraphics/fop/branches/fop-2_0/findbugs-exclude.xml
xmlgraphics/fop/branches/fop-2_0/lib/xmlgraphics-commons-2.0.1.jar
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/afp/AFPStreamer.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/AreaTreeObject.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/Page.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/PageViewport.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/RegionReference.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/inline/InlineArea.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/inline/TextArea.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/complexscripts/fonts/GlyphProcessingState.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiProperties.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiPropertySet.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiToggle.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/table/TableCaption.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonAural.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonMarginInline.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fonts/truetype/OpenFont.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/hyphenation/Hyphenator.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/hyphenation/SerializeHyphPattern.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/pdf/PDFCMap.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/pdf/PDFFactory.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/AbstractRenderer.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandler.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerGraphics2D.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerRawJPEG.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerSVG.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/intermediate/IFParser.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/intermediate/IFRenderer.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFArrayElement.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFDictionaryElement.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceElement.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/RTFHandler.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/xml/XMLRenderer.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/svg/NativeTextPainter.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/svg/PDFGraphics2D.java
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/tools/anttasks/RunTest.java
Modified: xmlgraphics/fop/branches/fop-2_0/build.xml
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/build.xml?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
--- xmlgraphics/fop/branches/fop-2_0/build.xml (original)
+++ xmlgraphics/fop/branches/fop-2_0/build.xml Tue May 26 07:58:18 2015
@@ -160,6 +160,7 @@ list of possible build targets.
<property name="javac.fork" value="no"/>
<property name="junit.fork" value="yes"/>
<property name="junit.haltonfailure" value="off"/>
+ <property name="junit.maxmemory" value="256m"/>
<property name="junit.printsummary" value="off"/>
<property name="junit.formatter.brief" value="on"/>
<property name="javadoc.packages" value="org.apache.fop.*"/>
@@ -225,7 +226,7 @@ list of possible build targets.
<junit haltonfailure="${junit.haltonfailure}"
fork="${junit.fork}"
printsummary="${junit.printsummary}"
- maxmemory="256m"/>
+ maxmemory="${junit.maxmemory}"/>
</presetdef>
<!-- =================================================================== -->
@@ -815,9 +816,9 @@ list of possible build targets.
<classpath>
<path refid="@{classpath}"/>
</classpath>
- <assertions>
- <enable/>
- </assertions>
+ <assertions>
+ <enable/>
+ </assertions>
<test name="@{testsuite}" todir="${junit.reports.dir}"
outfile="@{outfile}"/>
</junit>
</sequential>
@@ -1153,7 +1154,7 @@ NOTE:
</classpath>
</taskdef>
<findbugs home="${findbugs.home.dir}" output="${findbugs.output.format}"
reportLevel="low" effort="max"
-
outputFile="${build.dir}/report_findbugs.${findbugs.output.extension}"
excludeFilter="findbugs-exclude.xml" jvmargs="-Xmx1024m">
+
outputFile="${build.dir}/report_findbugs.${findbugs.output.extension}"
excludeFilter="findbugs-exclude.xml" jvmargs="-Xmx1024m"
warningsProperty="findbugs.warnings">
<sourcePath path="${src.java.dir}"/>
<class location="${build.classes.dir}"/>
<auxClasspath>
@@ -1166,6 +1167,7 @@ NOTE:
</path>
</auxClasspath>
</findbugs>
+ <fail if="findbugs.warnings"/>
</target>
<target name="findbugs-xml" depends="findbugs-avail" if="findbugs.present"
description="Runs findbugs for a code quality report in XML">
<property name="findbugs.output.format" value="xml"/>
Modified: xmlgraphics/fop/branches/fop-2_0/findbugs-exclude.xml
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/findbugs-exclude.xml?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
--- xmlgraphics/fop/branches/fop-2_0/findbugs-exclude.xml (original)
+++ xmlgraphics/fop/branches/fop-2_0/findbugs-exclude.xml Tue May 26 07:58:18
2015
@@ -48,6 +48,42 @@
<!-- START - APPROVED EXCLUSIONS -->
<Match>
+ <Bug pattern="BC_BAD_CAST_TO_CONCRETE_COLLECTION"/>
+ <!-- TODO - Not sure what to do with those two... Seems messy/hacky -->
+ <And>
+ <Class name="org.apache.fop.area.AreaTreeObject"/>
+ <Method name="clone"/>
+ </And>
+ </Match>
+ <Match>
+ <Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE"/>
+ <!-- TODO - See if these can be solved in a better way -->
+ <Or>
+ <And>
+ <Class name="org.apache.fop.layoutmgr.PageBreakingAlgorithm"/>
+ <Or>
+ <Method name="createFootnotePages"/>
+ <Method name="finish"/>
+ </Or>
+ </And>
+ <And>
+ <Class name="org.apache.fop.render.rtf.RTFHandler"/>
+ <Or>
+ <Method name="endCell"/>
+ <Method name="endFootnoteBody"/>
+ <Method name="endPart"/>
+ <Method name="endRow"/>
+ <Method name="startCell"/>
+ <Method name="startFootnoteBody"/>
+ <Method name="startListItem"/>
+ <Method name="startListLabel"/>
+ <Method name="startPart"/>
+ <Method name="startRow"/>
+ </Or>
+ </And>
+ </Or>
+ </Match>
+ <Match>
<Bug pattern="CN_IDIOM_NO_SUPER_CALL"/>
<Or>
<And>
@@ -86,6 +122,14 @@
</Or>
</Match>
<Match>
+ <!-- Only OK as long as the type of the base map remains plain HashMap...
-->
+ <Bug pattern="DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS"/>
+ <And>
+ <Class name="org.apache.fop.fonts.truetype.OpenFont"/>
+ <Method name="sortDirTabMap"/>
+ </And>
+ </Match>
+ <Match>
<Bug pattern="EQ_ALWAYS_TRUE"/>
<Or>
<And>
@@ -122,6 +166,14 @@
</Or>
</Match>
<Match>
+ <Bug pattern="OS_OPEN_STREAM_EXCEPTION_PATH"/>
+ <!-- TODO - fix potential file descriptor leak -->
+ <And>
+ <Class name="org.apache.fop.hyphenation.SerializeHyphPattern"/>
+ <Method name="serializeFile"/>
+ </And>
+ </Match>
+ <Match>
<Bug pattern="SE_INNER_CLASS"/>
<Or>
<Class name="org.apache.fop.afp.AFPPaintingState$AFPData"/>
@@ -141,6 +193,40 @@
</And>
</Or>
</Match>
+ <Match>
+ <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
+ <Or>
+ <!-- TODO - fix later -->
+ <Class name="org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement"/>
+ <!-- FOs not yet implemented -->
+ <Class name="org.apache.fop.fo.flow.MultiProperties"/>
+ <Class name="org.apache.fop.fo.flow.MultiPropertySet"/>
+ <Class name="org.apache.fop.fo.flow.MultiToggle"/>
+ <Class name="org.apache.fop.fo.flow.table.TableAndCaption"/>
+ <Class name="org.apache.fop.fo.flow.table.TableCaption"/>
+ </Or>
+ </Match>
+ <Match>
+ <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
+ <Or>
+ <!-- TODO - Implementation incomplete?
+ If not, remove unused field(s) and unused accessors -->
+ <Class name="org.apache.fop.complexscripts.fonts.GlyphProcessingState"/>
+ <Class
name="org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager"/>
+ <Class name="org.apache.fop.pdf.PDFCMap"/>
+ <Class name="org.apache.fop.render.pdf.PDFSVGHandler$PDFInfo"/>
+ <Class name="org.apache.fop.svg.PDFGraphics2D"/>
+ <!-- Properties not yet implemented -->
+ <Class name="org.apache.fop.fo.flow.MultiToggle"/>
+ <Class name="org.apache.fop.fo.properties.CommonMarginInline"/>
+ <Class name="org.apache.fop.fo.properties.CommonRelativePosition"/>
+ </Or>
+ </Match>
+ <Match>
+ <Bug pattern="UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD"/>
+ <!-- Properties not yet implemented -->
+ <Class name="org.apache.fop.fo.properties.CommonAural"/>
+ </Match>
<!-- END - APPROVED EXCLUSIONS -->
<!-- START - TEMPORARY (UNAPPROVED) EXCLUSIONS -->
@@ -161,6 +247,10 @@
<Bug pattern="DM_CONVERT_CASE"/>
</Match>
<Match>
+ <!-- 17 warnings -->
+ <Bug pattern="DM_DEFAULT_ENCODING"/>
+ </Match>
+ <Match>
<!-- 20 warnings -->
<Bug pattern="DM_FP_NUMBER_CTOR"/>
</Match>
Modified: xmlgraphics/fop/branches/fop-2_0/lib/xmlgraphics-commons-2.0.1.jar
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/lib/xmlgraphics-commons-2.0.1.jar?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
Binary files - no diff available.
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/afp/AFPStreamer.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/afp/AFPStreamer.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/afp/AFPStreamer.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/afp/AFPStreamer.java
Tue May 26 07:58:18 2015
@@ -25,7 +25,6 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import org.apache.commons.io.IOUtils;
@@ -160,10 +159,10 @@ public class AFPStreamer implements Stre
*/
// write out any external resource groups
public void close() throws IOException {
- Iterator it = pathResourceGroupMap.values().iterator();
- while (it.hasNext()) {
- StreamedResourceGroup resourceGroup =
(StreamedResourceGroup)it.next();
- resourceGroup.close();
+ for (ResourceGroup resourceGroup : pathResourceGroupMap.values()) {
+ // TODO - Why not a Map<URI, StreamedResourceGroup>, if all the
elements are expected to be of that type?
+ assert (resourceGroup instanceof StreamedResourceGroup);
+ ((StreamedResourceGroup) resourceGroup).close();
}
// close any open print-file resource group
if (printFileResourceGroup != null) {
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java
Tue May 26 07:58:18 2015
@@ -133,7 +133,6 @@ public class GraphicsSetProcessColor ext
dout.writeByte(a);
dout.writeByte(b);
} else {
- IOUtils.closeQuietly(dout);
IOUtils.closeQuietly(baout);
throw new IllegalStateException();
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/AreaTreeObject.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/AreaTreeObject.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/AreaTreeObject.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/AreaTreeObject.java
Tue May 26 07:58:18 2015
@@ -41,13 +41,18 @@ public abstract class AreaTreeObject imp
protected List<ExtensionAttachment> extensionAttachments;
/** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
public Object clone() throws CloneNotSupportedException {
AreaTreeObject ato = (AreaTreeObject) super.clone();
if (foreignAttributes != null) {
- ato.foreignAttributes = (Map) ((HashMap)
foreignAttributes).clone();
+ // @SuppressFBWarnings("BC_BAD_CAST_TO_CONCRETE_COLLECTION")
+ ato.foreignAttributes = (Map<QName, String>)
+ ((HashMap<QName, String>)foreignAttributes).clone();
}
if (extensionAttachments != null) {
- ato.extensionAttachments = (List) ((ArrayList)
extensionAttachments).clone();
+ // @SuppressFBWarnings("BC_BAD_CAST_TO_CONCRETE_COLLECTION")
+ ato.extensionAttachments = (List<ExtensionAttachment>)
+ ((ArrayList<ExtensionAttachment>)
extensionAttachments).clone();
}
return ato;
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/Page.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/Page.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
--- xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/Page.java
(original)
+++ xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/Page.java Tue
May 26 07:58:18 2015
@@ -252,8 +252,7 @@ public class Page extends AreaTreeObject
} else if (regionBody == null) {
return true;
} else {
- BodyRegion body = (BodyRegion)regionBody.getRegionReference();
- return body.isEmpty();
+ return regionBody.getRegionReference().isEmpty();
}
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/PageViewport.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/PageViewport.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/PageViewport.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/PageViewport.java
Tue May 26 07:58:18 2015
@@ -364,8 +364,7 @@ public class PageViewport extends AreaTr
* This will retrieve a marker with the class name
* and position.
*
- * @param name The class name of the marker to retrieve
- * @param pos the position to retrieve
+ * @param rm the retrieve-marker instance
* @return Object the marker found or null
*/
public Marker resolveMarker(AbstractRetrieveMarker rm) {
@@ -409,8 +408,8 @@ public class PageViewport extends AreaTr
page = (Page) in.readObject();
unresolvedIDRefs = page.getUnresolvedReferences();
if (unresolvedIDRefs != null && pendingResolved != null) {
- for (String id : pendingResolved.keySet()) {
- resolveIDRef(id, pendingResolved.get(id));
+ for (Map.Entry<String, List<PageViewport>> e :
pendingResolved.entrySet()) {
+ resolveIDRef(e.getKey(), e.getValue());
}
pendingResolved = null;
}
@@ -457,7 +456,9 @@ public class PageViewport extends AreaTr
* @return BodyRegion object
*/
public BodyRegion getBodyRegion() {
- return (BodyRegion)
getPage().getRegionViewport(FO_REGION_BODY).getRegionReference();
+ RegionReference regionReference =
getPage().getRegionViewport(FO_REGION_BODY).getRegionReference();
+ assert (regionReference instanceof BodyRegion);
+ return (BodyRegion) regionReference;
}
/**
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/RegionReference.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/RegionReference.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/RegionReference.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/RegionReference.java
Tue May 26 07:58:18 2015
@@ -134,6 +134,15 @@ public class RegionReference extends Are
addChildArea(block);
}
+ /**
+ * indicates whether the main reference area has any child areas added to
it
+ *
+ * @return whether the main reference area has any child areas added to it
+ */
+ public boolean isEmpty() {
+ return true;
+ }
+
/** {@inheritDoc} */
public Object clone() throws CloneNotSupportedException {
RegionReference rr = (RegionReference) super.clone();
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/inline/InlineArea.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/inline/InlineArea.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/inline/InlineArea.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/inline/InlineArea.java
Tue May 26 07:58:18 2015
@@ -272,11 +272,12 @@ public class InlineArea extends Area {
* @param ipdVariation the difference between new and old ipd
*/
protected void notifyIPDVariation(int ipdVariation) {
- if (getParentArea() instanceof InlineArea) {
- ((InlineArea) getParentArea()).handleIPDVariation(ipdVariation);
- } else if (getParentArea() instanceof LineArea) {
- ((LineArea) getParentArea()).handleIPDVariation(ipdVariation);
- } else if (getParentArea() == null) {
+ Area parentArea = getParentArea();
+ if (parentArea instanceof InlineArea) {
+ ((InlineArea) parentArea).handleIPDVariation(ipdVariation);
+ } else if (parentArea instanceof LineArea) {
+ ((LineArea) parentArea).handleIPDVariation(ipdVariation);
+ } else if (parentArea == null) {
// parent area not yet set: store the variations
storedIPDVariation += ipdVariation;
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/inline/TextArea.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/inline/TextArea.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/inline/TextArea.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/area/inline/TextArea.java
Tue May 26 07:58:18 2015
@@ -144,12 +144,13 @@ public class TextArea extends AbstractTe
* @return the text string
*/
public String getText() {
- StringBuffer text = new StringBuffer();
+ StringBuilder text = new StringBuilder();
// assemble the text
for (InlineArea inline : inlines) {
if (inline instanceof WordArea) {
text.append(((WordArea) inline).getWord());
} else {
+ assert (inline instanceof SpaceArea);
text.append(((SpaceArea) inline).getSpace());
}
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/complexscripts/fonts/GlyphProcessingState.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/complexscripts/fonts/GlyphProcessingState.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/complexscripts/fonts/GlyphProcessingState.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/complexscripts/fonts/GlyphProcessingState.java
Tue May 26 07:58:18 2015
@@ -119,6 +119,7 @@ public class GlyphProcessingState {
* @param language language identifier
* @param feature feature identifier
* @param sct script context tester (or null)
+ * @return this instance
*/
protected GlyphProcessingState reset(GlyphSequence gs, String script,
String language, String feature, ScriptContextTester sct) {
this.gdef = null;
@@ -130,7 +131,7 @@ public class GlyphProcessingState {
this.indexLast = gs.getGlyphCount();
this.consumed = 0;
this.lookupFlags = 0;
- this.classMatchSet = 0;
+ this.classMatchSet = 0; //
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
this.sct = sct;
this.gct = (sct != null) ? sct.getTester(feature) : null;
this.ignoreBase = new GlyphTester() { public boolean test(int gi, int
flags) { return isIgnoredBase(gi, flags); } };
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiProperties.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiProperties.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiProperties.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiProperties.java
Tue May 26 07:58:18 2015
@@ -54,6 +54,7 @@ public class MultiProperties extends FOb
if (!notImplementedWarningGiven) {
getFOValidationEventProducer().unimplementedFeature(this,
getName(),
getName(), getLocator());
+ // @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD")
notImplementedWarningGiven = true;
}
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiPropertySet.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiPropertySet.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiPropertySet.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiPropertySet.java
Tue May 26 07:58:18 2015
@@ -50,6 +50,7 @@ public class MultiPropertySet extends FO
if (!notImplementedWarningGiven) {
getFOValidationEventProducer().unimplementedFeature(this,
getName(),
getName(), getLocator());
+ // @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD")
notImplementedWarningGiven = true;
}
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiToggle.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiToggle.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiToggle.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/MultiToggle.java
Tue May 26 07:58:18 2015
@@ -31,12 +31,12 @@ import org.apache.fop.fo.properties.Stri
/**
* Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_multi-toggle">
- * <code>fo:multi-toggle<code></a> property.
+ * <code>fo:multi-toggle</code></a> property.
*/
public class MultiToggle extends FObj {
// The value of properties relevant for fo:multi-toggle (commented out for
performance).
// private CommonAccessibility commonAccessibility;
- public StringProperty prSwitchTo;
+ public StringProperty prSwitchTo; //
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
// End of property values
private static boolean notImplementedWarningGiven;
@@ -52,6 +52,7 @@ public class MultiToggle extends FObj {
if (!notImplementedWarningGiven) {
getFOValidationEventProducer().unimplementedFeature(this,
getName(),
getName(), getLocator());
+ // @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD")
notImplementedWarningGiven = true;
}
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java
Tue May 26 07:58:18 2015
@@ -72,6 +72,7 @@ public class TableAndCaption extends FOb
if (!notImplementedWarningGiven) {
getFOValidationEventProducer().unimplementedFeature(this,
getName(),
"fo:table-and-caption", getLocator());
+ // @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD")
notImplementedWarningGiven = true;
}
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/table/TableCaption.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/table/TableCaption.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/table/TableCaption.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/flow/table/TableCaption.java
Tue May 26 07:58:18 2015
@@ -67,6 +67,7 @@ public class TableCaption extends FObj i
if (!notImplementedWarningGiven) {
getFOValidationEventProducer().unimplementedFeature(this,
getName(),
"fo:table-caption", getLocator());
+ // @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD")
notImplementedWarningGiven = true;
}
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonAural.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonAural.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonAural.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonAural.java
Tue May 26 07:58:18 2015
@@ -27,6 +27,7 @@ import org.apache.fop.fo.PropertyList;
* Public "structure" allows direct member access.
*/
public class CommonAural {
+ // @SuppressFBWarnings("UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD")
/**
* The "azimuth" property.
*/
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonMarginInline.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonMarginInline.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonMarginInline.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonMarginInline.java
Tue May 26 07:58:18 2015
@@ -30,7 +30,7 @@ import org.apache.fop.fo.expr.PropertyEx
* Public "structure" allows direct member access.
*/
public class CommonMarginInline {
-
+ // @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
/**
* The "margin-top" property.
*/
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java
Tue May 26 07:58:18 2015
@@ -30,6 +30,7 @@ import org.apache.fop.fo.expr.PropertyEx
* Public "structure" allows direct member access.
*/
public class CommonRelativePosition {
+ // @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
/**
* The "relative-position" property.
*/
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fonts/truetype/OpenFont.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fonts/truetype/OpenFont.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fonts/truetype/OpenFont.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/fonts/truetype/OpenFont.java
Tue May 26 07:58:18 2015
@@ -1603,10 +1603,12 @@ public abstract class OpenFont {
// Create winAnsiEncoded kerning table from kerningTab
// (could probably be simplified, for now we remap back to CID
indexes and
// then to winAnsi)
- for (Integer unicodeKey1 : kerningTab.keySet()) {
- Integer cidKey1 = unicodeToGlyph(unicodeKey1.intValue());
+
+ for (Map.Entry<Integer, Map<Integer, Integer>> e1 :
kerningTab.entrySet()) {
+ Integer unicodeKey1 = e1.getKey();
+ Integer cidKey1 = unicodeToGlyph(unicodeKey1);
Map<Integer, Integer> akpx = new HashMap<Integer, Integer>();
- Map<Integer, Integer> ckpx = kerningTab.get(unicodeKey1);
+ Map<Integer, Integer> ckpx = e1.getValue();
for (Map.Entry<Integer, Integer> e : ckpx.entrySet()) {
Integer unicodeKey2 = e.getKey();
@@ -1693,6 +1695,7 @@ public abstract class OpenFont {
return (int) (o1.getValue().getOffset() -
o2.getValue().getOffset());
}
});
+ // @SuppressFBWarnings("DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS")
sortedSet.addAll(directoryTabs.entrySet());
return sortedSet;
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/hyphenation/Hyphenator.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/hyphenation/Hyphenator.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/hyphenation/Hyphenator.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/hyphenation/Hyphenator.java
Tue May 26 07:58:18 2015
@@ -64,6 +64,14 @@ public final class Hyphenator {
}
/**
+ * Clears the default hyphenation tree cache.<br>
+ * This method can be used if the underlying data files are changed at
runtime.
+ */
+ public static synchronized void clearHyphenationTreeCache() {
+ hTreeCache = new HyphenationTreeCache();
+ }
+
+ /**
* Returns a hyphenation tree for a given language and country,
* with fallback from (lang,country) to (lang).
* The hyphenation trees are cached.
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/hyphenation/SerializeHyphPattern.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/hyphenation/SerializeHyphPattern.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/hyphenation/SerializeHyphPattern.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/hyphenation/SerializeHyphPattern.java
Tue May 26 07:58:18 2015
@@ -53,12 +53,14 @@ public class SerializeHyphPattern {
return name.endsWith(extension);
}
});
- for (int j = 0; j < sourceFiles.length; j++) {
- File infile = new File(sourceDir, sourceFiles[j]);
- String outfilename = sourceFiles[j].substring(0,
sourceFiles[j].length()
- -
extension.length()) + ".hyp";
- File outfile = new File(targetDir, outfilename);
- serializeFile(infile, outfile);
+ if (sourceFiles != null) {
+ for (String sourceFile : sourceFiles) {
+ File infile = new File(sourceDir, sourceFile);
+ String outfilename = sourceFile.substring(0,
sourceFile.length()
+ - extension.length()) + ".hyp";
+ File outfile = new File(targetDir, outfilename);
+ serializeFile(infile, outfile);
+ }
}
}
@@ -73,6 +75,7 @@ public class SerializeHyphPattern {
HyphenationTree hTree = buildPatternFile(infile);
// serialize class
try {
+ // @SuppressFBWarnings("OS_OPEN_STREAM_EXCEPTION_PATH")
ObjectOutputStream out = new ObjectOutputStream(
new java.io.BufferedOutputStream(
new java.io.FileOutputStream(outfile)));
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
Tue May 26 07:58:18 2015
@@ -618,10 +618,12 @@ public abstract class BlockStackingLayou
}
}
} else if (innerPosition != null && innerPosition.getLM() != this) {
+ Position lastPosition = lastElement.getPosition();
+ assert (lastPosition instanceof NonLeafPosition);
// this adjustment concerns another LM
- NonLeafPosition savedPos = (NonLeafPosition)
lastElement.getPosition();
+ NonLeafPosition savedPos = (NonLeafPosition) lastPosition;
lastElement.setPosition(innerPosition);
- int returnValue =
((BlockLevelLayoutManager)lastElement.getLayoutManager())
+ int returnValue = ((BlockLevelLayoutManager)
lastElement.getLayoutManager())
.negotiateBPDAdjustment(adj, lastElement);
lastElement.setPosition(savedPos);
return returnValue;
@@ -635,7 +637,8 @@ public abstract class BlockStackingLayou
/** {@inheritDoc} */
public void discardSpace(KnuthGlue spaceGlue) {
assert (spaceGlue != null && spaceGlue.getPosition() != null);
- Position innerPosition = spaceGlue.getPosition().getPosition();
+ Position mainPosition = spaceGlue.getPosition();
+ Position innerPosition = mainPosition.getPosition();
if (innerPosition == null || innerPosition.getLM() == this) {
// if this block has block-progression-unit > 0, innerPosition can
be
@@ -652,8 +655,9 @@ public abstract class BlockStackingLayou
//TODO Why are both cases handled in the same way?
}
} else {
+ assert (mainPosition instanceof NonLeafPosition);
// this element was not created by this BlockLM
- NonLeafPosition savedPos =
(NonLeafPosition)spaceGlue.getPosition();
+ NonLeafPosition savedPos = (NonLeafPosition) mainPosition;
spaceGlue.setPosition(innerPosition);
((BlockLevelLayoutManager)
spaceGlue.getLayoutManager()).discardSpace(spaceGlue);
spaceGlue.setPosition(savedPos);
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java
Tue May 26 07:58:18 2015
@@ -133,7 +133,7 @@ public class FloatContentLayoutManager e
while (!(lm instanceof BlockLayoutManager)) {
lm = lm.getParent();
}
- if (lm instanceof BlockLayoutManager) {
+ if (lm != null) {
startIndent = ((BlockLayoutManager) lm).startIndent;
}
return startIndent;
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
Tue May 26 07:58:18 2015
@@ -239,9 +239,10 @@ public class FlowLayoutManager extends B
public int negotiateBPDAdjustment(int adj, KnuthElement lastElement) {
log.debug(" FLM.negotiateBPDAdjustment> " + adj);
- if (lastElement.getPosition() instanceof NonLeafPosition) {
+ Position lastPosition = lastElement.getPosition();
+ if (lastPosition instanceof NonLeafPosition) {
// this element was not created by this FlowLM
- NonLeafPosition savedPos =
(NonLeafPosition)lastElement.getPosition();
+ NonLeafPosition savedPos = (NonLeafPosition) lastPosition;
lastElement.setPosition(savedPos.getPosition());
int returnValue =
((BlockLevelLayoutManager)lastElement.getLayoutManager())
.negotiateBPDAdjustment(adj, lastElement);
@@ -258,9 +259,10 @@ public class FlowLayoutManager extends B
public void discardSpace(KnuthGlue spaceGlue) {
log.debug(" FLM.discardSpace> ");
- if (spaceGlue.getPosition() instanceof NonLeafPosition) {
+ Position gluePosition = spaceGlue.getPosition();
+ if (gluePosition instanceof NonLeafPosition) {
// this element was not created by this FlowLM
- NonLeafPosition savedPos =
(NonLeafPosition)spaceGlue.getPosition();
+ NonLeafPosition savedPos = (NonLeafPosition) gluePosition;
spaceGlue.setPosition(savedPos.getPosition());
((BlockLevelLayoutManager)
spaceGlue.getLayoutManager()).discardSpace(spaceGlue);
spaceGlue.setPosition(savedPos);
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
Tue May 26 07:58:18 2015
@@ -941,6 +941,7 @@ class PageBreakingAlgorithm extends Brea
@Override
protected void finish() {
for (int i = startLine; i < endLine; i++) {
+ // @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
for (KnuthPageNode node = (KnuthPageNode) getNode(i);
node != null;
node = (KnuthPageNode) node.next) {
@@ -978,6 +979,7 @@ class PageBreakingAlgorithm extends Brea
// footnoteElementIndex has already been set in
getFootnoteSplit()
} else {
// cannot add any content: create a new node and start again
+ // @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
KnuthPageNode node = (KnuthPageNode)
createNode(lastNode.position,
prevNode.line + 1, 1,
insertedFootnotesLength -
prevNode.insertedFootnotes,
@@ -992,6 +994,7 @@ class PageBreakingAlgorithm extends Brea
}
}
// create the last node
+ // @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
KnuthPageNode node = (KnuthPageNode)
createNode(lastNode.position, prevNode.line + 1,
1,
totalFootnotesLength -
prevNode.insertedFootnotes, 0, 0,
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
Tue May 26 07:58:18 2015
@@ -26,6 +26,7 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.fop.area.Area;
import org.apache.fop.area.AreaTreeHandler;
import org.apache.fop.area.AreaTreeModel;
import org.apache.fop.area.LineArea;
@@ -112,7 +113,9 @@ public class PageSequenceLayoutManager e
try {
ContentLayoutManager clm = getLayoutManagerMaker()
.makeContentLayoutManager(this,
getPageSequence().getTitleFO());
- title = (LineArea) clm.getParentArea(null);
+ Area parentArea = clm.getParentArea(null);
+ assert (parentArea instanceof LineArea);
+ title = (LineArea) parentArea;
} catch (IllegalStateException e) {
// empty title; do nothing
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java
Tue May 26 07:58:18 2015
@@ -63,7 +63,7 @@ public abstract class InlineStackingLayo
*/
protected InlineStackingLayoutManager(FObj node) {
super(node);
- extraBPD = MinOptMax.ZERO;
+ extraBPD = MinOptMax.ZERO; //
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
}
/**
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
Tue May 26 07:58:18 2015
@@ -108,7 +108,7 @@ public class LineLayoutManager extends I
* Each value holds the start and end indexes into a List of
* inline break positions.
*/
- private static class LineBreakPosition extends LeafPosition {
+ static class LineBreakPosition extends LeafPosition {
private final int parIndex; // index of the Paragraph this Position
refers to
private final int startIndex; //index of the first element this
Position refers to
private final int availableShrink;
@@ -986,7 +986,7 @@ public class LineLayoutManager extends I
keep.getContext(),
context));
}
- endIndex = ((LineBreakPosition)
llPoss.getChosenPosition(i)).getLeafPos();
+ endIndex = llPoss.getChosenPosition(i).getLeafPos();
// create a list of the FootnoteBodyLM handling footnotes
// whose citations are in this line
List<FootnoteBodyLayoutManager> footnoteList =
FootenoteUtil.getFootnotes(
@@ -994,7 +994,7 @@ public class LineLayoutManager extends I
List<FloatContentLayoutManager> floats =
FloatContentLayoutManager.checkForFloats(seq,
startIndex, endIndex);
startIndex = endIndex + 1;
- LineBreakPosition lbp = (LineBreakPosition)
llPoss.getChosenPosition(i);
+ LineBreakPosition lbp = llPoss.getChosenPosition(i);
if (baselineOffset < 0) {
baselineOffset = lbp.spaceBefore + lbp.baseline;
}
@@ -1186,7 +1186,9 @@ public class LineLayoutManager extends I
/** {@inheritDoc} */
public int negotiateBPDAdjustment(int adj, KnuthElement lastElement) {
- LeafPosition pos = (LeafPosition)lastElement.getPosition();
+ Position lastPos = lastElement.getPosition();
+ assert (lastPos instanceof LeafPosition);
+ LeafPosition pos = (LeafPosition) lastPos;
//if (lastElement.isPenalty()) {
// totalAdj += lastElement.getWidth();
//}
@@ -1230,7 +1232,7 @@ public class LineLayoutManager extends I
// null penalty allowing a page break between lines
returnList.add(new KnuthPenalty(0, 0, false, new
Position(this), false));
}
- LineBreakPosition lbp = (LineBreakPosition)
llPoss.getChosenPosition(i);
+ LineBreakPosition lbp = llPoss.getChosenPosition(i);
//log.debug("LLM.getChangedKnuthElements> lineWidth= "
// + lbp.lineWidth + " difference= " + lbp.difference);
//log.debug(" shrink= "
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java
Tue May 26 07:58:18 2015
@@ -24,8 +24,6 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.fop.layoutmgr.Position;
-
/**
* Line layout possibilities.
*/
@@ -37,12 +35,12 @@ public class LineLayoutPossibilities {
private final class Possibility {
private int lineCount;
private double demerits;
- private List breakPositions;
+ private List<LineLayoutManager.LineBreakPosition> breakPositions;
private Possibility(int lc, double dem) {
lineCount = lc;
demerits = dem;
- breakPositions = new java.util.ArrayList(lc);
+ breakPositions = new
java.util.ArrayList<LineLayoutManager.LineBreakPosition>(lc);
}
private int getLineCount() {
@@ -53,15 +51,15 @@ public class LineLayoutPossibilities {
return demerits;
}
- private void addBreakPosition(Position pos) {
+ private void addBreakPosition(LineLayoutManager.LineBreakPosition pos)
{
// Positions are always added with index 0 because
// they are created backward, from the last one to
// the first one
breakPositions.add(0, pos);
}
- private Position getBreakPosition(int i) {
- return (Position)breakPositions.get(i);
+ private LineLayoutManager.LineBreakPosition getBreakPosition(int i) {
+ return breakPositions.get(i);
}
}
@@ -181,7 +179,7 @@ public class LineLayoutPossibilities {
* @param pos a position
* @param i an index into posibilities list
*/
- public void addBreakPosition(Position pos, int i) {
+ public void addBreakPosition(LineLayoutManager.LineBreakPosition pos, int
i) {
((Possibility)possibilitiesList.get(i)).addBreakPosition(pos);
}
@@ -245,7 +243,7 @@ public class LineLayoutPossibilities {
* @param i the break position index
* @return the chosen position
*/
- public Position getChosenPosition(int i) {
+ public LineLayoutManager.LineBreakPosition getChosenPosition(int i) {
return
((Possibility)possibilitiesList.get(chosenIndex)).getBreakPosition(i);
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
Tue May 26 07:58:18 2015
@@ -209,7 +209,9 @@ public class TextLayoutManager extends L
*/
GlyphMapping lastMapping = null;
while (posIter.hasNext()) {
- final LeafPosition tbpNext = (LeafPosition) posIter.next();
+ Position nextPos = posIter.next();
+ assert (nextPos instanceof LeafPosition);
+ final LeafPosition tbpNext = (LeafPosition) nextPos;
if (tbpNext == null) {
continue; //Ignore elements without Positions
}
@@ -961,7 +963,9 @@ public class TextLayoutManager extends L
ListIterator oldListIterator = oldList.listIterator();
KnuthElement knuthElement = (KnuthElement) oldListIterator.next();
Position pos = knuthElement.getPosition();
- LeafPosition leafPos = (LeafPosition) pos.getPosition(depth);
+ Position innerPosition = pos.getPosition(depth);
+ assert (innerPosition instanceof LeafPosition);
+ LeafPosition leafPos = (LeafPosition) innerPosition;
int index = leafPos.getLeafPos();
//element could refer to '-1' position, for non-collapsed spaces (?)
if (index > -1) {
@@ -1082,14 +1086,18 @@ public class TextLayoutManager extends L
ListIterator oldListIter;
for (oldListIter = oldList.listIterator(); oldListIter.hasNext();) {
Position pos = ((KnuthElement) oldListIter.next()).getPosition();
- startPos = (LeafPosition) pos.getPosition(depth);
+ Position innerPosition = pos.getPosition(depth);
+ assert (innerPosition == null || innerPosition instanceof
LeafPosition);
+ startPos = (LeafPosition) innerPosition;
if (startPos != null && startPos.getLeafPos() != -1) {
break;
}
}
for (oldListIter = oldList.listIterator(oldList.size());
oldListIter.hasPrevious();) {
Position pos = ((KnuthElement)
oldListIter.previous()).getPosition();
- endPos = (LeafPosition) pos.getPosition(depth);
+ Position innerPosition = pos.getPosition(depth);
+ assert (innerPosition instanceof LeafPosition);
+ endPos = (LeafPosition) innerPosition;
if (endPos != null && endPos.getLeafPos() != -1) {
break;
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/RowPainter.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
Tue May 26 07:58:18 2015
@@ -269,6 +269,7 @@ class RowPainter {
} else {
borderAfterWhich = ConditionalBorder.REST;
}
+ assert (currentGU instanceof EmptyGridUnit);
addAreaForEmptyGridUnit((EmptyGridUnit)currentGU,
currentRow.getIndex(), i,
actualRowHeight,
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java
Tue May 26 07:58:18 2015
@@ -43,9 +43,6 @@ public class TableRowIterator {
/** Selects the table-footer elements for iteration. */
public static final int FOOTER = 2;
- /** The table on which this instance operates. */
- protected Table table;
-
/** Part of the table over which to iterate. One of BODY, HEADER or
FOOTER. */
private int tablePart;
@@ -59,7 +56,6 @@ public class TableRowIterator {
* @param tablePart indicates what part of the table to iterate over
(HEADER, FOOTER, BODY)
*/
public TableRowIterator(Table table, int tablePart) {
- this.table = table;
this.tablePart = tablePart;
switch(tablePart) {
case HEADER:
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/TableStepper.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
Tue May 26 07:58:18 2015
@@ -158,6 +158,7 @@ public class TableStepper {
for (int i = 0; i < columnCount; i++) {
GridUnit gu = row.getGridUnit(i);
if (!gu.isEmpty() && gu.isPrimary()) {
+ assert (gu instanceof PrimaryGridUnit);
activeCellList.add(new ActiveCell((PrimaryGridUnit) gu, row,
rowIndex,
previousRowsLength, getTableLM()));
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/pdf/PDFCMap.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/pdf/PDFCMap.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
--- xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/pdf/PDFCMap.java
(original)
+++ xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/pdf/PDFCMap.java
Tue May 26 07:58:18 2015
@@ -365,7 +365,7 @@ public class PDFCMap extends PDFStream {
/**
* font's writing direction
*/
- protected byte wMode = WMODE_HORIZONTAL;
+ protected byte wMode = WMODE_HORIZONTAL; //
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
/**
* base CMap (String or PDFStream)
@@ -381,8 +381,8 @@ public class PDFCMap extends PDFStream {
public PDFCMap(String name, PDFCIDSystemInfo sysInfo) {
super();
this.name = name;
- this.sysInfo = sysInfo;
- this.base = null;
+ this.sysInfo = sysInfo; //
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+ this.base = null; //
@SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
}
/**
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/pdf/PDFFactory.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/pdf/PDFFactory.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/pdf/PDFFactory.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/pdf/PDFFactory.java
Tue May 26 07:58:18 2015
@@ -1265,7 +1265,9 @@ public class PDFFactory {
log.error("Failed to embed font [" + desc + "] " +
desc.getEmbedFontName(), ioe);
return null;
} finally {
- IOUtils.closeQuietly(in);
+ if (in != null) {
+ IOUtils.closeQuietly(in);
+ }
}
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/AbstractRenderer.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/AbstractRenderer.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/AbstractRenderer.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/AbstractRenderer.java
Tue May 26 07:58:18 2015
@@ -301,6 +301,7 @@ public abstract class AbstractRenderer
startVParea(regionReference.getCTM(), port.getClipRectangle());
// do after starting viewport area
if (regionReference.getRegionClass() == FO_REGION_BODY) {
+ assert (regionReference instanceof BodyRegion);
renderBodyRegion((BodyRegion) regionReference);
} else {
renderRegion(regionReference);
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandler.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandler.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandler.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandler.java
Tue May 26 07:58:18 2015
@@ -31,6 +31,7 @@ import org.apache.fop.afp.AFPPaintingSta
import org.apache.fop.afp.AFPResourceInfo;
import org.apache.fop.afp.AFPUnitConverter;
import org.apache.fop.render.ImageHandlerBase;
+import org.apache.fop.render.RendererContext;
/**
* A base abstract AFP image handler
@@ -71,8 +72,9 @@ public abstract class AFPImageHandler im
(int)Math.round(position.getWidth()),
(int)Math.round(position.getHeight()));
- AFPRendererContext rendererContext
- = (AFPRendererContext)rendererImageInfo.getRendererContext();
+ RendererContext context = rendererImageInfo.getRendererContext();
+ assert (context instanceof AFPRendererContext);
+ AFPRendererContext rendererContext = (AFPRendererContext) context;
AFPInfo afpInfo = rendererContext.getInfo();
AFPPaintingState paintingState = afpInfo.getPaintingState();
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerGraphics2D.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerGraphics2D.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerGraphics2D.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerGraphics2D.java
Tue May 26 07:58:18 2015
@@ -82,7 +82,9 @@ public class AFPImageHandlerGraphics2D e
throws IOException {
AFPRenderingContext afpContext = (AFPRenderingContext)context;
- AFPGraphicsObjectInfo graphicsObjectInfo =
(AFPGraphicsObjectInfo)createDataObjectInfo();
+ AFPDataObjectInfo info = createDataObjectInfo();
+ assert (info instanceof AFPGraphicsObjectInfo);
+ AFPGraphicsObjectInfo graphicsObjectInfo = (AFPGraphicsObjectInfo)
info;
// set resource information
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerRawJPEG.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerRawJPEG.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerRawJPEG.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerRawJPEG.java
Tue May 26 07:58:18 2015
@@ -90,7 +90,9 @@ public class AFPImageHandlerRawJPEG exte
throws IOException {
AFPRenderingContext afpContext = (AFPRenderingContext)context;
- AFPImageObjectInfo imageObjectInfo =
(AFPImageObjectInfo)createDataObjectInfo();
+ AFPDataObjectInfo info = createDataObjectInfo();
+ assert (info instanceof AFPImageObjectInfo);
+ AFPImageObjectInfo imageObjectInfo = (AFPImageObjectInfo) info;
AFPPaintingState paintingState = afpContext.getPaintingState();
// set resource information
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java
Tue May 26 07:58:18 2015
@@ -107,7 +107,9 @@ public class AFPImageHandlerRenderedImag
throws IOException {
AFPRenderingContext afpContext = (AFPRenderingContext)context;
- AFPImageObjectInfo imageObjectInfo =
(AFPImageObjectInfo)createDataObjectInfo();
+ AFPDataObjectInfo info = createDataObjectInfo();
+ assert (info instanceof AFPImageObjectInfo);
+ AFPImageObjectInfo imageObjectInfo = (AFPImageObjectInfo) info;
AFPPaintingState paintingState = afpContext.getPaintingState();
// set resource information
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerSVG.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerSVG.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerSVG.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/afp/AFPImageHandlerSVG.java
Tue May 26 07:58:18 2015
@@ -78,7 +78,9 @@ public class AFPImageHandlerSVG implemen
ImageXMLDOM imageSVG = (ImageXMLDOM)image;
FOUserAgent userAgent = afpContext.getUserAgent();
- AFPGraphicsObjectInfo graphicsObjectInfo =
(AFPGraphicsObjectInfo)createDataObjectInfo();
+ AFPDataObjectInfo info = createDataObjectInfo();
+ assert (info instanceof AFPGraphicsObjectInfo);
+ AFPGraphicsObjectInfo graphicsObjectInfo = (AFPGraphicsObjectInfo)
info;
AFPResourceInfo resourceInfo = graphicsObjectInfo.getResourceInfo();
setDefaultToInlineResourceLevel(graphicsObjectInfo);
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java
Tue May 26 07:58:18 2015
@@ -43,7 +43,7 @@ import org.apache.fop.render.awt.AWTRend
public class ImageProxyPanel extends JPanel {
/** The reference to the BufferedImage storing the page data */
- private Reference imageRef;
+ private transient Reference imageRef;
/** The maximum and preferred size of the panel */
private Dimension size;
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/intermediate/IFParser.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/intermediate/IFParser.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/intermediate/IFParser.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/intermediate/IFParser.java
Tue May 26 07:58:18 2015
@@ -107,14 +107,16 @@ public class IFParser implements IFConst
transformer.transform(src, res);
} catch (TransformerException te) {
+ Throwable cause = te.getCause();
//Unpack original IFException if applicable
- if (te.getCause() instanceof SAXException) {
- SAXException se = (SAXException)te.getCause();
- if (se.getCause() instanceof IFException) {
- throw (IFException)se.getCause();
+ if (cause instanceof SAXException) {
+ SAXException se = (SAXException) cause;
+ cause = se.getCause();
+ if (cause instanceof IFException) {
+ throw (IFException) cause;
}
- } else if (te.getCause() instanceof IFException) {
- throw (IFException)te.getCause();
+ } else if (cause instanceof IFException) {
+ throw (IFException) cause;
}
throw te;
}
@@ -375,9 +377,10 @@ public class IFParser implements IFConst
}
private void handleIFException(IFException ife) throws SAXException {
- if (ife.getCause() instanceof SAXException) {
+ Throwable cause = ife.getCause();
+ if (cause instanceof SAXException) {
//unwrap
- throw (SAXException)ife.getCause();
+ throw (SAXException) cause;
} else {
//wrap
throw new SAXException(ife);
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/intermediate/IFRenderer.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/intermediate/IFRenderer.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/intermediate/IFRenderer.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/intermediate/IFRenderer.java
Tue May 26 07:58:18 2015
@@ -197,8 +197,9 @@ public class IFRenderer extends Abstract
}
private void handleIFExceptionWithIOException(IFException ife) throws
IOException {
- if (ife.getCause() instanceof IOException) {
- throw (IOException)ife.getCause();
+ Throwable cause = ife.getCause();
+ if (cause instanceof IOException) {
+ throw (IOException) cause;
} else {
handleIFException(ife);
}
@@ -1072,15 +1073,17 @@ public class IFRenderer extends Abstract
String s = word.getWord();
int[][] dp = word.getGlyphPositionAdjustments();
+ Area parentArea = word.getParentArea();
+ assert (parentArea instanceof AbstractTextArea);
if (dp == null) {
renderTextWithAdjustments(s, word.getLetterAdjustArray(),
word.isReversed(),
- font, (AbstractTextArea)word.getParentArea());
+ font, (AbstractTextArea) parentArea);
} else if (IFUtil.isDPOnlyDX(dp)) {
renderTextWithAdjustments(s, IFUtil.convertDPToDX(dp),
word.isReversed(),
- font, (AbstractTextArea)word.getParentArea());
+ font, (AbstractTextArea) parentArea);
} else {
renderTextWithAdjustments(s, dp, word.isReversed(),
- font, (AbstractTextArea)word.getParentArea());
+ font, (AbstractTextArea) parentArea);
}
super.renderWord(word);
@@ -1091,7 +1094,9 @@ public class IFRenderer extends Abstract
Font font = getFontFromArea(space.getParentArea());
String s = space.getSpace();
- AbstractTextArea textArea = (AbstractTextArea)space.getParentArea();
+ Area parentArea = space.getParentArea();
+ assert (parentArea instanceof AbstractTextArea);
+ AbstractTextArea textArea = (AbstractTextArea) parentArea;
renderTextWithAdjustments(s, (int[]) null, false, font, textArea);
/* COMBINED is always false
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
Tue May 26 07:58:18 2015
@@ -388,6 +388,7 @@ class PDFRenderingUtil {
} else if (type == PDFObjectType.Number) {
array.add(new PDFNumber(entry.getValueAsNumber()));
} else if (type == PDFObjectType.Reference) {
+ assert (entry instanceof PDFReferenceExtension);
array.add(resolveReference((PDFReferenceExtension) entry));
} else if (type == PDFObjectType.String) {
array.add(entry.getValue());
@@ -423,6 +424,7 @@ class PDFRenderingUtil {
} else if (type == PDFObjectType.Number) {
dictionary.put(key, new PDFNumber(entry.getValueAsNumber()));
} else if (type == PDFObjectType.Reference) {
+ assert (entry instanceof PDFReferenceExtension);
dictionary.put(key, resolveReference((PDFReferenceExtension)
entry));
} else if (type == PDFObjectType.String) {
dictionary.put(key, entry.getValue());
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFArrayElement.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFArrayElement.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFArrayElement.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFArrayElement.java
Tue May 26 07:58:18 2015
@@ -44,8 +44,9 @@ public class PDFArrayElement extends PDF
}
public PDFArrayExtension getArrayExtension() {
- assert getExtension() instanceof PDFArrayExtension;
- return (PDFArrayExtension) getExtension();
+ PDFCollectionEntryExtension extension = getExtension();
+ assert (extension instanceof PDFArrayExtension);
+ return (PDFArrayExtension) extension;
}
@Override
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFDictionaryElement.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFDictionaryElement.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFDictionaryElement.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFDictionaryElement.java
Tue May 26 07:58:18 2015
@@ -64,8 +64,9 @@ public class PDFDictionaryElement extend
}
public PDFDictionaryExtension getDictionaryExtension() {
- assert getExtension() instanceof PDFDictionaryExtension;
- return (PDFDictionaryExtension) getExtension();
+ PDFCollectionEntryExtension extension = getExtension();
+ assert extension instanceof PDFDictionaryExtension;
+ return (PDFDictionaryExtension) extension;
}
@Override
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceElement.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceElement.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceElement.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/pdf/extensions/PDFReferenceElement.java
Tue May 26 07:58:18 2015
@@ -52,7 +52,9 @@ public class PDFReferenceElement extends
} else if (refid.length() == 0) {
invalidPropertyValueError(ATT_REFID, refid, null);
} else {
- ((PDFReferenceExtension) getExtension()).setReferenceId(refid);
+ PDFCollectionEntryExtension extension = getExtension();
+ assert (extension instanceof PDFReferenceExtension);
+ ((PDFReferenceExtension) extension).setReferenceId(refid);
}
}
}
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/RTFHandler.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/RTFHandler.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/RTFHandler.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/RTFHandler.java
Tue May 26 07:58:18 2015
@@ -687,6 +687,7 @@ public class RTFHandler extends FOEventH
try {
RtfAttributes atts =
TableAttributesConverter.convertTablePartAttributes(part);
+ // @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
RtfTable tbl =
(RtfTable)builderContext.getContainer(RtfTable.class, true, this);
tbl.setHeaderAttribs(atts);
} catch (IOException ioe) {
@@ -703,6 +704,7 @@ public class RTFHandler extends FOEventH
}
try {
+ // @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
RtfTable tbl =
(RtfTable)builderContext.getContainer(RtfTable.class, true, this);
tbl.setHeaderAttribs(null);
} catch (IOException ioe) {
@@ -738,6 +740,7 @@ public class RTFHandler extends FOEventH
try {
// create an RtfTableRow in the current RtfTable
+ // @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
final RtfTable tbl =
(RtfTable)builderContext.getContainer(RtfTable.class,
true, null);
@@ -768,6 +771,7 @@ public class RTFHandler extends FOEventH
try {
TableContext tctx = builderContext.getTableContext();
+ // @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
final RtfTableRow row =
(RtfTableRow)builderContext.getContainer(RtfTableRow.class,
true, null);
@@ -805,6 +809,7 @@ public class RTFHandler extends FOEventH
try {
TableContext tctx = builderContext.getTableContext();
+ // @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
final RtfTableRow row =
(RtfTableRow)builderContext.getContainer(RtfTableRow.class,
true, null);
@@ -894,6 +899,7 @@ public class RTFHandler extends FOEventH
return;
}
try {
+ // @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
RtfTableCell cell =
(RtfTableCell)builderContext.getContainer(RtfTableCell.class, false, this);
cell.finish();
@@ -949,6 +955,7 @@ public class RTFHandler extends FOEventH
// create an RtfListItem in the current RtfList
try {
+ // @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
RtfList list = (RtfList)builderContext.getContainer(
RtfList.class, true, this);
@@ -995,6 +1002,7 @@ public class RTFHandler extends FOEventH
}
try {
+ // @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
RtfListItem item
= (RtfListItem)builderContext.getContainer(RtfListItem.class,
true, this);
@@ -1325,6 +1333,7 @@ public class RTFHandler extends FOEventH
}
try {
+ // @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
RtfFootnote rtfFootnote
= (RtfFootnote)builderContext.getContainer(
RtfFootnote.class,
@@ -1346,6 +1355,7 @@ public class RTFHandler extends FOEventH
}
try {
+ // @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
RtfFootnote rtfFootnote
= (RtfFootnote)builderContext.getContainer(
RtfFootnote.class,
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java
Tue May 26 07:58:18 2015
@@ -55,7 +55,7 @@ public abstract class RtfElement {
/** Create an RTF element as a child of given container with given
attributes */
RtfElement(RtfContainer parent, Writer w, RtfAttributes attr) throws
IOException {
-
+ // @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD")
id = idCounter++;
this.parent = parent;
attrib = (attr != null ? attr : new RtfAttributes());
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
Tue May 26 07:58:18 2015
@@ -234,11 +234,6 @@ public class RtfExternalGraphic extends
protected int height = -1;
/**
- * The desired percent value of the height
- */
- protected int heightPercent = -1;
-
- /**
* The desired height (in twips)
*/
protected int heightDesired = -1;
@@ -254,11 +249,6 @@ public class RtfExternalGraphic extends
protected int width = -1;
/**
- * The desired percent value of the width
- */
- protected int widthPercent = -1;
-
- /**
* The desired width (in twips)
*/
protected int widthDesired = -1;
Modified:
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/xml/XMLRenderer.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/xml/XMLRenderer.java?rev=1681707&r1=1681706&r2=1681707&view=diff
==============================================================================
---
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/xml/XMLRenderer.java
(original)
+++
xmlgraphics/fop/branches/fop-2_0/src/java/org/apache/fop/render/xml/XMLRenderer.java
Tue May 26 07:58:18 2015
@@ -202,7 +202,7 @@ public class XMLRenderer extends Abstrac
continue;
}
Object value = traitEntry.getValue();
- if (key == Trait.FONT) {
+ if (((Integer) key).intValue() == Trait.FONT) {
FontTriplet triplet = (FontTriplet)value;
addAttribute("font-name", triplet.getName());
addAttribute("font-style", triplet.getStyle());
@@ -245,8 +245,9 @@ public class XMLRenderer extends Abstrac
} else if (clazz.equals(Color.class)) {
Color c = (Color)value;
addAttribute(name, ColorUtil.colorToString(c));
- } else if (key == Trait.START_INDENT || key ==
Trait.END_INDENT) {
- if (((Integer)value).intValue() != 0) {
+ } else if (((Integer) key).intValue() == Trait.START_INDENT
+ || ((Integer) key).intValue() == Trait.END_INDENT) {
+ if ((Integer) value != 0) {
addAttribute(name, value.toString());
}
} else {
@@ -513,7 +514,8 @@ public class XMLRenderer extends Abstrac
renderRegion(region);
endElement("regionStart");
} else if (region.getRegionClass() == FO_REGION_BODY) {
- BodyRegion body = (BodyRegion)region;
+ assert (region instanceof BodyRegion);
+ BodyRegion body = (BodyRegion) region;
if (body.getColumnCount() != 1) {
addAttribute("columnGap", body.getColumnGap());
addAttribute("columnCount", body.getColumnCount());
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]