<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"/>
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.
*/
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);
*/
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);
* Main constructor.
*
* @param fontInfo the AFPGraphics2D instance
+ * @param resourceManager the AFPResourceManager instance
*/
public AFPTextHandler(FontInfo fontInfo, AFPResourceManager resourceManager) {
this.fontInfo = fontInfo;
package org.apache.fop.render.afp.extensions;
+import java.util.Locale;
+
/**
* An enumeration for placement instruction for AFP extensions.
*/
* @return the XML value
*/
public String getXMLValue() {
- String xmlName = name().toLowerCase();
+ String xmlName = name().toLowerCase(Locale.ENGLISH);
xmlName = xmlName.replace('_', '-');
return xmlName;
}
* @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);
}
/** {@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());
package org.apache.fop.render.ps;
+import java.util.Locale;
+
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.xmlgraphics.ps.PSGenerator;
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));
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;
throw new RuntimeException(e.getMessage());
}
}
-
+
/** {@inheritDoc} */
public void startPageNumberCitationLast(PageNumberCitationLast l) {
if (bDefer) {
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());
}
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) {