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 ga...@apache.org on 2014/08/07 22:28:00 UTC

svn commit: r1616590 - in /xmlgraphics/fop/trunk: ./ src/java/org/apache/fop/afp/ src/java/org/apache/fop/apps/ src/java/org/apache/fop/cli/ src/java/org/apache/fop/events/ src/java/org/apache/fop/fo/ src/java/org/apache/fop/fo/flow/ src/java/org/apach...

Author: gadams
Date: Thu Aug  7 20:27:59 2014
New Revision: 1616590

URL: http://svn.apache.org/r1616590
Log:
Fix or suppress 3-instance findbug warnings.

Modified:
    xmlgraphics/fop/trunk/findbugs-exclude.xml
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPResourceInfo.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/MimeConstants.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/ImageInputHandler.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventListener.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfo.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/hyphenation/PatternParser.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/Graphics2DImagePainter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/PreviewDialogAboutBox.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DGraphicsPainter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerSVG.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/NativeTextHandler.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageHandlerSVG.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSSVGHandler.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/RTFHandler.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageArea.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/anttasks/FileCompare.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/fontlist/FontListSerializer.java

Modified: xmlgraphics/fop/trunk/findbugs-exclude.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/findbugs-exclude.xml?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/findbugs-exclude.xml (original)
+++ xmlgraphics/fop/trunk/findbugs-exclude.xml Thu Aug  7 20:27:59 2014
@@ -26,10 +26,6 @@
     <Bug pattern="DLS_DEAD_LOCAL_STORE"/>
   </Match>
   <Match>
-    <!-- 3 warnings -->
-    <Bug pattern="DLS_DEAD_LOCAL_STORE_OF_NULL"/>
-  </Match>
-  <Match>
     <!-- 4 warnings -->
     <Bug pattern="DM_BOOLEAN_CTOR"/>
   </Match>
@@ -71,22 +67,10 @@
     </Or>
   </Match>
   <Match>
-    <!-- 3 warnings -->
-    <Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ"/>
-  </Match>
-  <Match>
-    <!-- 3 warnings -->
-    <Bug pattern="ES_COMPARING_STRINGS_WITH_EQ"/>
-  </Match>
-  <Match>
     <!-- 12 warnings -->
     <Bug pattern="FE_FLOATING_POINT_EQUALITY"/>
   </Match>
   <Match>
-    <!-- 3 warnings -->
-    <Bug pattern="IS2_INCONSISTENT_SYNC"/>
-  </Match>
-  <Match>
     <!-- 6 warnings -->
     <Bug pattern="ITA_INEFFICIENT_TO_ARRAY"/>
   </Match>
@@ -116,8 +100,12 @@
     <Bug pattern="NM_CONFUSING"/>
   </Match>
   <Match>
-    <!-- 3 warnings -->
     <Bug pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE"/>
+    <Or>
+      <Class name="org.apache.fop.apps.MimeConstants"/>
+      <Class name="org.apache.fop.events.EventListener"/>
+      <Class name="org.apache.fop.render.Graphics2DImagePainter"/>
+    </Or>
   </Match>
   <Match>
     <!-- 5 warnings -->
@@ -132,10 +120,6 @@
     <Bug pattern="NP_NULL_ON_SOME_PATH"/>
   </Match>
   <Match>
-    <!-- 3 warnings -->
-    <Bug pattern="NS_DANGEROUS_NON_SHORT_CIRCUIT"/>
-  </Match>
-  <Match>
     <!-- 4 warnings -->
     <Bug pattern="OS_OPEN_STREAM"/>
   </Match>
@@ -148,10 +132,6 @@
     <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
   </Match>
   <Match>
-    <!-- 3 warnings -->
-    <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"/>
-  </Match>
-  <Match>
     <!-- 23 warnings -->
     <Bug pattern="REC_CATCH_EXCEPTION"/>
   </Match>
@@ -176,8 +156,13 @@
     <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED"/>
   </Match>
   <Match>
-    <!-- 3 warnings -->
     <Bug pattern="SF_SWITCH_FALLTHROUGH"/>
+    <Or>
+      <And>
+        <Class name="org.apache.fop.render.awt.viewer.PreviewPanel$Reloader"/>
+        <Method name="run"/>
+      </And>
+    </Or>
   </Match>
   <Match>
     <!-- 21 warnings -->
@@ -200,10 +185,6 @@
     <Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
   </Match>
   <Match>
-    <!-- 3 warnings -->
-    <Bug pattern="UI_INHERITANCE_UNSAFE_GETRESOURCE"/>
-  </Match>
-  <Match>
     <!-- 6 warnings -->
     <Bug pattern="UPM_UNCALLED_PRIVATE_METHOD"/>
   </Match>
