From 36d81a0a715e65525e326c6911ac4859fec63968 Mon Sep 17 00:00:00 2001 From: Simon Steiner Date: Fri, 16 Sep 2016 10:43:45 +0000 Subject: [PATCH] FOP-2648: Code cleanup git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1761019 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/afp/AFPResourceLevelDefaults.java | 2 +- .../org/apache/fop/afp/fonts/RasterFont.java | 8 ++--- .../java/org/apache/fop/apps/FOUserAgent.java | 2 +- .../complexscripts/fonts/GlyphClassTable.java | 4 +-- .../fonts/GlyphCoverageTable.java | 2 +- .../fonts/GlyphPositioningTable.java | 16 +++++----- .../fonts/GlyphSubstitutionTable.java | 8 ++--- .../OTFAdvancedTypographicTableReader.java | 30 +++++++++---------- .../scripts/DevanagariScriptProcessor.java | 4 +-- .../scripts/GujaratiScriptProcessor.java | 4 +-- .../scripts/GurmukhiScriptProcessor.java | 4 +-- .../scripts/TamilScriptProcessor.java | 4 +-- .../fop/complexscripts/util/CharScript.java | 8 ++--- .../complexscripts/util/NumberConverter.java | 6 ++-- .../fop/fo/properties/PropertyCache.java | 3 +- .../java/org/apache/fop/fonts/CIDSubset.java | 2 +- .../main/java/org/apache/fop/fonts/Font.java | 2 +- .../java/org/apache/fop/fonts/FontCache.java | 2 +- .../java/org/apache/fop/fonts/FontInfo.java | 2 +- .../fop/fonts/SimpleSingleByteEncoding.java | 2 +- .../org/apache/fop/fonts/SingleByteFont.java | 2 +- .../fop/fonts/XMLFontMetricsReader.java | 2 +- .../org/apache/fop/fonts/apps/TTFReader.java | 2 +- .../fop/fonts/substitute/FontQualifier.java | 4 +-- .../apache/fop/fonts/truetype/OpenFont.java | 16 +++++----- .../fop/fonts/truetype/TTFSubSetFile.java | 8 ++--- .../org/apache/fop/fonts/type1/AFMParser.java | 6 ++-- .../fop/fonts/type1/PostscriptParser.java | 2 +- .../fop/layoutmgr/table/RowPainter.java | 2 +- .../org/apache/fop/render/PrintRenderer.java | 2 +- .../apache/fop/render/RendererContext.java | 8 ++--- .../fop/render/afp/AFPRendererContext.java | 8 ++--- .../intermediate/AbstractIFPainter.java | 4 +-- .../fop/render/intermediate/IFRenderer.java | 4 +-- .../fop/render/intermediate/IFSerializer.java | 8 ++--- .../fop/render/java2d/Java2DSVGHandler.java | 8 ++--- .../fop/render/pdf/PDFRenderingUtil.java | 4 +-- .../apache/fop/render/pdf/PDFSVGHandler.java | 10 +++---- .../fop/render/print/PageableRenderer.java | 4 +-- .../fop/render/ps/PSDocumentHandler.java | 18 +++++------ .../apache/fop/render/ps/PSRenderingUtil.java | 6 ++-- .../apache/fop/render/ps/PSSVGHandler.java | 8 ++--- .../fop/render/rtf/FOPRtfAttributes.java | 2 +- .../fop/render/rtf/FoUnitsConverter.java | 6 ++-- .../render/rtf/PageAttributesConverter.java | 2 +- .../org/apache/fop/render/rtf/RTFHandler.java | 8 ++--- .../render/rtf/TextAttributesConverter.java | 2 +- .../rtf/rtflib/rtfdoc/RtfAttributes.java | 4 +-- .../rtf/rtflib/rtfdoc/RtfColorTable.java | 22 +++++++------- .../rtf/rtflib/rtfdoc/RtfFontManager.java | 2 +- .../fop/render/rtf/rtflib/rtfdoc/RtfPage.java | 2 +- .../rtf/rtflib/rtfdoc/RtfSpaceSplitter.java | 2 +- .../rtf/rtflib/rtfdoc/RtfStringConverter.java | 4 +-- .../rtf/rtflib/rtfdoc/RtfStyleSheetTable.java | 4 +-- .../render/rtf/rtflib/rtfdoc/RtfTable.java | 2 +- .../rtf/rtflib/rtfdoc/RtfTableCell.java | 2 +- .../render/rtf/rtflib/rtfdoc/RtfTableRow.java | 6 ++-- .../render/rtf/rtflib/rtfdoc/RtfTextrun.java | 2 +- .../rtf/rtflib/tools/PercentContext.java | 6 ++-- .../render/rtf/rtflib/tools/TableContext.java | 10 +++---- .../apache/fop/render/txt/TXTRenderer.java | 2 +- .../apache/fop/render/xml/XMLRenderer.java | 2 +- .../java/org/apache/fop/svg/ACIUtils.java | 20 ++++++------- .../apache/fop/svg/AbstractFOPTranscoder.java | 8 ++--- .../org/apache/fop/svg/PDFGraphics2D.java | 2 +- .../fop/svg/font/FOPGVTGlyphVector.java | 2 +- .../apache/fop/tools/anttasks/RunTest.java | 2 +- .../java/org/apache/fop/util/XMLUtil.java | 2 +- .../org/apache/fop/util/text/IfFieldPart.java | 2 +- .../fop/complexscripts/fonts/ttx/TTXFile.java | 2 +- .../CollapsedConditionalBorderTestCase.java | 2 +- .../apache/fop/fotreetest/FOTreeTestCase.java | 2 +- 72 files changed, 193 insertions(+), 194 deletions(-) diff --git a/fop-core/src/main/java/org/apache/fop/afp/AFPResourceLevelDefaults.java b/fop-core/src/main/java/org/apache/fop/afp/AFPResourceLevelDefaults.java index 2ec844ac2..39c72d8f5 100644 --- a/fop-core/src/main/java/org/apache/fop/afp/AFPResourceLevelDefaults.java +++ b/fop-core/src/main/java/org/apache/fop/afp/AFPResourceLevelDefaults.java @@ -47,7 +47,7 @@ public class AFPResourceLevelDefaults { if (result == null) { throw new IllegalArgumentException("Unknown resource type name: " + resourceTypeName); } - return result.byteValue(); + return result; } private Map defaultResourceLevels = new java.util.HashMap(); diff --git a/fop-core/src/main/java/org/apache/fop/afp/fonts/RasterFont.java b/fop-core/src/main/java/org/apache/fop/afp/fonts/RasterFont.java index 9f9c5ed95..1facbf059 100644 --- a/fop-core/src/main/java/org/apache/fop/afp/fonts/RasterFont.java +++ b/fop-core/src/main/java/org/apache/fop/afp/fonts/RasterFont.java @@ -94,9 +94,9 @@ public class RasterFont extends AFPFont { SortedMap smallerSizes = charSets.headMap(requestedSize); SortedMap largerSizes = charSets.tailMap(requestedSize); int smallerSize = smallerSizes.isEmpty() ? 0 - : smallerSizes.lastKey().intValue(); + : smallerSizes.lastKey(); int largerSize = largerSizes.isEmpty() ? Integer.MAX_VALUE - : largerSizes.firstKey().intValue(); + : largerSizes.firstKey(); Integer fontSize; if (!smallerSizes.isEmpty() @@ -115,9 +115,9 @@ public class RasterFont extends AFPFont { } substitutionCharSets.put(requestedSize, csm); // do not output the warning if the font size is closer to an integer less than 0.1 - if (!(Math.abs(fontSize.intValue() / 1000.0 - sizeInPt) < 0.1)) { + if (!(Math.abs(fontSize / 1000.0 - sizeInPt) < 0.1)) { String msg = "No " + sizeInPt + "pt font " + getFontName() - + " found, substituted with " + fontSize.intValue() / 1000f + "pt font"; + + " found, substituted with " + fontSize / 1000f + "pt font"; LOG.warn(msg); } } diff --git a/fop-core/src/main/java/org/apache/fop/apps/FOUserAgent.java b/fop-core/src/main/java/org/apache/fop/apps/FOUserAgent.java index c0f0ac3d9..43d2b9d80 100644 --- a/fop-core/src/main/java/org/apache/fop/apps/FOUserAgent.java +++ b/fop-core/src/main/java/org/apache/fop/apps/FOUserAgent.java @@ -716,7 +716,7 @@ public class FOUserAgent { public boolean isAccessibilityEnabled() { Boolean enabled = (Boolean)this.getRendererOptions().get(Accessibility.ACCESSIBILITY); if (enabled != null) { - return enabled.booleanValue(); + return enabled; } else { return false; } diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java index 66dbf97c0..25ff6034f 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java @@ -196,7 +196,7 @@ public final class GlyphClassTable extends GlyphMappingTable implements GlyphCla if (it.hasNext()) { Object o = it.next(); if (o instanceof Integer) { - firstGlyph = ((Integer) o) .intValue(); + firstGlyph = (Integer) o; } else { throw new AdvancedTypographicTableFormatException("illegal entry, first entry must be Integer denoting first glyph value, but is: " + o); } @@ -209,7 +209,7 @@ public final class GlyphClassTable extends GlyphMappingTable implements GlyphCla while (it.hasNext()) { Object o = it.next(); if (o instanceof Integer) { - int gc = ((Integer) o) .intValue(); + int gc = (Integer) o; gca [ i++ ] = gc; if (gc > gcMax) { gcMax = gc; diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java index f996d8cf8..a4251e9ef 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java @@ -181,7 +181,7 @@ public final class GlyphCoverageTable extends GlyphMappingTable implements Glyph for (Iterator it = entries.iterator(); it.hasNext();) { Object o = it.next(); if (o instanceof Integer) { - int gid = ((Integer) o) .intValue(); + int gid = (Integer) o; if ((gid >= 0) && (gid < 65536)) { if (gid > gidMax) { map [ i++ ] = gidMax = gid; diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java index 4596dbdfb..705c0ff67 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java @@ -579,12 +579,12 @@ public class GlyphPositioningTable extends GlyphTable { if (((o = entries.get(2)) == null) || !(o instanceof Integer)) { throw new AdvancedTypographicTableFormatException("illegal entries, third entry must be an Integer, but is: " + ((o != null) ? o.getClass() : null)); } else { - nc1 = ((Integer)(o)).intValue(); + nc1 = (Integer) (o); } if (((o = entries.get(3)) == null) || !(o instanceof Integer)) { throw new AdvancedTypographicTableFormatException("illegal entries, fourth entry must be an Integer, but is: " + ((o != null) ? o.getClass() : null)); } else { - nc2 = ((Integer)(o)).intValue(); + nc2 = (Integer) (o); } if (((o = entries.get(4)) == null) || !(o instanceof PairValues[][])) { throw new AdvancedTypographicTableFormatException("illegal entries, fifth entry must be a PairValues[][], but is: " + ((o != null) ? o.getClass() : null)); @@ -840,7 +840,7 @@ public class GlyphPositioningTable extends GlyphTable { if (((o = entries.get(1)) == null) || !(o instanceof Integer)) { throw new AdvancedTypographicTableFormatException("illegal entries, second entry must be an Integer, but is: " + ((o != null) ? o.getClass() : null)); } else { - nmc = ((Integer)(o)).intValue(); + nmc = (Integer) (o); } if (((o = entries.get(2)) == null) || !(o instanceof MarkAnchor[])) { throw new AdvancedTypographicTableFormatException("illegal entries, third entry must be a MarkAnchor[], but is: " + ((o != null) ? o.getClass() : null)); @@ -994,12 +994,12 @@ public class GlyphPositioningTable extends GlyphTable { if (((o = entries.get(1)) == null) || !(o instanceof Integer)) { throw new AdvancedTypographicTableFormatException("illegal entries, second entry must be an Integer, but is: " + ((o != null) ? o.getClass() : null)); } else { - nmc = ((Integer)(o)).intValue(); + nmc = (Integer) (o); } if (((o = entries.get(2)) == null) || !(o instanceof Integer)) { throw new AdvancedTypographicTableFormatException("illegal entries, third entry must be an Integer, but is: " + ((o != null) ? o.getClass() : null)); } else { - mxc = ((Integer)(o)).intValue(); + mxc = (Integer) (o); } if (((o = entries.get(3)) == null) || !(o instanceof MarkAnchor[])) { throw new AdvancedTypographicTableFormatException("illegal entries, fourth entry must be a MarkAnchor[], but is: " + ((o != null) ? o.getClass() : null)); @@ -1130,7 +1130,7 @@ public class GlyphPositioningTable extends GlyphTable { if (((o = entries.get(1)) == null) || !(o instanceof Integer)) { throw new AdvancedTypographicTableFormatException("illegal entries, second entry must be an Integer, but is: " + ((o != null) ? o.getClass() : null)); } else { - nmc = ((Integer)(o)).intValue(); + nmc = (Integer) (o); } if (((o = entries.get(2)) == null) || !(o instanceof MarkAnchor[])) { throw new AdvancedTypographicTableFormatException("illegal entries, third entry must be a MarkAnchor[], but is: " + ((o != null) ? o.getClass() : null)); @@ -1372,7 +1372,7 @@ public class GlyphPositioningTable extends GlyphTable { if (((o = entries.get(1)) == null) || !(o instanceof Integer)) { throw new AdvancedTypographicTableFormatException("illegal entries, second entry must be an Integer, but is: " + ((o != null) ? o.getClass() : null)); } else { - ngc = ((Integer)(o)).intValue(); + ngc = (Integer) (o); } if (((o = entries.get(2)) == null) || !(o instanceof RuleSet[])) { throw new AdvancedTypographicTableFormatException("illegal entries, third entry must be an RuleSet[], but is: " + ((o != null) ? o.getClass() : null)); @@ -1676,7 +1676,7 @@ public class GlyphPositioningTable extends GlyphTable { if (((o = entries.get(3)) == null) || !(o instanceof Integer)) { throw new AdvancedTypographicTableFormatException("illegal entries, fourth entry must be an Integer, but is: " + ((o != null) ? o.getClass() : null)); } else { - ngc = ((Integer)(o)).intValue(); + ngc = (Integer) (o); } if (((o = entries.get(4)) == null) || !(o instanceof RuleSet[])) { throw new AdvancedTypographicTableFormatException("illegal entries, fifth entry must be an RuleSet[], but is: " + ((o != null) ? o.getClass() : null)); diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java index 1d9da2eaa..35df1f48f 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java @@ -305,7 +305,7 @@ public class GlyphSubstitutionTable extends GlyphTable { Object o = entries.get(0); int delta = 0; if (o instanceof Integer) { - delta = ((Integer) o) .intValue(); + delta = (Integer) o; } else { throw new AdvancedTypographicTableFormatException("illegal entries entry, must be Integer, but is: " + o); } @@ -346,7 +346,7 @@ public class GlyphSubstitutionTable extends GlyphTable { for (Iterator it = entries.iterator(); it.hasNext();) { Object o = it.next(); if (o instanceof Integer) { - int gid = ((Integer) o) .intValue(); + int gid = (Integer) o; if ((gid >= 0) && (gid < 65536)) { glyphs [ i++ ] = gid; } else { @@ -901,7 +901,7 @@ public class GlyphSubstitutionTable extends GlyphTable { if (((o = entries.get(1)) == null) || !(o instanceof Integer)) { throw new AdvancedTypographicTableFormatException("illegal entries, second entry must be an Integer, but is: " + ((o != null) ? o.getClass() : null)); } else { - ngc = ((Integer)(o)).intValue(); + ngc = (Integer) (o); } if (((o = entries.get(2)) == null) || !(o instanceof RuleSet[])) { throw new AdvancedTypographicTableFormatException("illegal entries, third entry must be an RuleSet[], but is: " + ((o != null) ? o.getClass() : null)); @@ -1206,7 +1206,7 @@ public class GlyphSubstitutionTable extends GlyphTable { if (((o = entries.get(3)) == null) || !(o instanceof Integer)) { throw new AdvancedTypographicTableFormatException("illegal entries, fourth entry must be an Integer, but is: " + ((o != null) ? o.getClass() : null)); } else { - ngc = ((Integer)(o)).intValue(); + ngc = (Integer) (o); } if (((o = entries.get(4)) == null) || !(o instanceof RuleSet[])) { throw new AdvancedTypographicTableFormatException("illegal entries, fifth entry must be an RuleSet[], but is: " + ((o != null) ? o.getClass() : null)); diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java index 9cf35f553..ca51e9a24 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java @@ -3647,12 +3647,12 @@ public final class OTFAdvancedTypographicTableReader { Integer sf = (Integer) stp[5]; // subtable format GlyphMappingTable mapping = (GlyphMappingTable) stp[6]; List entries = (List) stp[7]; - if (tt.intValue() == GlyphTable.GLYPH_TABLE_TYPE_DEFINITION) { + if (tt == GlyphTable.GLYPH_TABLE_TYPE_DEFINITION) { int type = GDEFLookupType.getSubtableType(lt.intValue()); - String lid = "lu" + ln.intValue(); - int sequence = sn.intValue(); - int flags = lf.intValue(); - int format = sf.intValue(); + String lid = "lu" + ln; + int sequence = sn; + int flags = lf; + int format = sf; st = GlyphDefinitionTable.createSubtable(type, lid, sequence, flags, format, mapping, entries); } return st; @@ -3683,12 +3683,12 @@ public final class OTFAdvancedTypographicTableReader { Integer sf = (Integer) stp[5]; // subtable format GlyphCoverageTable coverage = (GlyphCoverageTable) stp[6]; List entries = (List) stp[7]; - if (tt.intValue() == GlyphTable.GLYPH_TABLE_TYPE_SUBSTITUTION) { + if (tt == GlyphTable.GLYPH_TABLE_TYPE_SUBSTITUTION) { int type = GSUBLookupType.getSubtableType(lt.intValue()); - String lid = "lu" + ln.intValue(); - int sequence = sn.intValue(); - int flags = lf.intValue(); - int format = sf.intValue(); + String lid = "lu" + ln; + int sequence = sn; + int flags = lf; + int format = sf; st = GlyphSubstitutionTable.createSubtable(type, lid, sequence, flags, format, coverage, entries); } return st; @@ -3719,12 +3719,12 @@ public final class OTFAdvancedTypographicTableReader { Integer sf = (Integer) stp[5]; // subtable format GlyphCoverageTable coverage = (GlyphCoverageTable) stp[6]; List entries = (List) stp[7]; - if (tt.intValue() == GlyphTable.GLYPH_TABLE_TYPE_POSITIONING) { + if (tt == GlyphTable.GLYPH_TABLE_TYPE_POSITIONING) { int type = GSUBLookupType.getSubtableType(lt.intValue()); - String lid = "lu" + ln.intValue(); - int sequence = sn.intValue(); - int flags = lf.intValue(); - int format = sf.intValue(); + String lid = "lu" + ln; + int sequence = sn; + int flags = lf; + int format = sf; st = GlyphPositioningTable.createSubtable(type, lid, sequence, flags, format, coverage, entries); } return st; diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/DevanagariScriptProcessor.java b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/DevanagariScriptProcessor.java index 8d312b846..82058dcf2 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/DevanagariScriptProcessor.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/DevanagariScriptProcessor.java @@ -106,7 +106,7 @@ public class DevanagariScriptProcessor extends IndicScriptProcessor { private static boolean containsHalfConsonant(GlyphSequence gs, int k) { Boolean half = (Boolean) gs.getAssociation(k) .getPredication("half"); - return (half != null) ? half.booleanValue() : false; + return (half != null) ? half : false; } @Override @@ -156,7 +156,7 @@ public class DevanagariScriptProcessor extends IndicScriptProcessor { private static boolean containsReph(GlyphSequence gs, int k) { Boolean rphf = (Boolean) gs.getAssociation(k) .getPredication("rphf"); - return (rphf != null) ? rphf.booleanValue() : false; + return (rphf != null) ? rphf : false; } private static boolean containsMatra(GlyphSequence gs, int k) { diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/GujaratiScriptProcessor.java b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/GujaratiScriptProcessor.java index 1f96455bc..c65a4c982 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/GujaratiScriptProcessor.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/GujaratiScriptProcessor.java @@ -106,7 +106,7 @@ public class GujaratiScriptProcessor extends IndicScriptProcessor { private static boolean containsHalfConsonant(GlyphSequence gs, int k) { Boolean half = (Boolean) gs.getAssociation(k) .getPredication("half"); - return (half != null) ? half.booleanValue() : false; + return (half != null) ? half : false; } @Override @@ -156,7 +156,7 @@ public class GujaratiScriptProcessor extends IndicScriptProcessor { private static boolean containsReph(GlyphSequence gs, int k) { Boolean rphf = (Boolean) gs.getAssociation(k) .getPredication("rphf"); - return (rphf != null) ? rphf.booleanValue() : false; + return (rphf != null) ? rphf : false; } private static boolean containsMatra(GlyphSequence gs, int k) { diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/GurmukhiScriptProcessor.java b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/GurmukhiScriptProcessor.java index cc50761bb..29b086cd3 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/GurmukhiScriptProcessor.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/GurmukhiScriptProcessor.java @@ -106,7 +106,7 @@ public class GurmukhiScriptProcessor extends IndicScriptProcessor { private static boolean containsHalfConsonant(GlyphSequence gs, int k) { Boolean half = (Boolean) gs.getAssociation(k) .getPredication("half"); - return (half != null) ? half.booleanValue() : false; + return (half != null) ? half : false; } @Override @@ -156,7 +156,7 @@ public class GurmukhiScriptProcessor extends IndicScriptProcessor { private static boolean containsReph(GlyphSequence gs, int k) { Boolean rphf = (Boolean) gs.getAssociation(k) .getPredication("rphf"); - return (rphf != null) ? rphf.booleanValue() : false; + return (rphf != null) ? rphf : false; } private static boolean containsMatra(GlyphSequence gs, int k) { diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/TamilScriptProcessor.java b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/TamilScriptProcessor.java index 6df0bf8ee..3d02ce017 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/TamilScriptProcessor.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/TamilScriptProcessor.java @@ -106,7 +106,7 @@ public class TamilScriptProcessor extends IndicScriptProcessor { private static boolean containsHalfConsonant(GlyphSequence gs, int k) { Boolean half = (Boolean) gs.getAssociation(k).getPredication("half"); - return (half != null) ? half.booleanValue() : false; + return (half != null) ? half : false; } @Override @@ -156,7 +156,7 @@ public class TamilScriptProcessor extends IndicScriptProcessor { private static boolean containsReph(GlyphSequence gs, int k) { Boolean rphf = (Boolean) gs.getAssociation(k).getPredication("rphf"); - return (rphf != null) ? rphf.booleanValue() : false; + return (rphf != null) ? rphf : false; } private static boolean containsMatra(GlyphSequence gs, int k) { diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/util/CharScript.java b/fop-core/src/main/java/org/apache/fop/complexscripts/util/CharScript.java index 9321abc99..e82bb4779 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/util/CharScript.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/util/CharScript.java @@ -713,7 +713,7 @@ public final class CharScript { int[] sa = new int [ s.size() ]; int ns = 0; for (Iterator it = s.iterator(); it.hasNext();) { - sa [ ns++ ] = ((Integer) it.next()) .intValue(); + sa [ ns++ ] = (Integer) it.next(); } Arrays.sort(sa); return sa; @@ -732,7 +732,7 @@ public final class CharScript { Integer k = s; Integer v = (Integer) m.get(k); if (v != null) { - m.put(k, v.intValue() + 1); + m.put(k, v + 1); } else { m.put(k, 0); } @@ -742,7 +742,7 @@ public final class CharScript { for (Iterator it = m.entrySet().iterator(); it.hasNext();) { Map.Entry e = (Map.Entry) it.next(); Integer k = (Integer) e.getKey(); - int s = k.intValue(); + int s = k; switch (s) { case SCRIPT_UNDETERMINED: case SCRIPT_UNCODED: @@ -750,7 +750,7 @@ public final class CharScript { default: Integer v = (Integer) e.getValue(); assert v != null; - int c = v.intValue(); + int c = v; if (c > cMax) { cMax = c; sMax = s; diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java b/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java index bfb8b6571..817f70a18 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java @@ -254,7 +254,7 @@ public class NumberConverter { if (number < 0) { throw new IllegalArgumentException("number must be non-negative"); } else if (token.length == 1) { - int s = token[0].intValue(); + int s = token[0]; switch (s) { case (int) '1': fn = formatNumberAsDecimal(number, (int) '1', 1); @@ -282,7 +282,7 @@ public class NumberConverter { } else if ((token.length == 2) && (token[0] == (int) 'W') && (token[1] == (int) 'w')) { fn = formatNumberAsWord(number, Character.TITLECASE_LETTER); } else if (isPaddedOne(token)) { - int s = token [ token.length - 1 ].intValue(); + int s = token[token.length - 1]; fn = formatNumberAsDecimal(number, s, token.length); } else { throw new IllegalArgumentException("invalid format token: \"" + UTF32.fromUTF32(token) + "\""); @@ -503,7 +503,7 @@ public class NumberConverter { } private static int getDecimalValue(Integer scalar) { - int s = scalar.intValue(); + int s = scalar; if (Character.getType(s) == Character.DECIMAL_DIGIT_NUMBER) { return Character.getNumericValue(s); } else { diff --git a/fop-core/src/main/java/org/apache/fop/fo/properties/PropertyCache.java b/fop-core/src/main/java/org/apache/fop/fo/properties/PropertyCache.java index b36f01ff5..5846fb76c 100644 --- a/fop-core/src/main/java/org/apache/fop/fo/properties/PropertyCache.java +++ b/fop-core/src/main/java/org/apache/fop/fo/properties/PropertyCache.java @@ -79,8 +79,7 @@ public final class PropertyCache { boolean useCache; try { useCache = Boolean.valueOf( - System.getProperty("org.apache.fop.fo.properties.use-cache", "true")) - .booleanValue(); + System.getProperty("org.apache.fop.fo.properties.use-cache", "true")); } catch (SecurityException e) { useCache = true; LOG.info("Unable to access org.apache.fop.fo.properties.use-cache" diff --git a/fop-core/src/main/java/org/apache/fop/fonts/CIDSubset.java b/fop-core/src/main/java/org/apache/fop/fonts/CIDSubset.java index e0fbdd6c2..d2ebcfcb9 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/CIDSubset.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/CIDSubset.java @@ -84,7 +84,7 @@ public class CIDSubset implements CIDSet { public char getUnicode(int index) { Character mapValue = usedCharsIndex.get(index); if (mapValue != null) { - return mapValue.charValue(); + return mapValue; } else { return CharUtilities.NOT_A_CHARACTER; } diff --git a/fop-core/src/main/java/org/apache/fop/fonts/Font.java b/fop-core/src/main/java/org/apache/fop/fonts/Font.java index b3cea0d6f..93daa4b10 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/Font.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/Font.java @@ -199,7 +199,7 @@ public class Font implements Substitutable, Positionable { if (kernPair != null) { Integer width = kernPair.get((int) ch2); if (width != null) { - return width.intValue() * getFontSize() / 1000; + return width * getFontSize() / 1000; } } return 0; diff --git a/fop-core/src/main/java/org/apache/fop/fonts/FontCache.java b/fop-core/src/main/java/org/apache/fop/fonts/FontCache.java index 5e75133ed..8379ac137 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/FontCache.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/FontCache.java @@ -408,7 +408,7 @@ public final class FontCache implements Serializable { synchronized (changeLock) { if (getFailedFontMap().containsKey(embedUrl)) { long failedLastModified = getFailedFontMap().get( - embedUrl).longValue(); + embedUrl); if (lastModified != failedLastModified) { // this font has been changed so lets remove it // from failed font map for now diff --git a/fop-core/src/main/java/org/apache/fop/fonts/FontInfo.java b/fop-core/src/main/java/org/apache/fop/fonts/FontInfo.java index 334e260aa..b2cf38189 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/FontInfo.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/FontInfo.java @@ -134,7 +134,7 @@ public class FontInfo { String oldName = triplets.get(triplet); int newPriority = triplet.getPriority(); if (oldName != null) { - int oldPriority = tripletPriorities.get(triplet).intValue(); + int oldPriority = tripletPriorities.get(triplet); if (oldPriority < newPriority) { logDuplicateFont(triplet, false, oldName, oldPriority, internalFontKey, newPriority); return; diff --git a/fop-core/src/main/java/org/apache/fop/fonts/SimpleSingleByteEncoding.java b/fop-core/src/main/java/org/apache/fop/fonts/SimpleSingleByteEncoding.java index ee13a1647..e42bfc5d0 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/SimpleSingleByteEncoding.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/SimpleSingleByteEncoding.java @@ -56,7 +56,7 @@ public class SimpleSingleByteEncoding implements SingleByteEncoding { public char mapChar(char c) { Character nc = charMap.get(c); if (nc != null) { - return nc.charValue(); + return nc; } return NOT_FOUND_CODE_POINT; } diff --git a/fop-core/src/main/java/org/apache/fop/fonts/SingleByteFont.java b/fop-core/src/main/java/org/apache/fop/fonts/SingleByteFont.java index 52fe4241c..9dbd8a5d2 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/SingleByteFont.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/SingleByteFont.java @@ -247,7 +247,7 @@ public class SingleByteFont extends CustomFont { private char getUnicode(int index) { Character mapValue = usedCharsIndex.get(index); if (mapValue != null) { - return mapValue.charValue(); + return mapValue; } else { return CharUtilities.NOT_A_CHARACTER; } diff --git a/fop-core/src/main/java/org/apache/fop/fonts/XMLFontMetricsReader.java b/fop-core/src/main/java/org/apache/fop/fonts/XMLFontMetricsReader.java index 4e6177786..7f3927f24 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/XMLFontMetricsReader.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/XMLFontMetricsReader.java @@ -291,7 +291,7 @@ public class XMLFontMetricsReader extends DefaultHandler { int[] wds = new int[cidWidths.size()]; int j = 0; for (int count = 0; count < cidWidths.size(); count++) { - wds[j++] = cidWidths.get(count).intValue(); + wds[j++] = cidWidths.get(count); } //multiFont.addCIDWidthEntry(cidWidthIndex, wds); diff --git a/fop-core/src/main/java/org/apache/fop/fonts/apps/TTFReader.java b/fop-core/src/main/java/org/apache/fop/fonts/apps/TTFReader.java index 6f80fd098..8af55488b 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/apps/TTFReader.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/apps/TTFReader.java @@ -464,7 +464,7 @@ public class TTFReader extends AbstractFontReader { for (Map.Entry e : h2.entrySet()) { Integer kpx2 = e.getKey(); - if (isCid || kpx2.intValue() < 256) { + if (isCid || kpx2 < 256) { el2 = doc.createElement("pair"); el2.setAttribute("kpx2", kpx2.toString()); Integer val = e.getValue(); diff --git a/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontQualifier.java b/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontQualifier.java index 8e9213e9d..820326d11 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontQualifier.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontQualifier.java @@ -189,7 +189,7 @@ public class FontQualifier { } } else if (weightObj instanceof Integer) { Integer fontWeightInteger = (Integer)weightObj; - int fontWeightValue = fontWeightInteger.intValue(); + int fontWeightValue = fontWeightInteger; if (fontWeightValue == fontWeight) { weightMatched = true; } @@ -272,7 +272,7 @@ public class FontQualifier { triplets.add(new FontTriplet(name, style, weight)); } else if (weightObj instanceof Integer) { Integer weightInteger = (Integer)weightObj; - int weight = weightInteger.intValue(); + int weight = weightInteger; triplets.add(new FontTriplet(name, style, weight)); } } diff --git a/fop-core/src/main/java/org/apache/fop/fonts/truetype/OpenFont.java b/fop-core/src/main/java/org/apache/fop/fonts/truetype/OpenFont.java index 14aeee889..5be2140fe 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/truetype/OpenFont.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/truetype/OpenFont.java @@ -553,14 +553,14 @@ public abstract class OpenFont { List v = ansiIndex.get(j); if (v != null) { for (Integer aIdx : v) { - ansiWidth[aIdx.intValue()] + ansiWidth[aIdx] = mtxTab[glyphIdx].getWx(); if (log.isTraceEnabled()) { log.trace("Added width " + mtxTab[glyphIdx].getWx() + " uni: " + j - + " ansi: " + aIdx.intValue()); + + " ansi: " + aIdx); } } } @@ -596,7 +596,7 @@ public abstract class OpenFont { List v = ansiIndex.get(j); if (v != null) { for (Integer aIdx : v) { - ansiWidth[aIdx.intValue()] = mtxTab[glyphIdx].getWx(); + ansiWidth[aIdx] = mtxTab[glyphIdx].getWx(); } } @@ -1633,13 +1633,13 @@ public abstract class OpenFont { for (Map.Entry e : ckpx.entrySet()) { Integer unicodeKey2 = e.getKey(); - Integer cidKey2 = unicodeToGlyph(unicodeKey2.intValue()); + Integer cidKey2 = unicodeToGlyph(unicodeKey2); Integer kern = e.getValue(); - Iterator uniMap = mtxTab[cidKey2.intValue()].getUnicodeIndex().listIterator(); + Iterator uniMap = mtxTab[cidKey2].getUnicodeIndex().listIterator(); while (uniMap.hasNext()) { Integer unicodeKey = (Integer)uniMap.next(); - Integer[] ansiKeys = unicodeToWinAnsi(unicodeKey.intValue()); + Integer[] ansiKeys = unicodeToWinAnsi(unicodeKey); for (int u = 0; u < ansiKeys.length; u++) { akpx.put(ansiKeys[u], kern); } @@ -1647,10 +1647,10 @@ public abstract class OpenFont { } if (akpx.size() > 0) { - Iterator uniMap = mtxTab[cidKey1.intValue()].getUnicodeIndex().listIterator(); + Iterator uniMap = mtxTab[cidKey1].getUnicodeIndex().listIterator(); while (uniMap.hasNext()) { Integer unicodeKey = (Integer)uniMap.next(); - Integer[] ansiKeys = unicodeToWinAnsi(unicodeKey.intValue()); + Integer[] ansiKeys = unicodeToWinAnsi(unicodeKey); for (int u = 0; u < ansiKeys.length; u++) { ansiKerningTab.put(ansiKeys[u], akpx); } diff --git a/fop-core/src/main/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java b/fop-core/src/main/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java index 6d2d68672..6eeb293a3 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java @@ -435,10 +435,10 @@ public class TTFSubSetFile extends TTFFile { Integer origIndex = glyph.getKey(); Integer subsetIndex = glyph.getValue(); - writeUShort(currentPos + subsetIndex.intValue() * 4, - mtxTab[origIndex.intValue()].getWx()); - writeUShort(currentPos + subsetIndex.intValue() * 4 + 2, - mtxTab[origIndex.intValue()].getLsb()); + writeUShort(currentPos + subsetIndex * 4, + mtxTab[origIndex].getWx()); + writeUShort(currentPos + subsetIndex * 4 + 2, + mtxTab[origIndex].getLsb()); } updateCheckSum(currentPos, hmtxSize, hmtx); diff --git a/fop-core/src/main/java/org/apache/fop/fonts/type1/AFMParser.java b/fop-core/src/main/java/org/apache/fop/fonts/type1/AFMParser.java index d4bd2d3e3..5d307edc7 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/type1/AFMParser.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/type1/AFMParser.java @@ -202,7 +202,7 @@ public class AFMParser { } Integer newParseMode = PARSE_MODE_CHANGES.get(key); if (newParseMode != null) { - parseMode = newParseMode.intValue(); + parseMode = newParseMode; } } return (AFMFile)stack.pop(); @@ -528,7 +528,7 @@ public class AFMParser { private static class IsBaseFont extends AbstractValueHandler { public void parse(String line, int startpos, Stack stack) throws IOException { - if (getBooleanValue(line, startpos).booleanValue()) { + if (getBooleanValue(line, startpos)) { throw new IOException("Only base fonts are currently supported!"); } } @@ -536,7 +536,7 @@ public class AFMParser { private static class IsCIDFont extends AbstractValueHandler { public void parse(String line, int startpos, Stack stack) throws IOException { - if (getBooleanValue(line, startpos).booleanValue()) { + if (getBooleanValue(line, startpos)) { throw new IOException("CID fonts are currently not supported!"); } } diff --git a/fop-core/src/main/java/org/apache/fop/fonts/type1/PostscriptParser.java b/fop-core/src/main/java/org/apache/fop/fonts/type1/PostscriptParser.java index bc984fecd..a3bfea8a9 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/type1/PostscriptParser.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/type1/PostscriptParser.java @@ -244,7 +244,7 @@ public class PostscriptParser { private void parseToken(int pos) throws UnsupportedEncodingException { byte[] bytesToken = new byte[token.size()]; for (int i = 0; i < token.size(); i++) { - bytesToken[i] = token.get(i).byteValue(); + bytesToken[i] = token.get(i); } parseToken(new String(bytesToken, "ASCII"), pos); token.clear(); diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java index 05e6f1c2b..3ee6f53b1 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java @@ -536,7 +536,7 @@ class RowPainter { * @return its y-offset on the page */ private int getRowOffset(int rowIndex) { - return ((Integer) rowOffsets.get(rowIndex - firstRowIndex)).intValue(); + return (Integer) rowOffsets.get(rowIndex - firstRowIndex); } // TODO get rid of that diff --git a/fop-core/src/main/java/org/apache/fop/render/PrintRenderer.java b/fop-core/src/main/java/org/apache/fop/render/PrintRenderer.java index 0bff5fc49..a2e76b7e3 100644 --- a/fop-core/src/main/java/org/apache/fop/render/PrintRenderer.java +++ b/fop-core/src/main/java/org/apache/fop/render/PrintRenderer.java @@ -116,7 +116,7 @@ public abstract class PrintRenderer extends AbstractRenderer { */ protected Font getFontFromArea(Area area) { FontTriplet triplet = (FontTriplet)area.getTrait(Trait.FONT); - int size = ((Integer)area.getTrait(Trait.FONT_SIZE)).intValue(); + int size = (Integer) area.getTrait(Trait.FONT_SIZE); return fontInfo.getFontInstance(triplet, size); } diff --git a/fop-core/src/main/java/org/apache/fop/render/RendererContext.java b/fop-core/src/main/java/org/apache/fop/render/RendererContext.java index 8d62be570..c7f13eefa 100644 --- a/fop-core/src/main/java/org/apache/fop/render/RendererContext.java +++ b/fop-core/src/main/java/org/apache/fop/render/RendererContext.java @@ -151,22 +151,22 @@ public class RendererContext { /** @return the currentXPosition */ public int getCurrentXPosition() { - return ((Integer)context.getProperty(RendererContextConstants.XPOS)).intValue(); + return (Integer) context.getProperty(RendererContextConstants.XPOS); } /** @return the currentYPosition */ public int getCurrentYPosition() { - return ((Integer)context.getProperty(RendererContextConstants.YPOS)).intValue(); + return (Integer) context.getProperty(RendererContextConstants.YPOS); } /** @return the width of the image */ public int getWidth() { - return ((Integer)context.getProperty(RendererContextConstants.WIDTH)).intValue(); + return (Integer) context.getProperty(RendererContextConstants.WIDTH); } /** @return the height of the image */ public int getHeight() { - return ((Integer)context.getProperty(RendererContextConstants.HEIGHT)).intValue(); + return (Integer) context.getProperty(RendererContextConstants.HEIGHT); } /** @return the foreign attributes */ diff --git a/fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererContext.java b/fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererContext.java index cd00a078b..c05666863 100644 --- a/fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererContext.java +++ b/fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererContext.java @@ -54,10 +54,10 @@ public class AFPRendererContext extends RendererContext { */ public AFPInfo getInfo() { AFPInfo info = new AFPInfo(); - info.setWidth(((Integer)getProperty(RendererContextConstants.WIDTH)).intValue()); - info.setHeight(((Integer)getProperty(RendererContextConstants.HEIGHT)).intValue()); - info.setX(((Integer)getProperty(RendererContextConstants.XPOS)).intValue()); - info.setY(((Integer)getProperty(RendererContextConstants.YPOS)).intValue()); + info.setWidth((Integer) getProperty(RendererContextConstants.WIDTH)); + info.setHeight((Integer) getProperty(RendererContextConstants.HEIGHT)); + info.setX((Integer) getProperty(RendererContextConstants.XPOS)); + info.setY((Integer) getProperty(RendererContextConstants.YPOS)); info.setHandlerConfiguration((Configuration)getProperty( RendererContextConstants.HANDLER_CONFIGURATION)); info.setFontInfo((org.apache.fop.fonts.FontInfo)getProperty( diff --git a/fop-core/src/main/java/org/apache/fop/render/intermediate/AbstractIFPainter.java b/fop-core/src/main/java/org/apache/fop/render/intermediate/AbstractIFPainter.java index 929d786ea..cbe883d3c 100644 --- a/fop-core/src/main/java/org/apache/fop/render/intermediate/AbstractIFPainter.java +++ b/fop-core/src/main/java/org/apache/fop/render/intermediate/AbstractIFPainter.java @@ -432,13 +432,13 @@ public abstract class AbstractIFPainter implements state.setFontStyle(style); } if (weight != null) { - state.setFontWeight(weight.intValue()); + state.setFontWeight(weight); } if (variant != null) { state.setFontVariant(variant); } if (size != null) { - state.setFontSize(size.intValue()); + state.setFontSize(size); } if (color != null) { state.setTextColor(color); diff --git a/fop-core/src/main/java/org/apache/fop/render/intermediate/IFRenderer.java b/fop-core/src/main/java/org/apache/fop/render/intermediate/IFRenderer.java index 6ba21f591..692e08398 100644 --- a/fop-core/src/main/java/org/apache/fop/render/intermediate/IFRenderer.java +++ b/fop-core/src/main/java/org/apache/fop/render/intermediate/IFRenderer.java @@ -956,7 +956,7 @@ public class IFRenderer extends AbstractPathOrientedRenderer { boolean idRefOK = idRef != null && idRef.length() > 0; if (pvKeyOK && idRefOK) { Integer pageIndex = (Integer)pageIndices.get(pvKey); - action = getGoToActionForID(idRef, (pageIndex != null ? pageIndex.intValue() : -1)); + action = getGoToActionForID(idRef, (pageIndex != null ? pageIndex : -1)); } else { //Warnings already issued by AreaTreeHandler } @@ -1038,7 +1038,7 @@ public class IFRenderer extends AbstractPathOrientedRenderer { beginTextObject(); String fontName = getInternalFontNameForArea(text); - int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue(); + int size = (Integer) text.getTrait(Trait.FONT_SIZE); StructureTreeElement structElem = (StructureTreeElement) text.getTrait(Trait.STRUCTURE_TREE_ELEMENT); establishStructureTreeElement(structElem); diff --git a/fop-core/src/main/java/org/apache/fop/render/intermediate/IFSerializer.java b/fop-core/src/main/java/org/apache/fop/render/intermediate/IFSerializer.java index 395e79719..91290c481 100644 --- a/fop-core/src/main/java/org/apache/fop/render/intermediate/IFSerializer.java +++ b/fop-core/src/main/java/org/apache/fop/render/intermediate/IFSerializer.java @@ -728,9 +728,9 @@ implements IFConstants, IFPainter, IFDocumentNavigationHandler { } } if (weight != null) { - changed = (weight.intValue() != state.getFontWeight()); + changed = (weight != state.getFontWeight()); if (changed) { - state.setFontWeight(weight.intValue()); + state.setFontWeight(weight); addAttribute(atts, "weight", weight.toString()); } } @@ -742,9 +742,9 @@ implements IFConstants, IFPainter, IFDocumentNavigationHandler { } } if (size != null) { - changed = (size.intValue() != state.getFontSize()); + changed = (size != state.getFontSize()); if (changed) { - state.setFontSize(size.intValue()); + state.setFontSize(size); addAttribute(atts, "size", size.toString()); } } diff --git a/fop-core/src/main/java/org/apache/fop/render/java2d/Java2DSVGHandler.java b/fop-core/src/main/java/org/apache/fop/render/java2d/Java2DSVGHandler.java index b4347070d..f257ff10a 100644 --- a/fop-core/src/main/java/org/apache/fop/render/java2d/Java2DSVGHandler.java +++ b/fop-core/src/main/java/org/apache/fop/render/java2d/Java2DSVGHandler.java @@ -69,10 +69,10 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler public static Java2DInfo getJava2DInfo(RendererContext context) { Java2DInfo pdfi = new Java2DInfo(); pdfi.state = (Java2DGraphicsState)context.getProperty(JAVA2D_STATE); - pdfi.width = ((Integer)context.getProperty(WIDTH)).intValue(); - pdfi.height = ((Integer)context.getProperty(HEIGHT)).intValue(); - pdfi.currentXPosition = ((Integer)context.getProperty(XPOS)).intValue(); - pdfi.currentYPosition = ((Integer)context.getProperty(YPOS)).intValue(); + pdfi.width = (Integer) context.getProperty(WIDTH); + pdfi.height = (Integer) context.getProperty(HEIGHT); + pdfi.currentXPosition = (Integer) context.getProperty(XPOS); + pdfi.currentYPosition = (Integer) context.getProperty(YPOS); Map foreign = (Map)context.getProperty(RendererContextConstants.FOREIGN_ATTRIBUTES); pdfi.paintAsBitmap = ImageHandlerUtil.isConversionModeBitmap(foreign); return pdfi; diff --git a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java index e870b3469..4ad9ee333 100644 --- a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java +++ b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFRenderingUtil.java @@ -766,9 +766,9 @@ class PDFRenderingUtil { private static boolean booleanValueOf(Object obj) { if (obj instanceof Boolean) { - return ((Boolean)obj).booleanValue(); + return (Boolean) obj; } else if (obj instanceof String) { - return Boolean.valueOf((String)obj).booleanValue(); + return Boolean.valueOf((String) obj); } else { throw new IllegalArgumentException("Boolean or \"true\" or \"false\" expected."); } diff --git a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFSVGHandler.java b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFSVGHandler.java index 3899e40e7..70a1ad800 100644 --- a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFSVGHandler.java +++ b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFSVGHandler.java @@ -62,13 +62,13 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler pdfi.pdfPage = (PDFPage)context.getProperty(PDF_PAGE); pdfi.pdfContext = (PDFResourceContext)context.getProperty(PDF_CONTEXT); //pdfi.currentStream = (PDFStream)context.getProperty(PDF_STREAM); - pdfi.width = ((Integer)context.getProperty(WIDTH)).intValue(); - pdfi.height = ((Integer)context.getProperty(HEIGHT)).intValue(); + pdfi.width = (Integer) context.getProperty(WIDTH); + pdfi.height = (Integer) context.getProperty(HEIGHT); pdfi.fi = (FontInfo)context.getProperty(PDF_FONT_INFO); pdfi.currentFontName = (String)context.getProperty(PDF_FONT_NAME); - pdfi.currentFontSize = ((Integer)context.getProperty(PDF_FONT_SIZE)).intValue(); - pdfi.currentXPosition = ((Integer)context.getProperty(XPOS)).intValue(); - pdfi.currentYPosition = ((Integer)context.getProperty(YPOS)).intValue(); + pdfi.currentFontSize = (Integer) context.getProperty(PDF_FONT_SIZE); + pdfi.currentXPosition = (Integer) context.getProperty(XPOS); + pdfi.currentYPosition = (Integer) context.getProperty(YPOS); pdfi.cfg = (Configuration)context.getProperty(HANDLER_CONFIGURATION); Map foreign = (Map)context.getProperty(RendererContextConstants.FOREIGN_ATTRIBUTES); pdfi.paintAsBitmap = ImageHandlerUtil.isConversionModeBitmap(foreign); diff --git a/fop-core/src/main/java/org/apache/fop/render/print/PageableRenderer.java b/fop-core/src/main/java/org/apache/fop/render/print/PageableRenderer.java index 7a6f89b9c..1e79d7632 100644 --- a/fop-core/src/main/java/org/apache/fop/render/print/PageableRenderer.java +++ b/fop-core/src/main/java/org/apache/fop/render/print/PageableRenderer.java @@ -123,11 +123,11 @@ public class PageableRenderer extends Java2DRenderer implements Pageable { protected int getPositiveInteger(Object o) { if (o instanceof Integer) { Integer i = (Integer)o; - if (i.intValue() < 1) { + if (i < 1) { throw new IllegalArgumentException( "Value must be a positive Integer"); } - return i.intValue(); + return i; } else if (o instanceof String) { return Integer.parseInt((String)o); } else { diff --git a/fop-core/src/main/java/org/apache/fop/render/ps/PSDocumentHandler.java b/fop-core/src/main/java/org/apache/fop/render/ps/PSDocumentHandler.java index 1bf57e23b..62c7ffeb8 100644 --- a/fop-core/src/main/java/org/apache/fop/render/ps/PSDocumentHandler.java +++ b/fop-core/src/main/java/org/apache/fop/render/ps/PSDocumentHandler.java @@ -332,7 +332,7 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { gen.getResourceTracker().notifyResourceUsageOnPage(PSProcSets.STD_PROCSET); gen.writeDSCComment(DSCConstants.PAGE, new Object[] {name, - Integer.valueOf(this.currentPageNumber)}); + this.currentPageNumber}); double pageWidth = size.width / 1000.0; double pageHeight = size.height / 1000.0; @@ -383,20 +383,20 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { if (rotate) { pageBoundingBox.setRect(0, 0, pageHeight, pageWidth); gen.writeDSCComment(DSCConstants.PAGE_BBOX, new Object[] { - zero, zero, Long.valueOf(Math.round(pageHeight)), - Long.valueOf(Math.round(pageWidth)) }); + zero, zero, Math.round(pageHeight), + Math.round(pageWidth)}); gen.writeDSCComment(DSCConstants.PAGE_HIRES_BBOX, new Object[] { - zero, zero, Double.valueOf(pageHeight), - Double.valueOf(pageWidth) }); + zero, zero, pageHeight, + pageWidth}); gen.writeDSCComment(DSCConstants.PAGE_ORIENTATION, "Landscape"); } else { pageBoundingBox.setRect(0, 0, pageWidth, pageHeight); gen.writeDSCComment(DSCConstants.PAGE_BBOX, new Object[] { - zero, zero, Long.valueOf(Math.round(pageWidth)), - Long.valueOf(Math.round(pageHeight)) }); + zero, zero, Math.round(pageWidth), + Math.round(pageHeight)}); gen.writeDSCComment(DSCConstants.PAGE_HIRES_BBOX, new Object[] { - zero, zero, Double.valueOf(pageWidth), - Double.valueOf(pageHeight) }); + zero, zero, pageWidth, + pageHeight}); if (psUtil.isAutoRotateLandscape()) { gen.writeDSCComment(DSCConstants.PAGE_ORIENTATION, "Portrait"); diff --git a/fop-core/src/main/java/org/apache/fop/render/ps/PSRenderingUtil.java b/fop-core/src/main/java/org/apache/fop/render/ps/PSRenderingUtil.java index 47e46da02..cae8a0440 100644 --- a/fop-core/src/main/java/org/apache/fop/render/ps/PSRenderingUtil.java +++ b/fop-core/src/main/java/org/apache/fop/render/ps/PSRenderingUtil.java @@ -90,9 +90,9 @@ public class PSRenderingUtil { private boolean booleanValueOf(Object obj) { if (obj instanceof Boolean) { - return ((Boolean)obj).booleanValue(); + return (Boolean) obj; } else if (obj instanceof String) { - return Boolean.valueOf((String)obj).booleanValue(); + return Boolean.valueOf((String) obj); } else { throw new IllegalArgumentException("Boolean or \"true\" or \"false\" expected."); } @@ -100,7 +100,7 @@ public class PSRenderingUtil { private int intValueOf(Object obj) { if (obj instanceof Integer) { - return ((Integer)obj).intValue(); + return (Integer) obj; } else if (obj instanceof String) { return Integer.parseInt((String)obj); } else { diff --git a/fop-core/src/main/java/org/apache/fop/render/ps/PSSVGHandler.java b/fop-core/src/main/java/org/apache/fop/render/ps/PSSVGHandler.java index 5e3fa1ca5..ad8af8a49 100644 --- a/fop-core/src/main/java/org/apache/fop/render/ps/PSSVGHandler.java +++ b/fop-core/src/main/java/org/apache/fop/render/ps/PSSVGHandler.java @@ -72,10 +72,10 @@ public class PSSVGHandler extends AbstractGenericSVGHandler PSInfo psi = new PSInfo(); psi.psGenerator = (PSGenerator)context.getProperty(PS_GENERATOR); psi.fontInfo = (org.apache.fop.fonts.FontInfo) context.getProperty(PS_FONT_INFO); - psi.width = ((Integer)context.getProperty(WIDTH)).intValue(); - psi.height = ((Integer)context.getProperty(HEIGHT)).intValue(); - psi.currentXPosition = ((Integer)context.getProperty(XPOS)).intValue(); - psi.currentYPosition = ((Integer)context.getProperty(YPOS)).intValue(); + psi.width = (Integer) context.getProperty(WIDTH); + psi.height = (Integer) context.getProperty(HEIGHT); + psi.currentXPosition = (Integer) context.getProperty(XPOS); + psi.currentYPosition = (Integer) context.getProperty(YPOS); psi.cfg = (Configuration)context.getProperty(HANDLER_CONFIGURATION); return psi; } diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/FOPRtfAttributes.java b/fop-core/src/main/java/org/apache/fop/render/rtf/FOPRtfAttributes.java index 3ffed6ba0..613ec407e 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/FOPRtfAttributes.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/FOPRtfAttributes.java @@ -78,7 +78,7 @@ public class FOPRtfAttributes extends RtfAttributes { int greenComponent = color.getGreen(); int blueComponent = color.getBlue(); set(name, RtfColorTable.getInstance().getColorNumber( - redComponent, greenComponent, blueComponent).intValue()); + redComponent, greenComponent, blueComponent)); return this; } diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/FoUnitsConverter.java b/fop-core/src/main/java/org/apache/fop/render/rtf/FoUnitsConverter.java index 394784197..154bee0c0 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/FoUnitsConverter.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/FoUnitsConverter.java @@ -101,7 +101,7 @@ final class FoUnitsConverter { // convert number to integer try { if (number != null && number.trim().length() > 0) { - result = Float.valueOf(number).floatValue(); + result = Float.valueOf(number); } } catch (Exception e) { throw new FOPException("number format error: cannot convert '" @@ -114,7 +114,7 @@ final class FoUnitsConverter { if (factor == null) { throw new FOPException("conversion factor not found for '" + units + "' units"); } - result *= factor.floatValue(); + result *= factor; } return result; @@ -132,7 +132,7 @@ final class FoUnitsConverter { float result = 0; size = size.substring(0, size.length() - sFONTSUFFIX.length()); try { - result = (Float.valueOf(size).floatValue()); + result = (Float.valueOf(size)); } catch (Exception e) { throw new FOPException("Invalid font size value '" + size + "'"); } diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/PageAttributesConverter.java b/fop-core/src/main/java/org/apache/fop/render/rtf/PageAttributesConverter.java index 360e5c1df..b2c4b3dd1 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/PageAttributesConverter.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/PageAttributesConverter.java @@ -67,7 +67,7 @@ final class PageAttributesConverter { Object widthRaw = attrib.getValue(RtfPage.PAGE_WIDTH); Object heightRaw = attrib.getValue(RtfPage.PAGE_HEIGHT); if ((widthRaw instanceof Integer) && (heightRaw instanceof Integer) - && ((Integer) widthRaw).intValue() > ((Integer) heightRaw).intValue()) { + && (Integer) widthRaw > (Integer) heightRaw) { attrib.set(RtfPage.LANDSCAPE); } diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/RTFHandler.java b/fop-core/src/main/java/org/apache/fop/render/rtf/RTFHandler.java index aa39b111c..052c6fc26 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/RTFHandler.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/RTFHandler.java @@ -249,8 +249,8 @@ public class RTFHandler extends FOEventHandler { int useAblePageWidth = pagemaster.getPageWidth().getValue() - pagemaster.getCommonMarginBlock().marginLeft.getValue() - pagemaster.getCommonMarginBlock().marginRight.getValue() - - sect.getRtfAttributes().getValueAsInteger(RtfPage.MARGIN_LEFT).intValue() - - sect.getRtfAttributes().getValueAsInteger(RtfPage.MARGIN_RIGHT).intValue(); + - sect.getRtfAttributes().getValueAsInteger(RtfPage.MARGIN_LEFT) + - sect.getRtfAttributes().getValueAsInteger(RtfPage.MARGIN_RIGHT); percentManager.setDimension(pageSeq, useAblePageWidth); bHeaderSpecified = false; @@ -778,7 +778,7 @@ public class RTFHandler extends FOEventHandler { //while the current column is in row-spanning, act as if //a vertical merged cell would have been specified. while (tctx.getNumberOfColumns() > tctx.getColumnIndex() - && tctx.getColumnRowSpanningNumber().intValue() > 0) { + && tctx.getColumnRowSpanningNumber() > 0) { RtfTableCell vCell = row.newTableCellMergedVertically( (int)tctx.getColumnWidth(), tctx.getColumnRowSpanningAttrs()); @@ -819,7 +819,7 @@ public class RTFHandler extends FOEventHandler { //while the current column is in row-spanning, act as if //a vertical merged cell would have been specified. while (tctx.getNumberOfColumns() > tctx.getColumnIndex() - && tctx.getColumnRowSpanningNumber().intValue() > 0) { + && tctx.getColumnRowSpanningNumber() > 0) { RtfTableCell vCell = row.newTableCellMergedVertically( (int)tctx.getColumnWidth(), tctx.getColumnRowSpanningAttrs()); diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/TextAttributesConverter.java b/fop-core/src/main/java/org/apache/fop/render/rtf/TextAttributesConverter.java index d3810b094..8c0d252a5 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/TextAttributesConverter.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/TextAttributesConverter.java @@ -529,6 +529,6 @@ final class TextAttributesConverter { int greenComponent = fopColor.getGreen(); int blueComponent = fopColor.getBlue(); return RtfColorTable.getInstance().getColorNumber(redComponent, - greenComponent, blueComponent).intValue(); + greenComponent, blueComponent); } } diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java index b777d5816..57918f04c 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java @@ -59,7 +59,7 @@ public class RtfAttributes implements Cloneable { if (value == null) { set(name); } else { - set(name, value.intValue()); + set(name, value); } } else if (attrs.getValue(name) instanceof String) { String value = (String)attrs.getValue(name); @@ -234,7 +234,7 @@ public class RtfAttributes implements Cloneable { */ public void addIntegerValue(int addValue, String name) { Integer value = (Integer) getValue(name); - int v = (value != null) ? value.intValue() : 0; + int v = (value != null) ? value : 0; set(name, v + addValue); } } diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java index a849fea43..605db7150 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java @@ -96,14 +96,14 @@ public final class RtfColorTable { * Initialize the color table. */ private void init() { - addNamedColor("black", getColorNumber(0, 0, 0).intValue()); - addNamedColor("white", getColorNumber(255, 255, 255).intValue()); - addNamedColor("red", getColorNumber(255, 0, 0).intValue()); - addNamedColor("green", getColorNumber(0, 255, 0).intValue()); - addNamedColor("blue", getColorNumber(0, 0, 255).intValue()); - addNamedColor("cyan", getColorNumber(0, 255, 255).intValue()); - addNamedColor("magenta", getColorNumber(255, 0, 255).intValue()); - addNamedColor("yellow", getColorNumber(255, 255, 0).intValue()); + addNamedColor("black", getColorNumber(0, 0, 0)); + addNamedColor("white", getColorNumber(255, 255, 255)); + addNamedColor("red", getColorNumber(255, 0, 0)); + addNamedColor("green", getColorNumber(0, 255, 0)); + addNamedColor("blue", getColorNumber(0, 0, 255)); + addNamedColor("cyan", getColorNumber(0, 255, 255)); + addNamedColor("magenta", getColorNumber(255, 0, 255)); + addNamedColor("yellow", getColorNumber(255, 255, 0)); getColorNumber(0, 0, 128); getColorNumber(0, 128, 128); @@ -115,7 +115,7 @@ public final class RtfColorTable { // Added by Normand Masse // Gray color added - addNamedColor("gray", getColorNumber(128, 128, 128).intValue()); + addNamedColor("gray", getColorNumber(128, 128, 128)); getColorNumber(192, 192, 192); } @@ -163,7 +163,7 @@ public final class RtfColorTable { //The color was found. Before returning the index, increment //it by one. Because index 0 is reserved for auto-colored, but //is not contained in colorTable. - retVal = ((Integer) o).intValue() + 1; + retVal = (Integer) o + 1; } return retVal; @@ -192,7 +192,7 @@ public final class RtfColorTable { int len = colorTable.size(); for (int i = 0; i < len; i++) { - int identifier = ((Integer) colorTable.get(i)).intValue(); + int identifier = (Integer) colorTable.get(i); header.newLine(); header.write("\\red" + determineColorLevel(identifier, RED)); diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java index a36c989dc..2b4e8eba5 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java @@ -122,7 +122,7 @@ public final class RtfFontManager { retVal = fontTable.size() - 1; } else { - retVal = ((Integer)o).intValue(); + retVal = (Integer) o; } return retVal; diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java index 11feb951c..67945e3a1 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java @@ -91,7 +91,7 @@ extends RtfContainer { Object heightRaw = attrib.getValue(PAGE_HEIGHT); if ((widthRaw instanceof Integer) && (heightRaw instanceof Integer) - && ((Integer) widthRaw).intValue() > ((Integer) heightRaw).intValue()) { + && (Integer) widthRaw > (Integer) heightRaw) { writeControlWord(LANDSCAPE); } } diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceSplitter.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceSplitter.java index 2db0dd128..2e6b7fd62 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceSplitter.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceSplitter.java @@ -73,7 +73,7 @@ public class RtfSpaceSplitter { } commonAttributes.unset(key); - return i.intValue(); + return i; } /** @return attributes, applicable to whole block. */ diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java index 9649fb7fc..b805f1310 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java @@ -120,11 +120,11 @@ public final class RtfStringConverter { sb.append('\\'); sb.append(replacement); sb.append(' '); - } else if (c.charValue() > 127) { + } else if (c > 127) { // write unicode representation - contributed by Michel Jacobson // sb.append("\\u"); - sb.append(Integer.toString((int)c.charValue())); + sb.append(Integer.toString((int) c)); sb.append("\\\'3f"); } else { // plain char that is understood by RTF natively diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java index dded727fc..e3f7ce3c3 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java @@ -178,7 +178,7 @@ public final class RtfStyleSheetTable { } // Adds the attributes to default attributes, if not available in default attributes - attr.set("cs", style.intValue()); + attr.set("cs", style); Object o = attrTable.get(name); if (o != null) { @@ -191,7 +191,7 @@ public final class RtfStyleSheetTable { if (i == null) { attr.set(attrName); } else { - attr.set(attrName, i.intValue()); + attr.set(attrName, i); } } } diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java index aecf30dce..874873bc6 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java @@ -201,7 +201,7 @@ public class RtfTable extends RtfContainer { isNestedTable = Boolean.FALSE; } else { - return isNestedTable.booleanValue(); + return isNestedTable; } return false; diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java index 5bafb5841..5203d0a79 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java @@ -231,7 +231,7 @@ public class RtfTableCell int iCurrentWidth = this.cellWidth; if (attrib.getValue("number-columns-spanned") != null) { // Get the number of columns spanned - int nbMergedCells = ((Integer)attrib.getValue("number-columns-spanned")).intValue(); + int nbMergedCells = (Integer) attrib.getValue("number-columns-spanned"); RtfTable tab = getRow().getTable(); diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java index 8dd58739c..10039e40d 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java @@ -193,7 +193,7 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { final Object leftIndent = attrib.getValue(ITableAttributes.ATTR_ROW_LEFT_INDENT); if (leftIndent != null) { - xPos = ((Integer)leftIndent).intValue(); + xPos = (Integer) leftIndent; } RtfAttributes tableBorderAttributes = getTable().getBorderAttributes(); @@ -342,11 +342,11 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes { // set (RTF 1.5) gaph to the average of the (RTF 1.6) left and right padding values final Integer leftPadStr = (Integer)attrib.getValue(ATTR_ROW_PADDING_LEFT); if (leftPadStr != null) { - gaph = leftPadStr.intValue(); + gaph = leftPadStr; } final Integer rightPadStr = (Integer)attrib.getValue(ATTR_ROW_PADDING_RIGHT); if (rightPadStr != null) { - gaph = (gaph + rightPadStr.intValue()) / 2; + gaph = (gaph + rightPadStr) / 2; } } catch (Exception e) { final String msg = "RtfTableRow.writePaddingAttributes: " + e.toString(); diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java index 4410eb17f..aa1b226f6 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java @@ -291,7 +291,7 @@ public class RtfTextrun extends RtfContainer { setChildren(children); par = new RtfParagraphBreak(this, writer); for (int i = 0; i < deletedCloseGroupCount; i++) { - addCloseGroupMark(((Integer)tmp.pop()).intValue()); + addCloseGroupMark((Integer) tmp.pop()); } } return par; diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java index a9558aad3..4247dc249 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/tools/PercentContext.java @@ -86,12 +86,12 @@ public class PercentContext implements PercentBaseContext { case LengthBase.TABLE_UNITS: Object unit = tableUnitMap.get(fobj); if (unit != null) { - return ((Integer)unit).intValue(); + return (Integer) unit; } else if (fobj.getParent() != null) { // If the object itself has no width the parent width will be used unit = tableUnitMap.get(fobj.getParent()); if (unit != null) { - return ((Integer)unit).intValue(); + return (Integer) unit; } } return 0; @@ -151,7 +151,7 @@ public class PercentContext implements PercentBaseContext { public void setDimension(FObj fobj) { if (baseWidthSet) { Integer width = findParent(fobj.getParent()); - if (width.intValue() != -1) { + if (width != -1) { lengthMap.put(fobj, width); } } diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java index 74cc20bf5..4b7850d0b 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java @@ -125,7 +125,7 @@ public class TableContext implements ITableColumnsInfo { */ public boolean getFirstSpanningCol() { Boolean b = (Boolean) colFirstSpanningCol.get(colIndex); - return b.booleanValue(); + return b; } /** @@ -194,13 +194,13 @@ public class TableContext implements ITableColumnsInfo { for (int z = 0; z < colRowSpanningNumber.size(); ++z) { Integer i = (Integer)colRowSpanningNumber.get(z); - if (i.intValue() > 0) { - i = i.intValue() - 1; + if (i > 0) { + i = i - 1; } colRowSpanningNumber.set(z, i); - if (i.intValue() == 0) { + if (i == 0) { colRowSpanningAttrs.set(z, null); colFirstSpanningCol.set(z, false); } @@ -241,7 +241,7 @@ public class TableContext implements ITableColumnsInfo { setNextColumnWidth(INVALID_COLUMN_WIDTH); } } - return ((Float)colWidths.get(colIndex)).floatValue(); + return (Float) colWidths.get(colIndex); } /** diff --git a/fop-core/src/main/java/org/apache/fop/render/txt/TXTRenderer.java b/fop-core/src/main/java/org/apache/fop/render/txt/TXTRenderer.java index 811906f36..0d2a7bbe7 100644 --- a/fop-core/src/main/java/org/apache/fop/render/txt/TXTRenderer.java +++ b/fop-core/src/main/java/org/apache/fop/render/txt/TXTRenderer.java @@ -246,7 +246,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer { for (int y = 0; y < pageHeight; y++) { Character c = bm.getCharacter(x, y); if (c != null) { - putChar(x, y, c.charValue(), false); + putChar(x, y, c, false); } } } diff --git a/fop-core/src/main/java/org/apache/fop/render/xml/XMLRenderer.java b/fop-core/src/main/java/org/apache/fop/render/xml/XMLRenderer.java index c50508edb..e226c88dd 100644 --- a/fop-core/src/main/java/org/apache/fop/render/xml/XMLRenderer.java +++ b/fop-core/src/main/java/org/apache/fop/render/xml/XMLRenderer.java @@ -128,7 +128,7 @@ public class XMLRenderer extends AbstractXMLRenderer { userAgent.getXMLHandlerRegistry().addXMLHandler(xmlHandler); Boolean b = (Boolean)userAgent.getRendererOptions().get("compact-format"); if (b != null) { - setCompactFormat(b.booleanValue()); + setCompactFormat(b); } } diff --git a/fop-core/src/main/java/org/apache/fop/svg/ACIUtils.java b/fop-core/src/main/java/org/apache/fop/svg/ACIUtils.java index deba98f21..a58137119 100644 --- a/fop-core/src/main/java/org/apache/fop/svg/ACIUtils.java +++ b/fop-core/src/main/java/org/apache/fop/svg/ACIUtils.java @@ -67,7 +67,7 @@ public final class ACIUtils { GVTAttributedCharacterIterator.TextAttribute.GVT_FONT_FAMILIES); String style = toStyle((Float) aci.getAttribute(TextAttribute.POSTURE)); int weight = toCSSWeight((Float) aci.getAttribute(TextAttribute.WEIGHT)); - float fontSize = ((Float) aci.getAttribute(TextAttribute.SIZE)).floatValue(); + float fontSize = (Float) aci.getAttribute(TextAttribute.SIZE); String firstFontFamily = null; //GVT_FONT can sometimes be different from the fonts in GVT_FONT_FAMILIES @@ -119,23 +119,23 @@ public final class ACIUtils { public static int toCSSWeight(Float weight) { if (weight == null) { return 400; - } else if (weight <= TextAttribute.WEIGHT_EXTRA_LIGHT.floatValue()) { + } else if (weight <= TextAttribute.WEIGHT_EXTRA_LIGHT) { return 100; - } else if (weight <= TextAttribute.WEIGHT_LIGHT.floatValue()) { + } else if (weight <= TextAttribute.WEIGHT_LIGHT) { return 200; - } else if (weight <= TextAttribute.WEIGHT_DEMILIGHT.floatValue()) { + } else if (weight <= TextAttribute.WEIGHT_DEMILIGHT) { return 300; - } else if (weight <= TextAttribute.WEIGHT_REGULAR.floatValue()) { + } else if (weight <= TextAttribute.WEIGHT_REGULAR) { return 400; - } else if (weight <= TextAttribute.WEIGHT_SEMIBOLD.floatValue()) { + } else if (weight <= TextAttribute.WEIGHT_SEMIBOLD) { return 500; - } else if (weight < TextAttribute.WEIGHT_BOLD.floatValue()) { + } else if (weight < TextAttribute.WEIGHT_BOLD) { return 600; } else if (weight == TextAttribute.WEIGHT_BOLD.floatValue()) { return 700; - } else if (weight <= TextAttribute.WEIGHT_HEAVY.floatValue()) { + } else if (weight <= TextAttribute.WEIGHT_HEAVY) { return 800; - } else if (weight <= TextAttribute.WEIGHT_EXTRABOLD.floatValue()) { + } else if (weight <= TextAttribute.WEIGHT_EXTRABOLD) { return 900; } else { return 900; @@ -143,7 +143,7 @@ public final class ACIUtils { } public static String toStyle(Float posture) { - return ((posture != null) && (posture.floatValue() > 0.0)) + return ((posture != null) && (posture > 0.0)) ? Font.STYLE_ITALIC : Font.STYLE_NORMAL; } diff --git a/fop-core/src/main/java/org/apache/fop/svg/AbstractFOPTranscoder.java b/fop-core/src/main/java/org/apache/fop/svg/AbstractFOPTranscoder.java index 430638a4b..12faa2adc 100644 --- a/fop-core/src/main/java/org/apache/fop/svg/AbstractFOPTranscoder.java +++ b/fop-core/src/main/java/org/apache/fop/svg/AbstractFOPTranscoder.java @@ -155,7 +155,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder implem //By default, enable font auto-detection if no cfg is given boolean autoFonts = getAutoFontsDefault(); if (hints.containsKey(KEY_AUTO_FONTS)) { - autoFonts = ((Boolean)hints.get(KEY_AUTO_FONTS)).booleanValue(); + autoFonts = (Boolean) hints.get(KEY_AUTO_FONTS); } if (autoFonts) { DefaultConfiguration c = new DefaultConfiguration("cfg"); @@ -212,7 +212,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder implem protected boolean isTextStroked() { boolean stroke = false; if (hints.containsKey(KEY_STROKE_TEXT)) { - stroke = ((Boolean)hints.get(KEY_STROKE_TEXT)).booleanValue(); + stroke = (Boolean) hints.get(KEY_STROKE_TEXT); } return stroke; } @@ -223,7 +223,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder implem */ protected float getDeviceResolution() { if (hints.containsKey(KEY_DEVICE_RESOLUTION)) { - return ((Float)hints.get(KEY_DEVICE_RESOLUTION)).floatValue(); + return (Float) hints.get(KEY_DEVICE_RESOLUTION); } else { return GraphicsConstants.DEFAULT_DPI; } @@ -369,7 +369,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder implem public float getPixelUnitToMillimeter() { Object key = ImageTranscoder.KEY_PIXEL_UNIT_TO_MILLIMETER; if (getTranscodingHints().containsKey(key)) { - return ((Float)getTranscodingHints().get(key)).floatValue(); + return (Float) getTranscodingHints().get(key); } else { // return 0.3528f; // 72 dpi return UnitConv.IN2MM / 96; //96dpi = 0.2645833333333333333f; diff --git a/fop-core/src/main/java/org/apache/fop/svg/PDFGraphics2D.java b/fop-core/src/main/java/org/apache/fop/svg/PDFGraphics2D.java index 41e3f7d8b..a73cdc243 100644 --- a/fop-core/src/main/java/org/apache/fop/svg/PDFGraphics2D.java +++ b/fop-core/src/main/java/org/apache/fop/svg/PDFGraphics2D.java @@ -1411,7 +1411,7 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand if (kernPair != null) { Integer width = kernPair.get(ch2); if (width != null) { - currentStream.write(endText + (-width.intValue()) + " " + startText); + currentStream.write(endText + (-width) + " " + startText); } } } diff --git a/fop-core/src/main/java/org/apache/fop/svg/font/FOPGVTGlyphVector.java b/fop-core/src/main/java/org/apache/fop/svg/font/FOPGVTGlyphVector.java index ef9adf08f..3447f4a24 100644 --- a/fop-core/src/main/java/org/apache/fop/svg/font/FOPGVTGlyphVector.java +++ b/fop-core/src/main/java/org/apache/fop/svg/font/FOPGVTGlyphVector.java @@ -124,7 +124,7 @@ public class FOPGVTGlyphVector implements GVTGlyphVector { this.language = (String) aci.getAttribute(GVTAttributedCharacterIterator.TextAttribute.LANGUAGE); Integer level = (Integer) aci.getAttribute(GVTAttributedCharacterIterator.TextAttribute.BIDI_LEVEL); if (level != null) { - this.level = level.intValue(); + this.level = level; } } } diff --git a/fop-core/src/main/java/org/apache/fop/tools/anttasks/RunTest.java b/fop-core/src/main/java/org/apache/fop/tools/anttasks/RunTest.java index 0d728ae9a..585a0a55c 100644 --- a/fop-core/src/main/java/org/apache/fop/tools/anttasks/RunTest.java +++ b/fop-core/src/main/java/org/apache/fop/tools/anttasks/RunTest.java @@ -111,7 +111,7 @@ public class RunTest extends Task { Boolean pass = (Boolean)e.getValue(); System.out.println("file: " + fname + " - reference success: " + pass); - if (pass.booleanValue()) { + if (pass) { broke = true; } } diff --git a/fop-core/src/main/java/org/apache/fop/util/XMLUtil.java b/fop-core/src/main/java/org/apache/fop/util/XMLUtil.java index b3d2c19dc..87efed670 100644 --- a/fop-core/src/main/java/org/apache/fop/util/XMLUtil.java +++ b/fop-core/src/main/java/org/apache/fop/util/XMLUtil.java @@ -47,7 +47,7 @@ public final class XMLUtil implements XMLConstants { if (s == null) { return defaultValue; } else { - return Boolean.valueOf(s).booleanValue(); + return Boolean.valueOf(s); } } diff --git a/fop-core/src/main/java/org/apache/fop/util/text/IfFieldPart.java b/fop-core/src/main/java/org/apache/fop/util/text/IfFieldPart.java index 451329f47..52c06bad1 100644 --- a/fop-core/src/main/java/org/apache/fop/util/text/IfFieldPart.java +++ b/fop-core/src/main/java/org/apache/fop/util/text/IfFieldPart.java @@ -81,7 +81,7 @@ public class IfFieldPart implements Part { protected boolean isTrue(Map params) { Object obj = params.get(fieldName); if (obj instanceof Boolean) { - return ((Boolean)obj).booleanValue(); + return (Boolean) obj; } else { return (obj != null); } diff --git a/fop-core/src/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java b/fop-core/src/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java index 27d668af6..c251ba3b2 100644 --- a/fop-core/src/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java +++ b/fop-core/src/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java @@ -3291,7 +3291,7 @@ public class TTXFile { if (gmap != null) { Integer cid = gmap.get(gid); if (cid != null) { - return cid.intValue(); + return cid; } } } diff --git a/fop-core/src/test/java/org/apache/fop/fo/flow/table/CollapsedConditionalBorderTestCase.java b/fop-core/src/test/java/org/apache/fop/fo/flow/table/CollapsedConditionalBorderTestCase.java index 2cfaeee2b..2a512cf62 100644 --- a/fop-core/src/test/java/org/apache/fop/fo/flow/table/CollapsedConditionalBorderTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/fo/flow/table/CollapsedConditionalBorderTestCase.java @@ -128,7 +128,7 @@ public class CollapsedConditionalBorderTestCase extends AbstractTableTest { private static void checkBorder(String errorMsge, BorderSpecification border, Object[] resolvedBorder) { checkBorder(errorMsge, border, - ((Integer) resolvedBorder[0]).intValue(), + (Integer) resolvedBorder[0], (Color) resolvedBorder[1]); } diff --git a/fop-core/src/test/java/org/apache/fop/fotreetest/FOTreeTestCase.java b/fop-core/src/test/java/org/apache/fop/fotreetest/FOTreeTestCase.java index 3d58e7ef0..23eb999f0 100644 --- a/fop-core/src/test/java/org/apache/fop/fotreetest/FOTreeTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/fotreetest/FOTreeTestCase.java @@ -165,7 +165,7 @@ public class FOTreeTestCase { public void processingInstruction(String target, String data) throws SAXException { if ("fop-useragent-break-indent-inheritance".equals(target)) { fopConfig.setBreakIndentInheritanceOnReferenceAreaBoundary( - Boolean.valueOf(data).booleanValue()); + Boolean.valueOf(data)); } else if ("fop-source-resolution".equals(target)) { fopConfig.setSourceResolution(Float.parseFloat(data)); } -- 2.39.5