From 944253c7864f923abb3532c401aacb72ad5df0cb Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Sat, 31 Oct 2015 23:13:35 +0000 Subject: [PATCH] FindBugs fixes git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1711708 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/hpsf/MutableSection.java | 7 +++---- .../poi/ss/formula/CollaboratingWorkbooksEnvironment.java | 5 +++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/java/org/apache/poi/hpsf/MutableSection.java b/src/java/org/apache/poi/hpsf/MutableSection.java index cb864fa8b1..b0d71acf0e 100644 --- a/src/java/org/apache/poi/hpsf/MutableSection.java +++ b/src/java/org/apache/poi/hpsf/MutableSection.java @@ -505,10 +505,9 @@ public class MutableSection extends Section throws IOException { int length = TypeWriter.writeUIntToStream(out, dictionary.size()); - for (final Iterator i = dictionary.keySet().iterator(); i.hasNext();) - { - final Long key = i.next(); - final String value = dictionary.get(key); + for (Map.Entry ls : dictionary.entrySet()) { + final Long key = ls.getKey(); + final String value = ls.getValue(); if (codepage == CodePageUtil.CP_UNICODE) { diff --git a/src/java/org/apache/poi/ss/formula/CollaboratingWorkbooksEnvironment.java b/src/java/org/apache/poi/ss/formula/CollaboratingWorkbooksEnvironment.java index 00b3e8bfcb..074e7a18da 100644 --- a/src/java/org/apache/poi/ss/formula/CollaboratingWorkbooksEnvironment.java +++ b/src/java/org/apache/poi/ss/formula/CollaboratingWorkbooksEnvironment.java @@ -76,8 +76,9 @@ public final class CollaboratingWorkbooksEnvironment { } public static void setupFormulaEvaluator(Map evaluators) { Map evaluatorsByName = new HashMap(evaluators.size()); - for (String wbName : evaluators.keySet()) { - FormulaEvaluator eval = evaluators.get(wbName); + for (Map.Entry swb : evaluators.entrySet()) { + String wbName = swb.getKey(); + FormulaEvaluator eval = swb.getValue(); if (eval instanceof WorkbookEvaluatorProvider) { evaluatorsByName.put(wbName, ((WorkbookEvaluatorProvider)eval)._getWorkbookEvaluator()); } else { -- 2.39.5