@@ -212,10 +193,6 @@
     <Bug pattern="URF_UNREAD_FIELD"/>
   </Match>
   <Match>
-    <!-- 3 warnings -->
-    <Bug pattern="UUF_UNUSED_FIELD"/>
-  </Match>
-  <Match>
     <!-- 58 warnings -->
     <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
   </Match>

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPResourceInfo.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPResourceInfo.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPResourceInfo.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/AFPResourceInfo.java Thu Aug  7 20:27:59 2014
@@ -158,11 +158,10 @@ public class AFPResourceInfo {
         }
 
         AFPResourceInfo ri = (AFPResourceInfo)obj;
-        return (uri == ri.uri || uri != null && uri.equals(ri.uri))
-            && (imageDimension == ri.imageDimension
-                    || (imageDimension != null && imageDimension.equals(ri.imageDimension)))
-            && (name == ri.name || name != null && name.equals(ri.name))
-            && (level == ri.level || level != null && level.equals(ri.level));
+        return (uri != null && uri.equals(ri.uri))
+            && (imageDimension != null && imageDimension.equals(ri.imageDimension))
+            && (name != null && name.equals(ri.name))
+            && (level != null && level.equals(ri.level));
     }
 
     /** {@inheritDoc} */

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/MimeConstants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/MimeConstants.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/MimeConstants.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/MimeConstants.java Thu Aug  7 20:27:59 2014
@@ -22,6 +22,7 @@ package org.apache.fop.apps;
 /**
  * Frequently used MIME types for various file formats used when working with Apache FOP.
  */
