Author: ssteiner
Date: Fri Sep 16 11:17:35 2016
New Revision: 1761020

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

Modified:
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/AFPGraphics2D.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/DataStream.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/modca/MapPageOverlay.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/apps/FOUserAgent.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/apps/FopConfParser.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/LineArea.java
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/Span.java
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/Trait.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/InlineParent.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/TextArea.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/cli/CommandLineOptions.java
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/cli/Main.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/BidiResolver.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/DelimitedTextRange.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/InlineRun.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/UnflattenProcessor.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningState.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/GlyphSubstitutionState.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/fonts/GlyphSubtable.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphTable.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.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/scripts/ScriptProcessor.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/CharAssociation.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/CharScript.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/datatypes/URISpecification.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/flow/table/EffRow.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/CustomFontCollection.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/DefaultFontConfigurator.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/FontAdder.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/FontCache.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/FontManager.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/FontManagerConfigurator.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/FontSelector.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/FontSetup.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/FontUtil.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/MultiByteFont.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/SingleByteFont.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/XMLFontMetricsReader.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/autodetect/NativeFontDirFinder.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontQualifier.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontSubstitutions.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/truetype/OpenFont.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/hyphenation/HyphenationTree.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/hyphenation/PatternParser.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/SpaceResolver.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.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/layoutmgr/table/ColumnSetup.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowGroupLayoutManager.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableRowIterator.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableStepper.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/PDFColorHandler.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/PDFPages.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFPaintingState.java
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFText.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFWArray.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/AbstractFOEventHandlerMaker.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/AbstractRenderer.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/AbstractRendererMaker.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/RendererFactory.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/XMLHandlerConfigurator.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/XMLHandlerRegistry.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererConfig.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandlerMaker.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/intermediate/AbstractIFPainter.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/intermediate/IFRenderer.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/java2d/InstalledFontCollection.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pcl/PCLGenerator.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/ps/PSImageHandlerSVG.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/RTFHandler.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfContainer.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListTable.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceManager.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/txt/TXTState.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/xml/XMLRenderer.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/svg/NativeTextPainter.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/svg/PDFGraphics2D.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/tools/anttasks/FileCompare.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/tools/anttasks/Fop.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/traits/BorderStyle.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/traits/Direction.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/traits/RuleStyle.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/traits/WritingMode.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/ColorExt.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/DOM2SAX.java
    
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/DigestFilterTestCase.java
    
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/afp/modca/AbstractAFPObjectTest.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/fo/flow/table/RowGroupBuilderTestCase.java
    
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/fotreetest/FOTreeTestCase.java
    
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/rtf/rtflib/testdocs/CreateTestDocuments.java
    
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/threading/FOPTestbed.java
    
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/util/DigestFilter.java
    
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/visual/BitmapComparator.java
    
xmlgraphics/fop/trunk/fop-events/src/main/java/org/apache/fop/events/DefaultEventBroadcaster.java
    
xmlgraphics/fop/trunk/fop-events/src/main/java/org/apache/fop/tools/EventProducerCollector.java
    
xmlgraphics/fop/trunk/fop-events/src/main/java/org/apache/fop/tools/EventProducerCollectorTask.java

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/AFPGraphics2D.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/AFPGraphics2D.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/AFPGraphics2D.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/AFPGraphics2D.java
 Fri Sep 16 11:17:35 2016
@@ -455,8 +455,7 @@ public class AFPGraphics2D extends Abstr
                 double[][] quadParts = 
