Author: ssteiner
Date: Fri Sep 16 12:50:43 2016
New Revision: 1761026

URL: http://svn.apache.org/viewvc?rev=1761026&view=rev
Log:
FOP-2648: Code cleanup, use entryset

Modified:
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/WordArea.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/GlyphSequence.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/FOText.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/CustomFont.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/FontInfo.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/type1/Type1FontLoader.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/WhitespaceManagementPenalty.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFArray.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFilterList.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/ImageHandlerRegistry.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/intermediate/IFUtil.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pcl/fonts/truetype/PCLTTFFontReader.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/ColorUtil.java
    
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/apps/AFPRendererConfBuilder.java
    
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java
    
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/fonts/CIDFullTestCase.java
    
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/pdf/xref/CrossReferenceTableTestCase.java

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java
 Fri Sep 16 12:50:43 2016
@@ -140,7 +140,7 @@ public abstract class AbstractGraphicsCo
             sb.append('=');
             sb.append(coords[i]);
         }
-        return getName() + "{" + sb.toString() + "}";
+        return getName() + "{" + sb + "}";
     }
 
     /**

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/WordArea.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/WordArea.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/WordArea.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/WordArea.java
 Fri Sep 16 12:50:43 2016
@@ -125,9 +125,7 @@ public class WordArea extends InlineArea
         if (this.levels != null) {
             int n = end - start;
             int[] levels = new int [ n ];
-            for (int i = 0; i < n; i++) {
-                levels[i] = this.levels [ start + i ];
-            }
+            System.arraycopy(this.levels, start + 0, levels, 0, n);
             return levels;
         } else {
             return null;

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java
 Fri Sep 16 12:50:43 2016
@@ -21,6 +21,7 @@ package org.apache.fop.complexscripts.fo
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
@@ -340,9 +341,7 @@ public class GlyphPositioningTable exten
         public List getEntries() {
             if (values != null) {
                 List entries = new ArrayList(values.length);
-                for (Value value : values) {
-                    entries.add(value);
-                }
+                Collections.addAll(entries, values);
                 return entries;
             } else {
                 return null;

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java
 Fri Sep 16 12:50:43 2016
@@ -20,6 +20,7 @@
 package org.apache.fop.complexscripts.fonts;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
@@ -506,9 +507,7 @@ public class GlyphSubstitutionTable exte
         /** {@inheritDoc} */
         public List getEntries() {
             List entries = new ArrayList(gaa.length);
-            for (int[] aGaa : gaa) {
-                entries.add(aGaa);
-            }
+            Collections.addAll(entries, gaa);
             return entries;
         }
         /** {@inheritDoc} */
@@ -638,9 +637,7 @@ public class GlyphSubstitutionTable exte
         /** {@inheritDoc} */
         public List getEntries() {
             List entries = new ArrayList(ligatureSets.length);
-            for (LigatureSet ligatureSet : ligatureSets) {
-                entries.add(ligatureSet);
-            }
+            Collections.addAll(entries, ligatureSets);
             return entries;
         }
         /** {@inheritDoc} */

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java
 Fri Sep 16 12:50:43 2016
