Author: ssteiner Date: Fri Aug 4 14:15:05 2017 New Revision: 1804125 URL: http://svn.apache.org/viewvc?rev=1804125&view=rev Log: Use foreach and cleanup
Modified: 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/fo/properties/NumberProperty.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/pdf/PDFPattern.java xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/text/GlyphNameFieldPart.java xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/text/HexFieldPart.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/render/afp/AFPRendererConfigParserTestCase.java xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleFO2PDF.java xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/MultipleFO2PDF.java xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/atxml/ExampleConcat.java xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/intermediate/ExampleConcat.java xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/model/ProjectTeamXMLReader.java xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/tools/AbstractObjectReader.java xmlgraphics/fop/trunk/fop/lib/xmlgraphics-commons-svn-trunk.jar 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=1804125&r1=1804124&r2=1804125&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 Aug 4 14:15:05 2017 @@ -3644,7 +3644,7 @@ public final class OTFAdvancedTypographi GlyphMappingTable mapping = (GlyphMappingTable) stp[6]; List entries = (List) stp[7]; if (tt == GlyphTable.GLYPH_TABLE_TYPE_DEFINITION) { - int type = GDEFLookupType.getSubtableType(lt.intValue()); + int type = GDEFLookupType.getSubtableType(lt); String lid = "lu" + ln; int sequence = sn; int flags = lf; @@ -3680,7 +3680,7 @@ public final class OTFAdvancedTypographi GlyphCoverageTable coverage = (GlyphCoverageTable) stp[6]; List entries = (List) stp[7]; if (tt == GlyphTable.GLYPH_TABLE_TYPE_SUBSTITUTION) { - int type = GSUBLookupType.getSubtableType(lt.intValue()); + int type = GSUBLookupType.getSubtableType(lt); String lid = "lu" + ln; int sequence = sn; int flags = lf; @@ -3716,7 +3716,7 @@ public final class OTFAdvancedTypographi GlyphCoverageTable coverage = (GlyphCoverageTable) stp[6]; List entries = (List) stp[7]; if (tt == GlyphTable.GLYPH_TABLE_TYPE_POSITIONING) { - int type = GSUBLookupType.getSubtableType(lt.intValue()); + int type = GSUBLookupType.getSubtableType(lt); String lid = "lu" + ln; int sequence = sn; int flags = lf; Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/properties/NumberProperty.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/properties/NumberProperty.java?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/properties/NumberProperty.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fo/properties/NumberProperty.java Fri Aug 4 14:15:05 2017 @@ -145,7 +145,7 @@ public final class NumberProperty extend * @return the canonical NumberProperty */ public static NumberProperty getInstance(Double num) { - return CACHE.fetch(new NumberProperty(num.doubleValue())); + return CACHE.fetch(new NumberProperty(num)); } /** @@ -155,7 +155,7 @@ public final class NumberProperty extend * @return the canonical NumberProperty */ public static NumberProperty getInstance(Integer num) { - return CACHE.fetch(new NumberProperty(num.intValue())); + return CACHE.fetch(new NumberProperty(num)); } /** Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/SingleByteFont.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/SingleByteFont.java?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/SingleByteFont.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/SingleByteFont.java Fri Aug 4 14:15:05 2017 @@ -363,7 +363,7 @@ public class SingleByteFont extends Cust if (this.unencodedCharacters != null) { Set<Character> sortedKeys = new TreeSet<Character>(this.unencodedCharacters.keySet()); for (Character ch : sortedKeys) { - char mapped = mapChar(ch.charValue()); + char mapped = mapChar(ch); assert mapped != Typeface.NOT_FOUND; } } Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFPattern.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFPattern.java?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFPattern.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFPattern.java Fri Aug 4 14:15:05 2017 @@ -249,7 +249,7 @@ public class PDFPattern extends PDFPathP p.append("/Matrix [ "); for (tempInt = 0; tempInt < vectorSize; tempInt++) { p.append(PDFNumber.doubleOut( - ((Double)this.matrix.get(tempInt)).doubleValue(), 8)); + (Double) this.matrix.get(tempInt), 8)); p.append(" "); } p.append("] \n"); @@ -304,7 +304,7 @@ public class PDFPattern extends PDFPathP p.append("/Matrix [ "); for (tempInt = 0; tempInt < vectorSize; tempInt++) { p.append(PDFNumber.doubleOut( - ((Double)this.matrix.get(tempInt)).doubleValue(), 8)); + (Double) this.matrix.get(tempInt), 8)); p.append(" "); } p.append("] \n"); Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/text/GlyphNameFieldPart.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/text/GlyphNameFieldPart.java?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/text/GlyphNameFieldPart.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/text/GlyphNameFieldPart.java Fri Aug 4 14:15:05 2017 @@ -49,7 +49,7 @@ public class GlyphNameFieldPart implemen private String getGlyphName(Object obj) { if (obj instanceof Character) { - return Glyphs.charToGlyphName(((Character)obj).charValue()); + return Glyphs.charToGlyphName((Character) obj); } else { throw new IllegalArgumentException( "Value for glyph name part must be a Character but was: " Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/text/HexFieldPart.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/text/HexFieldPart.java?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/text/HexFieldPart.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/text/HexFieldPart.java Fri Aug 4 14:15:05 2017 @@ -53,7 +53,7 @@ public class HexFieldPart implements Par } Object obj = params.get(fieldName); if (obj instanceof Character) { - sb.append(Integer.toHexString(((Character)obj).charValue())); + sb.append(Integer.toHexString((Character) obj)); } else if (obj instanceof Number) { sb.append(Integer.toHexString(((Number)obj).intValue())); } else { Modified: xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/afp/modca/AbstractAFPObjectTest.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/afp/modca/AbstractAFPObjectTest.java?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/afp/modca/AbstractAFPObjectTest.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/afp/modca/AbstractAFPObjectTest.java Fri Aug 4 14:15:05 2017 @@ -139,8 +139,8 @@ public abstract class AbstractAFPObjectT int index = 0; for (byte[] anExpected : expected) { - for (int j = 0; j < anExpected.length; j++) { - assertTrue("" + index, actual[index] == anExpected[j]); + for (byte anAnExpected : anExpected) { + assertTrue("" + index, actual[index] == anAnExpected); index++; } } Modified: xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPRendererConfigParserTestCase.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPRendererConfigParserTestCase.java?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPRendererConfigParserTestCase.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPRendererConfigParserTestCase.java Fri Aug 4 14:15:05 2017 @@ -65,7 +65,7 @@ public class AFPRendererConfigParserTest public void testLineWidthCorrection() throws Exception { parseConfig(createRenderer()); assertEquals(AFPConstants.LINE_WIDTH_CORRECTION, - conf.getLineWidthCorrection().floatValue(), 0.0001f); + conf.getLineWidthCorrection(), 0.0001f); parseConfig(createRenderer().setLineWidthCorrection(1f)); assertEquals(Float.valueOf(1f), conf.getLineWidthCorrection()); } Modified: xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleFO2PDF.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleFO2PDF.java?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleFO2PDF.java (original) +++ xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleFO2PDF.java Fri Aug 4 14:15:05 2017 @@ -88,11 +88,11 @@ public class ExampleFO2PDF { // Result processing FormattingResults foResults = fop.getResults(); java.util.List pageSequences = foResults.getPageSequences(); - for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) { - PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next(); + for (Object pageSequence : pageSequences) { + PageSequenceResults pageSequenceResults = (PageSequenceResults) pageSequence; System.out.println("PageSequence " + (String.valueOf(pageSequenceResults.getID()).length() > 0 - ? pageSequenceResults.getID() : "<no id>") + ? pageSequenceResults.getID() : "<no id>") + " generated " + pageSequenceResults.getPageCount() + " pages."); } System.out.println("Generated " + foResults.getPageCount() + " pages in total."); Modified: xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/MultipleFO2PDF.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/MultipleFO2PDF.java?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/MultipleFO2PDF.java (original) +++ xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/MultipleFO2PDF.java Fri Aug 4 14:15:05 2017 @@ -142,11 +142,11 @@ public class MultipleFO2PDF { // Result processing java.util.List pageSequences = foResults.getPageSequences(); - for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) { - PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next(); + for (Object pageSequence : pageSequences) { + PageSequenceResults pageSequenceResults = (PageSequenceResults) pageSequence; System.out.println("PageSequence " + (String.valueOf(pageSequenceResults.getID()).length() > 0 - ? pageSequenceResults.getID() : "<no id>") + ? pageSequenceResults.getID() : "<no id>") + " generated " + pageSequenceResults.getPageCount() + " pages."); } System.out.println("Generated " + foResults.getPageCount() + " pages in total."); Modified: xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/atxml/ExampleConcat.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/atxml/ExampleConcat.java?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/atxml/ExampleConcat.java (original) +++ xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/atxml/ExampleConcat.java Fri Aug 4 14:15:05 2017 @@ -152,8 +152,8 @@ public class ExampleConcat { //Iterate over all area tree files AreaTreeParser parser = new AreaTreeParser(); - for (int i = 0; i < files.length; i++) { - Source src = new StreamSource(files[i]); + for (File file : files) { + Source src = new StreamSource(file); parser.parse(src, treeModel, userAgent); } Modified: xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/intermediate/ExampleConcat.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/intermediate/ExampleConcat.java?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/intermediate/ExampleConcat.java (original) +++ xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/intermediate/ExampleConcat.java Fri Aug 4 14:15:05 2017 @@ -160,8 +160,8 @@ public class ExampleConcat { IFConcatenator concatenator = new IFConcatenator(targetHandler, null); //Iterate over all intermediate files - for (int i = 0; i < files.length; i++) { - Source src = new StreamSource(files[i]); + for (File file : files) { + Source src = new StreamSource(file); concatenator.appendDocument(src); } Modified: xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/model/ProjectTeamXMLReader.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/model/ProjectTeamXMLReader.java?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/model/ProjectTeamXMLReader.java (original) +++ xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/model/ProjectTeamXMLReader.java Fri Aug 4 14:15:05 2017 @@ -20,7 +20,6 @@ package embedding.model; //Java -import java.util.Iterator; import java.io.IOException; //SAX @@ -87,9 +86,8 @@ public class ProjectTeamXMLReader extend handler.startElement("projectteam"); handler.element("projectname", projectTeam.getProjectName()); - Iterator i = projectTeam.getMembers().iterator(); - while (i.hasNext()) { - ProjectMember member = (ProjectMember)i.next(); + for (Object o : projectTeam.getMembers()) { + ProjectMember member = (ProjectMember) o; generateFor(member); } handler.endElement("projectteam"); Modified: xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/tools/AbstractObjectReader.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/tools/AbstractObjectReader.java?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/tools/AbstractObjectReader.java (original) +++ xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/tools/AbstractObjectReader.java Fri Aug 4 14:15:05 2017 @@ -135,7 +135,7 @@ public abstract class AbstractObjectRead * @see org.xml.sax.XMLReader#getFeature(String) */ public boolean getFeature(java.lang.String name) { - return ((Boolean) features.get(name)).booleanValue(); + return (Boolean) features.get(name); } /** @@ -158,7 +158,7 @@ public abstract class AbstractObjectRead * @see org.xml.sax.XMLReader#setFeature(String, boolean) */ public void setFeature(java.lang.String name, boolean value) { - this.features.put(name, new Boolean(value)); + this.features.put(name, value); } /** Modified: xmlgraphics/fop/trunk/fop/lib/xmlgraphics-commons-svn-trunk.jar URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop/lib/xmlgraphics-commons-svn-trunk.jar?rev=1804125&r1=1804124&r2=1804125&view=diff ============================================================================== Binary files - no diff available. --------------------------------------------------------------------- To unsubscribe, e-mail: fop-commits-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-commits-h...@xmlgraphics.apache.org