]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
fix findbugs issues introduced with revision 1391502
authorLuis Bernardo <lbernardo@apache.org>
Mon, 15 Oct 2012 00:04:26 +0000 (00:04 +0000)
committerLuis Bernardo <lbernardo@apache.org>
Mon, 15 Oct 2012 00:04:26 +0000 (00:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1398155 13f79535-47bb-0310-9956-ffa450edef68

findbugs-exclude.xml
src/java/org/apache/fop/fo/flow/Markers.java
src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java

index a764eac41fdeead209de41da723277c2ed3e5970..1b7bcac67e664cc1dfb7c8eebf435d4c52caea05 100644 (file)
       <Method name="make"/>
       <Bug pattern="BC_UNCONFIRMED_CAST"/>
    </Match>
+   <Match>
+      <Class name="org.apache.fop.layoutmgr.LayoutManagerMapping$RetrieveTableMarkerLayoutManagerMaker"/>
+      <Method name="make"/>
+      <Bug pattern="BC_UNCONFIRMED_CAST"/>
+   </Match>
    <Match>
       <Class name="org.apache.fop.layoutmgr.LayoutManagerMapping$WrapperLayoutManagerMaker"/>
       <Method name="make"/>
index 24da818af669371d1fa41c269bc4d87c0faded2a..392a1576ebdff5a464004d83a3800b54fa4cf59f 100644 (file)
@@ -20,8 +20,8 @@
 package org.apache.fop.fo.flow;
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -81,16 +81,18 @@ public final class Markers {
                     firstQualifyingIsFirst = new HashMap<String, Marker>();
                 }
                 // first on scope: only put in new values, leave current
-                for (Iterator<String> iter = marks.keySet().iterator(); iter.hasNext();) {
-                    String key = iter.next();
+                Set<Map.Entry<String, Marker>> entries = marks.entrySet();
+                for (Map.Entry<String, Marker> entry : entries) {
+                    String key = entry.getKey();
+                    Marker marker = entry.getValue();
                     if (!firstQualifyingIsFirst.containsKey(key)) {
-                        firstQualifyingIsFirst.put(key, marks.get(key));
+                        firstQualifyingIsFirst.put(key, marker);
                         if (log.isTraceEnabled()) {
                             log.trace("Adding marker " + key + " to firstQualifyingIsFirst");
                         }
                     }
                     if (!firstQualifyingIsAny.containsKey(key)) {
-                        firstQualifyingIsAny.put(key, marks.get(key));
+                        firstQualifyingIsAny.put(key, marker);
                         if (log.isTraceEnabled()) {
                             log.trace("Adding marker " + key + " to firstQualifyingIsAny");
                         }
@@ -106,10 +108,12 @@ public final class Markers {
                 }
             } else {
                 // first on scope: only put in new values, leave current
-                for (Iterator<String> iter = marks.keySet().iterator(); iter.hasNext();) {
-                    String key = iter.next();
+                Set<Map.Entry<String, Marker>> entries = marks.entrySet();
+                for (Map.Entry<String, Marker> entry : entries) {
+                    String key = entry.getKey();
+                    Marker marker = entry.getValue();
                     if (!firstQualifyingIsAny.containsKey(key)) {
-                        firstQualifyingIsAny.put(key, marks.get(key));
+                        firstQualifyingIsAny.put(key, marker);
                         if (log.isTraceEnabled()) {
                             log.trace("Adding marker " + key + " to firstQualifyingIsAny");
                         }
index f810d20c58a8a5d007a441055cf2f475ae0d4abb..8a6b0a70348ff90db7f926489004b58c5e82f66a 100644 (file)
@@ -742,7 +742,7 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
         return true;
     }
 
-    private class TableCellBreaker extends LocalBreaker {
+    private static class TableCellBreaker extends LocalBreaker {
 
         public TableCellBreaker(TableCellLayoutManager lm, int ipd, int displayAlign) {
             super(lm, ipd, displayAlign);