+// @SuppressFBWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE")
 public interface MimeConstants extends org.apache.xmlgraphics.util.MimeConstants {
 
     /** Apache FOP's AWT preview (non-standard MIME type) */

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/ImageInputHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/ImageInputHandler.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/ImageInputHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/ImageInputHandler.java Thu Aug  7 20:27:59 2014
@@ -52,7 +52,7 @@ public class ImageInputHandler extends I
     protected Source createXSLTSource() {
         Source src = super.createXSLTSource();
         if (src == null) {
-            src = new StreamSource(getClass().getResource("image2fo.xsl").toExternalForm());
+            src = new StreamSource(ImageInputHandler.class.getResource("image2fo.xsl").toExternalForm());
         }
         return src;
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventListener.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventListener.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventListener.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/events/EventListener.java Thu Aug  7 20:27:59 2014
@@ -22,6 +22,7 @@ package org.apache.fop.events;
 /**
  * This interface is implemented by clients who want to listen for events.
  */
+// @SuppressFBWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE")
 public interface EventListener extends java.util.EventListener {
 
     /**

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java Thu Aug  7 20:27:59 2014
@@ -343,7 +343,7 @@ public final class FOPropertyMapping imp
             addSubpropMakerName("precedence", CP_PRECEDENCE);
         }
 
-        // SuppressFBWarnings("MS_EXPOSE_REP")
+        // @SuppressFBWarnings("MS_EXPOSE_REP")
         return generics;
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java Thu Aug  7 20:27:59 2014
@@ -420,18 +420,14 @@ public class Marker extends FObjMixed {
 
             if (o instanceof MarkerAttribute) {
                 MarkerAttribute attr = (MarkerAttribute) o;
-                return ((attr.namespace == this.namespace)
-                            || (attr.namespace != null
-                                    && attr.namespace.equals(this.namespace)))
-                    && ((attr.qname == this.qname)
-                            || (attr.qname != null
-                                    && attr.qname.equals(this.qname)))
-                    && ((attr.name == this.name)
-                            || (attr.name != null
-                                    && attr.name.equals(this.name)))
-                    && ((attr.value == this.value)
-                            || (attr.value != null
-                                    && attr.value.equals(this.value)));
+                return (attr.namespace != null
+                                    && attr.namespace.equals(this.namespace))
+                    && (attr.qname != null
+                                    && attr.qname.equals(this.qname))
+                    && (attr.name != null
+                                    && attr.name.equals(this.name))
+                    && (attr.value != null
+                                    && attr.value.equals(this.value));
             } else {
                 return false;
             }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java Thu Aug  7 20:27:59 2014
@@ -78,7 +78,7 @@ public class ToBeImplementedProperty ext
          * Since a PropertyCache is not used here, returning true helps the PropertyCache when a non
          * implemented property is part of an implemented one.
          */
-        // FBOFF: EQ_ALWAYS_TRUE
+        // @SuppressFBWarnings("EQ_ALWAYS_TRUE")
         return true;
     }
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfo.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfo.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfo.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfo.java Thu Aug  7 20:27:59 2014
@@ -245,13 +245,13 @@ public class FontInfo {
 
         // only if the font may be substituted
         // fallback 1: try the same font-family and weight with default style
-        if (internalFontKey == null && style != Font.STYLE_NORMAL) {
+        if (internalFontKey == null && !style.equals(Font.STYLE_NORMAL)) {
             key = createFontKey(family, Font.STYLE_NORMAL, weight);
             internalFontKey = getInternalFontKey(key);
         }
 
         // fallback 2: try the same font-family with default style and try to adjust weight
-        if (internalFontKey == null && style != Font.STYLE_NORMAL) {
+        if (internalFontKey == null && !style.equals(Font.STYLE_NORMAL)) {
             key = findAdjustWeight(family, Font.STYLE_NORMAL, weight);
             if (key != null) {
                 internalFontKey = getInternalFontKey(key);

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/hyphenation/PatternParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/hyphenation/PatternParser.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/hyphenation/PatternParser.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/hyphenation/PatternParser.java Thu Aug  7 20:27:59 2014
@@ -261,7 +261,7 @@ public class PatternParser extends Defau
         parser = createParser();
         parser.setContentHandler(this);
         parser.setErrorHandler(this);
-        InputStream stream = this.getClass().getResourceAsStream("classes.xml");
+        InputStream stream = PatternParser.class.getResourceAsStream("classes.xml");
         InputSource source = new InputSource(stream);
         try {
             parser.parse(source);

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Thu Aug  7 20:27:59 2014
@@ -419,7 +419,9 @@ public class TableStepper {
         for (Iterator iter = activeCells.iterator(); iter.hasNext();) {
             ActiveCell activeCell = (ActiveCell) iter.next();
             if (activeCell.endsOnRow(activeRowIndex)) {
-                rowFinished &= activeCell.finishes(step);
+                if (!activeCell.finishes(step)) {
+                    rowFinished = false;
+                }
             }
         }
         if (rowFinished) {

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/Graphics2DImagePainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/Graphics2DImagePainter.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/Graphics2DImagePainter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/Graphics2DImagePainter.java Thu Aug  7 20:27:59 2014
@@ -24,6 +24,7 @@ package org.apache.fop.render;
  * a Graphics2D instance can implement this interface to paint themselves.
  * @deprecated use {@link org.apache.xmlgraphics.java2d.Graphics2DImagePainter} directly!
  */
+// @SuppressFBWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE")
 public interface Graphics2DImagePainter
         extends org.apache.xmlgraphics.java2d.Graphics2DImagePainter {
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java Thu Aug  7 20:27:59 2014
@@ -62,6 +62,15 @@ public class ImageProxyPanel extends JPa
     public ImageProxyPanel(AWTRenderer renderer, int page) {
         this.renderer = renderer;
         this.page = page;
+        try {
+            Dimension size = renderer.getPageImageSize(page);
+            Insets insets = getInsets();
+            size.width += insets.left + insets.right;
+            size.height += insets.top + insets.bottom;
+            this.size = size;
+        } catch (Exception e) {
+            this.size = new Dimension(10, 10);
+        }
         // Allows single panel to appear behind page display.
         // Important for textured L&Fs.
         setOpaque(false);
@@ -78,17 +87,6 @@ public class ImageProxyPanel extends JPa
      * @return the size of the page plus the border.
      */
     public Dimension getPreferredSize() {
-        if (size == null) {
-            try {
-                Insets insets = getInsets();
-                size = renderer.getPageImageSize(page);
-                size = new Dimension(size.width + insets.left + insets.right,
-                                                         size.height + insets.top + insets.bottom);
-            } catch (FOPException fopEx) {
-                // Arbitary size. Doesn't really matter what's returned here.
-                return new Dimension(10, 10);
-            }
-        }
         return size;
     }
 
@@ -96,7 +94,7 @@ public class ImageProxyPanel extends JPa
      * Sets the number of the page to be displayed and refreshes the display.
      * @param pg the page number
      */
-    public void setPage(int pg) {
+    public synchronized void setPage(int pg) {
         if (page != pg) {
             page = pg;
             imageRef = null;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/PreviewDialogAboutBox.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/PreviewDialogAboutBox.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/PreviewDialogAboutBox.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/PreviewDialogAboutBox.java Thu Aug  7 20:27:59 2014
@@ -64,7 +64,7 @@ public class PreviewDialogAboutBox exten
         JPanel insetsPanel3 = new JPanel();
         okButton = new JButton();
         JLabel imageControl1 = new JLabel();
-        imageControl1.setIcon(new ImageIcon(getClass().getResource("images/fop.gif")));
+        imageControl1.setIcon(new ImageIcon(PreviewDialogAboutBox.class.getResource("images/fop.gif")));
         JLabel label1 = new JLabel(translator.getString("About.Product"));
         JLabel label2 = new JLabel(translator.getString("About.Version")
                                             + " " + Version.getVersion());

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java Thu Aug  7 20:27:59 2014
@@ -320,7 +320,7 @@ public class PreviewPanel extends JPanel
 
         // ***** MouseListener *****
 
-        public void mousePressed(MouseEvent e) {
+        public synchronized void mousePressed(MouseEvent e) {
             startPosX = e.getX();
             startPosY = e.getY();
         }
@@ -357,6 +357,7 @@ public class PreviewPanel extends JPanel
                     // This page intentionally left blank
                     // Makes 0th/1st page on rhs
                     gridPanel.add(new JLabel(""));
+                    // @SuppressFBWarnings("SF_SWITCH_FALLTHROUGH")
                 case CONTINUOUS:
                     currentPage = 0;
                     firstPage = 0;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java Thu Aug  7 20:27:59 2014
@@ -56,8 +56,8 @@ public class IFGraphicContext extends Gr
     /**
      * {@inheritDoc}
      */
+    // @SuppressFBWarnings("CN_IDIOM_NO_SUPER_CALL")
     public Object clone() {
-        // FBOFF: CN_IDIOM_NO_SUPER_CALL
         return new IFGraphicContext(this);
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DGraphicsPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DGraphicsPainter.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DGraphicsPainter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DGraphicsPainter.java Thu Aug  7 20:27:59 2014
@@ -261,11 +261,13 @@ class Java2DGraphicsPainter implements G
             closePath();
             getG2D().fill(currentPath);
             currentPath = null;
+            break;
 
         case Constants.EN_NONE:
             // No rule is drawn
             break;
         default:
+            break;
         } // end switch
         restoreGraphicsState();
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DRenderer.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DRenderer.java Thu Aug  7 20:27:59 2014
@@ -893,11 +893,13 @@ public abstract class Java2DRenderer ext
             closePath();
             state.getGraph().fill(currentPath);
             currentPath = null;
+            break;
 
         case EN_NONE:
             // No rule is drawn
             break;
         default:
+            break;
         } // end switch
 
         super.renderLeader(area);

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLGenerator.java Thu Aug  7 20:27:59 2014
@@ -715,6 +715,7 @@ public class PCLGenerator {
         boolean monochrome = isMonochromeImage(img);
         if (!monochrome) {
             //Transparency mask disabled. Doesn't work reliably
+            /*
             final boolean transparencyDisabled = true;
             RenderedImage mask = (transparencyDisabled ? null : getMask(img, effDim));
             if (mask != null) {
@@ -724,11 +725,12 @@ public class PCLGenerator {
                 paintMonochromeBitmap(mask, effResolution);
                 popCursorPos();
             }
+            */
 
             RenderedImage red = BitmapImageUtil.convertToMonochrome(
                     img, effDim, this.ditheringQuality);
             selectCurrentPattern(0, 0); //Solid black
-            setTransparencyMode(sourceTransparency || mask != null, true);
+            setTransparencyMode(sourceTransparency /*|| mask != null*/, true);
             paintMonochromeBitmap(red, effResolution);
         } else {
             RenderedImage effImg = img;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerSVG.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerSVG.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerSVG.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFImageHandlerSVG.java Thu Aug  7 20:27:59 2014
@@ -101,7 +101,6 @@ public class PDFImageHandlerSVG implemen
         GraphicsNode root;
         try {
             root = builder.build(ctx, clonedDoc);
-            builder = null;
         } catch (Exception e) {
             SVGEventProducer eventProducer = SVGEventProducer.Provider.get(
                     context.getUserAgent().getEventBroadcaster());

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/NativeTextHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/NativeTextHandler.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/NativeTextHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/NativeTextHandler.java Thu Aug  7 20:27:59 2014
@@ -147,7 +147,7 @@ public class NativeTextHandler implement
         final int l = text.length();
         for (int i = 0; i < l; i++) {
             final char ch = text.charAt(i);
-            final char mch = this.font.mapChar(ch);
+            final char mch = font.mapChar(ch);
             PSGenerator.escapeChar(mch, target);
         }
     }
@@ -157,13 +157,13 @@ public class NativeTextHandler implement
     }
 
     private void establishCurrentFont() throws IOException {
-        if ((currentFontName != this.font.getFontName())
-                || (currentFontSize != this.font.getFontSize())) {
+        if (!currentFontName.equals(font.getFontName())
+                || (currentFontSize != font.getFontSize())) {
             PSGenerator gen = getPSGenerator();
-            gen.writeln("/" + this.font.getFontTriplet().getName() + " "
+            gen.writeln("/" + font.getFontTriplet().getName() + " "
                     + gen.formatDouble(font.getFontSize() / 1000f) + " F");
-            currentFontName = this.font.getFontName();
-            currentFontSize = this.font.getFontSize();
+            currentFontName = font.getFontName();
+            currentFontSize = font.getFontSize();
         }
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageHandlerSVG.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageHandlerSVG.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageHandlerSVG.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSImageHandlerSVG.java Thu Aug  7 20:27:59 2014
@@ -138,8 +138,6 @@ public class PSImageHandlerSVG implement
             float sx = pos.width / w;
             float sy = pos.height / h;
 
-            ctx = null;
-
             gen.commentln("%FOPBeginSVG");
             gen.saveGraphicsState();
             final boolean clip = false;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSSVGHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSSVGHandler.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSSVGHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSSVGHandler.java Thu Aug  7 20:27:59 2014
@@ -278,8 +278,6 @@ public class PSSVGHandler extends Abstra
         float sx = psInfo.getWidth() / w;
         float sy = psInfo.getHeight() / h;
 
-        ctx = null;
-
         try {
             gen.commentln("%FOPBeginSVG");
             gen.saveGraphicsState();

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=1616590&r1=1616589&r2=1616590&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 Thu Aug  7 20:27:59 2014
@@ -1101,7 +1101,7 @@ public class RTFHandler extends FOEventH
         } catch (ImageException ie) {
             ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                     getUserAgent().getEventBroadcaster());
-            eventProducer.imageError(this, (info != null ? info.toString() : uri), ie, null);
+            eventProducer.imageError(this, uri, ie, null);
         } catch (FileNotFoundException fe) {
             ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
                     getUserAgent().getEventBroadcaster());

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageArea.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageArea.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageArea.java Thu Aug  7 20:27:59 2014
@@ -37,8 +37,6 @@ import java.io.Writer;
 public class RtfPageArea
 extends RtfContainer {
     private RtfPage currentPage;
-    private RtfNull nullChild;
-    private RtfAttributes childAttributes;
 
     /** Create an RTF element as a child of given container */
     RtfPageArea(RtfFile f, Writer w) throws IOException {

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java Thu Aug  7 20:27:59 2014
@@ -331,8 +331,8 @@ public class RtfTextrun extends RtfConta
      * @throws IOException for I/O problems
      */
     public void addBookmark(String id) throws IOException {
-       if (id != "") {
-            // if id is not empty, add boormark
+       if (id.length() > 0) {
+            // if id is not empty, add bookmark
            new RtfBookmark(this, writer, id);
        }
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/anttasks/FileCompare.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/anttasks/FileCompare.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/anttasks/FileCompare.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/anttasks/FileCompare.java Thu Aug  7 20:27:59 2014
@@ -42,14 +42,13 @@ public class FileCompare {
     private String referenceDirectory;
     private String testDirectory;
     private String[] filenameList;
-    private String filenames;
 
     /**
      * Sets directory for test files.
      * @param testDirectory the test directory
      */
     public void setTestDirectory(String testDirectory) {
-        if (!(testDirectory.endsWith("/") | testDirectory.endsWith("\\"))) {
+        if (!(testDirectory.endsWith("/") || testDirectory.endsWith("\\"))) {
             testDirectory += File.separator;
         }
         this.testDirectory = testDirectory;
@@ -61,7 +60,7 @@ public class FileCompare {
      */
     public void setReferenceDirectory(String referenceDirectory) {
         if (!(referenceDirectory.endsWith("/")
-                | referenceDirectory.endsWith("\\"))) {
+                || referenceDirectory.endsWith("\\"))) {
             referenceDirectory += File.separator;
         }
         this.referenceDirectory = referenceDirectory;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/fontlist/FontListSerializer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/fontlist/FontListSerializer.java?rev=1616590&r1=1616589&r2=1616590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/fontlist/FontListSerializer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/fontlist/FontListSerializer.java Thu Aug  7 20:27:59 2014
@@ -81,7 +81,7 @@ public class FontListSerializer {
         while (iter.hasNext()) {
             Map.Entry entry = (Map.Entry)iter.next();
             String familyName = (String)entry.getKey();
-            if (singleFamily != null && familyName != singleFamily) {
+            if (singleFamily != null && !singleFamily.equals(familyName)) {
                 continue;
             }
             atts.clear();



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org