From 8d775d94555b992aa3986323c0867c2cc82c90e4 Mon Sep 17 00:00:00 2001 From: Luis Bernardo Date: Mon, 15 Oct 2012 00:04:26 +0000 Subject: [PATCH] fix findbugs issues introduced with revision 1391502 git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1398155 13f79535-47bb-0310-9956-ffa450edef68 --- findbugs-exclude.xml | 5 +++++ src/java/org/apache/fop/fo/flow/Markers.java | 20 +++++++++++-------- .../table/TableCellLayoutManager.java | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/findbugs-exclude.xml b/findbugs-exclude.xml index a764eac41..1b7bcac67 100644 --- a/findbugs-exclude.xml +++ b/findbugs-exclude.xml @@ -3303,6 +3303,11 @@ + + + + + diff --git a/src/java/org/apache/fop/fo/flow/Markers.java b/src/java/org/apache/fop/fo/flow/Markers.java index 24da818af..392a1576e 100644 --- a/src/java/org/apache/fop/fo/flow/Markers.java +++ b/src/java/org/apache/fop/fo/flow/Markers.java @@ -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(); } // first on scope: only put in new values, leave current - for (Iterator iter = marks.keySet().iterator(); iter.hasNext();) { - String key = iter.next(); + Set> entries = marks.entrySet(); + for (Map.Entry 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 iter = marks.keySet().iterator(); iter.hasNext();) { - String key = iter.next(); + Set> entries = marks.entrySet(); + for (Map.Entry 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"); } diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java index f810d20c5..8a6b0a703 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java @@ -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); -- 2.39.5