diff options
author | Simon Steiner <ssteiner@apache.org> | 2016-09-01 13:02:29 +0000 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2016-09-01 13:02:29 +0000 |
commit | d00fbcc5807af09bfdb187f82df0474b9a6e19a4 (patch) | |
tree | 0147707d2398f5196a5f21629548d00335bbfaf4 | |
parent | cd5c4f508674e5ebbdbe872272455019d2220ca0 (diff) | |
download | xmlgraphics-fop-d00fbcc5807af09bfdb187f82df0474b9a6e19a4.tar.gz xmlgraphics-fop-d00fbcc5807af09bfdb187f82df0474b9a6e19a4.zip |
FOP-2643: Java 9 warnings
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1758773 13f79535-47bb-0310-9956-ffa450edef68
97 files changed, 347 insertions, 347 deletions
diff --git a/fop-core/src/main/codegen/fonts/font-file.xsl b/fop-core/src/main/codegen/fonts/font-file.xsl index 37010a826..ff7ced9b4 100644 --- a/fop-core/src/main/codegen/fonts/font-file.xsl +++ b/fop-core/src/main/codegen/fonts/font-file.xsl @@ -235,7 +235,7 @@ public class <xsl:value-of select="class-name"/> extends Base14Font { boundingBoxes[0x<xsl:value-of select="$char-num"/>] = new Rectangle(<xsl:value-of select="@llx"/>, <xsl:value-of select="@lly"/>, <xsl:value-of select="@urx - @llx"/>, <xsl:value-of select="@ury - @lly"/>);</xsl:if></xsl:template> <xsl:template match="kerning"> - first = new Integer(<xsl:value-of select="@kpx1"/>); + first = <xsl:value-of select="@kpx1"/>; pairs = (Map)kerning.get(first); if (pairs == null) { pairs = new java.util.HashMap(); @@ -244,8 +244,8 @@ public class <xsl:value-of select="class-name"/> extends Base14Font { <xsl:apply-templates select="pair"/></xsl:template> <xsl:template match="pair"> - second = new Integer(<xsl:value-of select="@kpx2"/>); - pairs.put(second, new Integer(<xsl:value-of select="@kern"/>)); + second = <xsl:value-of select="@kpx2"/>; + pairs.put(second, <xsl:value-of select="@kern"/>); </xsl:template> </xsl:stylesheet> 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 aea97cb7d..2ec844ac2 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 @@ -39,7 +39,7 @@ public class AFPResourceLevelDefaults { } private static void registerResourceTypeName(String name, byte type) { - RESOURCE_TYPE_NAMES.put(name.toLowerCase(), new Byte(type)); + RESOURCE_TYPE_NAMES.put(name.toLowerCase(), type); } private static byte getResourceType(String resourceTypeName) { @@ -77,7 +77,7 @@ public class AFPResourceLevelDefaults { * @param level the resource level */ public void setDefaultResourceLevel(byte type, AFPResourceLevel level) { - this.defaultResourceLevels.put(new Byte(type), level); + this.defaultResourceLevels.put(type, level); } /** @@ -86,7 +86,7 @@ public class AFPResourceLevelDefaults { * @return the default resource level */ public AFPResourceLevel getDefaultResourceLevel(byte type) { - AFPResourceLevel result = (AFPResourceLevel)this.defaultResourceLevels.get(new Byte(type)); + AFPResourceLevel result = (AFPResourceLevel)this.defaultResourceLevels.get(type); if (result == null) { result = AFPResourceInfo.DEFAULT_LEVEL; } 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 b587ef3cd..9f9c5ed95 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 @@ -62,7 +62,7 @@ public class RasterFont extends AFPFont { */ public void addCharacterSet(int size, CharacterSet characterSet) { //TODO: replace with Integer.valueOf() once we switch to Java 5 - this.charSets.put(new Integer(size), characterSet); + this.charSets.put(size, characterSet); this.charSet = characterSet; } @@ -74,7 +74,7 @@ public class RasterFont extends AFPFont { */ public CharacterSet getCharacterSet(int sizeInMpt) { - Integer requestedSize = Integer.valueOf(sizeInMpt); + Integer requestedSize = sizeInMpt; CharacterSet csm = charSets.get(requestedSize); double sizeInPt = sizeInMpt / 1000.0; @@ -101,9 +101,9 @@ public class RasterFont extends AFPFont { Integer fontSize; if (!smallerSizes.isEmpty() && (sizeInMpt - smallerSize) <= (largerSize - sizeInMpt)) { - fontSize = Integer.valueOf(smallerSize); + fontSize = smallerSize; } else { - fontSize = Integer.valueOf(largerSize); + fontSize = largerSize; } csm = charSets.get(fontSize); diff --git a/fop-core/src/main/java/org/apache/fop/area/AreaTreeParser.java b/fop-core/src/main/java/org/apache/fop/area/AreaTreeParser.java index 640f04335..7e32b8d8c 100644 --- a/fop-core/src/main/java/org/apache/fop/area/AreaTreeParser.java +++ b/fop-core/src/main/java/org/apache/fop/area/AreaTreeParser.java @@ -1085,7 +1085,7 @@ public class AreaTreeParser { if (value != null) { Class cl = Trait.getTraitClass(trait); if (cl == Integer.class) { - area.addTrait(trait, new Integer(value)); + area.addTrait(trait, Integer.valueOf(value)); } else if (cl == Boolean.class) { area.addTrait(trait, Boolean.valueOf(value)); } else if (cl == String.class) { diff --git a/fop-core/src/main/java/org/apache/fop/area/Trait.java b/fop-core/src/main/java/org/apache/fop/area/Trait.java index 2d733022e..51bf5cad0 100644 --- a/fop-core/src/main/java/org/apache/fop/area/Trait.java +++ b/fop-core/src/main/java/org/apache/fop/area/Trait.java @@ -48,7 +48,7 @@ public final class Trait implements Serializable { } /** Id reference line, not resolved. (not sure if this is needed.) */ - //public static final Integer ID_LINK = new Integer(0); + //public static final Integer ID_LINK = Integer.valueOf(0); /** * Internal link trait. @@ -84,10 +84,10 @@ public final class Trait implements Serializable { public static final Integer LINETHROUGH = 12; /** Shadow offset. */ - //public static final Integer OFFSET = new Integer(13); + //public static final Integer OFFSET = Integer.valueOf(13); /** The shadow for text. */ - //public static final Integer SHADOW = new Integer(14); + //public static final Integer SHADOW = Integer.valueOf(14); /** The border start. */ public static final Integer BORDER_START = 15; @@ -120,10 +120,10 @@ public final class Trait implements Serializable { public static final Integer SPACE_END = 24; /** break before */ - //public static final Integer BREAK_BEFORE = new Integer(25); + //public static final Integer BREAK_BEFORE = Integer.valueOf(25); /** break after */ - //public static final Integer BREAK_AFTER = new Integer(26); + //public static final Integer BREAK_AFTER = Integer.valueOf(26); /** The start-indent trait. */ public static final Integer START_INDENT = 27; diff --git a/fop-core/src/main/java/org/apache/fop/cli/CommandLineOptions.java b/fop-core/src/main/java/org/apache/fop/cli/CommandLineOptions.java index 6932333ea..8bc16fec4 100644 --- a/fop-core/src/main/java/org/apache/fop/cli/CommandLineOptions.java +++ b/fop-core/src/main/java/org/apache/fop/cli/CommandLineOptions.java @@ -602,11 +602,11 @@ public class CommandLineOptions { for (int j = 0; j < parts.length; j++) { String s = parts[j]; if (s.matches("\\d+")) { - renderingOptions.put(PrintRenderer.START_PAGE, new Integer(s)); + renderingOptions.put(PrintRenderer.START_PAGE, Integer.valueOf(s)); } else if (s.matches("\\d+-\\d+")) { String[] startend = s.split("-"); - renderingOptions.put(PrintRenderer.START_PAGE, new Integer(startend[0])); - renderingOptions.put(PrintRenderer.END_PAGE, new Integer(startend[1])); + renderingOptions.put(PrintRenderer.START_PAGE, Integer.valueOf(startend[0])); + renderingOptions.put(PrintRenderer.END_PAGE, Integer.valueOf(startend[1])); } else { PagesMode mode = PagesMode.byName(s); renderingOptions.put(PrintRenderer.PAGES_MODE, mode); @@ -623,7 +623,7 @@ public class CommandLineOptions { || (isOption(args[i + 1]))) { throw new FOPException("you must specify the number of copies"); } else { - renderingOptions.put(PrintRenderer.COPIES, new Integer(args[i + 1])); + renderingOptions.put(PrintRenderer.COPIES, Integer.valueOf(args[i + 1])); return 1; } } 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 301ab846e..66dbf97c0 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 @@ -159,10 +159,10 @@ public final class GlyphClassTable extends GlyphMappingTable implements GlyphCla /** {@inheritDoc} */ public List getEntries() { List entries = new java.util.ArrayList(); - entries.add(Integer.valueOf(firstGlyph)); + entries.add(firstGlyph); if (gca != null) { for (int i = 0, n = gca.length; i < n; i++) { - entries.add(Integer.valueOf(gca [ i ])); + entries.add(gca[i]); } } return entries; 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 699672439..f996d8cf8 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 @@ -147,7 +147,7 @@ public final class GlyphCoverageTable extends GlyphMappingTable implements Glyph List entries = new java.util.ArrayList(); if (map != null) { for (int i = 0, n = map.length; i < n; i++) { - entries.add(Integer.valueOf(map [ i ])); + entries.add(map[i]); } } return entries; 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 ecc933ae2..4596dbdfb 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 @@ -535,8 +535,8 @@ public class GlyphPositioningTable extends GlyphTable { List entries = new ArrayList(5); entries.add(cdt1); entries.add(cdt2); - entries.add(Integer.valueOf(nc1)); - entries.add(Integer.valueOf(nc2)); + entries.add(nc1); + entries.add(nc2); entries.add(pvm); return entries; } else { @@ -796,7 +796,7 @@ public class GlyphPositioningTable extends GlyphTable { if ((bct != null) && (maa != null) && (nmc > 0) && (bam != null)) { List entries = new ArrayList(4); entries.add(bct); - entries.add(Integer.valueOf(nmc)); + entries.add(nmc); entries.add(maa); entries.add(bam); return entries; @@ -942,8 +942,8 @@ public class GlyphPositioningTable extends GlyphTable { if (lam != null) { List entries = new ArrayList(5); entries.add(lct); - entries.add(Integer.valueOf(nmc)); - entries.add(Integer.valueOf(mxc)); + entries.add(nmc); + entries.add(mxc); entries.add(maa); entries.add(lam); return entries; @@ -1086,7 +1086,7 @@ public class GlyphPositioningTable extends GlyphTable { if ((mct2 != null) && (maa != null) && (nmc > 0) && (mam != null)) { List entries = new ArrayList(4); entries.add(mct2); - entries.add(Integer.valueOf(nmc)); + entries.add(nmc); entries.add(maa); entries.add(mam); return entries; @@ -1293,7 +1293,7 @@ public class GlyphPositioningTable extends GlyphTable { if (rsa != null) { List entries = new ArrayList(3); entries.add(cdt); - entries.add(Integer.valueOf(ngc)); + entries.add(ngc); entries.add(rsa); return entries; } else { @@ -1608,7 +1608,7 @@ public class GlyphPositioningTable extends GlyphTable { entries.add(icdt); entries.add(bcdt); entries.add(lcdt); - entries.add(Integer.valueOf(ngc)); + entries.add(ngc); entries.add(rsa); return entries; } else { 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 7bb5a23e1..1d9da2eaa 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 @@ -287,7 +287,7 @@ public class GlyphSubstitutionTable extends GlyphTable { /** {@inheritDoc} */ public List getEntries() { List entries = new ArrayList(1); - entries.add(Integer.valueOf(delta)); + entries.add(delta); return entries; } /** {@inheritDoc} */ @@ -325,7 +325,7 @@ public class GlyphSubstitutionTable extends GlyphTable { public List getEntries() { List entries = new ArrayList(glyphs.length); for (int i = 0, n = glyphs.length; i < n; i++) { - entries.add(Integer.valueOf(glyphs[i])); + entries.add(glyphs[i]); } return entries; } @@ -822,7 +822,7 @@ public class GlyphSubstitutionTable extends GlyphTable { if (rsa != null) { List entries = new ArrayList(3); entries.add(cdt); - entries.add(Integer.valueOf(ngc)); + entries.add(ngc); entries.add(rsa); return entries; } else { @@ -1138,7 +1138,7 @@ public class GlyphSubstitutionTable extends GlyphTable { entries.add(icdt); entries.add(bcdt); entries.add(lcdt); - entries.add(Integer.valueOf(ngc)); + entries.add(ngc); entries.add(rsa); return entries; } else { 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 de083a995..9cf35f553 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 @@ -557,7 +557,7 @@ public final class OTFAdvancedTypographicTableReader { for (int i = 0, n = ng; i < n; i++) { int g = in.readTTFUShort(); ga[i] = g; - entries.add(Integer.valueOf(g)); + entries.add(g); } // dump info if debugging if (log.isDebugEnabled()) { @@ -613,7 +613,7 @@ public final class OTFAdvancedTypographicTableReader { in.skip(2); // read start glyph int sg = in.readTTFUShort(); - entries.add(Integer.valueOf(sg)); + entries.add(sg); // read glyph count int ng = in.readTTFUShort(); // read glyph classes @@ -621,7 +621,7 @@ public final class OTFAdvancedTypographicTableReader { for (int i = 0, n = ng; i < n; i++) { int gc = in.readTTFUShort(); ca[i] = gc; - entries.add(Integer.valueOf(gc)); + entries.add(gc); } // dump info if debugging if (log.isDebugEnabled()) { @@ -687,7 +687,7 @@ public final class OTFAdvancedTypographicTableReader { } // read coverage table seMapping = readCoverageTable(tableTag + " single substitution coverage", subtableOffset + co); - seEntries.add(Integer.valueOf(dg)); + seEntries.add(dg); } private void readSingleSubTableFormat2(int lookupType, int lookupFlags, long subtableOffset, int subtableFormat) throws IOException { @@ -715,7 +715,7 @@ public final class OTFAdvancedTypographicTableReader { log.debug(tableTag + " single substitution glyph[" + i + "]: " + gs); } gsa[i] = gs; - seEntries.add(Integer.valueOf(gs)); + seEntries.add(gs); } } @@ -1101,7 +1101,7 @@ public final class OTFAdvancedTypographicTableReader { // store results seMapping = ct; seEntries.add(cdt); - seEntries.add(Integer.valueOf(ngc)); + seEntries.add(ngc); seEntries.add(rsa); } @@ -1397,7 +1397,7 @@ public final class OTFAdvancedTypographicTableReader { seEntries.add(icdt); seEntries.add(bcdt); seEntries.add(lcdt); - seEntries.add(Integer.valueOf(ngc)); + seEntries.add(ngc); seEntries.add(rsa); } @@ -1999,8 +1999,8 @@ public final class OTFAdvancedTypographicTableReader { seMapping = ct; seEntries.add(cdt1); seEntries.add(cdt2); - seEntries.add(Integer.valueOf(nc1)); - seEntries.add(Integer.valueOf(nc2)); + seEntries.add(nc1); + seEntries.add(nc2); seEntries.add(pvm); } @@ -2225,7 +2225,7 @@ public final class OTFAdvancedTypographicTableReader { // store results seMapping = mct; seEntries.add(bct); - seEntries.add(Integer.valueOf(nmc)); + seEntries.add(nmc); seEntries.add(maa); seEntries.add(bam); } @@ -2359,8 +2359,8 @@ public final class OTFAdvancedTypographicTableReader { // store results seMapping = mct; seEntries.add(lct); - seEntries.add(Integer.valueOf(nmc)); - seEntries.add(Integer.valueOf(mxc)); + seEntries.add(nmc); + seEntries.add(mxc); seEntries.add(maa); seEntries.add(lam); } @@ -2466,7 +2466,7 @@ public final class OTFAdvancedTypographicTableReader { // store results seMapping = mct1; seEntries.add(mct2); - seEntries.add(Integer.valueOf(nmc)); + seEntries.add(nmc); seEntries.add(maa); seEntries.add(mam); } @@ -2660,7 +2660,7 @@ public final class OTFAdvancedTypographicTableReader { // store results seMapping = ct; seEntries.add(cdt); - seEntries.add(Integer.valueOf(ngc)); + seEntries.add(ngc); seEntries.add(rsa); } @@ -2956,7 +2956,7 @@ public final class OTFAdvancedTypographicTableReader { seEntries.add(icdt); seEntries.add(bcdt); seEntries.add(lcdt); - seEntries.add(Integer.valueOf(ngc)); + seEntries.add(ngc); seEntries.add(rsa); } @@ -3755,12 +3755,12 @@ public final class OTFAdvancedTypographicTableReader { if (seEntries != null) { if ((tableType == GlyphTable.GLYPH_TABLE_TYPE_DEFINITION) || (seEntries.size() > 0)) { if (seSubtables != null) { - Integer tt = Integer.valueOf(tableType); - Integer lt = Integer.valueOf(lookupType); - Integer ln = Integer.valueOf(lookupSequence); - Integer lf = Integer.valueOf(lookupFlags); - Integer sn = Integer.valueOf(subtableSequence); - Integer sf = Integer.valueOf(subtableFormat); + Integer tt = tableType; + Integer lt = lookupType; + Integer ln = lookupSequence; + Integer lf = lookupFlags; + Integer sn = subtableSequence; + Integer sf = subtableFormat; seSubtables.add(new Object[] { tt, lt, ln, lf, sn, sf, seMapping, seEntries }); } } 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 d16de5db5..9321abc99 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 @@ -708,7 +708,7 @@ public final class CharScript { public static int[] scriptsOf(CharSequence cs) { Set s = new HashSet(); for (int i = 0, n = cs.length(); i < n; i++) { - s.add(Integer.valueOf(scriptOf(cs.charAt(i)))); + s.add(scriptOf(cs.charAt(i))); } int[] sa = new int [ s.size() ]; int ns = 0; @@ -729,12 +729,12 @@ public final class CharScript { for (int i = 0, n = cs.length(); i < n; i++) { int c = cs.charAt(i); int s = scriptOf(c); - Integer k = Integer.valueOf(s); + Integer k = s; Integer v = (Integer) m.get(k); if (v != null) { - m.put(k, Integer.valueOf(v.intValue() + 1)); + m.put(k, v.intValue() + 1); } else { - m.put(k, Integer.valueOf(0)); + m.put(k, 0); } } int sMax = -1; @@ -818,7 +818,7 @@ public final class CharScript { Map<Integer, String> m = getScriptTagsMap(); if (m != null) { String tag; - if ((tag = m.get(Integer.valueOf(code))) != null) { + if ((tag = m.get(code)) != null) { return tag; } else { return ""; @@ -855,8 +855,8 @@ public final class CharScript { assert tag.length() != 0; assert code >= 0; assert code < 2000; - tm.put(Integer.valueOf(code), tag); - cm.put(tag, Integer.valueOf(code)); + tm.put(code, tag); + cm.put(tag, code); } private static void makeScriptMaps() { diff --git a/fop-core/src/main/java/org/apache/fop/fo/CharIterator.java b/fop-core/src/main/java/org/apache/fop/fo/CharIterator.java index 68070da3f..a311e3452 100644 --- a/fop-core/src/main/java/org/apache/fop/fo/CharIterator.java +++ b/fop-core/src/main/java/org/apache/fop/fo/CharIterator.java @@ -45,7 +45,7 @@ public abstract class CharIterator implements Iterator, Cloneable { * {@inheritDoc} */ public Object next() throws NoSuchElementException { - return new Character(nextChar()); + return nextChar(); } /** diff --git a/fop-core/src/main/java/org/apache/fop/fo/expr/NumericProperty.java b/fop-core/src/main/java/org/apache/fop/fo/expr/NumericProperty.java index a3a108191..588e43137 100644 --- a/fop-core/src/main/java/org/apache/fop/fo/expr/NumericProperty.java +++ b/fop-core/src/main/java/org/apache/fop/fo/expr/NumericProperty.java @@ -87,7 +87,7 @@ public class NumericProperty extends Property implements Numeric, Length { /** {@inheritDoc} */ public Number getNumber() { - return new Double(value); + return value; } /** {@inheritDoc} */ diff --git a/fop-core/src/main/java/org/apache/fop/fo/expr/PropertyParser.java b/fop-core/src/main/java/org/apache/fop/fo/expr/PropertyParser.java index c3cb073bd..d13c3cea8 100644 --- a/fop-core/src/main/java/org/apache/fop/fo/expr/PropertyParser.java +++ b/fop-core/src/main/java/org/apache/fop/fo/expr/PropertyParser.java @@ -256,11 +256,11 @@ public final class PropertyParser extends PropertyTokenizer { break; case TOK_FLOAT: - prop = NumberProperty.getInstance(new Double(currentTokenValue)); + prop = NumberProperty.getInstance(Double.valueOf(currentTokenValue)); break; case TOK_INTEGER: - prop = NumberProperty.getInstance(new Integer(currentTokenValue)); + prop = NumberProperty.getInstance(Integer.valueOf(currentTokenValue)); break; case TOK_PERCENT: diff --git a/fop-core/src/main/java/org/apache/fop/fo/properties/CharacterProperty.java b/fop-core/src/main/java/org/apache/fop/fo/properties/CharacterProperty.java index c5aa2f939..070fa01fb 100644 --- a/fop-core/src/main/java/org/apache/fop/fo/properties/CharacterProperty.java +++ b/fop-core/src/main/java/org/apache/fop/fo/properties/CharacterProperty.java @@ -76,7 +76,7 @@ public final class CharacterProperty extends Property { * @return this.character cast as an Object */ public Object getObject() { - return new Character(character); + return character; } /** diff --git a/fop-core/src/main/java/org/apache/fop/fo/properties/NumberProperty.java b/fop-core/src/main/java/org/apache/fop/fo/properties/NumberProperty.java index de31e03e7..7f54fbc8f 100644 --- a/fop-core/src/main/java/org/apache/fop/fo/properties/NumberProperty.java +++ b/fop-core/src/main/java/org/apache/fop/fo/properties/NumberProperty.java @@ -121,12 +121,12 @@ public final class NumberProperty extends Property implements Numeric { //if possible if (num == Math.floor(num)) { if (num < Integer.MAX_VALUE) { - this.number = new Integer((int)num); + this.number = (int) num; } else { - this.number = new Long((long)num); + this.number = (long) num; } } else { - this.number = new Double(num); + this.number = num; } } @@ -135,7 +135,7 @@ public final class NumberProperty extends Property implements Numeric { * @param num integer numeric value for property */ private NumberProperty(int num) { - this.number = new Integer(num); + this.number = num; } /** 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 e14d30b2a..b36f01ff5 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 @@ -116,7 +116,7 @@ public final class PropertyCache<T> { return null; } - Integer hashCode = Integer.valueOf(obj.hashCode()); + Integer hashCode = obj.hashCode(); WeakReference<T> weakRef = map.get(hashCode); if (weakRef == null) { diff --git a/fop-core/src/main/java/org/apache/fop/fonts/CIDFull.java b/fop-core/src/main/java/org/apache/fop/fonts/CIDFull.java index 1130459b7..c108c4784 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/CIDFull.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/CIDFull.java @@ -91,7 +91,7 @@ public class CIDFull implements CIDSet { int nextBitSet = 0; for (int j = 0; j < glyphIndices.cardinality(); j++) { nextBitSet = glyphIndices.nextSetBit(nextBitSet); - glyphs.put(Integer.valueOf(nextBitSet), Integer.valueOf(nextBitSet)); + glyphs.put(nextBitSet, nextBitSet); nextBitSet++; } return Collections.unmodifiableMap(glyphs); 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 e14ed85b0..5e75133ed 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 @@ -433,7 +433,7 @@ public final class FontCache implements Serializable { public void registerFailedFont(String embedUrl, long lastModified) { synchronized (changeLock) { if (!getFailedFontMap().containsKey(embedUrl)) { - getFailedFontMap().put(embedUrl, new Long(lastModified)); + getFailedFontMap().put(embedUrl, lastModified); changed = true; } } 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 617b5a4a7..334e260aa 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 @@ -143,7 +143,7 @@ public class FontInfo { } } this.triplets.put(triplet, internalFontKey); - this.tripletPriorities.put(triplet, Integer.valueOf(newPriority)); + this.tripletPriorities.put(triplet, newPriority); } /** @@ -304,7 +304,7 @@ public class FontInfo { sizes = new HashMap<Integer, Font>(); getFontInstanceCache().put(triplet, sizes); } - Integer size = Integer.valueOf(fontSize); + Integer size = fontSize; Font font = sizes.get(size); if (font == null) { String fontKey = getInternalFontKey(triplet); 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 0180d4540..ee13a1647 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 @@ -54,7 +54,7 @@ public class SimpleSingleByteEncoding implements SingleByteEncoding { /** {@inheritDoc} */ public char mapChar(char c) { - Character nc = charMap.get(Character.valueOf(c)); + Character nc = charMap.get(c); if (nc != null) { return nc.charValue(); } @@ -119,7 +119,7 @@ public class SimpleSingleByteEncoding implements SingleByteEncoding { } char newSlot = (char)(getLastChar() + 1); this.mapping.add(ch); - this.charMap.put(Character.valueOf(ch.getSingleUnicodeValue()), Character.valueOf(newSlot)); + this.charMap.put(ch.getSingleUnicodeValue(), newSlot); return newSlot; } 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 e3037a524..52fe4241c 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 @@ -122,7 +122,7 @@ public class SingleByteFont extends CustomFont { int codePoint = i % 256; NamedCharacter nc = encoding.getCharacterForIndex(codePoint); UnencodedCharacter uc - = this.unencodedCharacters.get(Character.valueOf(nc.getSingleUnicodeValue())); + = this.unencodedCharacters.get(nc.getSingleUnicodeValue()); return size * uc.getWidth(); } return 0; @@ -147,7 +147,7 @@ public class SingleByteFont extends CustomFont { SimpleSingleByteEncoding encoding = getAdditionalEncoding(encodingIndex); int codePoint = glyphIndex % 256; NamedCharacter nc = encoding.getCharacterForIndex(codePoint); - UnencodedCharacter uc = this.unencodedCharacters.get(Character.valueOf(nc.getSingleUnicodeValue())); + UnencodedCharacter uc = this.unencodedCharacters.get(nc.getSingleUnicodeValue()); bbox = uc.getBBox(); } return bbox == null ? null : new Rectangle(bbox.x * size, bbox.y * size, bbox.width * size, bbox.height * size); @@ -255,7 +255,7 @@ public class SingleByteFont extends CustomFont { private char mapUnencodedChar(char ch) { if (this.unencodedCharacters != null) { - UnencodedCharacter unencoded = this.unencodedCharacters.get(Character.valueOf(ch)); + UnencodedCharacter unencoded = this.unencodedCharacters.get(ch); if (unencoded != null) { if (this.additionalEncodings == null) { this.additionalEncodings = new ArrayList<SimpleSingleByteEncoding>(); @@ -384,7 +384,7 @@ public class SingleByteFont extends CustomFont { } if (ch.hasSingleUnicodeValue()) { UnencodedCharacter uc = new UnencodedCharacter(ch, width, bbox); - this.unencodedCharacters.put(Character.valueOf(ch.getSingleUnicodeValue()), uc); + this.unencodedCharacters.put(ch.getSingleUnicodeValue(), uc); } else { //Cannot deal with unicode sequences, so ignore this character } @@ -452,7 +452,7 @@ public class SingleByteFont extends CustomFont { for (int i = 0, c = arr.length; i < c; i++) { NamedCharacter nc = enc.getCharacterForIndex(enc.getFirstChar() + i); UnencodedCharacter uc = this.unencodedCharacters.get( - Character.valueOf(nc.getSingleUnicodeValue())); + nc.getSingleUnicodeValue()); arr[i] = uc.getWidth(); } return arr; diff --git a/fop-core/src/main/java/org/apache/fop/fonts/Typeface.java b/fop-core/src/main/java/org/apache/fop/fonts/Typeface.java index 3232d7605..faf79abc7 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/Typeface.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/Typeface.java @@ -125,7 +125,7 @@ public abstract class Typeface implements FontMetrics { */ protected void warnMissingGlyph(char c) { // Give up, character is not available - Character ch = new Character(c); + Character ch = c; if (warnedChars == null) { warnedChars = new HashSet<Character>(); } diff --git a/fop-core/src/main/java/org/apache/fop/fonts/apps/PFMReader.java b/fop-core/src/main/java/org/apache/fop/fonts/apps/PFMReader.java index dd7f7343c..e45b4c2c4 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/apps/PFMReader.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/apps/PFMReader.java @@ -233,22 +233,22 @@ public class PFMReader extends AbstractFontReader { el = doc.createElement("cap-height"); root.appendChild(el); - Integer value = new Integer(pfm.getCapHeight()); + Integer value = pfm.getCapHeight(); el.appendChild(doc.createTextNode(value.toString())); el = doc.createElement("x-height"); root.appendChild(el); - value = new Integer(pfm.getXHeight()); + value = pfm.getXHeight(); el.appendChild(doc.createTextNode(value.toString())); el = doc.createElement("ascender"); root.appendChild(el); - value = new Integer(pfm.getLowerCaseAscent()); + value = pfm.getLowerCaseAscent(); el.appendChild(doc.createTextNode(value.toString())); el = doc.createElement("descender"); root.appendChild(el); - value = new Integer(pfm.getLowerCaseDescent()); + value = pfm.getLowerCaseDescent(); el.appendChild(doc.createTextNode(value.toString())); Element bbox = doc.createElement("bbox"); @@ -258,33 +258,33 @@ public class PFMReader extends AbstractFontReader { for (int i = 0; i < names.length; i++) { el = doc.createElement(names[i]); bbox.appendChild(el); - value = new Integer(bb[i]); + value = bb[i]; el.appendChild(doc.createTextNode(value.toString())); } el = doc.createElement("flags"); root.appendChild(el); - value = new Integer(pfm.getFlags()); + value = pfm.getFlags(); el.appendChild(doc.createTextNode(value.toString())); el = doc.createElement("stemv"); root.appendChild(el); - value = new Integer(pfm.getStemV()); + value = pfm.getStemV(); el.appendChild(doc.createTextNode(value.toString())); el = doc.createElement("italicangle"); root.appendChild(el); - value = new Integer(pfm.getItalicAngle()); + value = pfm.getItalicAngle(); el.appendChild(doc.createTextNode(value.toString())); el = doc.createElement("first-char"); root.appendChild(el); - value = new Integer(pfm.getFirstChar()); + value = (int) pfm.getFirstChar(); el.appendChild(doc.createTextNode(value.toString())); el = doc.createElement("last-char"); root.appendChild(el); - value = new Integer(pfm.getLastChar()); + value = (int) pfm.getLastChar(); el.appendChild(doc.createTextNode(value.toString())); Element widths = doc.createElement("widths"); 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 34cad34df..14aeee889 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 @@ -275,8 +275,8 @@ public abstract class OpenFont { UnicodeMapping(OpenFont font, int glyphIndex, int unicodeIndex) { this.unicodeIndex = unicodeIndex; this.glyphIndex = glyphIndex; - font.glyphToUnicodeMap.put(new Integer(glyphIndex), new Integer(unicodeIndex)); - font.unicodeToGlyphMap.put(new Integer(unicodeIndex), new Integer(glyphIndex)); + font.glyphToUnicodeMap.put(glyphIndex, unicodeIndex); + font.unicodeToGlyphMap.put(unicodeIndex, glyphIndex); } /** @@ -535,7 +535,7 @@ public abstract class OpenFont { & 0xffff; //mtxTab[glyphIdx].setName(mtxTab[glyphIdx].getName() + " - "+(char)j); unicodeMappings.add(new UnicodeMapping(this, glyphIdx, j)); - mtxTab[glyphIdx].getUnicodeIndex().add(new Integer(j)); + mtxTab[glyphIdx].getUnicodeIndex().add(j); if (encodingID == 0 && j >= 0xF020 && j <= 0xF0FF) { //Experimental: Mapping 0xF020-0xF0FF to 0x0020-0x00FF @@ -545,12 +545,12 @@ public abstract class OpenFont { if (!eightBitGlyphs.get(mapped)) { //Only map if Unicode code point hasn't been mapped before unicodeMappings.add(new UnicodeMapping(this, glyphIdx, mapped)); - mtxTab[glyphIdx].getUnicodeIndex().add(new Integer(mapped)); + mtxTab[glyphIdx].getUnicodeIndex().add(mapped); } } // Also add winAnsiWidth - List<Integer> v = ansiIndex.get(new Integer(j)); + List<Integer> v = ansiIndex.get(j); if (v != null) { for (Integer aIdx : v) { ansiWidth[aIdx.intValue()] @@ -576,7 +576,7 @@ public abstract class OpenFont { glyphIdx = (j + cmapDeltas[i]) & 0xffff; if (glyphIdx < mtxTab.length) { - mtxTab[glyphIdx].getUnicodeIndex().add(new Integer(j)); + mtxTab[glyphIdx].getUnicodeIndex().add(j); } else { log.debug("Glyph " + glyphIdx + " out of range: " @@ -585,7 +585,7 @@ public abstract class OpenFont { unicodeMappings.add(new UnicodeMapping(this, glyphIdx, j)); if (glyphIdx < mtxTab.length) { - mtxTab[glyphIdx].getUnicodeIndex().add(new Integer(j)); + mtxTab[glyphIdx].getUnicodeIndex().add(j); } else { log.debug("Glyph " + glyphIdx + " out of range: " @@ -593,7 +593,7 @@ public abstract class OpenFont { } // Also add winAnsiWidth - List<Integer> v = ansiIndex.get(new Integer(j)); + List<Integer> v = ansiIndex.get(j); if (v != null) { for (Integer aIdx : v) { ansiWidth[aIdx.intValue()] = mtxTab[glyphIdx].getWx(); @@ -685,8 +685,8 @@ public abstract class OpenFont { // same char (eg bullet) is repeated more than one place ansiIndex = new HashMap<Integer, List<Integer>>(); for (int i = 32; i < Glyphs.WINANSI_ENCODING.length; i++) { - Integer ansi = new Integer(i); - Integer uni = new Integer(Glyphs.WINANSI_ENCODING[i]); + Integer ansi = i; + Integer uni = (int) Glyphs.WINANSI_ENCODING[i]; List<Integer> v = ansiIndex.get(uni); if (v == null) { @@ -1614,7 +1614,7 @@ public abstract class OpenFont { if (adjTab == null) { adjTab = new HashMap<Integer, Integer>(); } - adjTab.put(u2, new Integer(convertTTFUnit2PDFUnit(kpx))); + adjTab.put(u2, convertTTFUnit2PDFUnit(kpx)); kerningTab.put(iObj, adjTab); } } @@ -1852,7 +1852,7 @@ public abstract class OpenFont { List<Integer> ret = new ArrayList<Integer>(); for (int i = 32; i < Glyphs.WINANSI_ENCODING.length; i++) { if (unicode == Glyphs.WINANSI_ENCODING[i]) { - ret.add(new Integer(i)); + ret.add(i); } } return ret.toArray(new Integer[ret.size()]); @@ -1898,7 +1898,7 @@ public abstract class OpenFont { * @return unicode code point */ private Integer glyphToUnicode(int glyphIndex) { - return glyphToUnicodeMap.get(new Integer(glyphIndex)); + return glyphToUnicodeMap.get(glyphIndex); } /** @@ -1909,7 +1909,7 @@ public abstract class OpenFont { */ private Integer unicodeToGlyph(int unicodeIndex) throws IOException { final Integer result - = unicodeToGlyphMap.get(new Integer(unicodeIndex)); + = unicodeToGlyphMap.get(unicodeIndex); if (result == null) { throw new IOException( "Glyph index not found for unicode value " + unicodeIndex); diff --git a/fop-core/src/main/java/org/apache/fop/fonts/type1/AFMFile.java b/fop-core/src/main/java/org/apache/fop/fonts/type1/AFMFile.java index 2aa718ea0..307eb016f 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/type1/AFMFile.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/type1/AFMFile.java @@ -430,7 +430,7 @@ public class AFMFile { continue; } if (container == null) { - Integer k1 = Integer.valueOf(chm1.getCharCode()); + Integer k1 = chm1.getCharCode(); container = m.get(k1); if (container == null) { container = new java.util.HashMap<Integer, Integer>(); @@ -438,8 +438,8 @@ public class AFMFile { } } Dimension2D dim = entryTo.getValue(); - container.put(Integer.valueOf(chm2.getCharCode()), - Integer.valueOf((int)Math.round(dim.getWidth()))); + container.put(chm2.getCharCode(), + (int) Math.round(dim.getWidth())); } } return m; 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 ecc9196ed..d4bd2d3e3 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 @@ -148,8 +148,8 @@ public class AFMParser { VALUE_PARSERS.put(KPY, new NotImplementedYet(KPY)); PARSE_MODE_CHANGES = new HashMap<String, Integer>(); - PARSE_MODE_CHANGES.put(START_CHAR_METRICS, new Integer(PARSE_CHAR_METRICS)); - PARSE_MODE_CHANGES.put(END_CHAR_METRICS, new Integer(PARSE_NORMAL)); + PARSE_MODE_CHANGES.put(START_CHAR_METRICS, PARSE_CHAR_METRICS); + PARSE_MODE_CHANGES.put(END_CHAR_METRICS, PARSE_NORMAL); } /** @@ -278,9 +278,9 @@ public class AFMParser { protected Number getNumberValue(String line, int startpos) { try { - return new Integer(getIntegerValue(line, startpos)); + return getIntegerValue(line, startpos); } catch (NumberFormatException nfe) { - return new Double(getDoubleValue(line, startpos)); + return getDoubleValue(line, startpos); } } @@ -384,7 +384,7 @@ public class AFMParser { public void parse(String line, int startpos, Stack<Object> stack) throws IOException { int value = getIntegerValue(line, startpos); - setValue(getContextObject(stack), int.class, new Integer(value)); + setValue(getContextObject(stack), int.class, value); } } @@ -395,7 +395,7 @@ public class AFMParser { public void parse(String line, int startpos, Stack<Object> stack) throws IOException { double value = getDoubleValue(line, startpos); - setValue(getContextObject(stack), double.class, new Double(value)); + setValue(getContextObject(stack), double.class, value); } } @@ -429,7 +429,7 @@ public class AFMParser { public void parse(String line, int startpos, Stack<Object> stack) throws IOException { double value = getDoubleValue(line, startpos); - setValue(getContextObject(stack), double.class, new Double(value)); + setValue(getContextObject(stack), double.class, value); } } diff --git a/fop-core/src/main/java/org/apache/fop/fonts/type1/PFMFile.java b/fop-core/src/main/java/org/apache/fop/fonts/type1/PFMFile.java index 8856fdb7f..1bd986b2e 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/type1/PFMFile.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/type1/PFMFile.java @@ -235,12 +235,12 @@ public class PFMFile { log.trace("glyphs: " + glyph1 + ", " + glyph2); } - Map<Integer, Integer> adjTab = kerningTab.get(Integer.valueOf(g1)); + Map<Integer, Integer> adjTab = kerningTab.get(g1); if (adjTab == null) { adjTab = new HashMap<Integer, Integer>(); } - adjTab.put(Integer.valueOf(g2), Integer.valueOf(adj)); - kerningTab.put(Integer.valueOf(g1), adjTab); + adjTab.put(g2, adj); + kerningTab.put(g1, adjTab); } } diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/TraitSetter.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/TraitSetter.java index 0ff0badc8..16187eac6 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/TraitSetter.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/TraitSetter.java @@ -558,8 +558,8 @@ public final class TraitSetter { */ public static void addBreaks(Area area, int breakBefore, int breakAfter) { /* Currently disabled as these traits are never used by the renderers - area.addTrait(Trait.BREAK_AFTER, new Integer(breakAfter)); - area.addTrait(Trait.BREAK_BEFORE, new Integer(breakBefore)); + area.addTrait(Trait.BREAK_AFTER, Integer.valueOf(breakAfter)); + area.addTrait(Trait.BREAK_BEFORE, Integer.valueOf(breakBefore)); */ } diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java index 8f806f492..66a4d1a15 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java @@ -1510,7 +1510,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager lineArea.addTrait(Trait.START_INDENT, lbp.startIndent); } if (lbp.endIndent != 0) { - lineArea.addTrait(Trait.END_INDENT, new Integer(lbp.endIndent)); + lineArea.addTrait(Trait.END_INDENT, lbp.endIndent); } lineArea.setBPD(lbp.lineHeight); lineArea.setIPD(lbp.lineWidth); 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 40edca6f7..05e6f1c2b 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 @@ -525,7 +525,7 @@ class RowPainter { * below. */ for (int i = rowOffsets.size(); i <= rowIndex - firstRowIndex; i++) { - rowOffsets.add(new Integer(offset)); + rowOffsets.add(offset); } } diff --git a/fop-core/src/main/java/org/apache/fop/pdf/AbstractPDFStream.java b/fop-core/src/main/java/org/apache/fop/pdf/AbstractPDFStream.java index 67cb7b097..8dba4981d 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/AbstractPDFStream.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/AbstractPDFStream.java @@ -199,7 +199,7 @@ public abstract class AbstractPDFStream extends PDFObject { OutputStream filteredOutput = getFilterList().applyFilters(cout); outputRawStreamData(filteredOutput); filteredOutput.close(); - refLength.setNumber(Integer.valueOf(cout.getCount())); + refLength.setNumber(cout.getCount()); bytesWritten += cout.getCount(); //Stream trailer diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFArray.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFArray.java index 36ff57799..1be4e9af0 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFArray.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFArray.java @@ -62,7 +62,7 @@ public class PDFArray extends PDFObject { super(parent); for (int i = 0, c = values.length; i < c; i++) { - this.values.add(Integer.valueOf(values[i])); + this.values.add(values[i]); } } @@ -76,7 +76,7 @@ public class PDFArray extends PDFObject { super(parent); for (int i = 0, c = values.length; i < c; i++) { - this.values.add(new Double(values[i])); + this.values.add(values[i]); } } @@ -156,7 +156,7 @@ public class PDFArray extends PDFObject { * @param value the new value */ public void set(int index, double value) { - this.values.set(index, new Double(value)); + this.values.set(index, value); } /** @@ -187,7 +187,7 @@ public class PDFArray extends PDFObject { * @param value the value */ public void add(double value) { - this.values.add(new Double(value)); + this.values.add(value); } /** diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFCIDFont.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFCIDFont.java index 28908c6c3..abe5df446 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFCIDFont.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFCIDFont.java @@ -106,7 +106,7 @@ public class PDFCIDFont extends PDFObject { this.basefont = basefont; this.cidtype = cidtype; - this.dw = new Integer(dw); + this.dw = dw; this.w = w; this.dw2 = null; this.w2 = null; @@ -122,7 +122,7 @@ public class PDFCIDFont extends PDFObject { * @param dw the default width */ public void setDW(int dw) { - this.dw = new Integer(dw); + this.dw = dw; } /** diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFCIDFontDescriptor.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFCIDFontDescriptor.java index 726e46f23..c1bcbfacf 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFCIDFontDescriptor.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFCIDFontDescriptor.java @@ -46,7 +46,7 @@ public class PDFCIDFontDescriptor extends PDFFontDescriptor { super(basefont, fontBBox[3], fontBBox[1], capHeight, flags, new PDFRectangle(fontBBox), italicAngle, stemV); - put("MissingWidth", new Integer(500)); + put("MissingWidth", Integer.valueOf(500)); if (lang != null) { put("Lang", lang); } diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFColor.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFColor.java index 1fb544368..652f82891 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFColor.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFColor.java @@ -131,19 +131,19 @@ public class PDFColor extends PDFPathPaint { List theColorVector = new ArrayList(); if (this.colorSpace.getColorSpace() == PDFDeviceColorSpace.DEVICE_RGB) { // RGB - theColorVector.add(new Double(this.red)); - theColorVector.add(new Double(this.green)); - theColorVector.add(new Double(this.blue)); + theColorVector.add(this.red); + theColorVector.add(this.green); + theColorVector.add(this.blue); } else if (this.colorSpace.getColorSpace() == PDFDeviceColorSpace.DEVICE_CMYK) { // CMYK - theColorVector.add(new Double(this.cyan)); - theColorVector.add(new Double(this.magenta)); - theColorVector.add(new Double(this.yellow)); - theColorVector.add(new Double(this.black)); + theColorVector.add(this.cyan); + theColorVector.add(this.magenta); + theColorVector.add(this.yellow); + theColorVector.add(this.black); } else { // GRAY - theColorVector.add(new Double(this.black)); + theColorVector.add(this.black); } return (theColorVector); } diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFDictionary.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFDictionary.java index 4ad1c2ce5..c7f4e8d3b 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFDictionary.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFDictionary.java @@ -87,7 +87,7 @@ public class PDFDictionary extends PDFObject { if (!entries.containsKey(name)) { this.order.add(name); } - this.entries.put(name, Integer.valueOf(value)); + this.entries.put(name, value); } /** diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java index 035c6cdbc..9b444cb24 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFEmbeddedFile.java @@ -55,7 +55,7 @@ public class PDFEmbeddedFile extends PDFStream { super.populateStreamDict(lengthEntry); try { PDFDictionary dict = (PDFDictionary)get("Params"); - dict.put("Size", new Integer(data.getSize())); + dict.put("Size", Integer.valueOf(data.getSize())); } catch (IOException ioe) { //ignore and just skip this entry as it's optional } diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java index e2c17b4e9..bdfb2a94d 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java @@ -1398,8 +1398,8 @@ public class PDFFactory { public PDFSeparationColorSpace makeSeparationColorSpace(PDFResourceContext res, NamedColorSpace ncs) { String colorName = ncs.getColorName(); - final Double zero = new Double(0d); - final Double one = new Double(1d); + final Double zero = 0d; + final Double one = 1d; List domain = Arrays.asList(new Double[] {zero, one}); List range = Arrays.asList(new Double[] {zero, one, zero, one, zero, one}); float[] cZero = new float[] {1f, 1f, 1f}; diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFFontNonBase14.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFFontNonBase14.java index faef636f6..c893f2cfb 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFFontNonBase14.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFFontNonBase14.java @@ -52,8 +52,8 @@ public abstract class PDFFontNonBase14 extends PDFFont { */ public void setWidthMetrics(int firstChar, int lastChar, PDFArray widths) { - put("FirstChar", new Integer(firstChar)); - put("LastChar", new Integer(lastChar)); + put("FirstChar", Integer.valueOf(firstChar)); + put("LastChar", Integer.valueOf(lastChar)); put("Widths", widths); } diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFFormXObject.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFFormXObject.java index bc81a0a35..941103943 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFFormXObject.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFFormXObject.java @@ -50,7 +50,7 @@ public class PDFFormXObject extends PDFXObject { put("Type", new PDFName("XObject")); put("Subtype", new PDFName("Form")); - put("FormType", new Integer(1)); + put("FormType", 1); setMatrix(new AffineTransform()); if (resources != null) { put("Resources", resources); diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFGState.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFGState.java index 094b7c246..18b37fe13 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFGState.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFGState.java @@ -90,18 +90,18 @@ public class PDFGState extends PDFObject { DEFAULT = new PDFGState(); Map vals = DEFAULT.values; /*vals.put(LW, new Float(1.0)); - vals.put(LC, new Integer(0)); - vals.put(LJ, new Integer(0)); + vals.put(LC, Integer.valueOf(0)); + vals.put(LJ, Integer.valueOf(0)); vals.put(ML, new Float(10.0)); vals.put(D, "0 []"); vals.put(RI, "RelativeColorimetric"); vals.put(OP, Boolean.FALSE); vals.put(op, Boolean.FALSE); - vals.put(OPM, new Integer(1)); + vals.put(OPM, Integer.valueOf(1)); vals.put(Font, "");*/ - vals.put(GSTATE_ALPHA_STROKE, new Float(1.0)); - vals.put(GSTATE_ALPHA_NONSTROKE, new Float(1.0)); + vals.put(GSTATE_ALPHA_STROKE, 1.0f); + vals.put(GSTATE_ALPHA_NONSTROKE, 1.0f); } private Map values = new java.util.HashMap(); @@ -126,9 +126,9 @@ public class PDFGState extends PDFObject { */ public void setAlpha(float val, boolean fill) { if (fill) { - values.put(GSTATE_ALPHA_NONSTROKE, new Float(val)); + values.put(GSTATE_ALPHA_NONSTROKE, val); } else { - values.put(GSTATE_ALPHA_STROKE, new Float(val)); + values.put(GSTATE_ALPHA_STROKE, val); } } diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFImageXObject.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFImageXObject.java index bbee663da..1ab0f10a0 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFImageXObject.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFImageXObject.java @@ -96,9 +96,9 @@ public class PDFImageXObject extends PDFXObject { private void populateDictionaryFromImage() { put("Subtype", new PDFName("Image")); - put("Width", new Integer(pdfimage.getWidth())); - put("Height", new Integer(pdfimage.getHeight())); - put("BitsPerComponent", new Integer(pdfimage.getBitsPerComponent())); + put("Width", pdfimage.getWidth()); + put("Height", pdfimage.getHeight()); + put("BitsPerComponent", pdfimage.getBitsPerComponent()); PDFICCStream pdfICCStream = pdfimage.getICCStream(); if (pdfICCStream != null) { @@ -114,8 +114,8 @@ public class PDFImageXObject extends PDFXObject { * this will invert the values - too bad if it's not * a PhotoShop image... */ - final Float zero = new Float(0.0f); - final Float one = new Float(1.0f); + final Float zero = 0.0f; + final Float one = 1.0f; PDFArray decode = new PDFArray(this); for (int i = 0, c = pdfimage.getColorSpace().getNumComponents(); i < c; i++) { decode.add(one); @@ -128,15 +128,15 @@ public class PDFImageXObject extends PDFXObject { PDFColor transp = pdfimage.getTransparentColor(); PDFArray mask = new PDFArray(this); if (pdfimage.getColorSpace().isGrayColorSpace()) { - mask.add(new Integer(transp.red255())); - mask.add(new Integer(transp.red255())); + mask.add(Integer.valueOf(transp.red255())); + mask.add(Integer.valueOf(transp.red255())); } else { - mask.add(new Integer(transp.red255())); - mask.add(new Integer(transp.red255())); - mask.add(new Integer(transp.green255())); - mask.add(new Integer(transp.green255())); - mask.add(new Integer(transp.blue255())); - mask.add(new Integer(transp.blue255())); + mask.add(Integer.valueOf(transp.red255())); + mask.add(Integer.valueOf(transp.red255())); + mask.add(Integer.valueOf(transp.green255())); + mask.add(Integer.valueOf(transp.green255())); + mask.add(Integer.valueOf(transp.blue255())); + mask.add(Integer.valueOf(transp.blue255())); } put("Mask", mask); } diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFLink.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFLink.java index fd74c100a..21e989999 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFLink.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFLink.java @@ -77,7 +77,7 @@ public class PDFLink extends PDFObject { * @param structParent key in the structure parent tree */ public void setStructParent(int structParent) { - this.structParent = new Integer(structParent); + this.structParent = structParent; } /** diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFNumber.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFNumber.java index 754194886..26489c6ec 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFNumber.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFNumber.java @@ -30,7 +30,7 @@ public class PDFNumber extends PDFObject { private Number number; public PDFNumber() { - this.number = Integer.valueOf(0); + this.number = 0; } public PDFNumber(Number number) { diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFPage.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFPage.java index 7a5365761..fc08e1760 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFPage.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFPage.java @@ -142,7 +142,7 @@ public class PDFPage extends PDFResourceContext { * @param tr the transition dictionary */ public void setTransition(int dur, TransitionDictionary tr) { - put("Dur", new Integer(dur)); + put("Dur", Integer.valueOf(dur)); put("Trans", tr); } diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFPattern.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFPattern.java index 788297914..ebc21b811 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFPattern.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFPattern.java @@ -239,9 +239,9 @@ public class PDFPattern extends PDFPathPaint { } p.append("] \n"); } - p.append("/XStep " + PDFNumber.doubleOut(new Double(this.xStep)) + p.append("/XStep " + PDFNumber.doubleOut(Double.valueOf(this.xStep)) + " \n"); - p.append("/YStep " + PDFNumber.doubleOut(new Double(this.yStep)) + p.append("/YStep " + PDFNumber.doubleOut(Double.valueOf(this.yStep)) + " \n"); if (this.matrix != null) { diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFT1Stream.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFT1Stream.java index 2bae5dca3..6e8bd8c87 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFT1Stream.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFT1Stream.java @@ -63,9 +63,9 @@ public class PDFT1Stream extends AbstractPDFFontStream { /** {@inheritDoc} */ protected void populateStreamDict(Object lengthEntry) { super.populateStreamDict(lengthEntry); - put("Length1", new Integer(pfb.getLength1())); - put("Length2", new Integer(pfb.getLength2())); - put("Length3", new Integer(pfb.getLength3())); + put("Length1", pfb.getLength1()); + put("Length2", pfb.getLength2()); + put("Length3", pfb.getLength3()); } /** 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 620c3e621..0bff5fc49 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 @@ -143,13 +143,13 @@ public abstract class PrintRenderer extends AbstractRenderer { context.setUserAgent(userAgent); context.setProperty(RendererContextConstants.WIDTH, - new Integer(width)); + width); context.setProperty(RendererContextConstants.HEIGHT, - new Integer(height)); + height); context.setProperty(RendererContextConstants.XPOS, - new Integer(x)); + x); context.setProperty(RendererContextConstants.YPOS, - new Integer(y)); + y); context.setProperty(RendererContextConstants.PAGE_VIEWPORT, getCurrentPageViewport()); if (foreignAttributes != null) { diff --git a/fop-core/src/main/java/org/apache/fop/render/afp/AFPPainter.java b/fop-core/src/main/java/org/apache/fop/render/afp/AFPPainter.java index 72e83fa67..efa17989f 100644 --- a/fop-core/src/main/java/org/apache/fop/render/afp/AFPPainter.java +++ b/fop-core/src/main/java/org/apache/fop/render/afp/AFPPainter.java @@ -865,7 +865,7 @@ public class AFPPainter extends AbstractIFPainter<AFPDocumentHandler> { hints.put(ImageHandlerUtil.CONVERSION_MODE, ImageHandlerUtil.CONVERSION_MODE_BITMAP); hints.put("TARGET_RESOLUTION", - Integer.valueOf(context.getPaintingState().getResolution())); + context.getPaintingState().getResolution()); try { diff --git a/fop-core/src/main/java/org/apache/fop/render/awt/viewer/Command.java b/fop-core/src/main/java/org/apache/fop/render/awt/viewer/Command.java index f989eaf33..a4e9da419 100644 --- a/fop-core/src/main/java/org/apache/fop/render/awt/viewer/Command.java +++ b/fop-core/src/main/java/org/apache/fop/render/awt/viewer/Command.java @@ -51,7 +51,7 @@ public class Command extends AbstractAction { super(name); putValue(SHORT_DESCRIPTION, name); if (mnemonic > 0) { - putValue(MNEMONIC_KEY, new Integer(mnemonic)); + putValue(MNEMONIC_KEY, mnemonic); } } diff --git a/fop-core/src/main/java/org/apache/fop/render/gradient/GradientMaker.java b/fop-core/src/main/java/org/apache/fop/render/gradient/GradientMaker.java index 3c847a843..0e3869868 100644 --- a/fop-core/src/main/java/org/apache/fop/render/gradient/GradientMaker.java +++ b/fop-core/src/main/java/org/apache/fop/render/gradient/GradientMaker.java @@ -47,10 +47,10 @@ public final class GradientMaker { Point2D startPoint = gp.getStartPoint(); Point2D endPoint = gp.getEndPoint(); List<Double> coords = new java.util.ArrayList<Double>(4); - coords.add(Double.valueOf(startPoint.getX())); - coords.add(Double.valueOf(startPoint.getY())); - coords.add(Double.valueOf(endPoint.getX())); - coords.add(Double.valueOf(endPoint.getY())); + coords.add(startPoint.getX()); + coords.add(startPoint.getY()); + coords.add(endPoint.getX()); + coords.add(endPoint.getY()); return makeGradient(gp, coords, baseTransform, transform); } @@ -70,12 +70,12 @@ public final class GradientMaker { dy *= scale; } List<Double> coords = new java.util.ArrayList<Double>(6); - coords.add(Double.valueOf(center.getX() + dx)); - coords.add(Double.valueOf(center.getY() + dy)); - coords.add(Double.valueOf(0)); - coords.add(Double.valueOf(center.getX())); - coords.add(Double.valueOf(center.getY())); - coords.add(Double.valueOf(radius)); + coords.add(center.getX() + dx); + coords.add(center.getY() + dy); + coords.add(0d); + coords.add(center.getX()); + coords.add(center.getY()); + coords.add(radius); return makeGradient(gradient, coords, baseTransform, transform); } @@ -101,7 +101,7 @@ public final class GradientMaker { double[] m = new double[6]; gradientTransform.getMatrix(m); for (double d : m) { - matrix.add(Double.valueOf(d)); + matrix.add(d); } return matrix; } 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 f2eae9ae1..6ba21f591 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 @@ -567,7 +567,7 @@ public class IFRenderer extends AbstractPathOrientedRenderer { log.trace("renderPage() " + page); } try { - pageIndices.put(page.getKey(), new Integer(page.getPageIndex())); + pageIndices.put(page.getKey(), page.getPageIndex()); Rectangle viewArea = page.getViewArea(); Dimension dim = new Dimension(viewArea.width, viewArea.height); @@ -1048,8 +1048,8 @@ public class IFRenderer extends AbstractPathOrientedRenderer { FontTriplet triplet = (FontTriplet)text.getTrait(Trait.FONT); try { - painter.setFont(triplet.getName(), triplet.getStyle(), new Integer(triplet.getWeight()), - "normal", new Integer(size), ct); + painter.setFont(triplet.getName(), triplet.getStyle(), triplet.getWeight(), + "normal", size, ct); } catch (IFException e) { handleIFException(e); } diff --git a/fop-core/src/main/java/org/apache/fop/render/java2d/Java2DFontMetrics.java b/fop-core/src/main/java/org/apache/fop/render/java2d/Java2DFontMetrics.java index e7f6d989f..1759a0c88 100644 --- a/fop-core/src/main/java/org/apache/fop/render/java2d/Java2DFontMetrics.java +++ b/fop-core/src/main/java/org/apache/fop/render/java2d/Java2DFontMetrics.java @@ -296,7 +296,7 @@ public class Java2DFontMetrics { if ((style & Font.ITALIC) != 0) { atts.put(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE); } - atts.put(TextAttribute.SIZE, new Float(size)); //size in pt + atts.put(TextAttribute.SIZE, size); //size in pt return new Font(atts); } diff --git a/fop-core/src/main/java/org/apache/fop/render/pdf/AbstractImageAdapter.java b/fop-core/src/main/java/org/apache/fop/render/pdf/AbstractImageAdapter.java index c61ca8cda..b835de617 100644 --- a/fop-core/src/main/java/org/apache/fop/render/pdf/AbstractImageAdapter.java +++ b/fop-core/src/main/java/org/apache/fop/render/pdf/AbstractImageAdapter.java @@ -308,7 +308,7 @@ public abstract class AbstractImageAdapter implements PDFImage { icm.getBlues(blues); for (int i = 0; i < icm.getMapSize(); i++) { if ((alphas[i] & 0xFF) == 0) { - return Integer.valueOf(i); + return i; } } return null; diff --git a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentHandler.java b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentHandler.java index e5896b803..b4e707def 100644 --- a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentHandler.java +++ b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFDocumentHandler.java @@ -253,7 +253,7 @@ public class PDFDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { pdfUtil.generatePageLabel(index, name); currentPageRef = new PageReference(currentPage, size); - this.pageReferences.put(Integer.valueOf(index), currentPageRef); + this.pageReferences.put(index, currentPageRef); this.generator = new PDFContentGenerator(this.pdfDoc, this.outputStream, this.currentPage); @@ -335,7 +335,7 @@ public class PDFDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { } PageReference getPageReference(int pageIndex) { - return this.pageReferences.get(Integer.valueOf(pageIndex)); + return this.pageReferences.get(pageIndex); } static final class PageReference { diff --git a/fop-core/src/main/java/org/apache/fop/render/pdf/extensions/PDFCollectionEntryElement.java b/fop-core/src/main/java/org/apache/fop/render/pdf/extensions/PDFCollectionEntryElement.java index 4185ceef0..f5d6b7a0b 100644 --- a/fop-core/src/main/java/org/apache/fop/render/pdf/extensions/PDFCollectionEntryElement.java +++ b/fop-core/src/main/java/org/apache/fop/render/pdf/extensions/PDFCollectionEntryElement.java @@ -124,9 +124,9 @@ public class PDFCollectionEntryElement extends AbstractPDFExtensionElement { try { double d = Double.parseDouble(value); if (Math.abs(Math.floor(d) - d) < 1E-10) { - extension.setValue(Long.valueOf((long) d)); + extension.setValue((long) d); } else { - extension.setValue(Double.valueOf(d)); + extension.setValue(d); } } catch (NumberFormatException e) { invalidPropertyValueError("<value>", value, null); diff --git a/fop-core/src/main/java/org/apache/fop/render/pdf/extensions/PDFObjectExtension.java b/fop-core/src/main/java/org/apache/fop/render/pdf/extensions/PDFObjectExtension.java index 5447d87f2..d0d748a3c 100644 --- a/fop-core/src/main/java/org/apache/fop/render/pdf/extensions/PDFObjectExtension.java +++ b/fop-core/src/main/java/org/apache/fop/render/pdf/extensions/PDFObjectExtension.java @@ -70,12 +70,12 @@ public class PDFObjectExtension { } else if (value instanceof String) { double d = Double.parseDouble((String) value); if (Math.abs(Math.floor(d) - d) < 1E-10) { - return Long.valueOf((long) d); + return (long) d; } else { - return Double.valueOf(d); + return d; } } else { - return Integer.valueOf(0); + return 0; } } diff --git a/fop-core/src/main/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java b/fop-core/src/main/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java index 3fded29d7..92659b63a 100644 --- a/fop-core/src/main/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java +++ b/fop-core/src/main/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java @@ -50,17 +50,17 @@ public class ImageEncoderCCITTFax implements ImageEncoder { /** {@inheritDoc} */ public String getImplicitFilter() { PSDictionary dict = new PSDictionary(); - dict.put("/Columns", new Integer(ccitt.getSize().getWidthPx())); + dict.put("/Columns", ccitt.getSize().getWidthPx()); int compression = ccitt.getCompression(); switch (compression) { case TIFFImage.COMP_FAX_G3_1D : - dict.put("/K", new Integer(0)); + dict.put("/K", 0); break; case TIFFImage.COMP_FAX_G3_2D : - dict.put("/K", new Integer(1)); + dict.put("/K", 1); break; case TIFFImage.COMP_FAX_G4_2D : - dict.put("/K", new Integer(-1)); + dict.put("/K", -1); break; default: throw new IllegalStateException( 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 b40fef8ba..1bf57e23b 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 @@ -211,7 +211,7 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { gen.writeln(DSCConstants.PS_ADOBE_30); gen.writeDSCComment(DSCConstants.CREATOR, new String[] {getUserAgent().getProducer()}); gen.writeDSCComment(DSCConstants.CREATION_DATE, new Object[] {new java.util.Date()}); - gen.writeDSCComment(DSCConstants.LANGUAGE_LEVEL, new Integer(gen.getPSLevel())); + gen.writeDSCComment(DSCConstants.LANGUAGE_LEVEL, gen.getPSLevel()); gen.writeDSCComment(DSCConstants.PAGES, new Object[] {DSCConstants.ATEND}); gen.writeDSCComment(DSCConstants.BBOX, DSCConstants.ATEND); gen.writeDSCComment(DSCConstants.HIRES_BBOX, DSCConstants.ATEND); @@ -259,7 +259,7 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { //Write trailer gen.writeDSCComment(DSCConstants.TRAILER); writeExtensions(COMMENT_DOCUMENT_TRAILER); - gen.writeDSCComment(DSCConstants.PAGES, new Integer(this.currentPageNumber)); + gen.writeDSCComment(DSCConstants.PAGES, this.currentPageNumber); new DSCCommentBoundingBox(this.documentBoundingBox).generate(gen); new DSCCommentHiResBoundingBox(this.documentBoundingBox).generate(gen); gen.getResourceTracker().writeResources(false, gen); @@ -332,7 +332,7 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { gen.getResourceTracker().notifyResourceUsageOnPage(PSProcSets.STD_PROCSET); gen.writeDSCComment(DSCConstants.PAGE, new Object[] {name, - new Integer(this.currentPageNumber)}); + Integer.valueOf(this.currentPageNumber)}); double pageWidth = size.width / 1000.0; double pageHeight = size.height / 1000.0; @@ -340,11 +340,11 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { List pageSizes = new java.util.ArrayList(); if (this.psUtil.isAutoRotateLandscape() && (pageHeight < pageWidth)) { rotate = true; - pageSizes.add(new Long(Math.round(pageHeight))); - pageSizes.add(new Long(Math.round(pageWidth))); + pageSizes.add(Math.round(pageHeight)); + pageSizes.add(Math.round(pageWidth)); } else { - pageSizes.add(new Long(Math.round(pageWidth))); - pageSizes.add(new Long(Math.round(pageHeight))); + pageSizes.add(Math.round(pageWidth)); + pageSizes.add(Math.round(pageHeight)); } pageDeviceDictionary.put("/PageSize", pageSizes); this.currentPageDefinition = new PageDefinition( @@ -378,25 +378,25 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { } }*/ - final Integer zero = new Integer(0); + final Integer zero = 0; Rectangle2D pageBoundingBox = new Rectangle2D.Double(); if (rotate) { pageBoundingBox.setRect(0, 0, pageHeight, pageWidth); gen.writeDSCComment(DSCConstants.PAGE_BBOX, new Object[] { - zero, zero, new Long(Math.round(pageHeight)), - new Long(Math.round(pageWidth)) }); + zero, zero, Long.valueOf(Math.round(pageHeight)), + Long.valueOf(Math.round(pageWidth)) }); gen.writeDSCComment(DSCConstants.PAGE_HIRES_BBOX, new Object[] { - zero, zero, new Double(pageHeight), - new Double(pageWidth) }); + zero, zero, Double.valueOf(pageHeight), + Double.valueOf(pageWidth) }); gen.writeDSCComment(DSCConstants.PAGE_ORIENTATION, "Landscape"); } else { pageBoundingBox.setRect(0, 0, pageWidth, pageHeight); gen.writeDSCComment(DSCConstants.PAGE_BBOX, new Object[] { - zero, zero, new Long(Math.round(pageWidth)), - new Long(Math.round(pageHeight)) }); + zero, zero, Long.valueOf(Math.round(pageWidth)), + Long.valueOf(Math.round(pageHeight)) }); gen.writeDSCComment(DSCConstants.PAGE_HIRES_BBOX, new Object[] { - zero, zero, new Double(pageWidth), - new Double(pageHeight) }); + zero, zero, Double.valueOf(pageWidth), + Double.valueOf(pageHeight) }); if (psUtil.isAutoRotateLandscape()) { gen.writeDSCComment(DSCConstants.PAGE_ORIENTATION, "Portrait"); 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 66c3b01ab..394784197 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 @@ -49,10 +49,10 @@ final class FoUnitsConverter { /** conversion factors keyed by xsl:fo units names */ private static final Map TWIP_FACTORS = new HashMap(); static { - TWIP_FACTORS.put(FixedLength.MM, new Float(MM_TO_TWIPS)); - TWIP_FACTORS.put(FixedLength.CM, new Float(CM_TO_TWIPS)); - TWIP_FACTORS.put(FixedLength.POINT, new Float(POINT_TO_TWIPS)); - TWIP_FACTORS.put(FixedLength.INCH, new Float(IN_TO_TWIPS)); + TWIP_FACTORS.put(FixedLength.MM, MM_TO_TWIPS); + TWIP_FACTORS.put(FixedLength.CM, CM_TO_TWIPS); + TWIP_FACTORS.put(FixedLength.POINT, POINT_TO_TWIPS); + TWIP_FACTORS.put(FixedLength.INCH, IN_TO_TWIPS); } /** singleton pattern */ 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 05c68bec6..aa39b111c 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 @@ -588,10 +588,10 @@ public class RTFHandler extends FOEventHandler { percentManager.setDimension(tc, iWidth); //convert to twips - Float width = new Float(FoUnitsConverter.getInstance().convertMptToTwips(iWidth)); + Float width = FoUnitsConverter.getInstance().convertMptToTwips(iWidth); builderContext.getTableContext().setNextColumnWidth(width); builderContext.getTableContext().setNextColumnRowSpanning( - new Integer(0), null); + 0, null); builderContext.getTableContext().setNextFirstSpanningCol(false); } catch (Exception e) { log.error("startColumn: " + e.getMessage()); @@ -844,11 +844,11 @@ public class RTFHandler extends FOEventHandler { cell.setVMerge(RtfTableCell.MERGE_START); // set the number of rows spanned - tctx.setCurrentColumnRowSpanning(new Integer(numberRowsSpanned), + tctx.setCurrentColumnRowSpanning(numberRowsSpanned, cell.getRtfAttributes()); } else { tctx.setCurrentColumnRowSpanning( - new Integer(numberRowsSpanned), null); + numberRowsSpanned, null); } //process number-columns-spanned attribute @@ -873,11 +873,11 @@ public class RTFHandler extends FOEventHandler { // set the number of rows spanned tctx.setCurrentColumnRowSpanning( - new Integer(numberRowsSpanned), + numberRowsSpanned, cell.getRtfAttributes()); } else { tctx.setCurrentColumnRowSpanning( - new Integer(numberRowsSpanned), cell.getRtfAttributes()); + numberRowsSpanned, cell.getRtfAttributes()); } } } 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 6fa84d44c..b777d5816 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 @@ -129,7 +129,7 @@ public class RtfAttributes implements Cloneable { * @return this (which now contains the new entry), for chaining calls */ public RtfAttributes set(String name, int value) { - values.put(name, new Integer(value)); + values.put(name, value); return this; } 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 413c9ad87..a849fea43 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 @@ -122,7 +122,7 @@ public final class RtfColorTable { /** define a named color for getColorNumber(String) */ private void addNamedColor(String name, int colorNumber) { - namedColors.put(name.toLowerCase(), new Integer(colorNumber)); + namedColors.put(name.toLowerCase(), colorNumber); } ////////////////////////////////////////////////// @@ -147,7 +147,7 @@ public final class RtfColorTable { * @return The number of the color in the table */ public Integer getColorNumber(int red, int green, int blue) { - Integer identifier = new Integer(determineIdentifier(red, green, blue)); + Integer identifier = determineIdentifier(red, green, blue); Object o = colorIndex.get(identifier); int retVal; @@ -166,7 +166,7 @@ public final class RtfColorTable { retVal = ((Integer) o).intValue() + 1; } - return new Integer(retVal); + return retVal; } /** @@ -215,7 +215,7 @@ public final class RtfColorTable { * @param i Identifier of color */ private void addColor(Integer i) { - colorIndex.put(i, new Integer(colorTable.size())); + colorIndex.put(i, colorTable.size()); colorTable.addElement(i); } diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java index 5af417ed5..aa3a403fa 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java @@ -519,16 +519,16 @@ public class RtfExternalGraphic extends RtfElement { } if (this.cropValues[0] != 0) { - writeOneAttribute("piccropl", new Integer(this.cropValues[0])); + writeOneAttribute("piccropl", this.cropValues[0]); } if (this.cropValues[1] != 0) { - writeOneAttribute("piccropt", new Integer(this.cropValues[1])); + writeOneAttribute("piccropt", this.cropValues[1]); } if (this.cropValues[2] != 0) { - writeOneAttribute("piccropr", new Integer(this.cropValues[2])); + writeOneAttribute("piccropr", this.cropValues[2]); } if (this.cropValues[3] != 0) { - writeOneAttribute("piccropb", new Integer(this.cropValues[3])); + writeOneAttribute("piccropb", this.cropValues[3]); } } diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java index cd28a518c..3c3ce9a2b 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java @@ -106,7 +106,7 @@ extends RtfContainer { if (listTable != null) { return listTable; } else { - listTable = new RtfListTable(this, writer, new Integer(listNum), attr); + listTable = new RtfListTable(this, writer, listNum, attr); listTableContainer.addChild(listTable); } 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 4701604c8..a36c989dc 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 @@ -174,7 +174,7 @@ public final class RtfFontManager { * @param family Identifier of font */ private void addFont(String family) { - fontIndex.put(getFontKey(family), new Integer(fontTable.size())); + fontIndex.put(getFontKey(family), fontTable.size()); fontTable.addElement(family); } } diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java index a89159109..9bcf8e1b0 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfList.java @@ -51,8 +51,8 @@ public class RtfList extends RtfContainer { super(parent, w, attr); //random number generator for ids - listId = new Integer(listIdGenerator.nextInt()); - listTemplateId = new Integer(listIdGenerator.nextInt()); + listId = listIdGenerator.nextInt(); + listTemplateId = listIdGenerator.nextInt(); //create a new list table entry for the list listTable = getRtfFile().startListTable(attr); diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java index 209cbe102..07b3436ac 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListItem.java @@ -189,7 +189,7 @@ public class RtfListItem extends RtfContainer getRtfListStyle().writeListPrefix(this); writeGroupMark(false); - writeOneAttribute(RtfListTable.LIST_NUMBER, new Integer(number)); + writeOneAttribute(RtfListTable.LIST_NUMBER, number); } /** diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleBullet.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleBullet.java index 9c7235352..e7139d02e 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleBullet.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleBullet.java @@ -44,7 +44,7 @@ public class RtfListStyleBullet extends RtfListStyle { // bulleted list item.writeControlWord("pnlvlblt"); item.writeControlWord("ilvl0"); - item.writeOneAttribute(RtfListTable.LIST_NUMBER, new Integer(item.getNumber())); + item.writeOneAttribute(RtfListTable.LIST_NUMBER, item.getNumber()); item.writeOneAttribute("pnindent", item.getParentList().attrib.getValue(RtfListTable.LIST_INDENT)); item.writeControlWord("pnf1"); diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleNumber.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleNumber.java index c03315715..f2edf7d2f 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleNumber.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleNumber.java @@ -46,7 +46,7 @@ public class RtfListStyleNumber extends RtfListStyle { item.writeControlWord("ilvl0"); item.writeOneAttribute(RtfListTable.LIST_NUMBER, "0"); item.writeControlWord("pndec"); - item.writeOneAttribute("pnstart", new Integer(1)); + item.writeOneAttribute("pnstart", 1); item.writeOneAttribute("pnindent", item.attrib.getValue(RtfListTable.LIST_INDENT)); item.writeControlWord("pntxta."); @@ -79,7 +79,7 @@ public class RtfListStyleNumber extends RtfListStyle { public void writeLevelGroup(RtfElement element) throws IOException { element.writeOneAttributeNS( - RtfListTable.LIST_START_AT, new Integer(1)); + RtfListTable.LIST_START_AT, 1); element.attrib.set(RtfListTable.LIST_NUMBER_TYPE, 0); element.writeGroupMark(true); @@ -92,6 +92,6 @@ public class RtfListStyleNumber extends RtfListStyle { RtfListTable.LIST_NUM_POSITION, "\\'01;"); element.writeGroupMark(false); - element.writeOneAttribute(RtfListTable.LIST_FONT_TYPE, new Integer(0)); + element.writeOneAttribute(RtfListTable.LIST_FONT_TYPE, 0); } } diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleText.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleText.java index e236ea4bd..b10d4348f 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleText.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListStyleText.java @@ -54,7 +54,7 @@ public class RtfListStyleText extends RtfListStyle { // bulleted list item.writeControlWord("pnlvlblt"); item.writeControlWord("ilvl0"); - item.writeOneAttribute(RtfListTable.LIST_NUMBER, new Integer(item.getNumber())); + item.writeOneAttribute(RtfListTable.LIST_NUMBER, item.getNumber()); item.writeOneAttribute("pnindent", item.getParentList().attrib.getValue(RtfListTable.LIST_INDENT)); item.writeControlWord("pnf1"); diff --git a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListTable.java b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListTable.java index ff51d8535..ff65c4fe1 100644 --- a/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListTable.java +++ b/fop-core/src/main/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfListTable.java @@ -155,8 +155,8 @@ public class RtfListTable extends RtfContainer { writeGroupMark(true); writeOneAttributeNS(LIST_ID, style.getRtfList().getListId().toString()); - writeOneAttributeNS(LIST_OVR_COUNT, new Integer(0)); - writeOneAttributeNS(LIST_NUMBER, new Integer(z++)); + writeOneAttributeNS(LIST_OVR_COUNT, 0); + writeOneAttributeNS(LIST_NUMBER, z++); writeGroupMark(false); writeGroupMark(false); @@ -191,7 +191,7 @@ public class RtfListTable extends RtfContainer { writeOneAttributeNS(LIST_JUSTIFICATION, attrib.getValue(LIST_JUSTIFICATION)); writeOneAttributeNS(LIST_FOLLOWING_CHAR, attrib.getValue(LIST_FOLLOWING_CHAR)); - writeOneAttributeNS(LIST_SPACE, new Integer(0)); + writeOneAttributeNS(LIST_SPACE, 0); writeOneAttributeNS(LIST_INDENT, attrib.getValue(LIST_INDENT)); RtfListItem item = (RtfListItem)list.getChildren().get(0); 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 689a2753f..2db0dd128 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 @@ -69,7 +69,7 @@ public class RtfSpaceSplitter { public int split(String key) { Integer i = (Integer) commonAttributes.getValue(key); if (i == null) { - i = new Integer(0); + i = 0; } commonAttributes.unset(key); 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 9f542dd75..9649fb7fc 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 @@ -41,20 +41,20 @@ public final class RtfStringConverter { private static final RtfStringConverter INSTANCE = new RtfStringConverter(); private static final Map SPECIAL_CHARS; - private static final Character DBLQUOTE = new Character('\"'); - private static final Character QUOTE = new Character('\''); - private static final Character SPACE = new Character(' '); + private static final Character DBLQUOTE = '\"'; + private static final Character QUOTE = '\''; + private static final Character SPACE = ' '; /** List of characters to escape with corresponding replacement strings */ static { SPECIAL_CHARS = new HashMap(); - SPECIAL_CHARS.put(new Character('\t'), "tab"); - SPECIAL_CHARS.put(new Character('\n'), "line"); - SPECIAL_CHARS.put(new Character('\''), "rquote"); - SPECIAL_CHARS.put(new Character('\"'), "rdblquote"); - SPECIAL_CHARS.put(new Character('\\'), "\\"); - SPECIAL_CHARS.put(new Character('{'), "{"); - SPECIAL_CHARS.put(new Character('}'), "}"); + SPECIAL_CHARS.put('\t', "tab"); + SPECIAL_CHARS.put('\n', "line"); + SPECIAL_CHARS.put('\'', "rquote"); + SPECIAL_CHARS.put('\"', "rdblquote"); + SPECIAL_CHARS.put('\\', "\\"); + SPECIAL_CHARS.put('{', "{"); + SPECIAL_CHARS.put('}', "}"); } /** singleton pattern */ @@ -96,13 +96,13 @@ public final class RtfStringConverter { StringBuffer sb = new StringBuffer(Math.max(16, str.length())); // TODO: could be made more efficient (binary lookup, etc.) for (int i = 0; i < str.length(); i++) { - final Character c = new Character(str.charAt(i)); + final Character c = str.charAt(i); Character d; String replacement; if (i != 0) { - d = new Character(str.charAt(i - 1)); + d = str.charAt(i - 1); } else { - d = new Character(SPACE); + d = SPACE; } //This section modified by Chris Scott 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 48d6efed1..dded727fc 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 @@ -148,7 +148,7 @@ public final class RtfStyleSheetTable { if (attrs != null) { attrTable.put(name, attrs); } - styles.put(name, new Integer(nameTable.size() - 1 + startIndex)); + styles.put(name, nameTable.size() - 1 + startIndex); } /** 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 5a1615541..4410eb17f 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 @@ -281,7 +281,7 @@ public class RtfTextrun extends RtfContainer { ListIterator lit = children.listIterator(children.size()); while (lit.hasPrevious() && (lit.previous() instanceof RtfCloseGroupMark)) { - tmp.push(Integer.valueOf(((RtfCloseGroupMark)lit.next()).getBreakType())); + tmp.push(((RtfCloseGroupMark) lit.next()).getBreakType()); lit.remove(); deletedCloseGroupCount++; } 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 a1d76478c..a9558aad3 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 @@ -114,7 +114,7 @@ public class PercentContext implements PercentBaseContext { baseWidthSet = true; } // width in mpt - lengthMap.put(fobj, new Integer(width)); + lengthMap.put(fobj, width); } /** @@ -123,7 +123,7 @@ public class PercentContext implements PercentBaseContext { * @param tableUnit the table unit value (in millipoints) */ public void setTableUnit(Table table, int tableUnit) { - tableUnitMap.put(table, new Integer(tableUnit)); + tableUnitMap.put(table, tableUnit); } /** @@ -132,13 +132,13 @@ public class PercentContext implements PercentBaseContext { private Integer findParent(FONode fobj) { if (fobj.getRoot() != fobj) { if (lengthMap.containsKey(fobj)) { - return new Integer(lengthMap.get(fobj).toString()); + return Integer.valueOf(lengthMap.get(fobj).toString()); } else { return findParent(fobj.getParent()); } } else { log.error("Base Value for element " + fobj.getName() + " not found"); - return new Integer(-1); + return -1; } } 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 3e1aca1c1..74cc20bf5 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 @@ -168,9 +168,9 @@ public class TableContext implements ITableColumnsInfo { while (colIndex >= colFirstSpanningCol.size()) { setNextFirstSpanningCol(false); } - colFirstSpanningCol.set(colIndex, Boolean.valueOf(bFirstSpanningCol)); + colFirstSpanningCol.set(colIndex, bFirstSpanningCol); } else { - colFirstSpanningCol.add(Boolean.valueOf(bFirstSpanningCol)); + colFirstSpanningCol.add(bFirstSpanningCol); } } @@ -181,7 +181,7 @@ public class TableContext implements ITableColumnsInfo { */ public void setNextFirstSpanningCol( boolean bFirstSpanningCol) { - colFirstSpanningCol.add(Boolean.valueOf(bFirstSpanningCol)); + colFirstSpanningCol.add(bFirstSpanningCol); } /** @@ -195,14 +195,14 @@ public class TableContext implements ITableColumnsInfo { Integer i = (Integer)colRowSpanningNumber.get(z); if (i.intValue() > 0) { - i = new Integer(i.intValue() - 1); + i = i.intValue() - 1; } colRowSpanningNumber.set(z, i); if (i.intValue() == 0) { colRowSpanningAttrs.set(z, null); - colFirstSpanningCol.set(z, Boolean.valueOf(false)); + colFirstSpanningCol.set(z, false); } } } @@ -238,7 +238,7 @@ public class TableContext implements ITableColumnsInfo { log.warn("Column width for column " + (colIndex + 1) + " is not defined, using " + INVALID_COLUMN_WIDTH); while (colIndex >= getNumberOfColumns()) { - setNextColumnWidth(new Float(INVALID_COLUMN_WIDTH)); + setNextColumnWidth(INVALID_COLUMN_WIDTH); } } return ((Float)colWidths.get(colIndex)).floatValue(); diff --git a/fop-core/src/main/java/org/apache/fop/render/txt/border/BorderManager.java b/fop-core/src/main/java/org/apache/fop/render/txt/border/BorderManager.java index 0af243ec6..9342d266f 100644 --- a/fop-core/src/main/java/org/apache/fop/render/txt/border/BorderManager.java +++ b/fop-core/src/main/java/org/apache/fop/render/txt/border/BorderManager.java @@ -98,7 +98,7 @@ public class BorderManager { public Character getCharacter(int x, int y) { Character c = null; if (borderInfo[y][x] != null) { - c = new Character(borderInfo[y][x].convert2Char()); + c = borderInfo[y][x].convert2Char(); } return c; } 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 f415c5473..41e3f7d8b 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 @@ -934,10 +934,10 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand // } List<Double> bbox = new java.util.ArrayList<Double>(); - bbox.add(new Double(rect.getX())); - bbox.add(new Double(rect.getHeight() + rect.getY())); - bbox.add(new Double(rect.getWidth() + rect.getX())); - bbox.add(new Double(rect.getY())); + bbox.add(rect.getX()); + bbox.add(rect.getHeight() + rect.getY()); + bbox.add(rect.getWidth() + rect.getX()); + bbox.add(rect.getY()); AffineTransform transform; transform = new AffineTransform(getBaseTransform()); @@ -948,7 +948,7 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand double [] mat = new double[6]; transform.getMatrix(mat); for (int idx = 0; idx < mat.length; idx++) { - theMatrix.add(new Double(mat[idx])); + theMatrix.add(mat[idx]); } /** @todo see if pdfDoc and res can be linked here, @@ -1324,8 +1324,8 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand } if (kerningAvailable && (i + 1) < l) { - addKerning(currentStream, (Integer.valueOf(ch)), - (Integer.valueOf(fontState.mapChar(s.charAt(i + 1)))), + addKerning(currentStream, ((int) ch), + ((int) fontState.mapChar(s.charAt(i + 1))), kerning, startText, endText); } @@ -1348,10 +1348,10 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand if (profile == null) { Map<String, Float> vals = new java.util.HashMap<String, Float>(); if (fillAlpha != OPAQUE) { - vals.put(PDFGState.GSTATE_ALPHA_NONSTROKE, new Float(fillAlpha / 255f)); + vals.put(PDFGState.GSTATE_ALPHA_NONSTROKE, fillAlpha / 255f); } if (strokeAlpha != OPAQUE) { - vals.put(PDFGState.GSTATE_ALPHA_STROKE, new Float(strokeAlpha / 255f)); + vals.put(PDFGState.GSTATE_ALPHA_STROKE, strokeAlpha / 255f); } PDFGState gstate = pdfDoc.getFactory().makeGState(vals, paintingState.getGState()); resourceContext.addGState(gstate); diff --git a/fop-core/src/main/java/org/apache/fop/svg/text/BidiAttributedCharacterIterator.java b/fop-core/src/main/java/org/apache/fop/svg/text/BidiAttributedCharacterIterator.java index 268d44747..a233dd771 100644 --- a/fop-core/src/main/java/org/apache/fop/svg/text/BidiAttributedCharacterIterator.java +++ b/fop-core/src/main/java/org/apache/fop/svg/text/BidiAttributedCharacterIterator.java @@ -67,7 +67,7 @@ public class BidiAttributedCharacterIterator implements AttributedCharacterItera currRunLevel = nextRunLevel; } else if (nextRunLevel != currRunLevel) { as.addAttribute(GVTAttributedCharacterIterator.TextAttribute.BIDI_LEVEL, - new Integer(currRunLevel), runStart, i); + currRunLevel, runStart, i); runStart = i; runEnd = runStart; currRunLevel = nextRunLevel; @@ -75,7 +75,7 @@ public class BidiAttributedCharacterIterator implements AttributedCharacterItera } if ((currRunLevel >= 0) && (end > runStart)) { as.addAttribute(GVTAttributedCharacterIterator.TextAttribute.BIDI_LEVEL, - new Integer(currRunLevel), runStart, end); + currRunLevel, runStart, end); } return as.getIterator(); } else { diff --git a/fop-core/src/main/java/org/apache/fop/tools/TestConverter.java b/fop-core/src/main/java/org/apache/fop/tools/TestConverter.java index d837a29fb..c05ae8fee 100644 --- a/fop-core/src/main/java/org/apache/fop/tools/TestConverter.java +++ b/fop-core/src/main/java/org/apache/fop/tools/TestConverter.java @@ -285,8 +285,8 @@ public class TestConverter { FopFactory fopFactory = FopFactory.newInstance(baseUri); FOUserAgent userAgent = fopFactory.newFOUserAgent(); - userAgent.getRendererOptions().put("fineDetail", Boolean.valueOf(false)); - userAgent.getRendererOptions().put("consistentOutput", Boolean.valueOf(true)); + userAgent.getRendererOptions().put("fineDetail", false); + userAgent.getRendererOptions().put("consistentOutput", true); userAgent.setProducer("Testsuite Converter"); String outname = res; @@ -312,7 +312,7 @@ public class TestConverter { File f1 = new File(destdir, outname + ".at.xml"); File f2 = new File(compare, outname + ".at.xml"); if (!compareFiles(f1, f2)) { - differ.put(outname + ".at.xml", Boolean.valueOf(pass)); + differ.put(outname + ".at.xml", pass); } } } catch (Exception e) { 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 3f815e59e..b3d2c19dc 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 @@ -95,7 +95,7 @@ public final class XMLUtil implements XMLConstants { if (s == null) { return null; } else { - return new Integer(s); + return Integer.valueOf(s); } } 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 178203ff6..27d668af6 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 @@ -260,7 +260,7 @@ public class TTXFile { } public int mapCharToGlyph(int c) { if (cmap != null) { - Integer g = cmap.get(Integer.valueOf(c)); + Integer g = cmap.get(c); if (g != null) { return (int) g; } else { @@ -389,7 +389,7 @@ public class TTXFile { missingRequiredAttribute(en, "glyph"); } int gid = mapGlyphId(glyph, en); - alternates.add(Integer.valueOf(gid)); + alternates.add(gid); } else { notPermittedInElementContext(en, getParent(), pn); } @@ -401,7 +401,7 @@ public class TTXFile { missingRequiredAttribute(en, "glyph"); } int gid = mapGlyphId(glyph, en); - coverageEntries.add(Integer.valueOf(gid)); + coverageEntries.add(gid); } else { notPermittedInElementContext(en, getParent(), pn); } @@ -817,7 +817,7 @@ public class TTXFile { missingRequiredAttribute(en, "value"); } else { int gid = mapGlyphId(value, en); - coverageEntries.add(Integer.valueOf(gid)); + coverageEntries.add(gid); } } else { notPermittedInElementContext(en, getParent(), pnx); @@ -1030,7 +1030,7 @@ public class TTXFile { missingRequiredAttribute(en, "glyph"); } int gid = mapGlyphId(glyph, en); - coverageEntries.add(Integer.valueOf(gid)); + coverageEntries.add(gid); } else { notPermittedInElementContext(en, getParent(), pn); } @@ -1708,7 +1708,7 @@ public class TTXFile { missingRequiredAttribute(en, "value"); } else { int gid = mapGlyphId(value, en); - substitutes.add(Integer.valueOf(gid)); + substitutes.add(gid); } } else { notPermittedInElementContext(en, getParent(), pn); @@ -1730,8 +1730,8 @@ public class TTXFile { } else { ogid = mapGlyphId(out, en); } - coverageEntries.add(Integer.valueOf(igid)); - subtableEntries.add(Integer.valueOf(ogid)); + coverageEntries.add(igid); + subtableEntries.add(ogid); } else { notPermittedInElementContext(en, getParent(), pn); } @@ -2594,8 +2594,8 @@ public class TTXFile { private Map<Integer, Integer> getCMAP() { Map<Integer, Integer> cmap = new TreeMap(); for (int[] cme : cmapEntries) { - Integer c = Integer.valueOf(cme[0]); - Integer g = Integer.valueOf(cme[1]); + Integer c = cme[0]; + Integer g = cme[1]; cmap.put(c, g); } return cmap; @@ -2603,8 +2603,8 @@ public class TTXFile { private Map<Integer, Integer> getGMAP() { Map<Integer, Integer> gmap = new TreeMap(); for (int[] cme : cmapEntries) { - Integer c = Integer.valueOf(cme[0]); - Integer g = Integer.valueOf(cme[1]); + Integer c = cme[0]; + Integer g = cme[1]; gmap.put(g, c); } return gmap; @@ -2636,21 +2636,21 @@ public class TTXFile { List entries = new ArrayList<Integer>(); int s = -1; int l = -1; - Integer zero = Integer.valueOf(0); + Integer zero = 0; for (int[] m : cma) { int g = m[0]; int c = m[1]; if (s < 0) { s = g; l = g - 1; - entries.add(Integer.valueOf(s)); + entries.add(s); } while (g > (l + 1)) { entries.add(zero); l++; } assert l == (g - 1); - entries.add(Integer.valueOf(c)); + entries.add(c); l = g; } return GlyphClassTable.createClassTable(entries); @@ -3140,7 +3140,7 @@ public class TTXFile { } } } - return Integer.valueOf(ncMax); + return ncMax; } private Anchor[][] extractComponents() { Anchor[][] cam = new Anchor [ components.size() ][]; @@ -3206,7 +3206,7 @@ public class TTXFile { } } } - return Integer.valueOf(ncMax); + return ncMax; } private Integer computeLigaturesComponentCount(Anchor[][][] lam) { int nxMax = 0; @@ -3220,7 +3220,7 @@ public class TTXFile { } } } - return Integer.valueOf(nxMax); + return nxMax; } private Anchor[] extractAttachmentAnchors() { int na = attachmentAnchors.size(); 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 1362ad559..2cfaeee2b 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 @@ -40,13 +40,13 @@ import org.apache.fop.fo.properties.CommonBorderPaddingBackground.BorderInfo; */ public class CollapsedConditionalBorderTestCase extends AbstractTableTest { - private final Integer border0pt = new Integer(0); + private final Integer border0pt = 0; - private final Integer border4pt = new Integer(4000); + private final Integer border4pt = 4000; - private final Integer border6pt = new Integer(6000); + private final Integer border6pt = 6000; - private final Integer border8pt = new Integer(8000); + private final Integer border8pt = 8000; /** * Resolved borders for tables without headers and footers, generated from the Python diff --git a/fop-core/src/test/java/org/apache/fop/fonts/CIDFullTestCase.java b/fop-core/src/test/java/org/apache/fop/fonts/CIDFullTestCase.java index 7df6cc25b..73ded6875 100644 --- a/fop-core/src/test/java/org/apache/fop/fonts/CIDFullTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/fonts/CIDFullTestCase.java @@ -55,7 +55,7 @@ public class CIDFullTestCase { continue; } bs.set(j); - glyphs.put(Integer.valueOf(j), Integer.valueOf(j)); + glyphs.put(j, j); chars[i] = (char) j; widths[i] = 100; i++; diff --git a/fop-core/src/test/java/org/apache/fop/fonts/truetype/OTFSubSetFileTestCase.java b/fop-core/src/test/java/org/apache/fop/fonts/truetype/OTFSubSetFileTestCase.java index efc91d121..cce22531c 100644 --- a/fop-core/src/test/java/org/apache/fop/fonts/truetype/OTFSubSetFileTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/fonts/truetype/OTFSubSetFileTestCase.java @@ -245,21 +245,21 @@ public class OTFSubSetFileTestCase extends OTFFileTestCase { if (b0 == 28) { int b1 = input[curPos + 1] & 0xff; int b2 = input[curPos + 2] & 0xff; - return new BytesNumber(Integer.valueOf((short) (b1 << 8 | b2)), 3); + return new BytesNumber((int) (short) (b1 << 8 | b2), 3); } else if (b0 >= 32 && b0 <= 246) { - return new BytesNumber(Integer.valueOf(b0 - 139), 1); + return new BytesNumber(b0 - 139, 1); } else if (b0 >= 247 && b0 <= 250) { int b1 = input[curPos + 1] & 0xff; - return new BytesNumber(Integer.valueOf((b0 - 247) * 256 + b1 + 108), 2); + return new BytesNumber((b0 - 247) * 256 + b1 + 108, 2); } else if (b0 >= 251 && b0 <= 254) { int b1 = input[curPos + 1] & 0xff; - return new BytesNumber(Integer.valueOf(-(b0 - 251) * 256 - b1 - 108), 2); + return new BytesNumber(-(b0 - 251) * 256 - b1 - 108, 2); } else if (b0 == 255) { int b1 = input[curPos + 1] & 0xff; int b2 = input[curPos + 2] & 0xff; int b3 = input[curPos + 3] & 0xff; int b4 = input[curPos + 4] & 0xff; - return new BytesNumber(Integer.valueOf((b1 << 24 | b2 << 16 | b3 << 8 | b4)), 5); + return new BytesNumber((b1 << 24 | b2 << 16 | b3 << 8 | b4), 5); } else { throw new IllegalArgumentException(); } diff --git a/fop-core/src/test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java b/fop-core/src/test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java index a78b3e674..06fef70cc 100644 --- a/fop-core/src/test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/fonts/truetype/TTFFileTestCase.java @@ -114,10 +114,10 @@ public class TTFFileTestCase { if (ansiKerning.isEmpty()) { fail(); } - Integer k1 = ansiKerning.get(Integer.valueOf('A')).get( - Integer.valueOf('T')); + Integer k1 = ansiKerning.get((int) 'A').get( + (int) 'T'); assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(-112), k1.intValue()); - Integer k2 = ansiKerning.get(Integer.valueOf('Y')).get(Integer.valueOf('u')); + Integer k2 = ansiKerning.get((int) 'Y').get((int) 'u'); assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(-178), k2.intValue()); // DroidSansMono doens't have kerning (it's mono-spaced) @@ -297,9 +297,9 @@ public class TTFFileTestCase { if (kerning.isEmpty()) { fail(); } - Integer k1 = kerning.get(Integer.valueOf('A')).get(Integer.valueOf('T')); + Integer k1 = kerning.get((int) 'A').get((int) 'T'); assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(-112), k1.intValue()); - Integer k2 = kerning.get(Integer.valueOf('K')).get(Integer.valueOf('u')); + Integer k2 = kerning.get((int) 'K').get((int) 'u'); assertEquals(dejavuTTFFile.convertTTFUnit2PDFUnit(-45), k2.intValue()); // DroidSansMono has no kerning data (mono-spaced) diff --git a/fop-core/src/test/java/org/apache/fop/memory/MemoryEater.java b/fop-core/src/test/java/org/apache/fop/memory/MemoryEater.java index efe0cc489..537003b6e 100644 --- a/fop-core/src/test/java/org/apache/fop/memory/MemoryEater.java +++ b/fop-core/src/test/java/org/apache/fop/memory/MemoryEater.java @@ -75,7 +75,7 @@ public final class MemoryEater { Source src = new StreamSource(foFile); Transformer transformer = replicatorTemplates.newTransformer(); - transformer.setParameter("repeats", new Integer(replicatorRepeats)); + transformer.setParameter("repeats", replicatorRepeats); OutputStream out = new NullOutputStream(); //write to /dev/nul try { diff --git a/fop-core/src/test/java/org/apache/fop/pdf/PDFArrayTestCase.java b/fop-core/src/test/java/org/apache/fop/pdf/PDFArrayTestCase.java index 53e9bdba0..9d1f17210 100644 --- a/fop-core/src/test/java/org/apache/fop/pdf/PDFArrayTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/pdf/PDFArrayTestCase.java @@ -196,7 +196,7 @@ public class PDFArrayTestCase extends PDFObjectTestCase { */ @Test public void testAdd() { - intArray.add(new Integer(6)); + intArray.add(Integer.valueOf(6)); doubleArray.add(6.6); // Test some arbitrary values for (int i = 1; i <= 6; i++) { diff --git a/fop-core/src/test/java/org/apache/fop/pdf/PDFDictionaryTestCase.java b/fop-core/src/test/java/org/apache/fop/pdf/PDFDictionaryTestCase.java index cc2352300..b2da349fc 100644 --- a/fop-core/src/test/java/org/apache/fop/pdf/PDFDictionaryTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/pdf/PDFDictionaryTestCase.java @@ -65,7 +65,7 @@ public class PDFDictionaryTestCase extends PDFObjectTestCase { pdfDictUnderTest.setDocument(doc); pdfDictUnderTest.put("String", "TestValue"); pdfDictUnderTest.put("int", 10); - pdfDictUnderTest.put("double", Double.valueOf(3.1)); + pdfDictUnderTest.put("double", 3.1); pdfDictUnderTest.put("array", testArray); pdfDictUnderTest.put("number", testNumber); // null is a valid PDF object diff --git a/fop-core/src/test/java/org/apache/fop/traits/MinOptMaxTestCase.java b/fop-core/src/test/java/org/apache/fop/traits/MinOptMaxTestCase.java index ba6862785..190fb471e 100644 --- a/fop-core/src/test/java/org/apache/fop/traits/MinOptMaxTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/traits/MinOptMaxTestCase.java @@ -212,7 +212,7 @@ public class MinOptMaxTestCase { assertFalse(number.equals(MinOptMax.getInstance(1, 4, 5))); assertFalse(number.equals(MinOptMax.getInstance(1, 3, 4))); assertFalse(number.equals(null)); - assertFalse(number.equals(new Integer(1))); + assertFalse(number.equals(1)); } @Test diff --git a/fop-core/src/test/java/org/apache/fop/util/AdvancedMessageFormatTestCase.java b/fop-core/src/test/java/org/apache/fop/util/AdvancedMessageFormatTestCase.java index 5e75f2563..f0d965cd9 100644 --- a/fop-core/src/test/java/org/apache/fop/util/AdvancedMessageFormatTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/util/AdvancedMessageFormatTestCase.java @@ -172,15 +172,15 @@ public class AdvancedMessageFormatTestCase { Map params = new java.util.HashMap(); - params.put("amount", new Integer(0)); + params.put("amount", 0); msg = format.format(params); assertEquals("You have nothing.", msg); - params.put("amount", new Integer(7)); + params.put("amount", 7); msg = format.format(params); assertEquals("You have 7 bucks.", msg); - params.put("amount", new Integer(140)); + params.put("amount", 140); msg = format.format(params); assertEquals("You have more than enough.", msg); diff --git a/fop-events/src/test/java/org/apache/fop/events/BasicEventTestCase.java b/fop-events/src/test/java/org/apache/fop/events/BasicEventTestCase.java index 39e3fec98..e8c559728 100644 --- a/fop-events/src/test/java/org/apache/fop/events/BasicEventTestCase.java +++ b/fop-events/src/test/java/org/apache/fop/events/BasicEventTestCase.java @@ -43,7 +43,7 @@ public class BasicEventTestCase { Event ev = new Event(this, "123", EventSeverity.INFO, Event.paramsBuilder() .param("reason", "I'm tired") - .param("blah", new Integer(23)) + .param("blah", Integer.valueOf(23)) .build()); broadcaster.broadcastEvent(ev); @@ -52,7 +52,7 @@ public class BasicEventTestCase { assertEquals("123", listener.event.getEventID()); assertEquals(EventSeverity.INFO, listener.event.getSeverity()); assertEquals("I'm tired", ev.getParam("reason")); - assertEquals(new Integer(23), ev.getParam("blah")); + assertEquals(Integer.valueOf(23), ev.getParam("blah")); broadcaster.removeEventListener(listener); assertFalse(broadcaster.hasEventListeners()); @@ -79,7 +79,7 @@ public class BasicEventTestCase { listener.event.getEventID()); assertEquals(EventSeverity.WARN, listener.event.getSeverity()); assertEquals("I'm tired", ev.getParam("reason")); - assertEquals(new Integer(23), ev.getParam("blah")); + assertEquals(Integer.valueOf(23), ev.getParam("blah")); broadcaster.removeEventListener(listener); assertFalse(broadcaster.hasEventListeners()); diff --git a/fop/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java b/fop/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java index dc8e16202..c13342100 100644 --- a/fop/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java +++ b/fop/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java @@ -138,17 +138,17 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis { Node n = new Node(nodeIndex); ns.string.append(n.toNodeString()); if (n.high != 0) { - ns.high.add(new Integer(pos)); + ns.high.add(Integer.valueOf(pos)); NodeString highNs = new NodeString(pos); - highNs.low.add(new Integer(pos)); + highNs.low.add(Integer.valueOf(pos)); int index = strings.indexOf(ns); strings.add(index, highNs); addNode(n.high, strings, highNs); } if (n.low != 0) { - ns.low.add(new Integer(pos)); + ns.low.add(Integer.valueOf(pos)); NodeString lowNs = new NodeString(pos); - lowNs.high.add(new Integer(pos)); + lowNs.high.add(Integer.valueOf(pos)); int index = strings.indexOf(ns); strings.add(index + 1, lowNs); addNode(n.low, strings, lowNs); |