You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by sp...@apache.org on 2011/06/15 13:04:34 UTC
svn commit: r1135995 - in /xmlgraphics/fop/trunk: ./ src/documentation/
src/java/org/apache/fop/afp/parser/ src/java/org/apache/fop/afp/svg/
src/java/org/apache/fop/render/afp/extensions/
src/java/org/apache/fop/render/pdf/ src/java/org/apache/fop/rend...
Author: spepping
Date: Wed Jun 15 11:04:33 2011
New Revision: 1135995
URL: http://svn.apache.org/viewvc?rev=1135995&view=rev
Log:
Fix checkstyle and findbugs issues
Modified:
xmlgraphics/fop/trunk/findbugs-exclude.xml
xmlgraphics/fop/trunk/src/documentation/skinconf.xml
xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/parser/UnparsedStructuredField.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/svg/AFPTextHandler.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/ExtensionPlacement.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/AbstractPDFImageHandler.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/RTFHandler.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/ACIUtils.java
Modified: xmlgraphics/fop/trunk/findbugs-exclude.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/findbugs-exclude.xml?rev=1135995&r1=1135994&r2=1135995&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/findbugs-exclude.xml (original)
+++ xmlgraphics/fop/trunk/findbugs-exclude.xml Wed Jun 15 11:04:33 2011
@@ -132,6 +132,29 @@
<Bug pattern="NM_CONFUSING"/>
</Match>
<!-- /The names of public methods will not be modified -->
+ <!-- These casts are checked in the code -->
+ <Match>
+ <Class name="org.apache.fop.render.afp.AFPImageHandlerGraphics2D"/>
+ <Method name="isCompatible"/>
+ <Bug pattern="BC_UNCONFIRMED_CAST"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.fop.render.afp.AFPImageHandlerSVG"/>
+ <Method name="isCompatible"/>
+ <Bug pattern="BC_UNCONFIRMED_CAST"/>
+ </Match>
+ <Match>
+ <Class name="org.apache.fop.render.afp.AbstractPDFImageHandler"/>
+ <Method name="handleImage"/>
+ <Bug pattern="BC_UNCONFIRMED_CAST"/>
+ </Match>
+ <!-- /These casts are checked in the code -->
+ <!-- return null is OK -->
+ <Match>
+ <Class name="org.apache.fop.svg.ACIUtils"/>
+ <Method name="findFontsForBatikACI"/>
+ <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
+ </Match>
<!-- Automatically generated list of exclusions -->
<Match>
<Class name="org.apache.fop.area.BodyRegion"/>
Modified: xmlgraphics/fop/trunk/src/documentation/skinconf.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/skinconf.xml?rev=1135995&r1=1135994&r2=1135995&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/documentation/skinconf.xml (original)
+++ xmlgraphics/fop/trunk/src/documentation/skinconf.xml Wed Jun 15 11:04:33 2011
@@ -103,9 +103,8 @@ which will be used to configure the chos
For some skins just set the attributes to blank.
-->
<trail location="alt">
- <link1 name="apache.org" href="http://www.apache.org/"/>
- <link2 name="XML Federation" href="http://xml.apache.org/"/>
- <link3 name="xmlgraphics.apache.org" href="http://xmlgraphics.apache.org/"/>
+ <link1 name="The Apache Software Foundation" href="http://www.apache.org/"/>
+ <link2 name="Apache XML Graphics Project" href="http://xmlgraphics.apache.org/"/>
</trail>
<!-- Configure the TOC, i.e. the Table of Contents.
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/parser/UnparsedStructuredField.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/parser/UnparsedStructuredField.java?rev=1135995&r1=1135994&r2=1135995&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/parser/UnparsedStructuredField.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/parser/UnparsedStructuredField.java Wed Jun 15 11:04:33 2011
@@ -219,7 +219,7 @@ public final class UnparsedStructuredFie
*/
byte[] getExtData() {
if (this.extData == null) {
- return null;
+ return new byte[0];
}
byte[] rtn = new byte[this.extData.length];
System.arraycopy(this.extData, 0, rtn, 0, rtn.length);
@@ -232,7 +232,7 @@ public final class UnparsedStructuredFie
*/
public byte[] getData() {
if (this.data == null) {
- return null;
+ return new byte[0];
}
byte[] rtn = new byte[this.data.length];
System.arraycopy(this.data, 0, rtn, 0, rtn.length);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/svg/AFPTextHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/svg/AFPTextHandler.java?rev=1135995&r1=1135994&r2=1135995&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/svg/AFPTextHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/svg/AFPTextHandler.java Wed Jun 15 11:04:33 2011
@@ -60,6 +60,7 @@ public class AFPTextHandler extends FOPT
* Main constructor.
*
* @param fontInfo the AFPGraphics2D instance
+ * @param resourceManager the AFPResourceManager instance
*/
public AFPTextHandler(FontInfo fontInfo, AFPResourceManager resourceManager) {
this.fontInfo = fontInfo;
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/ExtensionPlacement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/ExtensionPlacement.java?rev=1135995&r1=1135994&r2=1135995&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/ExtensionPlacement.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/ExtensionPlacement.java Wed Jun 15 11:04:33 2011
@@ -19,6 +19,8 @@
package org.apache.fop.render.afp.extensions;
+import java.util.Locale;
+
/**
* An enumeration for placement instruction for AFP extensions.
*/
@@ -34,7 +36,7 @@ public enum ExtensionPlacement {
* @return the XML value
*/
public String getXMLValue() {
- String xmlName = name().toLowerCase();
+ String xmlName = name().toLowerCase(Locale.ENGLISH);
xmlName = xmlName.replace('_', '-');
return xmlName;
}
@@ -45,7 +47,7 @@ public enum ExtensionPlacement {
* @return the enum value
*/
public static ExtensionPlacement fromXMLValue(String value) {
- String name = value.toUpperCase();
+ String name = value.toUpperCase(Locale.ENGLISH);
name = name.replace('-', '_');
return ExtensionPlacement.valueOf(name);
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/AbstractPDFImageHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/AbstractPDFImageHandler.java?rev=1135995&r1=1135994&r2=1135995&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/AbstractPDFImageHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/AbstractPDFImageHandler.java Wed Jun 15 11:04:33 2011
@@ -39,6 +39,7 @@ abstract class AbstractPDFImageHandler i
/** {@inheritDoc} */
public void handleImage(RenderingContext context, Image image, Rectangle pos)
throws IOException {
+ assert context instanceof PDFRenderingContext;
PDFRenderingContext pdfContext = (PDFRenderingContext)context;
PDFContentGenerator generator = pdfContext.getGenerator();
PDFImage pdfimage = createPDFImage(image, image.getInfo().getOriginalURI());
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java?rev=1135995&r1=1135994&r2=1135995&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java Wed Jun 15 11:04:33 2011
@@ -19,6 +19,8 @@
package org.apache.fop.render.ps;
+import java.util.Locale;
+
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.xmlgraphics.ps.PSGenerator;
@@ -69,7 +71,8 @@ public class PSRendererConfigurator exte
child = cfg.getChild("rendering");
if (child != null) {
psUtil.setRenderingMode(PSRenderingMode.valueOf(
- child.getValue(psUtil.getRenderingMode().toString()).toUpperCase()));
+ child.getValue(psUtil.getRenderingMode().toString())
+ .toUpperCase(Locale.ENGLISH)));
}
psUtil.setSafeSetPageDevice(
cfg.getChild("safe-set-page-device").getValueAsBoolean(false));
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/RTFHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/RTFHandler.java?rev=1135995&r1=1135994&r2=1135995&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/RTFHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/RTFHandler.java Wed Jun 15 11:04:33 2011
@@ -100,6 +100,7 @@ import org.apache.fop.layoutmgr.inline.I
import org.apache.fop.layoutmgr.table.ColumnSetup;
import org.apache.fop.render.DefaultFontResolver;
import org.apache.fop.render.RendererEventProducer;
+import org.apache.fop.render.rtf.rtflib.exceptions.RtfException;
import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfAfterContainer;
import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfBeforeContainer;
import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfListContainer;
@@ -1448,7 +1449,7 @@ public class RTFHandler extends FOEventH
throw new RuntimeException(e.getMessage());
}
}
-
+
/** {@inheritDoc} */
public void startPageNumberCitationLast(PageNumberCitationLast l) {
if (bDefer) {
@@ -1463,7 +1464,10 @@ public class RTFHandler extends FOEventH
textrun.addPageNumberCitation(l.getRefId());
- } catch (Exception e) {
+ } catch (RtfException e) {
+ log.error("startPageNumberCitationLast: " + e.getMessage());
+ throw new RuntimeException(e.getMessage());
+ } catch (IOException e) {
log.error("startPageNumberCitationLast: " + e.getMessage());
throw new RuntimeException(e.getMessage());
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/ACIUtils.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/ACIUtils.java?rev=1135995&r1=1135994&r2=1135995&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/ACIUtils.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/ACIUtils.java Wed Jun 15 11:04:33 2011
@@ -79,24 +79,19 @@ public final class ACIUtils {
GVTFont gvtFont = (GVTFont)aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.GVT_FONT);
if (gvtFont != null) {
- try {
- String gvtFontFamily = gvtFont.getFamilyName(); //Not available in Batik 1.6!
- if (fontInfo.hasFont(gvtFontFamily, style, weight)) {
- FontTriplet triplet = fontInfo.fontLookup(gvtFontFamily, style,
- weight);
- Font f = fontInfo.getFontInstance(triplet, fsize);
- if (LOG.isDebugEnabled()) {
- LOG.debug("Found a font that matches the GVT font: "
- + gvtFontFamily + ", " + weight + ", " + style
- + " -> " + f);
- }
- fonts.add(f);
+ String gvtFontFamily = gvtFont.getFamilyName();
+ if (fontInfo.hasFont(gvtFontFamily, style, weight)) {
+ FontTriplet triplet = fontInfo.fontLookup(gvtFontFamily, style,
+ weight);
+ Font f = fontInfo.getFontInstance(triplet, fsize);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Found a font that matches the GVT font: "
+ + gvtFontFamily + ", " + weight + ", " + style
+ + " -> " + f);
}
- firstFontFamily = gvtFontFamily;
- } catch (Exception e) {
- //Most likely NoSuchMethodError here when using Batik 1.6
- //Just skip this section in this case
+ fonts.add(f);
}
+ firstFontFamily = gvtFontFamily;
}
if (gvtFonts != null) {
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org