@@ -21,6 +21,7 @@ package org.apache.fop.complexscripts.sc
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -241,9 +242,7 @@ public class IndicScriptProcessor extend
     };
     static {
         basicShapingFeatures = new HashSet<String>();
-        for (String s : BASIC_SHAPING_FEATURE_STRINGS) {
-            basicShapingFeatures.add(s);
-        }
+        Collections.addAll(basicShapingFeatures, 
BASIC_SHAPING_FEATURE_STRINGS);
     }
     private boolean isBasicShapingUse(GlyphTable.UseSpec us) {
         assert us != null;
@@ -265,9 +264,7 @@ public class IndicScriptProcessor extend
     };
     static {
         presentationFeatures = new HashSet<String>();
-        for (String s : PRESENTATION_FEATURE_STRINGS) {
-            presentationFeatures.add(s);
-        }
+        Collections.addAll(presentationFeatures, PRESENTATION_FEATURE_STRINGS);
     }
     private boolean isPresentationUse(GlyphTable.UseSpec us) {
         assert us != null;

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/GlyphSequence.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/GlyphSequence.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/GlyphSequence.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/GlyphSequence.java
 Fri Sep 16 12:50:43 2016
@@ -21,6 +21,7 @@ package org.apache.fop.complexscripts.ut
 
 import java.nio.IntBuffer;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 // CSOFF: LineLengthCheck
@@ -459,19 +460,13 @@ public class GlyphSequence implements Cl
         if (na > 0) {
             List gl = new ArrayList(na);
             if (baa != null) {
-                for (CharAssociation aBaa : baa) {
-                    gl.add(aBaa);
-                }
+                Collections.addAll(gl, baa);
             }
             if (iaa != null) {
-                for (CharAssociation anIaa : iaa) {
-                    gl.add(anIaa);
-                }
+                Collections.addAll(gl, iaa);
             }
             if (laa != null) {
-                for (CharAssociation aLaa : laa) {
-                    gl.add(aLaa);
-                }
+                Collections.addAll(gl, laa);
             }
             return gl;
         } else {

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java
 Fri Sep 16 12:50:43 2016
@@ -20,6 +20,7 @@
 package org.apache.fop.complexscripts.util;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 // CSOFF: LineLengthCheck
@@ -478,9 +479,7 @@ public class NumberConverter {
     */
 
     private static void appendScalars(List<Integer> scalars, Integer[] sa) {
-        for (Integer s : sa) {
-            scalars.add(s);
-        }
+        Collections.addAll(scalars, sa);
     }
 
     private static String scalarsToString(List<Integer> scalars) {

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/FOText.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/FOText.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/FOText.java 
(original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/FOText.java 
Fri Sep 16 12:50:43 2016
@@ -801,9 +801,7 @@ public class FOText extends FONode imple
             assert start <= end;
             int n = end - start;
             int[] bidiLevels = new int [ n ];
-            for (int i = 0; i < n; i++) {
-                bidiLevels[i] = this.bidiLevels [ start + i ];
-            }
+            System.arraycopy(this.bidiLevels, start + 0, bidiLevels, 0, n);
             return bidiLevels;
         } else {
             return null;

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/CustomFont.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/CustomFont.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/CustomFont.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/CustomFont.java
 Fri Sep 16 12:50:43 2016
@@ -530,9 +530,7 @@ public abstract class CustomFont extends
      */
     public void setCMap(CMapSegment[] cmap) {
         this.cmap.clear();
-        for (CMapSegment c : cmap) {
-            this.cmap.add(c);
-        }
+        Collections.addAll(this.cmap, cmap);
     }
 
     /**

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/FontInfo.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/FontInfo.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/FontInfo.java 
(original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/FontInfo.java 
Fri Sep 16 12:50:43 2016
@@ -428,7 +428,7 @@ public class FontInfo {
             }
             throw new IllegalStateException(
                     "fontLookup must return an array with at least one "
-                            + "FontTriplet on the last call. Lookup: " + 
sb.toString());
+                            + "FontTriplet on the last call. Lookup: " + sb);
 
         }
         FontTriplet[] fontTriplets = new FontTriplet[matchedTriplets.size()];

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java
 Fri Sep 16 12:50:43 2016
@@ -334,13 +334,14 @@ public class OTFSubSetFile extends OTFFi
 
         gidToSID = new LinkedHashMap<Integer, Integer>();
 
-        for (int gid : subsetGlyphs.keySet()) {
+        for (Entry<Integer, Integer> subsetGlyph : subsetGlyphs.entrySet()) {
+            int gid = subsetGlyph.getKey();
             int sid = cffReader.getSIDFromGID(charsetOffset, gid);
             //Check whether the SID falls into the standard string set
             if (sid < NUM_STANDARD_STRINGS) {
-                gidToSID.put(subsetGlyphs.get(gid), sid);
+                gidToSID.put(subsetGlyph.getValue(), sid);
                 if (mbFont != null) {
-                    mbFont.mapUsedGlyphName(subsetGlyphs.get(gid),
+                    mbFont.mapUsedGlyphName(subsetGlyph.getValue(),
                             CFFStandardString.getName(sid));
                 }
             } else {
@@ -348,16 +349,16 @@ public class OTFSubSetFile extends OTFFi
                 //index is 0 based, should use < not <=
                 if (index < cffReader.getStringIndex().getNumObjects()) {
                     if (mbFont != null) {
-                        mbFont.mapUsedGlyphName(subsetGlyphs.get(gid),
+                        mbFont.mapUsedGlyphName(subsetGlyph.getValue(),
                                 new 
String(cffReader.getStringIndex().getValue(index)));
                     }
-                    gidToSID.put(subsetGlyphs.get(gid), stringIndexData.size() 
+ 391);
+                    gidToSID.put(subsetGlyph.getValue(), 
stringIndexData.size() + 391);
                     
stringIndexData.add(cffReader.getStringIndex().getValue(index));
                 } else {
                     if (mbFont != null) {
-                        mbFont.mapUsedGlyphName(subsetGlyphs.get(gid), 
".notdef");
+                        mbFont.mapUsedGlyphName(subsetGlyph.getValue(), 
".notdef");
                     }
-                    gidToSID.put(subsetGlyphs.get(gid), index);
+                    gidToSID.put(subsetGlyph.getValue(), index);
                 }
             }
         }
@@ -410,7 +411,8 @@ public class OTFSubSetFile extends OTFFi
                 foundLocalUniques.add(new ArrayList<Integer>());
             }
             Map<Integer, Integer> gidHintMaskLengths = new HashMap<Integer, 
Integer>();
-            for (int gid : subsetGlyphs.keySet()) {
+            for (Entry<Integer, Integer> subsetGlyph : 
subsetGlyphs.entrySet()) {
+                int gid = subsetGlyph.getKey();
                 int group = subsetGroups.get(gid);
                 localIndexSubr = 
cffReader.getFDFonts().get(group).getLocalSubrData();
                 localUniques = 
foundLocalUniques.get(uniqueGroups.indexOf(subsetGroups.get(gid)));
@@ -418,7 +420,7 @@ public class OTFSubSetFile extends OTFFi
 
                 FDIndexReference newFDReference = new FDIndexReference(
                         uniqueGroups.indexOf(subsetGroups.get(gid)), 
subsetGroups.get(gid));
-                subsetFDSelect.put(subsetGlyphs.get(gid), newFDReference);
+                subsetFDSelect.put(subsetGlyph.getValue(), newFDReference);
                 byte[] data = charStringsIndex.getValue(gid);
                 preScanForSubsetIndexSize(data);
                 gidHintMaskLengths.put(gid, type2Parser.getMaskLength());
@@ -439,13 +441,15 @@ public class OTFSubSetFile extends OTFFi
             for (Integer uniqueGroup : uniqueGroups) {
                 foundLocalUniquesB.add(new ArrayList<Integer>());
             }
-            for (Integer gid : subsetGlyphs.keySet()) {
+            for (Entry<Integer, Integer> subsetGlyph : 
subsetGlyphs.entrySet()) {
+                int gid = subsetGlyph.getKey();
+                int value = subsetGlyph.getValue();
                 int group = subsetGroups.get(gid);
                 localIndexSubr = 
cffReader.getFDFonts().get(group).getLocalSubrData();
-                localUniques = 
foundLocalUniquesB.get(subsetFDSelect.get(subsetGlyphs.get(gid)).getNewFDIndex());
+                localUniques = 
foundLocalUniquesB.get(subsetFDSelect.get(value).getNewFDIndex());
                 byte[] data = charStringsIndex.getValue(gid);
-                subsetLocalIndexSubr = 
fdSubrs.get(subsetFDSelect.get(subsetGlyphs.get(gid)).getNewFDIndex());
-                subsetLocalSubrCount = 
foundLocalUniques.get(subsetFDSelect.get(subsetGlyphs.get(gid))
+                subsetLocalIndexSubr = 
fdSubrs.get(subsetFDSelect.get(value).getNewFDIndex());
+                subsetLocalSubrCount = 
foundLocalUniques.get(subsetFDSelect.get(value)
                         .getNewFDIndex()).size();
                 type2Parser = new Type2Parser();
                 type2Parser.setMaskLength(gidHintMaskLengths.get(gid));
@@ -457,15 +461,15 @@ public class OTFSubSetFile extends OTFFi
 
     protected void writeFDSelect() {
         writeByte(0); //Format
-        for (Integer gid : subsetFDSelect.keySet()) {
-            writeByte(subsetFDSelect.get(gid).getNewFDIndex());
+        for (FDIndexReference e : subsetFDSelect.values()) {
+            writeByte(e.getNewFDIndex());
         }
     }
 
     protected List<Integer> getUsedFDFonts() {
         List<Integer> uniqueNewRefs = new ArrayList<Integer>();
-        for (int gid : subsetFDSelect.keySet()) {
-            int fdIndex = subsetFDSelect.get(gid).getOldFDIndex();
+        for (FDIndexReference e : subsetFDSelect.values()) {
+            int fdIndex = e.getOldFDIndex();
             if (!uniqueNewRefs.contains(fdIndex)) {
                 uniqueNewRefs.add(fdIndex);
             }
@@ -1023,11 +1027,11 @@ public class OTFSubSetFile extends OTFFi
 
     private void writeCharsetTable(boolean cidFont) throws IOException {
         writeByte(0);
-        for (int gid : gidToSID.keySet()) {
-            if (cidFont && gid == 0) {
+        for (Entry<Integer, Integer> entry : gidToSID.entrySet()) {
+            if (cidFont && entry.getKey() == 0) {
                 continue;
             }
-            writeCard16((cidFont) ? gid : gidToSID.get(gid));
+            writeCard16((cidFont) ? entry.getKey() : entry.getValue());
         }
     }
 

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/type1/Type1FontLoader.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/type1/Type1FontLoader.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/type1/Type1FontLoader.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/type1/Type1FontLoader.java
 Fri Sep 16 12:50:43 2016
@@ -23,6 +23,7 @@ import java.awt.geom.RectangularShape;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URISyntaxException;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -215,9 +216,7 @@ public class Type1FontLoader extends Fon
 
     private Set<String> toGlyphSet(String[] glyphNames) {
         Set<String> glyphSet = new java.util.HashSet<String>();
-        for (String name : glyphNames) {
-            glyphSet.add(name);
-        }
+        Collections.addAll(glyphSet, glyphNames);
         return glyphSet;
     }
 

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/WhitespaceManagementPenalty.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/WhitespaceManagementPenalty.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/WhitespaceManagementPenalty.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/WhitespaceManagementPenalty.java
 Fri Sep 16 12:50:43 2016
@@ -84,7 +84,7 @@ public class WhitespaceManagementPenalty
         String str = super.toString();
         StringBuffer buffer = new StringBuffer(64);
         buffer.append(" number of variants = " + variantList.size());
-        return str + buffer.toString();
+        return str + buffer;
     }
 
 }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
 Fri Sep 16 12:50:43 2016
@@ -1326,7 +1326,7 @@ public class LineLayoutManager extends I
                     }
                 }
                 if (log.isTraceEnabled()) {
-                    log.trace(" Word to hyphenate: " + sbChars.toString());
+                    log.trace(" Word to hyphenate: " + sbChars);
                 }
                 // find hyphenation points
                 HyphContext hc = getHyphenContext(sbChars);

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFArray.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFArray.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFArray.java 
(original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFArray.java 
Fri Sep 16 12:50:43 2016
@@ -22,6 +22,7 @@ package org.apache.fop.pdf;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Set;
 
@@ -119,9 +120,7 @@ public class PDFArray extends PDFObject
         /* generic creation of PDF object */
         super(parent);
 
-        for (Object value : values) {
-            this.values.add(value);
-        }
+        Collections.addAll(this.values, values);
     }
 
     /**

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFilterList.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFilterList.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFilterList.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFilterList.java
 Fri Sep 16 12:50:43 2016
@@ -278,9 +278,9 @@ public class PDFFilterList {
         }
         if (filterCount > 0) {
             if (filterCount > 1) {
-                return "/Filter [ " + sb.toString() + "]";
+                return "/Filter [ " + sb + "]";
             } else {
-                return "/Filter " + sb.toString();
+                return "/Filter " + sb;
             }
         } else {
             return "";

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java
 Fri Sep 16 12:50:43 2016
@@ -308,8 +308,8 @@ public class PDFResources extends PDFDic
 
         if (!properties.isEmpty()) {
             PDFDictionary dict = new PDFDictionary(this);
-            for (String name : properties.keySet()) {
-                dict.put(name, properties.get(name));
+            for (Map.Entry<String, PDFReference> stringPDFReferenceEntry : 
properties.entrySet()) {
+                dict.put(stringPDFReferenceEntry.getKey(), 
stringPDFReferenceEntry.getValue());
             }
             put("Properties", dict);
         }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/ImageHandlerRegistry.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/ImageHandlerRegistry.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/ImageHandlerRegistry.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/ImageHandlerRegistry.java
 Fri Sep 16 12:50:43 2016
@@ -19,6 +19,7 @@
 
 package org.apache.fop.render;
 
+import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
@@ -142,9 +143,7 @@ public class ImageHandlerRegistry {
         for (ImageHandler handler : this.handlerList) {
             if (handler.isCompatible(context, null)) {
                 ImageFlavor[] f = handler.getSupportedImageFlavors();
-                for (ImageFlavor aF : f) {
-                    flavors.add(aF);
-                }
+                Collections.addAll(flavors, f);
             }
         }
         return flavors.toArray(new ImageFlavor[flavors.size()]);

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/intermediate/IFUtil.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/intermediate/IFUtil.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/intermediate/IFUtil.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/intermediate/IFUtil.java
 Fri Sep 16 12:50:43 2016
@@ -375,9 +375,7 @@ public final class IFUtil {
                 int[] paSrc = dp [ i + offset ];
                 if (paSrc != null) {
                     int[] paDst = new int [ 4 ];
-                    for (int k = 0; k < 4; k++) {
-                        paDst [ k ] = paSrc [ k ];
-                    }
+                    System.arraycopy(paSrc, 0, paDst, 0, 4);
                     dpNew [ i ] = paDst;
                 }
             }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pcl/fonts/truetype/PCLTTFFontReader.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pcl/fonts/truetype/PCLTTFFontReader.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pcl/fonts/truetype/PCLTTFFontReader.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pcl/fonts/truetype/PCLTTFFontReader.java
 Fri Sep 16 12:50:43 2016
@@ -605,8 +605,8 @@ public class PCLTTFFontReader extends PC
     private ByteArrayOutputStream updateOffsets(ByteArrayOutputStream baos, 
Map<Integer, byte[]> offsets)
             throws IOException {
         byte[] softFont = baos.toByteArray();
-        for (int offset : offsets.keySet()) {
-            PCLByteWriterUtil.updateDataAtLocation(softFont, 
offsets.get(offset), offset);
+        for (Entry<Integer, byte[]> integerEntry : offsets.entrySet()) {
+            PCLByteWriterUtil.updateDataAtLocation(softFont, 
integerEntry.getValue(), integerEntry.getKey());
         }
         baos = new ByteArrayOutputStream();
         baos.write(softFont);

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/ColorUtil.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/ColorUtil.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/ColorUtil.java 
(original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/ColorUtil.java 
Fri Sep 16 12:50:43 2016
@@ -798,7 +798,7 @@ public final class ColorUtil {
             }
         }
         sb.append(")");
-        return functionName + sb.toString();
+        return functionName + sb;
     }
 
     private static String toCIELabFunctionCall(ColorWithAlternatives color) {

Modified: 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/apps/AFPRendererConfBuilder.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/apps/AFPRendererConfBuilder.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/apps/AFPRendererConfBuilder.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/apps/AFPRendererConfBuilder.java
 Fri Sep 16 12:50:43 2016
@@ -94,8 +94,8 @@ public final class AFPRendererConfBuilde
 
     public AFPRendererConfBuilder setDefaultResourceLevels(Map<String, String> 
levels) {
         Element e = createElement(DEFAULT_RESOURCE_LEVELS.getName());
-        for (String key : levels.keySet()) {
-            e.setAttribute(key, levels.get(key));
+        for (Map.Entry<String, String> stringStringEntry : levels.entrySet()) {
+            e.setAttribute(stringStringEntry.getKey(), 
stringStringEntry.getValue());
         }
         return this;
     }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java
 Fri Sep 16 12:50:43 2016
@@ -2804,11 +2804,11 @@ public class TTXFile {
                 }
             }
             GlyphCoverageTable[] gca = new GlyphCoverageTable [ mi + 1 ];
-            for (String k : keys) {
-                if (k.startsWith(prefix)) {
-                    int i = Integer.parseInt(k.substring(prefixLength));
+            for (Map.Entry<String, GlyphCoverageTable> 
stringGlyphCoverageTableEntry : coverages.entrySet()) {
+                if (stringGlyphCoverageTableEntry.getKey().startsWith(prefix)) 
{
+                    int i = 
Integer.parseInt(stringGlyphCoverageTableEntry.getKey().substring(prefixLength));
                     if (i >= 0) {
-                        gca [ i ] = coverages.get(k);
+                        gca [ i ] = stringGlyphCoverageTableEntry.getValue();
                     }
                 }
             }
@@ -2915,11 +2915,11 @@ public class TTXFile {
         }
         private Map<GlyphTable.LookupSpec, List<String>> extractLookups() {
             Map<GlyphTable.LookupSpec, List<String>> lookups = new 
LinkedHashMap<GlyphTable.LookupSpec, List<String>>();
-            for (String st : scripts.keySet()) {
-                Map<String, List<String>> lm = scripts.get(st);
+            for (Map.Entry<String, Map<String, List<String>>> stringMapEntry : 
scripts.entrySet()) {
+                Map<String, List<String>> lm = stringMapEntry.getValue();
                 if (lm != null) {
-                    for (String lt : lm.keySet()) {
-                        List<String> fids = lm.get(lt);
+                    for (Map.Entry<String, List<String>> stringListEntry : 
lm.entrySet()) {
+                        List<String> fids = stringListEntry.getValue();
                         if (fids != null) {
                             for (String fid : fids) {
                                 if (fid != null) {
@@ -2929,7 +2929,7 @@ public class TTXFile {
                                         String ft = (String) fa[0];
                                         List<String> lids = (List<String>) 
fa[1];
                                         if ((lids != null) && (lids.size() > 
0)) {
-                                            GlyphTable.LookupSpec ls = new 
GlyphTable.LookupSpec(st, lt, ft);
+                                            GlyphTable.LookupSpec ls = new 
GlyphTable.LookupSpec(stringMapEntry.getKey(), stringListEntry.getKey(), ft);
                                             lookups.put(ls, lids);
                                         }
                                     }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/fonts/CIDFullTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/fonts/CIDFullTestCase.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/fonts/CIDFullTestCase.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/fonts/CIDFullTestCase.java
 Fri Sep 16 12:50:43 2016
@@ -91,8 +91,8 @@ public class CIDFullTestCase {
     @Test
     public void testGetGlyphs() {
         Map<Integer, Integer> fontGlyphs = cidFull.getGlyphs();
-        for (Integer key : fontGlyphs.keySet()) {
-            assertEquals(fontGlyphs.get(key), glyphs.get(key));
+        for (Map.Entry<Integer, Integer> integerIntegerEntry : 
fontGlyphs.entrySet()) {
+            assertEquals(integerIntegerEntry.getValue(), 
glyphs.get(integerIntegerEntry.getKey()));
         }
         assertTrue(fontGlyphs.size() == glyphs.size());
     }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/pdf/xref/CrossReferenceTableTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/pdf/xref/CrossReferenceTableTestCase.java?rev=1761026&r1=1761025&r2=1761026&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/pdf/xref/CrossReferenceTableTestCase.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/pdf/xref/CrossReferenceTableTestCase.java
 Fri Sep 16 12:50:43 2016
@@ -64,7 +64,7 @@ public class CrossReferenceTableTestCase
                 .append("\n0000000000 65535 f \n");
         for (Long objectReference : offsets) {
             final String padding = "0000000000";
-            String s = String.valueOf(objectReference).toString();
+            String s = String.valueOf(objectReference);
             String loc = padding.substring(s.length()) + s;
             expected.append(loc).append(" 00000 n \n");
         }




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

Reply via email to