CubicBezierApproximator.fixedMidPointApproximation(
                         cubicCoords);
                 if (quadParts.length >= 4) {
-                    for (int segIndex = 0; segIndex < quadParts.length; 
segIndex++) {
-                        double[] quadPts = quadParts[segIndex];
+                    for (double[] quadPts : quadParts) {
                         if (quadPts != null && quadPts.length == 4) {
                             graphicsObj.addFillet(new int[]{
                                     (int) Math.round(quadPts[X1]),

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/DataStream.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/DataStream.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/DataStream.java 
(original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/DataStream.java 
Fri Sep 16 11:17:35 2016
@@ -551,9 +551,9 @@ public class DataStream {
      */
 
     public void createPageTagLogicalElement(TagLogicalElement.State[] 
attributes) {
-        for (int i = 0; i < attributes.length; i++) {
+        for (TagLogicalElement.State attribute : attributes) {
 
-            currentPage.createTagLogicalElement(attributes[i]);
+            currentPage.createTagLogicalElement(attribute);
         }
     }
 
@@ -564,8 +564,8 @@ public class DataStream {
      *            the array of key value pairs.
      */
     public void createPageGroupTagLogicalElement(TagLogicalElement.State[] 
attributes) {
-        for (int i = 0; i < attributes.length; i++) {
-            currentPageGroup.createTagLogicalElement(attributes[i]);
+        for (TagLogicalElement.State attribute : attributes) {
+            currentPageGroup.createTagLogicalElement(attribute);
         }
     }
 

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java
 Fri Sep 16 11:17:35 2016
@@ -302,8 +302,7 @@ public abstract class CharacterSetBuilde
                 //process D3AC89 Font Position
                 processFontPosition(structuredFieldReader, 
characterSetOrientations, normalizer);
                 //process D38C89 Font Index (per orientation)
-                for (int i = 0; i < characterSetOrientations.length; i++) {
-                    CharacterSetOrientation characterSetOrientation = 
characterSetOrientations[i];
+                for (CharacterSetOrientation characterSetOrientation : 
characterSetOrientations) {
                     processFontIndex(structuredFieldReader, 
characterSetOrientation, codePage, normalizer);
                     
characterSet.addCharacterSetOrientation(characterSetOrientation);
                 }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java
 Fri Sep 16 11:17:35 2016
@@ -111,14 +111,14 @@ public class GraphicsSetProcessColor ext
         if (colSpaceType == ColorSpace.TYPE_CMYK) {
             colspace = CMYK;
             colsizes = new byte[] {0x08, 0x08, 0x08, 0x08};
-            for (int i = 0; i < colorComponents.length; i++) {
-                baout.write(Math.round(colorComponents[i] * 255));
+            for (float colorComponent : colorComponents) {
+                baout.write(Math.round(colorComponent * 255));
             }
         } else if (colSpaceType == ColorSpace.TYPE_RGB) {
             colspace = RGB;
             colsizes = new byte[] {0x08, 0x08, 0x08, 0x00};
-            for (int i = 0; i < colorComponents.length; i++) {
-                baout.write(Math.round(colorComponents[i] * 255));
+            for (float colorComponent : colorComponents) {
+                baout.write(Math.round(colorComponent * 255));
             }
         } else if (cs instanceof CIELabColorSpace) {
             colspace = CIELAB;

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/modca/MapPageOverlay.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/modca/MapPageOverlay.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/modca/MapPageOverlay.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/modca/MapPageOverlay.java
 Fri Sep 16 11:17:35 2016
@@ -125,8 +125,8 @@ public class MapPageOverlay extends Abst
             //now add the name
             byte[] name = (byte[]) overLays.get(i);
 
-            for (int j = 0; j < name.length; j++) {
-                data[++pos] = name[j];
+            for (byte aName : name) {
+                data[++pos] = aName;
             }
 
             data[++pos] = 0x04; //Resource Local Identifier (RLI)

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/apps/FOUserAgent.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/apps/FOUserAgent.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/apps/FOUserAgent.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/apps/FOUserAgent.java
 Fri Sep 16 11:17:35 2016
@@ -682,8 +682,7 @@ public class FOUserAgent {
         Configuration userConfig = null;
 
         Configuration[] cfgs = cfg.getChild(type + "s").getChildren(type);
-        for (int i = 0; i < cfgs.length; ++i) {
-            Configuration child = cfgs[i];
+        for (Configuration child : cfgs) {
             try {
                 if (child.getAttribute(mime).equals(mimeType)) {
                     userConfig = child;

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/apps/FopConfParser.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/apps/FopConfParser.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/apps/FopConfParser.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/apps/FopConfParser.java
 Fri Sep 16 11:17:35 2016
@@ -370,8 +370,7 @@ public class FopConfParser {
         ImageImplRegistry registry = 
fopFactoryBuilder.getImageManager().getRegistry();
         Configuration[] penalties = parent.getChildren("penalty");
         try {
-            for (int i = 0, c = penalties.length; i < c; i++) {
-                Configuration penaltyCfg = penalties[i];
+            for (Configuration penaltyCfg : penalties) {
                 String className = penaltyCfg.getAttribute("class");
                 String value = penaltyCfg.getAttribute("value");
                 Penalty p = null;

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/LineArea.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/LineArea.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/LineArea.java 
(original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/LineArea.java 
Fri Sep 16 11:17:35 2016
@@ -21,7 +21,6 @@ package org.apache.fop.area;
 
 import java.io.Serializable;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.fop.area.inline.InlineArea;
@@ -132,8 +131,7 @@ public class LineArea extends Area {
      * @param inlineAreas the list of inline areas
      */
     public void setInlineAreas(List inlineAreas) {
-        for (Iterator<InlineArea> it = inlineAreas.iterator(); it.hasNext();) {
-            InlineArea ia = it.next();
+        for (InlineArea ia : (Iterable<InlineArea>) inlineAreas) {
             Area pa = ia.getParentArea();
             if (pa == null) {
                 ia.setParentArea(this);
@@ -189,9 +187,9 @@ public class LineArea extends Area {
     public void updateExtentsFromChildren() {
         int ipd = 0;
         int bpd = 0;
-        for (int i = 0, len = inlineAreas.size(); i < len; i++) {
-            ipd = Math.max(ipd, inlineAreas.get(i).getAllocIPD());
-            bpd += inlineAreas.get(i).getAllocBPD();
+        for (InlineArea inlineArea : inlineAreas) {
+            ipd = Math.max(ipd, inlineArea.getAllocIPD());
+            bpd += inlineArea.getAllocBPD();
         }
         setIPD(ipd);
         setBPD(bpd);
@@ -258,8 +256,8 @@ public class LineArea extends Area {
             // justified line: apply the variation factor
             boolean bUnresolvedAreasPresent = false;
             // recursively apply variation factor to descendant areas
-            for (int i = 0, len = inlineAreas.size(); i < len; i++) {
-                bUnresolvedAreasPresent |= inlineAreas.get(i)
+            for (InlineArea inlineArea : inlineAreas) {
+                bUnresolvedAreasPresent |= inlineArea
                         .applyVariationFactor(adjustingInfo.variationFactor,
                                 adjustingInfo.availableStretch,
                                 adjustingInfo.availableShrink);

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/Span.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/Span.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/Span.java 
(original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/Span.java 
Fri Sep 16 11:17:35 2016
@@ -19,7 +19,6 @@
 
 package org.apache.fop.area;
 
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.fop.fo.Constants;
@@ -196,14 +195,14 @@ public class Span extends Area {
         switch (wmtg.getColumnProgressionDirection().getEnumValue()) {
         case Constants.EN_RL:
             setBidiLevel(1);
-            for (Iterator<NormalFlow> it = flowAreas.iterator(); 
it.hasNext();) {
-                it.next().setBidiLevel(1);
+            for (NormalFlow flowArea1 : flowAreas) {
+                flowArea1.setBidiLevel(1);
             }
             break;
         default:
             resetBidiLevel();
-            for (Iterator<NormalFlow> it = flowAreas.iterator(); 
it.hasNext();) {
-                it.next().resetBidiLevel();
+            for (NormalFlow flowArea : flowAreas) {
+                flowArea.resetBidiLevel();
             }
             break;
         }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/Trait.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/Trait.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/Trait.java 
(original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/Trait.java 
Fri Sep 16 11:17:35 2016
@@ -438,8 +438,7 @@ public final class Trait implements Seri
             String dest = null;
             boolean newWindow = false;
             String[] values = traitValue.split(",");
-            for (int i = 0, c = values.length; i < c; i++) {
-                String v = values[i];
+            for (String v : values) {
                 if (v.startsWith("dest=")) {
                     dest = v.substring(5);
                 } else if (v.startsWith("newWindow=")) {

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/InlineParent.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/InlineParent.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/InlineParent.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/InlineParent.java
 Fri Sep 16 11:17:35 2016
@@ -22,7 +22,6 @@ package org.apache.fop.area.inline;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.fop.area.Area;
@@ -108,8 +107,7 @@ public class InlineParent extends Inline
         boolean hasUnresolvedAreas = false;
         int cumulativeIPD = 0;
         // recursively apply variation factor to descendant areas
-        for (int i = 0, len = inlines.size(); i < len; i++) {
-            InlineArea inline = inlines.get(i);
+        for (InlineArea inline : inlines) {
             hasUnresolvedAreas |= inline.applyVariationFactor(
                     variationFactor, lineStretch, lineShrink);
             cumulativeIPD += inline.getIPD();  //Update this area's IPD based 
on changes to children
@@ -121,8 +119,7 @@ public class InlineParent extends Inline
 
     @Override
     public List collectInlineRuns(List runs) {
-        for (Iterator<InlineArea> it = getChildAreas().iterator(); 
it.hasNext();) {
-            InlineArea ia = it.next();
+        for (InlineArea ia : getChildAreas()) {
             runs = ia.collectInlineRuns(runs);
         }
         return runs;
@@ -133,8 +130,8 @@ public class InlineParent extends Inline
      * signalling that they will inherit the level of their parent text area.
      */
     public void resetChildrenLevel() {
-        for (Iterator it = inlines.iterator(); it.hasNext();) {
-            ((InlineArea) it.next()) .resetBidiLevel();
+        for (InlineArea inline : inlines) {
+            (inline).resetBidiLevel();
         }
     }
 

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/TextArea.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/TextArea.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/TextArea.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/area/inline/TextArea.java
 Fri Sep 16 11:17:35 2016
@@ -184,8 +184,7 @@ public class TextArea extends AbstractTe
     private static int findMinLevel(int[] levels, int defaultLevel) {
         if (levels != null) {
             int lMin = Integer.MAX_VALUE;
-            for (int i = 0, n = levels.length; i < n; i++) {
-                int l = levels [ i ];
+            for (int l : levels) {
                 if ((l >= 0) && (l < lMin)) {
                     lMin = l;
                 }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/cli/CommandLineOptions.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/cli/CommandLineOptions.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/cli/CommandLineOptions.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/cli/CommandLineOptions.java
 Fri Sep 16 11:17:35 2016
@@ -599,8 +599,7 @@ public class CommandLineOptions {
                 && (args[i + 1].charAt(0) != '-')) {
             String arg = args[i + 1];
             String[] parts = arg.split(",");
-            for (int j = 0; j < parts.length; j++) {
-                String s = parts[j];
+            for (String s : parts) {
                 if (s.matches("\\d+")) {
                     renderingOptions.put(PrintRenderer.START_PAGE, 
Integer.valueOf(s));
                 } else if (s.matches("\\d+-\\d+")) {
@@ -702,8 +701,8 @@ public class CommandLineOptions {
             if ("list".equals(mime)) {
                 String[] mimes = 
factory.getRendererFactory().listSupportedMimeTypes();
                 System.out.println("Supported MIME types:");
-                for (int j = 0; j < mimes.length; j++) {
-                    System.out.println("  " + mimes[j]);
+                for (String mime1 : mimes) {
+                    System.out.println("  " + mime1);
                 }
                 // @SuppressFBWarnings("DM_EXIT")
                 System.exit(0);

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/cli/Main.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/cli/Main.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/cli/Main.java 
(original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/cli/Main.java 
Fri Sep 16 11:17:35 2016
@@ -84,16 +84,16 @@ public final class Main {
         }
         files = libDir.listFiles(filter);
         if (files != null) {
-            for (int i = 0, size = files.length; i < size; i++) {
-                jars.add(files[i].toURI().toURL());
+            for (File file : files) {
+                jars.add(file.toURI().toURL());
             }
         }
         String optionalLib = System.getProperty("fop.optional.lib");
         if (optionalLib != null) {
             files = new File(optionalLib).listFiles(filter);
             if (files != null) {
-                for (int i = 0, size = files.length; i < size; i++) {
-                    jars.add(files[i].toURI().toURL());
+                for (File file : files) {
+                    jars.add(file.toURI().toURL());
                 }
             }
         }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/BidiResolver.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/BidiResolver.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/BidiResolver.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/BidiResolver.java
 Fri Sep 16 11:17:35 2016
@@ -20,7 +20,6 @@
 package org.apache.fop.complexscripts.bidi;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Stack;
 import java.util.Vector;
@@ -119,8 +118,8 @@ public final class BidiResolver {
     }
 
     private static void resolveInlineDirectionality(List ranges) {
-        for (Iterator it = ranges.iterator(); it.hasNext(); ) {
-            DelimitedTextRange r = (DelimitedTextRange) it.next();
+        for (Object range : ranges) {
+            DelimitedTextRange r = (DelimitedTextRange) range;
             r.resolve();
             if (log.isDebugEnabled()) {
                 log.debug(r);
@@ -129,8 +128,8 @@ public final class BidiResolver {
     }
 
     private static List collectRuns(List inlines, List runs) {
-        for (Iterator it = inlines.iterator(); it.hasNext(); ) {
-            InlineArea ia = (InlineArea) it.next();
+        for (Object inline : inlines) {
+            InlineArea ia = (InlineArea) inline;
             runs = ia.collectInlineRuns(runs);
         }
         return runs;
@@ -138,8 +137,8 @@ public final class BidiResolver {
 
     private static List splitRuns(List runs) {
         List runsNew = new Vector();
-        for (Iterator it = runs.iterator(); it.hasNext(); ) {
-            InlineRun ir = (InlineRun) it.next();
+        for (Object run : runs) {
+            InlineRun ir = (InlineRun) run;
             if (ir.isHomogenous()) {
                 runsNew.add(ir);
             } else {
@@ -156,8 +155,8 @@ public final class BidiResolver {
         if (mm == null) {
             mm = new int[] {Integer.MAX_VALUE, Integer.MIN_VALUE};
         }
-        for (Iterator it = runs.iterator(); it.hasNext(); ) {
-            InlineRun ir = (InlineRun) it.next();
+        for (Object run : runs) {
+            InlineRun ir = (InlineRun) run;
             ir.updateMinMax(mm);
         }
         return mm;
@@ -205,8 +204,8 @@ public final class BidiResolver {
         return runsNew;
     }
     private static void reverseWords(List runs, boolean mirror) {
-        for (Iterator it = runs.iterator(); it.hasNext(); ) {
-            InlineRun ir = (InlineRun) it.next();
+        for (Object run : runs) {
+            InlineRun ir = (InlineRun) run;
             ir.maybeReverseWord(mirror);
         }
     }
@@ -217,8 +216,8 @@ public final class BidiResolver {
     }
     private static void replaceInlines(LineArea la, List runs) {
         List<InlineArea> inlines = new ArrayList<InlineArea>();
-        for (Iterator it = runs.iterator(); it.hasNext(); ) {
-            InlineRun ir = (InlineRun) it.next();
+        for (Object run : runs) {
+            InlineRun ir = (InlineRun) run;
             inlines.add(ir.getInline());
         }
         la.setInlineAreas(unflattenInlines(inlines));
@@ -228,22 +227,22 @@ public final class BidiResolver {
     }
     private static void dumpRuns(String header, List runs) {
         log.debug(header);
-        for (Iterator it = runs.iterator(); it.hasNext(); ) {
-            InlineRun ir = (InlineRun) it.next();
+        for (Object run : runs) {
+            InlineRun ir = (InlineRun) run;
             log.debug(ir);
         }
     }
     private static void dumpRanges(String header, List ranges) {
         log.debug(header);
-        for (Iterator it = ranges.iterator(); it.hasNext(); ) {
-            DelimitedTextRange r = (DelimitedTextRange) it.next();
+        for (Object range : ranges) {
+            DelimitedTextRange r = (DelimitedTextRange) range;
             log.debug(r);
         }
     }
     private static List pruneEmptyRanges(List ranges) {
         Vector rv = new Vector();
-        for (Iterator it = ranges.iterator(); it.hasNext(); ) {
-            DelimitedTextRange r = (DelimitedTextRange) it.next();
+        for (Object range : ranges) {
+            DelimitedTextRange r = (DelimitedTextRange) range;
             if (!r.isEmpty()) {
                 rv.add(r);
             }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/DelimitedTextRange.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/DelimitedTextRange.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/DelimitedTextRange.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/DelimitedTextRange.java
 Fri Sep 16 11:17:35 2016
@@ -19,7 +19,6 @@
 
 package org.apache.fop.complexscripts.bidi;
 
-import java.util.Iterator;
 import java.util.List;
 import java.util.Vector;
 
@@ -114,8 +113,8 @@ public class DelimitedTextRange {
         StringBuffer sb = new StringBuffer("DR: " + fn.getLocalName() + " { <" 
+ CharUtilities.toNCRefs(buffer.toString()) + ">");
         sb.append(", intervals <");
         boolean first = true;
-        for (Iterator it = intervals.iterator(); it.hasNext(); ) {
-            TextInterval ti = (TextInterval) it.next();
+        for (Object interval : intervals) {
+            TextInterval ti = (TextInterval) interval;
             if (first) {
                 first = false;
             } else {
@@ -144,8 +143,8 @@ public class DelimitedTextRange {
      */
     private void assignLevels(int[] levels) {
         Vector intervalsNew = new Vector(intervals.size());
-        for (Iterator it = intervals.iterator(); it.hasNext(); ) {
-            TextInterval ti = (TextInterval) it.next();
+        for (Object interval : intervals) {
+            TextInterval ti = (TextInterval) interval;
             intervalsNew.addAll(assignLevels(ti, levels));
         }
         if (!intervalsNew.equals(intervals)) {
@@ -196,15 +195,15 @@ public class DelimitedTextRange {
      * <p>Assign resolved levels for each interval to source #PCDATA in the 
associated FOText.</p>
      */
     private void assignTextLevels() {
-        for (Iterator it = intervals.iterator(); it.hasNext(); ) {
-            TextInterval ti = (TextInterval) it.next();
+        for (Object interval : intervals) {
+            TextInterval ti = (TextInterval) interval;
             ti.assignTextLevels();
         }
     }
     private void assignBlockLevel(Direction paragraphEmbeddingLevel) {
         int defaultLevel = (paragraphEmbeddingLevel == Direction.RL) ? 1 : 0;
-        for (Iterator it = intervals.iterator(); it.hasNext(); ) {
-            TextInterval ti = (TextInterval) it.next();
+        for (Object interval : intervals) {
+            TextInterval ti = (TextInterval) interval;
             assignBlockLevel(ti.getNode(), defaultLevel);
         }
     }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/InlineRun.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/InlineRun.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/InlineRun.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/InlineRun.java
 Fri Sep 16 11:17:35 2016
@@ -93,8 +93,7 @@ public class InlineRun {
         int mn = Integer.MAX_VALUE;
         int mx = Integer.MIN_VALUE;
         if ((levels != null) && (levels.length > 0)) {
-            for (int i = 0, n = levels.length; i < n; i++) {
-                int l = levels [ i ];
+            for (int l : levels) {
                 if (l < mn) {
                     mn = l;
                 }
@@ -265,8 +264,7 @@ public class InlineRun {
         StringBuffer lb = new StringBuffer();
         int maxLevel = -1;
         int numLevels = levels.length;
-        for (int i = 0; i < numLevels; i++) {
-            int l = levels [ i ];
+        for (int l : levels) {
             if (l > maxLevel) {
                 maxLevel = l;
             }
@@ -275,19 +273,19 @@ public class InlineRun {
             // leave level buffer empty
         } else if (maxLevel < 10) {
             // use string of decimal digits
-            for (int i = 0; i < numLevels; i++) {
-                lb.append((char) ('0' + levels [ i ]));
+            for (int level : levels) {
+                lb.append((char) ('0' + level));
             }
         } else {
             // use comma separated list
             boolean first = true;
-            for (int i = 0; i < numLevels; i++) {
+            for (int level : levels) {
                 if (first) {
                     first = false;
                 } else {
                     lb.append(',');
                 }
-                lb.append(levels [ i ]);
+                lb.append(level);
             }
         }
         return lb.toString();

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/UnflattenProcessor.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/UnflattenProcessor.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/UnflattenProcessor.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/UnflattenProcessor.java
 Fri Sep 16 11:17:35 2016
@@ -20,7 +20,6 @@
 package org.apache.fop.complexscripts.bidi;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Stack;
@@ -61,8 +60,8 @@ class UnflattenProcessor {
     }
     List unflatten() {
         if (il != null) {
-            for (Iterator<InlineArea> it = il.iterator(); it.hasNext(); ) {
-                process(it.next());
+            for (InlineArea anIl : il) {
+                process(anIl);
             }
         }
         finishAll();
@@ -125,8 +124,7 @@ class UnflattenProcessor {
     }
     private void finishInlineContainer(List<InlineParent> ich, TextArea tc, 
InlineArea ia) {
         if ((ich != null) && !ich.isEmpty()) {     // finish non-matching 
inner inline container(s)
-            for (Iterator<InlineParent> it = ich.iterator(); it.hasNext(); ) {
-                InlineParent ic  = it.next();
+            for (InlineParent ic : ich) {
                 InlineParent ic0 = icOrig.empty() ? null : icOrig.peek();
                 if (ic0 == null) {
                     assert icNew.empty();
@@ -191,8 +189,8 @@ class UnflattenProcessor {
         }
     }
     private boolean alreadyUnflattened(InlineArea ia) {
-        for (Iterator<InlineArea> it = ilNew.iterator(); it.hasNext(); ) {
-            if (ia.isAncestorOrSelf(it.next())) {
+        for (InlineArea anIlNew : ilNew) {
+            if (ia.isAncestorOrSelf(anIlNew)) {
                 return true;
             }
         }
@@ -200,16 +198,14 @@ class UnflattenProcessor {
     }
     private void pushInlineContainers(List<InlineParent> ich) {
         LinkedList<InlineParent> icl = new LinkedList<InlineParent>();
-        for (Iterator<InlineParent> it = ich.iterator(); it.hasNext(); ) {
-            InlineParent ic = it.next();
+        for (InlineParent ic : ich) {
             if (icOrig.search(ic) >= 0) {
                 break;
             } else {
                 icl.addFirst(ic);
             }
         }
-        for (Iterator<InlineParent> it = icl.iterator(); it.hasNext(); ) {
-            InlineParent ic = it.next();
+        for (InlineParent ic : icl) {
             icOrig.push(ic);
             icNew.push(generateInlineContainer(ic));
         }
@@ -307,8 +303,7 @@ class UnflattenProcessor {
     }
     private void updateIPD(TextArea tc) {
         int numAdjustable = 0;
-        for (Iterator it = tc.getChildAreas().iterator(); it.hasNext(); ) {
-            InlineArea ia = (InlineArea) it.next();
+        for (InlineArea ia : tc.getChildAreas()) {
             if (ia instanceof SpaceArea) {
                 SpaceArea sa = (SpaceArea) ia;
                 if (sa.isAdjustable()) {

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java
 Fri Sep 16 11:17:35 2016
@@ -97,8 +97,7 @@ public final class GlyphClassTable exten
         if ((entries == null) || (entries.size() == 0)) {
             return false;
         } else {
-            for (Iterator it = entries.iterator(); it.hasNext();) {
-                Object o = it.next();
+            for (Object o : entries) {
                 if (!(o instanceof Integer)) {
                     return false;
                 }
@@ -111,8 +110,7 @@ public final class GlyphClassTable exten
         if ((entries == null) || (entries.size() == 0)) {
             return false;
         } else {
-            for (Iterator it = entries.iterator(); it.hasNext();) {
-                Object o = it.next();
+            for (Object o : entries) {
                 if (!(o instanceof MappingRange)) {
                     return false;
                 }
@@ -125,8 +123,7 @@ public final class GlyphClassTable exten
         if ((entries == null) || (entries.size() == 0)) {
             return false;
         } else {
-            for (Iterator it = entries.iterator(); it.hasNext();) {
-                Object o = it.next();
+            for (Object o : entries) {
                 if (!(o instanceof GlyphCoverageTable)) {
                     return false;
                 }
@@ -161,8 +158,8 @@ public final class GlyphClassTable exten
             List entries = new java.util.ArrayList();
             entries.add(firstGlyph);
             if (gca != null) {
-                for (int i = 0, n = gca.length; i < n; i++) {
-                    entries.add(gca[i]);
+                for (int aGca : gca) {
+                    entries.add(aGca);
                 }
             }
             return entries;

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java
 Fri Sep 16 11:17:35 2016
@@ -20,7 +20,6 @@
 package org.apache.fop.complexscripts.fonts;
 
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
@@ -99,8 +98,7 @@ public final class GlyphCoverageTable ex
         if ((entries == null) || (entries.size() == 0)) {
             return false;
         } else {
-            for (Iterator it = entries.iterator(); it.hasNext();) {
-                Object o = it.next();
+            for (Object o : entries) {
                 if (!(o instanceof Integer)) {
                     return false;
                 }
@@ -113,8 +111,7 @@ public final class GlyphCoverageTable ex
         if ((entries == null) || (entries.size() == 0)) {
             return false;
         } else {
-            for (Iterator it = entries.iterator(); it.hasNext();) {
-                Object o = it.next();
+            for (Object o : entries) {
                 if (!(o instanceof MappingRange)) {
                     return false;
                 }
@@ -146,8 +143,8 @@ public final class GlyphCoverageTable ex
         public List getEntries() {
             List entries = new java.util.ArrayList();
             if (map != null) {
-                for (int i = 0, n = map.length; i < n; i++) {
-                    entries.add(map[i]);
+                for (int aMap : map) {
+                    entries.add(aMap);
                 }
             }
             return entries;
@@ -178,13 +175,12 @@ public final class GlyphCoverageTable ex
             int n = entries.size();
             int gidMax = -1;
             int[] map = new int [ n ];
-            for (Iterator it = entries.iterator(); it.hasNext();) {
-                Object o = it.next();
+            for (Object o : entries) {
                 if (o instanceof Integer) {
                     int gid = (Integer) o;
                     if ((gid >= 0) && (gid < 65536)) {
                         if (gid > gidMax) {
-                            map [ i++ ] = gidMax = gid;
+                            map[i++] = gidMax = gid;
                         } else {
                             log.info("ignoring out of order or duplicate glyph 
index: " + gid);
                             skipped++;

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java
 Fri Sep 16 11:17:35 2016
@@ -20,7 +20,6 @@
 package org.apache.fop.complexscripts.fonts;
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
@@ -78,8 +77,7 @@ public class GlyphDefinitionTable extend
         if ((subtables == null) || (subtables.size() == 0)) {
             throw new AdvancedTypographicTableFormatException("subtables must 
be non-empty");
         } else {
-            for (Iterator it = subtables.iterator(); it.hasNext();) {
-                Object o = it.next();
+            for (Object o : subtables) {
                 if (o instanceof GlyphDefinitionSubtable) {
                     addSubtable((GlyphSubtable) o);
                 } else {

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java
 Fri Sep 16 11:17:35 2016
@@ -20,7 +20,6 @@
 package org.apache.fop.complexscripts.fonts;
 
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.List;
 
 // CSOFF: LineLengthCheck
@@ -186,8 +185,7 @@ public class GlyphMappingTable {
             int[] sa = new int [ n ];
             int[] ea = new int [ n ];
             int[] ma = new int [ n ];
-            for (Iterator it = entries.iterator(); it.hasNext();) {
-                Object o = it.next();
+            for (Object o : entries) {
                 if (o instanceof MappingRange) {
                     MappingRange r = (MappingRange) o;
                     int gs = r.getStart();
@@ -205,9 +203,9 @@ public class GlyphMappingTable {
                         throw new 
AdvancedTypographicTableFormatException("illegal mapping index: " + mi);
                     } else {
                         int miLast;
-                        sa [ i ] = gs;
-                        ea [ i ] = gidMax = ge;
-                        ma [ i ] = mi;
+                        sa[i] = gs;
+                        ea[i] = gidMax = ge;
+                        ma[i] = mi;
                         if ((miLast = mi + (ge - gs)) > miMax) {
                             miMax = miLast;
                         }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningState.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningState.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningState.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningState.java
 Fri Sep 16 11:17:35 2016
@@ -184,8 +184,7 @@ public class GlyphPositioningState exten
     public boolean apply(GlyphTable.RuleLookup[] lookups, int nig) {
         if ((lookups != null) && (lookups.length > 0)) {
             // apply each rule lookup to extracted input glyph array
-            for (int i = 0, n = lookups.length; i < n; i++) {
-                GlyphTable.RuleLookup l = lookups [ i ];
+            for (GlyphTable.RuleLookup l : lookups) {
                 if (l != null) {
                     GlyphTable.LookupTable lt = l.getLookup();
                     if (lt != 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=1761020&r1=1761019&r2=1761020&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 11:17:35 2016
@@ -21,7 +21,6 @@ package org.apache.fop.complexscripts.fo
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -76,8 +75,7 @@ public class GlyphPositioningTable exten
         if ((subtables == null) || (subtables.size() == 0)) {
             throw new AdvancedTypographicTableFormatException("subtables must 
be non-empty");
         } else {
-            for (Iterator it = subtables.iterator(); it.hasNext();) {
-                Object o = it.next();
+            for (Object o : subtables) {
                 if (o instanceof GlyphPositioningSubtable) {
                     addSubtable((GlyphSubtable) o);
                 } else {
@@ -342,8 +340,8 @@ public class GlyphPositioningTable exten
         public List getEntries() {
             if (values != null) {
                 List entries = new ArrayList(values.length);
-                for (int i = 0, n = values.length; i < n; i++) {
-                    entries.add(values[i]);
+                for (Value value : values) {
+                    entries.add(value);
                 }
                 return entries;
             } else {
@@ -487,8 +485,7 @@ public class GlyphPositioningTable exten
         public PairValues getPairValues(int ci, int gi1, int gi2) {
             if ((pvm != null) && (ci < pvm.length)) {
                 PairValues[] pvt = pvm [ ci ];
-                for (int i = 0, n = pvt.length; i < n; i++) {
-                    PairValues pv = pvt [ i ];
+                for (PairValues pv : pvt) {
                     if (pv != null) {
                         int g = pv.getGlyph();
                         if (g < gi2) {
@@ -1225,8 +1222,7 @@ public class GlyphPositioningTable exten
                 RuleSet rs = rsa [ 0 ];
                 if (rs != null) {
                     Rule[] ra = rs.getRules();
-                    for (int i = 0, n = ra.length; i < n; i++) {
-                        Rule r = ra [ i ];
+                    for (Rule r : ra) {
                         if ((r != null) && (r instanceof 
ChainedGlyphSequenceRule)) {
                             ChainedGlyphSequenceRule cr = 
(ChainedGlyphSequenceRule) r;
                             int[] iga = cr.getGlyphs(gi);
@@ -1313,8 +1309,7 @@ public class GlyphPositioningTable exten
                 RuleSet rs = rsa [ 0 ];
                 if (rs != null) {
                     Rule[] ra = rs.getRules();
-                    for (int i = 0, n = ra.length; i < n; i++) {
-                        Rule r = ra [ i ];
+                    for (Rule r : ra) {
                         if ((r != null) && (r instanceof 
ChainedClassSequenceRule)) {
                             ChainedClassSequenceRule cr = 
(ChainedClassSequenceRule) r;
                             int[] ca = cr.getClasses(cdt.getClassIndex(gi, 
ps.getClassMatchSet(gi)));
@@ -1415,8 +1410,7 @@ public class GlyphPositioningTable exten
                 RuleSet rs = rsa [ 0 ];
                 if (rs != null) {
                     Rule[] ra = rs.getRules();
-                    for (int i = 0, n = ra.length; i < n; i++) {
-                        Rule r = ra [ i ];
+                    for (Rule r : ra) {
                         if ((r != null) && (r instanceof 
ChainedCoverageSequenceRule)) {
                             ChainedCoverageSequenceRule cr = 
(ChainedCoverageSequenceRule) r;
                             GlyphCoverageTable[] gca = cr.getCoverages();
@@ -1552,8 +1546,7 @@ public class GlyphPositioningTable exten
                 RuleSet rs = rsa [ 0 ];
                 if (rs != null) {
                     Rule[] ra = rs.getRules();
-                    for (int i = 0, n = ra.length; i < n; i++) {
-                        Rule r = ra [ i ];
+                    for (Rule r : ra) {
                         if ((r != null) && (r instanceof 
ChainedGlyphSequenceRule)) {
                             ChainedGlyphSequenceRule cr = 
(ChainedGlyphSequenceRule) r;
                             int[] iga = cr.getGlyphs(gi);
@@ -1628,8 +1621,7 @@ public class GlyphPositioningTable exten
                 RuleSet rs = rsa [ 0 ];
                 if (rs != null) {
                     Rule[] ra = rs.getRules();
-                    for (int i = 0, n = ra.length; i < n; i++) {
-                        Rule r = ra [ i ];
+                    for (Rule r : ra) {
                         if ((r != null) && (r instanceof 
ChainedClassSequenceRule)) {
                             ChainedClassSequenceRule cr = 
(ChainedClassSequenceRule) r;
                             int[] ica = cr.getClasses(icdt.getClassIndex(gi, 
ps.getClassMatchSet(gi)));
@@ -1719,8 +1711,7 @@ public class GlyphPositioningTable exten
                 RuleSet rs = rsa [ 0 ];
                 if (rs != null) {
                     Rule[] ra = rs.getRules();
-                    for (int i = 0, n = ra.length; i < n; i++) {
-                        Rule r = ra [ i ];
+                    for (Rule r : ra) {
                         if ((r != null) && (r instanceof 
ChainedCoverageSequenceRule)) {
                             ChainedCoverageSequenceRule cr = 
(ChainedCoverageSequenceRule) r;
                             GlyphCoverageTable[] igca = cr.getCoverages();

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionState.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionState.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionState.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionState.java
 Fri Sep 16 11:17:35 2016
@@ -204,8 +204,7 @@ public class GlyphSubstitutionState exte
         int nog = 0;
         if ((lookups != null) && (lookups.length > 0)) {
             // apply each rule lookup to extracted input glyph array
-            for (int i = 0, n = lookups.length; i < n; i++) {
-                GlyphTable.RuleLookup l = lookups [ i ];
+            for (GlyphTable.RuleLookup l : lookups) {
                 if (l != null) {
                     GlyphTable.LookupTable lt = l.getLookup();
                     if (lt != 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=1761020&r1=1761019&r2=1761020&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 11:17:35 2016
@@ -20,7 +20,6 @@
 package org.apache.fop.complexscripts.fonts;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -74,8 +73,7 @@ public class GlyphSubstitutionTable exte
         if ((subtables == null) || (subtables.size() == 0)) {
             throw new AdvancedTypographicTableFormatException("subtables must 
be non-empty");
         } else {
-            for (Iterator it = subtables.iterator(); it.hasNext();) {
-                Object o = it.next();
+            for (Object o : subtables) {
                 if (o instanceof GlyphSubstitutionSubtable) {
                     addSubtable((GlyphSubtable) o);
                 } else {
@@ -324,8 +322,8 @@ public class GlyphSubstitutionTable exte
         /** {@inheritDoc} */
         public List getEntries() {
             List entries = new ArrayList(glyphs.length);
-            for (int i = 0, n = glyphs.length; i < n; i++) {
-                entries.add(glyphs[i]);
+            for (int glyph : glyphs) {
+                entries.add(glyph);
             }
             return entries;
         }
@@ -343,12 +341,11 @@ public class GlyphSubstitutionTable exte
             int i = 0;
             int n = entries.size();
             int[] glyphs = new int [ n ];
-            for (Iterator it = entries.iterator(); it.hasNext();) {
-                Object o = it.next();
+            for (Object o : entries) {
                 if (o instanceof Integer) {
                     int gid = (Integer) o;
                     if ((gid >= 0) && (gid < 65536)) {
-                        glyphs [ i++ ] = gid;
+                        glyphs[i++] = gid;
                     } else {
                         throw new 
AdvancedTypographicTableFormatException("illegal glyph index: " + gid);
                     }
@@ -509,8 +506,8 @@ public class GlyphSubstitutionTable exte
         /** {@inheritDoc} */
         public List getEntries() {
             List entries = new ArrayList(gaa.length);
-            for (int i = 0, n = gaa.length; i < n; i++) {
-                entries.add(gaa[i]);
+            for (int[] aGaa : gaa) {
+                entries.add(aGaa);
             }
             return entries;
         }
@@ -528,10 +525,9 @@ public class GlyphSubstitutionTable exte
             int i = 0;
             int n = entries.size();
             int[][] gaa = new int [ n ][];
-            for (Iterator it = entries.iterator(); it.hasNext();) {
-                Object o = it.next();
+            for (Object o : entries) {
                 if (o instanceof int[]) {
-                    gaa [ i++ ] = (int[]) o;
+                    gaa[i++] = (int[]) o;
                 } else {
                     throw new AdvancedTypographicTableFormatException("illegal 
entries entry, must be int[]: " + o);
                 }
@@ -642,8 +638,8 @@ public class GlyphSubstitutionTable exte
         /** {@inheritDoc} */
         public List getEntries() {
             List entries = new ArrayList(ligatureSets.length);
-            for (int i = 0, n = ligatureSets.length; i < n; i++) {
-                entries.add(ligatureSets[i]);
+            for (LigatureSet ligatureSet : ligatureSets) {
+                entries.add(ligatureSet);
             }
             return entries;
         }
@@ -661,10 +657,9 @@ public class GlyphSubstitutionTable exte
             int i = 0;
             int n = entries.size();
             LigatureSet[] ligatureSets = new LigatureSet [ n ];
-            for (Iterator it = entries.iterator(); it.hasNext();) {
-                Object o = it.next();
+            for (Object o : entries) {
                 if (o instanceof LigatureSet) {
-                    ligatureSets [ i++ ] = (LigatureSet) o;
+                    ligatureSets[i++] = (LigatureSet) o;
                 } else {
                     throw new AdvancedTypographicTableFormatException("illegal 
ligatures entry, must be LigatureSet: " + o);
                 }
@@ -754,8 +749,7 @@ public class GlyphSubstitutionTable exte
                 RuleSet rs = rsa [ 0 ];
                 if (rs != null) {
                     Rule[] ra = rs.getRules();
-                    for (int i = 0, n = ra.length; i < n; i++) {
-                        Rule r = ra [ i ];
+                    for (Rule r : ra) {
                         if ((r != null) && (r instanceof 
ChainedGlyphSequenceRule)) {
                             ChainedGlyphSequenceRule cr = 
(ChainedGlyphSequenceRule) r;
                             int[] iga = cr.getGlyphs(gi);
@@ -842,8 +836,7 @@ public class GlyphSubstitutionTable exte
                 RuleSet rs = rsa [ 0 ];
                 if (rs != null) {
                     Rule[] ra = rs.getRules();
-                    for (int i = 0, n = ra.length; i < n; i++) {
-                        Rule r = ra [ i ];
+                    for (Rule r : ra) {
                         if ((r != null) && (r instanceof 
ChainedClassSequenceRule)) {
                             ChainedClassSequenceRule cr = 
(ChainedClassSequenceRule) r;
                             int[] ca = cr.getClasses(cdt.getClassIndex(gi, 
ss.getClassMatchSet(gi)));
@@ -944,8 +937,7 @@ public class GlyphSubstitutionTable exte
                 RuleSet rs = rsa [ 0 ];
                 if (rs != null) {
                     Rule[] ra = rs.getRules();
-                    for (int i = 0, n = ra.length; i < n; i++) {
-                        Rule r = ra [ i ];
+                    for (Rule r : ra) {
                         if ((r != null) && (r instanceof 
ChainedCoverageSequenceRule)) {
                             ChainedCoverageSequenceRule cr = 
(ChainedCoverageSequenceRule) r;
                             GlyphCoverageTable[] gca = cr.getCoverages();
@@ -1082,8 +1074,7 @@ public class GlyphSubstitutionTable exte
                 RuleSet rs = rsa [ 0 ];
                 if (rs != null) {
                     Rule[] ra = rs.getRules();
-                    for (int i = 0, n = ra.length; i < n; i++) {
-                        Rule r = ra [ i ];
+                    for (Rule r : ra) {
                         if ((r != null) && (r instanceof 
ChainedGlyphSequenceRule)) {
                             ChainedGlyphSequenceRule cr = 
(ChainedGlyphSequenceRule) r;
                             int[] iga = cr.getGlyphs(gi);
@@ -1154,8 +1145,7 @@ public class GlyphSubstitutionTable exte
                 RuleSet rs = rsa [ 0 ];
                 if (rs != null) {
                     Rule[] ra = rs.getRules();
-                    for (int i = 0, n = ra.length; i < n; i++) {
-                        Rule r = ra [ i ];
+                    for (Rule r : ra) {
                         if ((r != null) && (r instanceof 
ChainedClassSequenceRule)) {
                             ChainedClassSequenceRule cr = 
(ChainedClassSequenceRule) r;
                             int[] ica = cr.getClasses(icdt.getClassIndex(gi, 
ss.getClassMatchSet(gi)));
@@ -1249,8 +1239,7 @@ public class GlyphSubstitutionTable exte
                 RuleSet rs = rsa [ 0 ];
                 if (rs != null) {
                     Rule[] ra = rs.getRules();
-                    for (int i = 0, n = ra.length; i < n; i++) {
-                        Rule r = ra [ i ];
+                    for (Rule r : ra) {
                         if ((r != null) && (r instanceof 
ChainedCoverageSequenceRule)) {
                             ChainedCoverageSequenceRule cr = 
(ChainedCoverageSequenceRule) r;
                             GlyphCoverageTable[] igca = cr.getCoverages();
@@ -1348,8 +1337,7 @@ public class GlyphSubstitutionTable exte
             } else if (components == null) {
                 throw new AdvancedTypographicTableFormatException("invalid 
ligature components, must be non-null array");
             } else {
-                for (int i = 0, n = components.length; i < n; i++) {
-                    int gc = components [ i ];
+                for (int gc : components) {
                     if ((gc < 0) || (gc > 65535)) {
                         throw new 
AdvancedTypographicTableFormatException("invalid component glyph index: " + gc);
                     }
@@ -1436,8 +1424,7 @@ public class GlyphSubstitutionTable exte
             } else {
                 this.ligatures = ligatures;
                 int ncMax = -1;
-                for (int i = 0, n = ligatures.length; i < n; i++) {
-                    Ligature l = ligatures [ i ];
+                for (Ligature l : ligatures) {
                     int nc = l.getNumComponents() + 1;
                     if (nc > ncMax) {
                         ncMax = nc;

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubtable.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubtable.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubtable.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubtable.java
 Fri Sep 16 11:17:35 2016
@@ -271,8 +271,8 @@ public abstract class GlyphSubtable impl
         if ((subtables == null) || (subtables.length == 0)) {
             return false;
         } else {
-            for (int i = 0, n = subtables.length; i < n; i++) {
-                if (subtables[i].usesReverseScan()) {
+            for (GlyphSubtable subtable : subtables) {
+                if (subtable.usesReverseScan()) {
                     return true;
                 }
             }
@@ -292,16 +292,16 @@ public abstract class GlyphSubtable impl
         } else {
             int flags = 0;
             // obtain first non-zero value of flags in array of subtables
-            for (int i = 0, n = subtables.length; i < n; i++) {
-                int f = subtables[i].getFlags();
+            for (GlyphSubtable subtable1 : subtables) {
+                int f = subtable1.getFlags();
                 if (flags == 0) {
                     flags = f;
                     break;
                 }
             }
             // enforce flag consistency
-            for (int i = 0, n = subtables.length; i < n; i++) {
-                int f = subtables[i].getFlags();
+            for (GlyphSubtable subtable : subtables) {
+                int f = subtable.getFlags();
                 if (f != flags) {
                     throw new IllegalStateException("inconsistent lookup flags 
" + f + ", expected " + flags);
                 }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphTable.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphTable.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphTable.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphTable.java
 Fri Sep 16 11:17:35 2016
@@ -22,7 +22,6 @@ package org.apache.fop.complexscripts.fo
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
@@ -117,8 +116,8 @@ public class GlyphTable {
     public List/*<LookupTable>*/ getLookupTables() {
         TreeSet/*<String>*/ lids = new 
TreeSet/*<String>*/(lookupTables.keySet());
         List/*<LookupTable>*/ ltl = new 
ArrayList/*<LookupTable>*/(lids.size());
-        for (Iterator it = lids.iterator(); it.hasNext(); ) {
-            String lid = (String) it.next();
+        for (Object lid1 : lids) {
+            String lid = (String) lid1;
             ltl.add(lookupTables.get(lid));
         }
         return ltl;
@@ -162,8 +161,8 @@ public class GlyphTable {
      */
     protected void freezeSubtables() {
         if (!frozen) {
-            for (Iterator it = lookupTables.values().iterator(); it.hasNext(); 
) {
-                LookupTable lt = (LookupTable) it.next();
+            for (Object o : lookupTables.values()) {
+                LookupTable lt = (LookupTable) o;
                 lt.freezeSubtables(lookupTables);
             }
             frozen = true;
@@ -181,8 +180,8 @@ public class GlyphTable {
     public List/*<LookupSpec>*/ matchLookupSpecs(String script, String 
language, String feature) {
         Set/*<LookupSpec>*/ keys = lookups.keySet();
         List/*<LookupSpec>*/ matches = new ArrayList/*<LookupSpec>*/();
-        for (Iterator it = keys.iterator(); it.hasNext();) {
-            LookupSpec ls = (LookupSpec) it.next();
+        for (Object key : keys) {
+            LookupSpec ls = (LookupSpec) key;
             if (!"*".equals(script)) {
                 if (!ls.getScript().equals(script)) {
                     continue;
@@ -217,8 +216,8 @@ public class GlyphTable {
         if (lm == null) {
             lm = new LinkedHashMap();
             List/*<LookupSpec>*/ lsl = matchLookupSpecs(script, language, 
feature);
-            for (Iterator it = lsl.iterator(); it.hasNext(); ) {
-                LookupSpec ls = (LookupSpec) it.next();
+            for (Object aLsl : lsl) {
+                LookupSpec ls = (LookupSpec) aLsl;
                 lm.put(ls, findLookupTables(ls));
             }
             matchedLookups.put(lsm, lm);
@@ -239,8 +238,8 @@ public class GlyphTable {
         TreeSet/*<LookupTable>*/ lts = new TreeSet/*<LookupTable>*/();
         List/*<String>*/ ids;
         if ((ids = (List/*<String>*/) lookups.get(ls)) != null) {
-            for (Iterator it = ids.iterator(); it.hasNext();) {
-                String lid = (String) it.next();
+            for (Object id : ids) {
+                String lid = (String) id;
                 LookupTable lt;
                 if ((lt = (LookupTable) lookupTables.get(lid)) != null) {
                     lts.add(lt);
@@ -259,16 +258,15 @@ public class GlyphTable {
      */
     public UseSpec[] assembleLookups(String[] features, 
Map/*<LookupSpec,List<LookupTable>>*/ lookups) {
         TreeSet/*<UseSpec>*/ uss = new TreeSet/*<UseSpec>*/();
-        for (int i = 0, n = features.length; i < n; i++) {
-            String feature = features[i];
-            for (Iterator it = lookups.entrySet().iterator(); it.hasNext(); ) {
-                Map.Entry/*<LookupSpec,List<LookupTable>>*/ e = 
(Map.Entry/*<LookupSpec,List<LookupTable>>*/) it.next();
+        for (String feature : features) {
+            for (Object o : lookups.entrySet()) {
+                Map.Entry/*<LookupSpec,List<LookupTable>>*/ e = 
(Map.Entry/*<LookupSpec,List<LookupTable>>*/) o;
                 LookupSpec ls = (LookupSpec) e.getKey();
                 if (ls.getFeature().equals(feature)) {
                     List/*<LookupTable>*/ ltl = (List/*<LookupTable>*/) 
e.getValue();
                     if (ltl != null) {
-                        for (Iterator ltit = ltl.iterator(); ltit.hasNext(); ) 
{
-                            LookupTable lt = (LookupTable) ltit.next();
+                        for (Object aLtl : ltl) {
+                            LookupTable lt = (LookupTable) aLtl;
                             uss.add(new UseSpec(lt, feature));
                         }
                     }
@@ -334,8 +332,7 @@ public class GlyphTable {
      */
     public static void resolveLookupReferences(RuleSet[] rsa, 
Map/*<String,LookupTable>*/ lookupTables) {
         if ((rsa != null) && (lookupTables != null)) {
-            for (int i = 0, n = rsa.length; i < n; i++) {
-                RuleSet rs = rsa [ i ];
+            for (RuleSet rs : rsa) {
                 if (rs != null) {
                     rs.resolveLookupReferences(lookupTables);
                 }
@@ -498,8 +495,8 @@ public class GlyphTable {
             this.idOrdinal = Integer.parseInt(id.substring(2));
             this.subtables = new LinkedList/*<GlyphSubtable>*/();
             if (subtables != null) {
-                for (Iterator it = subtables.iterator(); it.hasNext(); ) {
-                    GlyphSubtable st = (GlyphSubtable) it.next();
+                for (Object subtable : subtables) {
+                    GlyphSubtable st = (GlyphSubtable) subtable;
                     addSubtable(st);
                 }
             }
@@ -600,8 +597,7 @@ public class GlyphTable {
 
         private void resolveLookupReferences(GlyphSubtable[] subtables, 
Map/*<String,LookupTable>*/ lookupTables) {
             if (subtables != null) {
-                for (int i = 0, n = subtables.length; i < n; i++) {
-                    GlyphSubtable st = subtables [ i ];
+                for (GlyphSubtable st : subtables) {
                     if (st != null) {
                         st.resolveLookupReferences(lookupTables);
                     }
@@ -936,8 +932,7 @@ public class GlyphTable {
          */
         public void resolveLookupReferences(Map/*<String,LookupTable>*/ 
lookupTables) {
             if (lookups != null) {
-                for (int i = 0, n = lookups.length; i < n; i++) {
-                    RuleLookup l = lookups [ i ];
+                for (RuleLookup l : lookups) {
                     if (l != null) {
                         l.resolveLookupReferences(lookupTables);
                     }
@@ -1274,8 +1269,7 @@ public class GlyphTable {
          */
         public void resolveLookupReferences(Map/*<String,LookupTable>*/ 
lookupTables) {
             if (rules != null) {
-                for (int i = 0, n = rules.length; i < n; i++) {
-                    Rule r = rules [ i ];
+                for (Rule r : rules) {
                     if (r != null) {
                         r.resolveLookupReferences(lookupTables);
                     }

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java?rev=1761020&r1=1761019&r2=1761020&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java
 Fri Sep 16 11:17:35 2016
@@ -21,7 +21,6 @@ package org.apache.fop.complexscripts.fo
 
 import java.io.IOException;
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -3577,8 +3576,8 @@ public final class OTFAdvancedTypographi
     }
 
     private void constructLookupsFeatures(Map lookups, String st, String lt, 
List/*<String>*/ fids) {
-        for (Iterator fit = fids.iterator(); fit.hasNext();) {
-            String fid = (String) fit.next();
+        for (Object fid1 : fids) {
+            String fid = (String) fid1;
             constructLookupsFeature(lookups, st, lt, fid);
         }
     }
@@ -3597,16 +3596,16 @@ public final class OTFAdvancedTypographi
     }
 
     private void constructLookupsLanguages(Map lookups, String st, 
List/*<String>*/ ll, Map/*<String,Object[2]>*/ languages) {
-        for (Iterator lit = ll.iterator(); lit.hasNext();) {
-            String lt = (String) lit.next();
+        for (Object aLl : ll) {
+            String lt = (String) aLl;
             constructLookupsLanguage(lookups, st, lt, languages);
         }
     }
 
     private Map constructLookups() {
         Map/*<GlyphTable.LookupSpec,List<String>>*/ lookups = new 
java.util.LinkedHashMap();
-        for (Iterator sit = seScripts.keySet().iterator(); sit.hasNext();) {
-            String st = (String) sit.next();
+        for (Object o : seScripts.keySet()) {
+            String st = (String) o;
             Object[] sp = (Object[]) seScripts.get(st);
             if (sp != null) {
                 assert sp.length == 3;
@@ -3625,8 +3624,8 @@ public final class OTFAdvancedTypographi
     private List constructGDEFSubtables() {
         List/*<GlyphDefinitionSubtable>*/ subtables = new 
java.util.ArrayList();
         if (seSubtables != null) {
-            for (Iterator it = seSubtables.iterator(); it.hasNext();) {
-                Object[] stp = (Object[]) it.next();
+            for (Object seSubtable : seSubtables) {
+                Object[] stp = (Object[]) seSubtable;
                 GlyphSubtable st;
                 if ((st = constructGDEFSubtable(stp)) != null) {
                     subtables.add(st);
@@ -3661,8 +3660,8 @@ public final class OTFAdvancedTypographi
     private List constructGSUBSubtables() {
         List/*<GlyphSubtable>*/ subtables = new java.util.ArrayList();
         if (seSubtables != null) {
-            for (Iterator it = seSubtables.iterator(); it.hasNext();) {
-                Object[] stp = (Object[]) it.next();
+            for (Object seSubtable : seSubtables) {
+                Object[] stp = (Object[]) seSubtable;
                 GlyphSubtable st;
                 if ((st = constructGSUBSubtable(stp)) != null) {
                     subtables.add(st);
@@ -3697,8 +3696,8 @@ public final class OTFAdvancedTypographi
     private List constructGPOSSubtables() {
         List/*<GlyphSubtable>*/ subtables = new java.util.ArrayList();
         if (seSubtables != null) {
-            for (Iterator it = seSubtables.iterator(); it.hasNext();) {
-                Object[] stp = (Object[]) it.next();
+            for (Object seSubtable : seSubtables) {
+                Object[] stp = (Object[]) seSubtable;
                 GlyphSubtable st;
                 if ((st = constructGPOSSubtable(stp)) != null) {
                     subtables.add(st);
@@ -3786,13 +3785,13 @@ public final class OTFAdvancedTypographi
             sb.append('-');
         } else {
             boolean first = true;
-            for (int i = 0; i < ia.length; i++) {
+            for (int anIa : ia) {
                 if (!first) {
                     sb.append(' ');
                 } else {
                     first = false;
                 }
-                sb.append(ia[i]);
+                sb.append(anIa);
             }
         }
         return sb.toString();

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=1761020&r1=1761019&r2=1761020&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 11:17:35 2016
@@ -184,8 +184,7 @@ public class IndicScriptProcessor extend
         for (int i = 0, n = sa.length; i < n; i++) {
             GlyphSequence s = sa [ i ];
             // apply basic shaping subs
-            for (int j = 0, m = usa.length; j < m; j++) {
-                GlyphTable.UseSpec us = usa [ j ];
+            for (GlyphTable.UseSpec us : usa) {
                 if (isBasicShapingUse(us)) {
                     s.setPredications(true);
                     s = us.substitute(s, script, language, sct);
@@ -196,8 +195,7 @@ public class IndicScriptProcessor extend
             // reorder reph
             s = reorderReph(s);
             // apply presentation subs
-            for (int j = 0, m = usa.length; j < m; j++) {
-                GlyphTable.UseSpec us = usa [ j ];
+            for (GlyphTable.UseSpec us : usa) {
                 if (isPresentationUse(us)) {
                     s.setPredications(true);
                     s = us.substitute(s, script, language, sct);
@@ -503,19 +501,18 @@ public class IndicScriptProcessor extend
             int[] ga = gs.getGlyphArray(false);
             CharAssociation[] aa = gs.getAssociations(0, -1);
             Vector<GlyphSequence> nsv = new Vector<GlyphSequence>();
-            for (int i = 0, ns = sa.length; i < ns; i++) {
-                Segment s = sa [ i ];
+            for (Segment s : sa) {
                 Vector<Integer> ngv = new Vector<Integer>(ng);
                 Vector<CharAssociation> nav = new Vector<CharAssociation>(ng);
                 for (int j = 0; j < ng; j++) {
-                    CharAssociation ca = aa [ j ];
+                    CharAssociation ca = aa[j];
                     if (ca.contained(s.getOffset(), s.getCount())) {
-                        ngv.add(ga [ j ]);
+                        ngv.add(ga[j]);
                         nav.add(ca);
                     }
                 }
                 if (ngv.size() > 0) {
-                    nsv.add(new GlyphSequence(gs, null, toIntArray(ngv), null, 
null, nav.toArray(new CharAssociation [ nav.size() ]), null));
+                    nsv.add(new GlyphSequence(gs, null, toIntArray(ngv), null, 
null, nav.toArray(new CharAssociation[nav.size()]), null));
                 }
             }
             if (nsv.size() > 0) {




---------------------------------------------------------------------
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