Index: src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableUtils.java =================================================================== --- src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableUtils.java (revision 823070) +++ src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableUtils.java (working copy) @@ -73,7 +73,7 @@ * @return The aWTColor value */ public final static Color getAWTColor(int index, Color deflt) { - HSSFColor clr = (HSSFColor) colors.get(new Integer(index)); + HSSFColor clr = (HSSFColor) colors.get(Integer.valueOf(index)); if (clr == null) { return deflt; } Index: src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellEditor.java =================================================================== --- src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellEditor.java (revision 823070) +++ src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellEditor.java (working copy) @@ -192,7 +192,7 @@ * */ private final Color getAWTColor(int index, Color deflt) { - HSSFColor clr = (HSSFColor)colors.get(new Integer(index)); + HSSFColor clr = (HSSFColor)colors.get(Integer.valueOf(index)); if (clr == null) return deflt; return getAWTColor(clr); } Index: src/contrib/src/org/apache/poi/ss/usermodel/contrib/RegionUtil.java =================================================================== --- src/contrib/src/org/apache/poi/ss/usermodel/contrib/RegionUtil.java (revision 823070) +++ src/contrib/src/org/apache/poi/ss/usermodel/contrib/RegionUtil.java (working copy) @@ -48,7 +48,7 @@ public CellPropertySetter(Workbook workbook, String propertyName, int value) { _workbook = workbook; _propertyName = propertyName; - _propertyValue = new Short((short) value); + _propertyValue = Short.valueOf((short) value); } Index: src/contrib/src/org/apache/poi/ss/usermodel/contrib/CellUtil.java =================================================================== --- src/contrib/src/org/apache/poi/ss/usermodel/contrib/CellUtil.java (revision 823070) +++ src/contrib/src/org/apache/poi/ss/usermodel/contrib/CellUtil.java (working copy) @@ -154,7 +154,7 @@ * @see CellStyle for alignment options */ public static void setAlignment(Cell cell, Workbook workbook, short align) { - setCellStyleProperty(cell, workbook, ALIGNMENT, new Short(align)); + setCellStyleProperty(cell, workbook, ALIGNMENT, Short.valueOf(align)); } /** @@ -311,7 +311,7 @@ * @param value property value */ private static void putShort(Map properties, String name, short value) { - properties.put(name, new Short(value)); + properties.put(name, Short.valueOf(value)); } /** @@ -322,7 +322,7 @@ * @param value property value */ private static void putBoolean(Map properties, String name, boolean value) { - properties.put(name, new Boolean(value)); + properties.put(name, Boolean.valueOf(value)); } /** Index: src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java =================================================================== --- src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java (revision 823070) +++ src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java (working copy) @@ -589,7 +589,7 @@ { propertyCount++; final CustomProperty cp = new CustomProperty(p, - (String) dictionary.get(new Long(id))); + (String) dictionary.get(Long.valueOf(id))); cps.put(cp.getName(), cp); } } Index: src/java/org/apache/poi/hpsf/Variant.java =================================================================== --- src/java/org/apache/poi/hpsf/Variant.java (revision 823070) +++ src/java/org/apache/poi/hpsf/Variant.java (working copy) @@ -351,32 +351,32 @@ /** *

Denotes a variant type with a length that is unknown to HPSF yet.

*/ - public static final Integer LENGTH_UNKNOWN = new Integer(-2); + public static final Integer LENGTH_UNKNOWN = Integer.valueOf(-2); /** *

Denotes a variant type with a variable length.

*/ - public static final Integer LENGTH_VARIABLE = new Integer(-1); + public static final Integer LENGTH_VARIABLE = Integer.valueOf(-1); /** *

Denotes a variant type with a length of 0 bytes.

*/ - public static final Integer LENGTH_0 = new Integer(0); + public static final Integer LENGTH_0 = Integer.valueOf(0); /** *

Denotes a variant type with a length of 2 bytes.

*/ - public static final Integer LENGTH_2 = new Integer(2); + public static final Integer LENGTH_2 = Integer.valueOf(2); /** *

Denotes a variant type with a length of 4 bytes.

*/ - public static final Integer LENGTH_4 = new Integer(4); + public static final Integer LENGTH_4 = Integer.valueOf(4); /** *

Denotes a variant type with a length of 8 bytes.

*/ - public static final Integer LENGTH_8 = new Integer(8); + public static final Integer LENGTH_8 = Integer.valueOf(8); @@ -384,92 +384,92 @@ { /* Initialize the number-to-name map: */ Map tm1 = new HashMap(); - tm1.put(new Long(0), "VT_EMPTY"); - tm1.put(new Long(1), "VT_NULL"); - tm1.put(new Long(2), "VT_I2"); - tm1.put(new Long(3), "VT_I4"); - tm1.put(new Long(4), "VT_R4"); - tm1.put(new Long(5), "VT_R8"); - tm1.put(new Long(6), "VT_CY"); - tm1.put(new Long(7), "VT_DATE"); - tm1.put(new Long(8), "VT_BSTR"); - tm1.put(new Long(9), "VT_DISPATCH"); - tm1.put(new Long(10), "VT_ERROR"); - tm1.put(new Long(11), "VT_BOOL"); - tm1.put(new Long(12), "VT_VARIANT"); - tm1.put(new Long(13), "VT_UNKNOWN"); - tm1.put(new Long(14), "VT_DECIMAL"); - tm1.put(new Long(16), "VT_I1"); - tm1.put(new Long(17), "VT_UI1"); - tm1.put(new Long(18), "VT_UI2"); - tm1.put(new Long(19), "VT_UI4"); - tm1.put(new Long(20), "VT_I8"); - tm1.put(new Long(21), "VT_UI8"); - tm1.put(new Long(22), "VT_INT"); - tm1.put(new Long(23), "VT_UINT"); - tm1.put(new Long(24), "VT_VOID"); - tm1.put(new Long(25), "VT_HRESULT"); - tm1.put(new Long(26), "VT_PTR"); - tm1.put(new Long(27), "VT_SAFEARRAY"); - tm1.put(new Long(28), "VT_CARRAY"); - tm1.put(new Long(29), "VT_USERDEFINED"); - tm1.put(new Long(30), "VT_LPSTR"); - tm1.put(new Long(31), "VT_LPWSTR"); - tm1.put(new Long(64), "VT_FILETIME"); - tm1.put(new Long(65), "VT_BLOB"); - tm1.put(new Long(66), "VT_STREAM"); - tm1.put(new Long(67), "VT_STORAGE"); - tm1.put(new Long(68), "VT_STREAMED_OBJECT"); - tm1.put(new Long(69), "VT_STORED_OBJECT"); - tm1.put(new Long(70), "VT_BLOB_OBJECT"); - tm1.put(new Long(71), "VT_CF"); - tm1.put(new Long(72), "VT_CLSID"); + tm1.put(Long.valueOf(0), "VT_EMPTY"); + tm1.put(Long.valueOf(1), "VT_NULL"); + tm1.put(Long.valueOf(2), "VT_I2"); + tm1.put(Long.valueOf(3), "VT_I4"); + tm1.put(Long.valueOf(4), "VT_R4"); + tm1.put(Long.valueOf(5), "VT_R8"); + tm1.put(Long.valueOf(6), "VT_CY"); + tm1.put(Long.valueOf(7), "VT_DATE"); + tm1.put(Long.valueOf(8), "VT_BSTR"); + tm1.put(Long.valueOf(9), "VT_DISPATCH"); + tm1.put(Long.valueOf(10), "VT_ERROR"); + tm1.put(Long.valueOf(11), "VT_BOOL"); + tm1.put(Long.valueOf(12), "VT_VARIANT"); + tm1.put(Long.valueOf(13), "VT_UNKNOWN"); + tm1.put(Long.valueOf(14), "VT_DECIMAL"); + tm1.put(Long.valueOf(16), "VT_I1"); + tm1.put(Long.valueOf(17), "VT_UI1"); + tm1.put(Long.valueOf(18), "VT_UI2"); + tm1.put(Long.valueOf(19), "VT_UI4"); + tm1.put(Long.valueOf(20), "VT_I8"); + tm1.put(Long.valueOf(21), "VT_UI8"); + tm1.put(Long.valueOf(22), "VT_INT"); + tm1.put(Long.valueOf(23), "VT_UINT"); + tm1.put(Long.valueOf(24), "VT_VOID"); + tm1.put(Long.valueOf(25), "VT_HRESULT"); + tm1.put(Long.valueOf(26), "VT_PTR"); + tm1.put(Long.valueOf(27), "VT_SAFEARRAY"); + tm1.put(Long.valueOf(28), "VT_CARRAY"); + tm1.put(Long.valueOf(29), "VT_USERDEFINED"); + tm1.put(Long.valueOf(30), "VT_LPSTR"); + tm1.put(Long.valueOf(31), "VT_LPWSTR"); + tm1.put(Long.valueOf(64), "VT_FILETIME"); + tm1.put(Long.valueOf(65), "VT_BLOB"); + tm1.put(Long.valueOf(66), "VT_STREAM"); + tm1.put(Long.valueOf(67), "VT_STORAGE"); + tm1.put(Long.valueOf(68), "VT_STREAMED_OBJECT"); + tm1.put(Long.valueOf(69), "VT_STORED_OBJECT"); + tm1.put(Long.valueOf(70), "VT_BLOB_OBJECT"); + tm1.put(Long.valueOf(71), "VT_CF"); + tm1.put(Long.valueOf(72), "VT_CLSID"); Map tm2 = new HashMap(tm1.size(), 1.0F); tm2.putAll(tm1); numberToName = Collections.unmodifiableMap(tm2); /* Initialize the number-to-length map: */ tm1.clear(); - tm1.put(new Long(0), LENGTH_0); - tm1.put(new Long(1), LENGTH_UNKNOWN); - tm1.put(new Long(2), LENGTH_2); - tm1.put(new Long(3), LENGTH_4); - tm1.put(new Long(4), LENGTH_4); - tm1.put(new Long(5), LENGTH_8); - tm1.put(new Long(6), LENGTH_UNKNOWN); - tm1.put(new Long(7), LENGTH_UNKNOWN); - tm1.put(new Long(8), LENGTH_UNKNOWN); - tm1.put(new Long(9), LENGTH_UNKNOWN); - tm1.put(new Long(10), LENGTH_UNKNOWN); - tm1.put(new Long(11), LENGTH_UNKNOWN); - tm1.put(new Long(12), LENGTH_UNKNOWN); - tm1.put(new Long(13), LENGTH_UNKNOWN); - tm1.put(new Long(14), LENGTH_UNKNOWN); - tm1.put(new Long(16), LENGTH_UNKNOWN); - tm1.put(new Long(17), LENGTH_UNKNOWN); - tm1.put(new Long(18), LENGTH_UNKNOWN); - tm1.put(new Long(19), LENGTH_UNKNOWN); - tm1.put(new Long(20), LENGTH_UNKNOWN); - tm1.put(new Long(21), LENGTH_UNKNOWN); - tm1.put(new Long(22), LENGTH_UNKNOWN); - tm1.put(new Long(23), LENGTH_UNKNOWN); - tm1.put(new Long(24), LENGTH_UNKNOWN); - tm1.put(new Long(25), LENGTH_UNKNOWN); - tm1.put(new Long(26), LENGTH_UNKNOWN); - tm1.put(new Long(27), LENGTH_UNKNOWN); - tm1.put(new Long(28), LENGTH_UNKNOWN); - tm1.put(new Long(29), LENGTH_UNKNOWN); - tm1.put(new Long(30), LENGTH_VARIABLE); - tm1.put(new Long(31), LENGTH_UNKNOWN); - tm1.put(new Long(64), LENGTH_8); - tm1.put(new Long(65), LENGTH_UNKNOWN); - tm1.put(new Long(66), LENGTH_UNKNOWN); - tm1.put(new Long(67), LENGTH_UNKNOWN); - tm1.put(new Long(68), LENGTH_UNKNOWN); - tm1.put(new Long(69), LENGTH_UNKNOWN); - tm1.put(new Long(70), LENGTH_UNKNOWN); - tm1.put(new Long(71), LENGTH_UNKNOWN); - tm1.put(new Long(72), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(0), LENGTH_0); + tm1.put(Long.valueOf(1), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(2), LENGTH_2); + tm1.put(Long.valueOf(3), LENGTH_4); + tm1.put(Long.valueOf(4), LENGTH_4); + tm1.put(Long.valueOf(5), LENGTH_8); + tm1.put(Long.valueOf(6), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(7), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(8), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(9), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(10), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(11), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(12), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(13), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(14), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(16), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(17), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(18), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(19), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(20), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(21), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(22), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(23), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(24), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(25), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(26), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(27), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(28), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(29), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(30), LENGTH_VARIABLE); + tm1.put(Long.valueOf(31), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(64), LENGTH_8); + tm1.put(Long.valueOf(65), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(66), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(67), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(68), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(69), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(70), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(71), LENGTH_UNKNOWN); + tm1.put(Long.valueOf(72), LENGTH_UNKNOWN); tm2 = new HashMap(tm1.size(), 1.0F); tm2.putAll(tm1); numberToLength = Collections.unmodifiableMap(tm2); @@ -486,7 +486,7 @@ */ public static String getVariantName(final long variantType) { - final String name = (String) numberToName.get(new Long(variantType)); + final String name = (String) numberToName.get(Long.valueOf(variantType)); return name != null ? name : "unknown variant type"; } @@ -501,7 +501,7 @@ */ public static int getVariantLength(final long variantType) { - final Long key = new Long((int) variantType); + final Long key = Long.valueOf((int) variantType); final Long length = (Long) numberToLength.get(key); if (length == null) return -2; Index: src/java/org/apache/poi/hpsf/Section.java =================================================================== --- src/java/org/apache/poi/hpsf/Section.java (revision 823070) +++ src/java/org/apache/poi/hpsf/Section.java (working copy) @@ -278,7 +278,7 @@ this.offset + ple.offset, ple.length, codepage); if (p.getID() == PropertyIDMap.PID_CODEPAGE) - p = new Property(p.getID(), p.getType(), new Integer(codepage)); + p = new Property(p.getID(), p.getType(), Integer.valueOf(codepage)); properties[i1++] = p; } @@ -450,7 +450,7 @@ { String s = null; if (dictionary != null) - s = (String) dictionary.get(new Long(pid)); + s = (String) dictionary.get(Long.valueOf(pid)); if (s == null) s = SectionIDMap.getPIDString(getFormatID().getBytes(), pid); if (s == null) Index: src/java/org/apache/poi/hpsf/MutableSection.java =================================================================== --- src/java/org/apache/poi/hpsf/MutableSection.java (revision 823070) +++ src/java/org/apache/poi/hpsf/MutableSection.java (working copy) @@ -182,7 +182,7 @@ */ public void setProperty(final int id, final int value) { - setProperty(id, Variant.VT_I4, new Integer(value)); + setProperty(id, Variant.VT_I4, Integer.valueOf(value)); dirty = true; } @@ -199,7 +199,7 @@ */ public void setProperty(final int id, final long value) { - setProperty(id, Variant.VT_I8, new Long(value)); + setProperty(id, Variant.VT_I8, Long.valueOf(value)); dirty = true; } @@ -216,7 +216,7 @@ */ public void setProperty(final int id, final boolean value) { - setProperty(id, Variant.VT_BOOL, new Boolean(value)); + setProperty(id, Variant.VT_BOOL, Boolean.valueOf(value)); dirty = true; } @@ -300,7 +300,7 @@ */ protected void setPropertyBooleanValue(final int id, final boolean value) { - setProperty(id, Variant.VT_BOOL, new Boolean(value)); + setProperty(id, Variant.VT_BOOL, Boolean.valueOf(value)); } @@ -418,7 +418,7 @@ * dictionary is present. In order to cope with this problem we * add the codepage property and set it to Unicode. */ setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2, - new Integer(Constants.CP_UNICODE)); + Integer.valueOf(Constants.CP_UNICODE)); codepage = getCodepage(); } @@ -646,7 +646,7 @@ (Integer) getProperty(PropertyIDMap.PID_CODEPAGE); if (codepage == null) setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2, - new Integer(Constants.CP_UNICODE)); + Integer.valueOf(Constants.CP_UNICODE)); } else /* Setting the dictionary to null means to remove property 0. @@ -707,7 +707,7 @@ public void setCodepage(final int codepage) { setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2, - new Integer(codepage)); + Integer.valueOf(codepage)); } } Index: src/java/org/apache/poi/hpsf/Property.java =================================================================== --- src/java/org/apache/poi/hpsf/Property.java (revision 823070) +++ src/java/org/apache/poi/hpsf/Property.java (working copy) @@ -217,7 +217,7 @@ for (int i = 0; i < nrEntries; i++) { /* The key. */ - final Long id = new Long(LittleEndian.getUInt(src, o)); + final Long id = Long.valueOf(LittleEndian.getUInt(src, o)); o += LittleEndian.INT_SIZE; /* The value (a string). The length is the either the Index: src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java =================================================================== --- src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java (revision 823070) +++ src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java (working copy) @@ -291,7 +291,7 @@ */ public Object put(final long id, final String idString) { - return put(new Long(id), idString); + return put(Long.valueOf(id), idString); } @@ -305,7 +305,7 @@ */ public Object get(final long id) { - return get(new Long(id)); + return get(Long.valueOf(id)); } Index: src/java/org/apache/poi/hpsf/VariantSupport.java =================================================================== --- src/java/org/apache/poi/hpsf/VariantSupport.java (revision 823070) +++ src/java/org/apache/poi/hpsf/VariantSupport.java (working copy) @@ -97,7 +97,7 @@ { if (unsupportedMessage == null) unsupportedMessage = new LinkedList(); - Long vt = new Long(ex.getVariantType()); + Long vt = Long.valueOf(ex.getVariantType()); if (!unsupportedMessage.contains(vt)) { System.err.println(ex.getMessage()); @@ -182,7 +182,7 @@ * Read a short. In Java it is represented as an * Integer object. */ - value = new Integer(LittleEndian.getShort(src, o1)); + value = Integer.valueOf(LittleEndian.getShort(src, o1)); break; } case Variant.VT_I4: @@ -191,7 +191,7 @@ * Read a word. In Java it is represented as an * Integer object. */ - value = new Integer(LittleEndian.getInt(src, o1)); + value = Integer.valueOf(LittleEndian.getInt(src, o1)); break; } case Variant.VT_I8: @@ -200,7 +200,7 @@ * Read a double word. In Java it is represented as a * Long object. */ - value = new Long(LittleEndian.getLong(src, o1)); + value = Long.valueOf(LittleEndian.getLong(src, o1)); break; } case Variant.VT_R8: @@ -209,7 +209,7 @@ * Read an eight-byte double value. In Java it is represented as * a Double object. */ - value = new Double(LittleEndian.getDouble(src, o1)); + value = Double.valueOf(LittleEndian.getDouble(src, o1)); break; } case Variant.VT_FILETIME: Index: src/java/org/apache/poi/hpsf/CustomProperties.java =================================================================== --- src/java/org/apache/poi/hpsf/CustomProperties.java (revision 823070) +++ src/java/org/apache/poi/hpsf/CustomProperties.java (working copy) @@ -96,7 +96,7 @@ ") do not match."); /* Register name and ID in the dictionary. Mapping in both directions is possible. If there is already a */ - final Long idKey = new Long(cp.getID()); + final Long idKey = Long.valueOf(cp.getID()); final Object oldID = dictionaryNameToID.get(name); dictionaryIDToName.remove(oldID); dictionaryNameToID.put(name, idKey); @@ -313,7 +313,7 @@ final MutableProperty p = new MutableProperty(); p.setID(PropertyIDMap.PID_CODEPAGE); p.setType(Variant.VT_I2); - p.setValue(new Integer(codepage)); + p.setValue(Integer.valueOf(codepage)); put(new CustomProperty(p)); } Index: src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java =================================================================== --- src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java (revision 823070) +++ src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java (working copy) @@ -149,7 +149,7 @@ if (log.check( POILogger.DEBUG )) log.log(DEBUG, "Time at start of cell creating in HSSF sheet = ", - new Long(timestart)); + Long.valueOf(timestart)); HSSFRow lastrow = null; // Add every cell to its row @@ -180,12 +180,12 @@ hrow.createCellFromRecord( cval ); if (log.check( POILogger.DEBUG )) log.log( DEBUG, "record took ", - new Long( System.currentTimeMillis() - cellstart ) ); + Long.valueOf( System.currentTimeMillis() - cellstart ) ); } if (log.check( POILogger.DEBUG )) log.log(DEBUG, "total sheet cell creation took ", - new Long(System.currentTimeMillis() - timestart)); + Long.valueOf(System.currentTimeMillis() - timestart)); } /** @@ -231,7 +231,7 @@ } if (_rows.size() > 0) { - Integer key = new Integer(row.getRowNum()); + Integer key = Integer.valueOf(row.getRowNum()); HSSFRow removedRow = _rows.remove(key); if (removedRow != row) { //should not happen if the input argument is valid @@ -296,7 +296,7 @@ private void addRow(HSSFRow row, boolean addLow) { - _rows.put(new Integer(row.getRowNum()), row); + _rows.put(Integer.valueOf(row.getRowNum()), row); if (addLow) { _sheet.addRow(row.getRowRecord()); @@ -319,7 +319,7 @@ * @return HSSFRow representing the row number or null if its not defined on the sheet */ public HSSFRow getRow(int rowIndex) { - return _rows.get(new Integer(rowIndex)); + return _rows.get(Integer.valueOf(rowIndex)); } /** Index: src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java =================================================================== --- src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java (revision 823070) +++ src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java (working copy) @@ -211,7 +211,7 @@ EscherComplexProperty cp = (EscherComplexProperty)prop; String str = StringUtil.getFromUnicodeLE(cp.getComplexData()); - if(str.equals("Chart 1\0")) { + if("Chart 1\0".equals(str)) { return true; } } Index: src/java/org/apache/poi/hssf/usermodel/FontDetails.java =================================================================== --- src/java/org/apache/poi/hssf/usermodel/FontDetails.java (revision 823070) +++ src/java/org/apache/poi/hssf/usermodel/FontDetails.java (working copy) @@ -57,7 +57,7 @@ public void addChar( char c, int width ) { - charWidths.put(new Character(c), new Integer(width)); + charWidths.put(new Character(c), Integer.valueOf(width)); } /** @@ -78,7 +78,7 @@ { for ( int i = 0; i < characters.length; i++ ) { - charWidths.put( new Character(characters[i]), new Integer(widths[i])); + charWidths.put( new Character(characters[i]), Integer.valueOf(widths[i])); } } Index: src/java/org/apache/poi/hssf/usermodel/DVConstraint.java =================================================================== --- src/java/org/apache/poi/hssf/usermodel/DVConstraint.java (revision 823070) +++ src/java/org/apache/poi/hssf/usermodel/DVConstraint.java (working copy) @@ -276,7 +276,7 @@ return null; } try { - return new Double(numberStr); + return Double.valueOf(numberStr); } catch (NumberFormatException e) { throw new RuntimeException("The supplied text '" + numberStr + "' could not be parsed as a number"); @@ -290,7 +290,7 @@ if (timeStr == null) { return null; } - return new Double(HSSFDateUtil.convertTime(timeStr)); + return Double.valueOf(HSSFDateUtil.convertTime(timeStr)); } /** * @param dateFormat pass null for default YYYYMMDD @@ -311,7 +311,7 @@ + "' using specified format '" + dateFormat + "'", e); } } - return new Double(HSSFDateUtil.getExcelDate(dateVal)); + return Double.valueOf(HSSFDateUtil.getExcelDate(dateVal)); } public static DVConstraint createCustomFormulaConstraint(String formula) { @@ -464,7 +464,7 @@ */ public void setValue1(double value1) { _formula1 = null; - _value1 = new Double(value1); + _value1 = Double.valueOf(value1); } /** @@ -478,6 +478,6 @@ */ public void setValue2(double value2) { _formula2 = null; - _value2 = new Double(value2); + _value2 = Double.valueOf(value2); } } Index: src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java =================================================================== --- src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java (revision 823070) +++ src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java (working copy) @@ -1081,7 +1081,7 @@ // So we don't confuse users, give them back // the same object every time, but create // them lazily - Short sIdx = new Short(idx); + Short sIdx = Short.valueOf(idx); if(fonts.containsKey(sIdx)) { return (HSSFFont)fonts.get(sIdx); } Index: src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java =================================================================== --- src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java (revision 823070) +++ src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java (working copy) @@ -270,7 +270,7 @@ public void drawString(String str, int x, int y) { - if (str == null || str.equals("")) + if (str == null || "".equals(str)) return; Font excelFont = font; Index: src/java/org/apache/poi/hssf/model/Sheet.java =================================================================== --- src/java/org/apache/poi/hssf/model/Sheet.java (revision 823070) +++ src/java/org/apache/poi/hssf/model/Sheet.java (working copy) @@ -1031,7 +1031,7 @@ public void setColumnWidth(int column, int width) { if(width > 255*256) throw new IllegalArgumentException("The maximum column width for an individual cell is 255 characters."); - setColumn(column, null, new Integer(width), null, null, null); + setColumn(column, null, Integer.valueOf(width), null, null, null); } /** @@ -1059,7 +1059,7 @@ setColumn( column, null, null, null, Boolean.valueOf(hidden), null); } public void setDefaultColumnStyle(int column, int styleIndex) { - setColumn(column, new Short((short)styleIndex), null, null, null, null); + setColumn(column, Short.valueOf((short)styleIndex), null, null, null, null); } private void setColumn(int column, Short xfStyle, Integer width, Integer level, Boolean hidden, Boolean collapsed) { Index: src/java/org/apache/poi/hssf/model/DrawingManager.java =================================================================== --- src/java/org/apache/poi/hssf/model/DrawingManager.java (revision 823070) +++ src/java/org/apache/poi/hssf/model/DrawingManager.java (working copy) @@ -48,7 +48,7 @@ dg.setLastMSOSPID( -1 ); dgg.addCluster( dgId, 0 ); dgg.setDrawingsSaved( dgg.getDrawingsSaved() + 1 ); - dgMap.put( new Short( dgId ), dg ); + dgMap.put( Short.valueOf( dgId ), dg ); return dg; } @@ -60,7 +60,7 @@ public int allocateShapeId(short drawingGroupId) { // Get the last shape id for this drawing group. - EscherDgRecord dg = (EscherDgRecord) dgMap.get(new Short(drawingGroupId)); + EscherDgRecord dg = (EscherDgRecord) dgMap.get(Short.valueOf(drawingGroupId)); int lastShapeId = dg.getLastMSOSPID(); Index: src/java/org/apache/poi/hssf/model/Workbook.java =================================================================== --- src/java/org/apache/poi/hssf/model/Workbook.java (revision 823070) +++ src/java/org/apache/poi/hssf/model/Workbook.java (working copy) @@ -180,7 +180,7 @@ public static Workbook createWorkbook(List recs) { if (log.check( POILogger.DEBUG )) log.log(DEBUG, "Workbook (readfile) created with reclen=", - new Integer(recs.size())); + Integer.valueOf(recs.size())); Workbook retval = new Workbook(); List records = new ArrayList(recs.size() / 3); retval.records.setRecords(records); @@ -517,8 +517,8 @@ public void setSheetBof(int sheetIndex, int pos) { if (log.check( POILogger.DEBUG )) - log.log(DEBUG, "setting bof for sheetnum =", new Integer(sheetIndex), - " at pos=", new Integer(pos)); + log.log(DEBUG, "setting bof for sheetnum =", Integer.valueOf(sheetIndex), + " at pos=", Integer.valueOf(pos)); checkSheets(sheetIndex); getBoundSheetRec(sheetIndex) .setPositionOfBof(pos); @@ -757,7 +757,7 @@ public int getNumSheets() { if (log.check( POILogger.DEBUG )) - log.log(DEBUG, "getNumSheets=", new Integer(boundsheets.size())); + log.log(DEBUG, "getNumSheets=", Integer.valueOf(boundsheets.size())); return boundsheets.size(); } @@ -769,7 +769,7 @@ public int getNumExFormats() { if (log.check( POILogger.DEBUG )) - log.log(DEBUG, "getXF=", new Integer(numxfs)); + log.log(DEBUG, "getXF=", Integer.valueOf(numxfs)); return numxfs; } @@ -903,7 +903,7 @@ UnicodeString retval = sst.getString(str); if (log.check( POILogger.DEBUG )) - log.log(DEBUG, "Returning SST for index=", new Integer(str), + log.log(DEBUG, "Returning SST for index=", Integer.valueOf(str), " String= ", retval); return retval; } Index: src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java =================================================================== --- src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java (revision 823070) +++ src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java (working copy) @@ -73,7 +73,7 @@ public void processRecordInternally(Record record) { if (record instanceof FormatRecord) { FormatRecord fr = (FormatRecord) record; - _customFormatRecords.put(new Integer(fr.getIndexCode()), fr); + _customFormatRecords.put(Integer.valueOf(fr.getIndexCode()), fr); } if (record instanceof ExtendedFormatRecord) { ExtendedFormatRecord xr = (ExtendedFormatRecord) record; @@ -117,7 +117,7 @@ public String getFormatString(int formatIndex) { String format = null; if (formatIndex >= HSSFDataFormat.getNumberOfBuiltinBuiltinFormats()) { - FormatRecord tfr = _customFormatRecords.get(new Integer(formatIndex)); + FormatRecord tfr = _customFormatRecords.get(Integer.valueOf(formatIndex)); if (tfr == null) { System.err.println("Requested format at index " + formatIndex + ", but it wasn't found"); Index: src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java =================================================================== --- src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java (revision 823070) +++ src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java (working copy) @@ -67,7 +67,7 @@ public void addListener(HSSFListener lsnr, short sid) { List list = null; - Object obj = records.get(new Short(sid)); + Object obj = records.get(Short.valueOf(sid)); if (obj != null) { @@ -78,7 +78,7 @@ list = new ArrayList( 1); // probably most people will use one listener list.add(lsnr); - records.put(new Short(sid), list); + records.put(Short.valueOf(sid), list); } } @@ -115,7 +115,7 @@ protected short processRecord(Record rec) throws HSSFUserException { - Object obj = records.get(new Short(rec.getSid())); + Object obj = records.get(Short.valueOf(rec.getSid())); short userCode = 0; if (obj != null) Index: src/java/org/apache/poi/hssf/util/HSSFColor.java =================================================================== --- src/java/org/apache/poi/hssf/util/HSSFColor.java (revision 823070) +++ src/java/org/apache/poi/hssf/util/HSSFColor.java (working copy) @@ -63,7 +63,7 @@ for (int i = 0; i < colors.length; i++) { HSSFColor color = colors[i]; - Integer index1 = new Integer(color.getIndex()); + Integer index1 = Integer.valueOf(color.getIndex()); if (result.containsKey(index1)) { HSSFColor prevColor = (HSSFColor)result.get(index1); throw new RuntimeException("Dup color index (" + index1 @@ -111,7 +111,7 @@ } catch (IllegalAccessException e) { throw new RuntimeException(e); } - return new Integer(s.intValue()); + return Integer.valueOf(s.intValue()); } private static HSSFColor[] getAllColors() { Index: src/java/org/apache/poi/hssf/record/constant/ConstantValueParser.java =================================================================== --- src/java/org/apache/poi/hssf/record/constant/ConstantValueParser.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/constant/ConstantValueParser.java (working copy) @@ -61,7 +61,7 @@ in.readLong(); // 8 byte 'not used' field return EMPTY_REPRESENTATION; case TYPE_NUMBER: - return new Double(in.readDouble()); + return Double.valueOf(in.readDouble()); case TYPE_STRING: return StringUtil.readUnicodeString(in); case TYPE_BOOLEAN: Index: src/java/org/apache/poi/hssf/record/EscherAggregate.java =================================================================== --- src/java/org/apache/poi/hssf/record/EscherAggregate.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/EscherAggregate.java (working copy) @@ -434,7 +434,7 @@ { if ( recordId == EscherClientDataRecord.RECORD_ID || recordId == EscherTextboxRecord.RECORD_ID ) { - spEndingOffsets.add( new Integer( offset ) ); + spEndingOffsets.add( Integer.valueOf( offset ) ); shapes.add( record ); } } Index: src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java =================================================================== --- src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java (working copy) @@ -131,7 +131,7 @@ int b = in.readByte(); remaining -= LittleEndian.BYTE_SIZE; if (field_2_refPtg != null && field_4_ole_classname == null) { - field_4_unknownByte = new Byte((byte)b); + field_4_unknownByte = Byte.valueOf((byte)b); } } int nUnexpectedPadding = remaining - dataLenAfterFormula; @@ -144,7 +144,7 @@ // Fetch the stream ID if (dataLenAfterFormula >= 4) { - field_5_stream_id = new Integer(in.readInt()); + field_5_stream_id = Integer.valueOf(in.readInt()); remaining -= LittleEndian.INT_SIZE; } else { field_5_stream_id = null; Index: src/java/org/apache/poi/hssf/record/RecordFactory.java =================================================================== --- src/java/org/apache/poi/hssf/record/RecordFactory.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/RecordFactory.java (working copy) @@ -227,7 +227,7 @@ * null if the specified record is not interpreted by POI. */ public static Class getRecordClass(int sid) { - I_RecordCreator rc = _recordCreatorsById.get(new Integer(sid)); + I_RecordCreator rc = _recordCreatorsById.get(Integer.valueOf(sid)); if (rc == null) { return null; } @@ -254,7 +254,7 @@ } public static Record createSingleRecord(RecordInputStream in) { - I_RecordCreator constructor = _recordCreatorsById.get(new Integer(in.getSid())); + I_RecordCreator constructor = _recordCreatorsById.get(Integer.valueOf(in.getSid())); if (constructor == null) { return new UnknownRecord(in); @@ -346,7 +346,7 @@ throw new RecordFormatException( "Unable to determine record types"); } - Integer key = new Integer(sid); + Integer key = Integer.valueOf(sid); if (result.containsKey(key)) { Class prevClass = result.get(key).getRecordClass(); throw new RuntimeException("duplicate record sid 0x" + Integer.toHexString(sid).toUpperCase() @@ -354,7 +354,7 @@ } result.put(key, new ReflectionRecordCreator(constructor)); } -// result.put(new Integer(0x0406), result.get(new Integer(0x06))); +// result.put(Integer.valueOf(0x0406), result.get(Integer.valueOf(0x06))); return result; } Index: src/java/org/apache/poi/hssf/record/formula/eval/OperandResolver.java =================================================================== --- src/java/org/apache/poi/hssf/record/formula/eval/OperandResolver.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/formula/eval/OperandResolver.java (working copy) @@ -256,7 +256,7 @@ } catch (NumberFormatException e) { return null; } - return new Double(isPositive ? +val : -val); + return Double.valueOf(isPositive ? +val : -val); } /** Index: src/java/org/apache/poi/hssf/record/formula/function/FunctionDataBuilder.java =================================================================== --- src/java/org/apache/poi/hssf/record/formula/function/FunctionDataBuilder.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/formula/function/FunctionDataBuilder.java (working copy) @@ -47,7 +47,7 @@ FunctionMetadata fm = new FunctionMetadata(functionIndex, functionName, minParams, maxParams, returnClassCode, parameterClassCodes); - Integer indexKey = new Integer(functionIndex); + Integer indexKey = Integer.valueOf(functionIndex); if(functionIndex > _maxFunctionIndex) { @@ -60,7 +60,7 @@ if(!hasFootnote || !_mutatingFunctionIndexes.contains(indexKey)) { throw new RuntimeException("Multiple entries for function name '" + functionName + "'"); } - _functionDataByIndex.remove(new Integer(prevFM.getIndex())); + _functionDataByIndex.remove(Integer.valueOf(prevFM.getIndex())); } prevFM = (FunctionMetadata) _functionDataByIndex.get(indexKey); if(prevFM != null) { Index: src/java/org/apache/poi/hssf/record/formula/functions/Value.java =================================================================== --- src/java/org/apache/poi/hssf/record/formula/functions/Value.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/formula/functions/Value.java (working copy) @@ -39,7 +39,7 @@ /** "1,0000" is valid, "1,00" is not */ private static final int MIN_DISTANCE_BETWEEN_THOUSANDS_SEPARATOR = 4; - private static final Double ZERO = new Double(0.0); + private static final Double ZERO = Double.valueOf(0.0); public ValueEval evaluate(ValueEval[] args, int srcCellRow, short srcCellCol) { if (args.length != 1) { @@ -182,6 +182,6 @@ // still a problem parsing the number - probably out of range return null; } - return new Double(foundUnaryMinus ? -d : d); + return Double.valueOf(foundUnaryMinus ? -d : d); } } Index: src/java/org/apache/poi/hssf/record/formula/functions/Mode.java =================================================================== --- src/java/org/apache/poi/hssf/record/formula/functions/Mode.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/formula/functions/Mode.java (working copy) @@ -125,7 +125,7 @@ return; } if (arg instanceof NumberEval) { - temp.add(new Double(((NumberEval) arg).getNumberValue())); + temp.add(Double.valueOf(((NumberEval) arg).getNumberValue())); return; } throw new RuntimeException("Unexpected value type (" + arg.getClass().getName() + ")"); Index: src/java/org/apache/poi/hssf/record/formula/functions/Countif.java =================================================================== --- src/java/org/apache/poi/hssf/record/formula/functions/Countif.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/formula/functions/Countif.java (working copy) @@ -501,13 +501,13 @@ if (value.length() < 4 || value.charAt(0) != '#') { return null; } - if (value.equals("#NULL!")) return ErrorEval.NULL_INTERSECTION; - if (value.equals("#DIV/0!")) return ErrorEval.DIV_ZERO; - if (value.equals("#VALUE!")) return ErrorEval.VALUE_INVALID; - if (value.equals("#REF!")) return ErrorEval.REF_INVALID; - if (value.equals("#NAME?")) return ErrorEval.NAME_INVALID; - if (value.equals("#NUM!")) return ErrorEval.NUM_ERROR; - if (value.equals("#N/A")) return ErrorEval.NA; + if ("#NULL!".equals(value)) return ErrorEval.NULL_INTERSECTION; + if ("#DIV/0!".equals(value)) return ErrorEval.DIV_ZERO; + if ("#VALUE!".equals(value)) return ErrorEval.VALUE_INVALID; + if ("#REF!".equals(value)) return ErrorEval.REF_INVALID; + if ("#NAME?".equals(value)) return ErrorEval.NAME_INVALID; + if ("#NUM!".equals(value)) return ErrorEval.NUM_ERROR; + if ("#N/A".equals(value)) return ErrorEval.NA; return null; } Index: src/java/org/apache/poi/hssf/record/SubRecord.java =================================================================== --- src/java/org/apache/poi/hssf/record/SubRecord.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/SubRecord.java (working copy) @@ -143,7 +143,7 @@ _linkPtg = readRefPtg(buf); switch (linkSize - formulaSize - 6) { case 1: - _unknownByte6 = new Byte(in.readByte()); + _unknownByte6 = Byte.valueOf(in.readByte()); break; case 0: _unknownByte6 = null; Index: src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java =================================================================== --- src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java (working copy) @@ -114,8 +114,8 @@ _unknownRecords.add(rec); } public void insertRow(RowRecord row) { - // Integer integer = new Integer(row.getRowNumber()); - _rowRecords.put(new Integer(row.getRowNumber()), row); + // Integer integer = Integer.valueOf(row.getRowNumber()); + _rowRecords.put(Integer.valueOf(row.getRowNumber()), row); if ((row.getRowNumber() < _firstrow) || (_firstrow == -1)) { _firstrow = row.getRowNumber(); } @@ -127,7 +127,7 @@ public void removeRow(RowRecord row) { int rowIndex = row.getRowNumber(); _valuesAgg.removeAllCellsValuesForRow(rowIndex); - Integer key = new Integer(rowIndex); + Integer key = Integer.valueOf(rowIndex); RowRecord rr = _rowRecords.remove(key); if (rr == null) { throw new RuntimeException("Invalid row index (" + key.intValue() + ")"); @@ -143,7 +143,7 @@ if (rowIndex < 0 || rowIndex > maxrow) { throw new IllegalArgumentException("The row number must be between 0 and " + maxrow); } - return _rowRecords.get(new Integer(rowIndex)); + return _rowRecords.get(Integer.valueOf(rowIndex)); } public int getPhysicalNumberOfRows() Index: src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java =================================================================== --- src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java (working copy) @@ -493,7 +493,7 @@ level = Math.min(7, level); colInfoSearchStartIdx = Math.max(0, colInfoIdx - 1); // -1 just in case this column is collapsed later. } - setColumn(i, null, null, new Integer(level), null, null); + setColumn(i, null, null, Integer.valueOf(level), null, null); } } /** Index: src/java/org/apache/poi/hssf/record/NoteRecord.java =================================================================== --- src/java/org/apache/poi/hssf/record/NoteRecord.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/NoteRecord.java (working copy) @@ -40,7 +40,7 @@ */ public final static short NOTE_VISIBLE = 0x2; - private static final Byte DEFAULT_PADDING = new Byte((byte)0); + private static final Byte DEFAULT_PADDING = Byte.valueOf((byte)0); private int field_1_row; private int field_2_col; @@ -89,7 +89,7 @@ field_6_author = StringUtil.readCompressedUnicode(in, length); } if (in.available() == 1) { - field_7_padding = new Byte(in.readByte()); + field_7_padding = Byte.valueOf(in.readByte()); } } Index: src/java/org/apache/poi/hssf/record/PageBreakRecord.java =================================================================== --- src/java/org/apache/poi/hssf/record/PageBreakRecord.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/PageBreakRecord.java (working copy) @@ -90,7 +90,7 @@ for(int k = 0; k < nBreaks; k++) { Break br = new Break(in); _breaks.add(br); - _breakMap.put(new Integer(br.main), br); + _breakMap.put(Integer.valueOf(br.main), br); } } @@ -160,7 +160,7 @@ */ public void addBreak(int main, int subFrom, int subTo) { - Integer key = new Integer(main); + Integer key = Integer.valueOf(main); Break region = _breakMap.get(key); if(region == null) { region = new Break(main, subFrom, subTo); @@ -178,7 +178,7 @@ * @param main (zero-based) */ public final void removeBreak(int main) { - Integer rowKey = new Integer(main); + Integer rowKey = Integer.valueOf(main); Break region = _breakMap.get(rowKey); _breaks.remove(region); _breakMap.remove(rowKey); @@ -190,7 +190,7 @@ * @return The Break or null if no break exists at the row/col specified. */ public final Break getBreak(int main) { - Integer rowKey = new Integer(main); + Integer rowKey = Integer.valueOf(main); return _breakMap.get(rowKey); } Index: src/java/org/apache/poi/hssf/record/TextObjectRecord.java =================================================================== --- src/java/org/apache/poi/hssf/record/TextObjectRecord.java (revision 823070) +++ src/java/org/apache/poi/hssf/record/TextObjectRecord.java (working copy) @@ -108,7 +108,7 @@ } _linkRefPtg = ptgs[0]; if (in.remaining() > 0) { - _unknownPostFormulaByte = new Byte(in.readByte()); + _unknownPostFormulaByte = Byte.valueOf(in.readByte()); } else { _unknownPostFormulaByte = null; } Index: src/java/org/apache/poi/ss/usermodel/BuiltinFormats.java =================================================================== --- src/java/org/apache/poi/ss/usermodel/BuiltinFormats.java (revision 823070) +++ src/java/org/apache/poi/ss/usermodel/BuiltinFormats.java (working copy) @@ -142,7 +142,7 @@ public static Map getBuiltinFormats() { Map result = new LinkedHashMap(); for (int i=0; i<_formats.length; i++) { - result.put(new Integer(i), _formats[i]); + result.put(Integer.valueOf(i), _formats[i]); } return result; } Index: src/java/org/apache/poi/ss/usermodel/DataFormatter.java =================================================================== --- src/java/org/apache/poi/ss/usermodel/DataFormatter.java (revision 823070) +++ src/java/org/apache/poi/ss/usermodel/DataFormatter.java (working copy) @@ -147,7 +147,7 @@ if (format != null) { return format; } - if (formatStr.equals("General") || formatStr.equals("@")) { + if ("General".equals(formatStr) || "@".equals(formatStr)) { if (DataFormatter.isWholeNumber(cellValue)) { return generalWholeNumFormat; } @@ -257,7 +257,7 @@ if(mIsMonth) { sb.append('M'); ms.add( - new Integer(sb.length() -1) + Integer.valueOf(sb.length() -1) ); } else { sb.append('m'); @@ -407,7 +407,7 @@ if (numberFormat == null) { return String.valueOf(d); } - return numberFormat.format(new Double(d)); + return numberFormat.format(Double.valueOf(d)); } /** @@ -432,7 +432,7 @@ if (numberFormat == null) { return String.valueOf(value); } - return numberFormat.format(new Double(value)); + return numberFormat.format(Double.valueOf(value)); } /** Index: src/java/org/apache/poi/ss/formula/FormulaParser.java =================================================================== --- src/java/org/apache/poi/ss/formula/FormulaParser.java (revision 823070) +++ src/java/org/apache/poi/ss/formula/FormulaParser.java (working copy) @@ -1218,10 +1218,10 @@ private static Double convertArrayNumber(Ptg ptg) { if (ptg instanceof IntPtg) { - return new Double(((IntPtg)ptg).getValue()); + return Double.valueOf(((IntPtg)ptg).getValue()); } if (ptg instanceof NumberPtg) { - return new Double(((NumberPtg)ptg).getValue()); + return Double.valueOf(((NumberPtg)ptg).getValue()); } throw new RuntimeException("Unexpected ptg (" + ptg.getClass().getName() + ")"); } @@ -1271,19 +1271,19 @@ switch(part1.charAt(0)) { case 'V': - if(part1.equals("VALUE")) { + if("VALUE".equals(part1)) { Match('!'); return HSSFErrorConstants.ERROR_VALUE; } throw expected("#VALUE!"); case 'R': - if(part1.equals("REF")) { + if("REF".equals(part1)) { Match('!'); return HSSFErrorConstants.ERROR_REF; } throw expected("#REF!"); case 'D': - if(part1.equals("DIV")) { + if("DIV".equals(part1)) { Match('/'); Match('0'); Match('!'); @@ -1291,19 +1291,19 @@ } throw expected("#DIV/0!"); case 'N': - if(part1.equals("NAME")) { + if("NAME".equals(part1)) { Match('?'); // only one that ends in '?' return HSSFErrorConstants.ERROR_NAME; } - if(part1.equals("NUM")) { + if("NUM".equals(part1)) { Match('!'); return HSSFErrorConstants.ERROR_NUM; } - if(part1.equals("NULL")) { + if("NULL".equals(part1)) { Match('!'); return HSSFErrorConstants.ERROR_NULL; } - if(part1.equals("N")) { + if("N".equals(part1)) { Match('/'); if(look != 'A' && look != 'a') { throw expected("#N/A"); Index: src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java =================================================================== --- src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java (revision 823070) +++ src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java (working copy) @@ -192,7 +192,7 @@ if (sheetIndex < 0) { throw new RuntimeException("Specified sheet from a different book"); } - result = new Integer(sheetIndex); + result = Integer.valueOf(sheetIndex); _sheetIndexesBySheet.put(sheet, result); } return result.intValue(); @@ -214,7 +214,7 @@ if (sheetIndex < 0) { return -1; } - result = new Integer(sheetIndex); + result = Integer.valueOf(sheetIndex); _sheetIndexesByName.put(sheetName, result); } return result.intValue(); Index: src/java/org/apache/poi/ss/util/SheetReferences.java =================================================================== --- src/java/org/apache/poi/ss/util/SheetReferences.java (revision 823070) +++ src/java/org/apache/poi/ss/util/SheetReferences.java (working copy) @@ -36,11 +36,11 @@ } public void addSheetReference(String sheetName, int number) { - map.put(new Integer(number), sheetName); + map.put(Integer.valueOf(number), sheetName); } public String getSheetName(int number) { - return (String)map.get(new Integer(number)); + return (String)map.get(Integer.valueOf(number)); } } Index: src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java =================================================================== --- src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java (revision 823070) +++ src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java (working copy) @@ -89,7 +89,7 @@ return r; } - Constructor recordConstructor = recordsMap.get(new Short(header.getRecordId())); + Constructor recordConstructor = recordsMap.get(Short.valueOf(header.getRecordId())); EscherRecord escherRecord = null; if (recordConstructor == null) { return new UnknownEscherRecord(); @@ -135,7 +135,7 @@ } catch (NoSuchMethodException e) { throw new RuntimeException(e); } - result.put(new Short(sid), constructor); + result.put(Short.valueOf(sid), constructor); } return result; } Index: src/java/org/apache/poi/ddf/EscherProperties.java =================================================================== --- src/java/org/apache/poi/ddf/EscherProperties.java (revision 823070) +++ src/java/org/apache/poi/ddf/EscherProperties.java (working copy) @@ -586,20 +586,20 @@ } private static void addProp(Map m, int s, String propName) { - m.put(new Short((short) s), new EscherPropertyMetaData(propName)); + m.put(Short.valueOf((short) s), new EscherPropertyMetaData(propName)); } private static void addProp(Map m, int s, String propName, byte type) { - m.put(new Short((short) s), new EscherPropertyMetaData(propName, type)); + m.put(Short.valueOf((short) s), new EscherPropertyMetaData(propName, type)); } public static String getPropertyName(short propertyId) { - EscherPropertyMetaData o = properties.get(new Short(propertyId)); + EscherPropertyMetaData o = properties.get(Short.valueOf(propertyId)); return o == null ? "unknown" : o.getDescription(); } public static byte getPropertyType(short propertyId) { - EscherPropertyMetaData escherPropertyMetaData = properties.get(new Short(propertyId)); + EscherPropertyMetaData escherPropertyMetaData = properties.get(Short.valueOf(propertyId)); return escherPropertyMetaData == null ? 0 : escherPropertyMetaData.getType(); } } Index: src/java/org/apache/poi/ddf/EscherOptRecord.java =================================================================== --- src/java/org/apache/poi/ddf/EscherOptRecord.java (revision 823070) +++ src/java/org/apache/poi/ddf/EscherOptRecord.java (working copy) @@ -158,7 +158,7 @@ { EscherProperty p1 = (EscherProperty) o1; EscherProperty p2 = (EscherProperty) o2; - return new Short( p1.getPropertyNumber() ).compareTo( new Short( p2.getPropertyNumber() ) ); + return Short.valueOf( p1.getPropertyNumber() ).compareTo( Short.valueOf( p2.getPropertyNumber() ) ); } } ); } Index: src/java/org/apache/poi/util/HexRead.java =================================================================== --- src/java/org/apache/poi/util/HexRead.java (revision 823070) +++ src/java/org/apache/poi/util/HexRead.java (working copy) @@ -128,7 +128,7 @@ characterCount++; if ( characterCount == 2 ) { - bytes.add( new Byte( b ) ); + bytes.add( Byte.valueOf( b ) ); characterCount = 0; b = (byte) 0; } @@ -151,7 +151,7 @@ characterCount++; if ( characterCount == 2 ) { - bytes.add( new Byte( b ) ); + bytes.add( Byte.valueOf( b ) ); characterCount = 0; b = (byte) 0; } Index: src/java/org/apache/poi/util/IntMapper.java =================================================================== --- src/java/org/apache/poi/util/IntMapper.java (revision 823070) +++ src/java/org/apache/poi/util/IntMapper.java (working copy) @@ -69,7 +69,7 @@ { int index = elements.size(); elements.add(value); - valueKeyMap.put(value, new Integer(index)); + valueKeyMap.put(value, Integer.valueOf(index)); return true; } Index: src/java/org/apache/poi/util/BitFieldFactory.java =================================================================== --- src/java/org/apache/poi/util/BitFieldFactory.java (revision 823070) +++ src/java/org/apache/poi/util/BitFieldFactory.java (working copy) @@ -32,10 +32,10 @@ private static Map instances = new HashMap(); public static BitField getInstance(final int mask) { - BitField f = (BitField)instances.get(new Integer(mask)); + BitField f = (BitField)instances.get(Integer.valueOf(mask)); if (f == null) { f = new BitField(mask); - instances.put(new Integer(mask), f); + instances.put(Integer.valueOf(mask), f); } return f; } Index: src/java/org/apache/poi/util/POILogger.java =================================================================== --- src/java/org/apache/poi/util/POILogger.java (revision 823070) +++ src/java/org/apache/poi/util/POILogger.java (working copy) @@ -601,7 +601,7 @@ for (int j = 0; j < array.length; j++) { - results.add(new Byte(array[ j ])); + results.add(Byte.valueOf(array[ j ])); } } if (object instanceof char []) @@ -619,7 +619,7 @@ for (int j = 0; j < array.length; j++) { - results.add(new Short(array[ j ])); + results.add(Short.valueOf(array[ j ])); } } else if (object instanceof int []) @@ -628,7 +628,7 @@ for (int j = 0; j < array.length; j++) { - results.add(new Integer(array[ j ])); + results.add(Integer.valueOf(array[ j ])); } } else if (object instanceof long []) @@ -637,7 +637,7 @@ for (int j = 0; j < array.length; j++) { - results.add(new Long(array[ j ])); + results.add(Long.valueOf(array[ j ])); } } else if (object instanceof float []) @@ -655,7 +655,7 @@ for (int j = 0; j < array.length; j++) { - results.add(new Double(array[ j ])); + results.add(Double.valueOf(array[ j ])); } } else if (object instanceof Object []) Index: src/scratchpad/src/org/apache/poi/hpbf/model/QuillContents.java =================================================================== --- src/scratchpad/src/org/apache/poi/hpbf/model/QuillContents.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hpbf/model/QuillContents.java (working copy) @@ -41,7 +41,7 @@ // Check first 8 bytes String f8 = new String(data, 0, 8); - if(! f8.equals("CHNKINK ")) { + if(! "CHNKINK ".equals(f8)) { throw new IllegalArgumentException("Expecting 'CHNKINK ' but was '"+f8+"'"); } // Ignore the next 24, for now at least @@ -64,9 +64,9 @@ System.arraycopy(data, from, bitData, 0, len); // Create - if(bitType.equals("TEXT")) { + if("TEXT".equals(bitType)) { bits[i] = new QCTextBit(thingType, bitType, bitData); - } else if(bitType.equals("PLC ")) { + } else if("PLC ".equals(bitType)) { bits[i] = QCPLCBit.createQCPLCBit(thingType, bitType, bitData); } else { bits[i] = new UnknownQCBit(thingType, bitType, bitData); Index: src/scratchpad/src/org/apache/poi/hdf/model/HDFObjectFactory.java =================================================================== --- src/scratchpad/src/org/apache/poi/hdf/model/HDFObjectFactory.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hdf/model/HDFObjectFactory.java (working copy) @@ -345,7 +345,7 @@ byte[] chpx = new byte[size]; System.arraycopy(fkp, ++chpxOffset, chpx, 0, size); - //_papTable.put(new Integer(fcStart), papx); + //_papTable.put(Integer.valueOf(fcStart), papx); _characterRuns.add(new ChpxNode(fcStart, fcEnd, chpx)); } Index: src/scratchpad/src/org/apache/poi/hdf/model/hdftypes/ListTables.java =================================================================== --- src/scratchpad/src/org/apache/poi/hdf/model/hdftypes/ListTables.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hdf/model/hdftypes/ListTables.java (working copy) @@ -51,14 +51,14 @@ LFOLVL lfolvl = override._levels[x]; if(lfolvl._fFormatting) { - LST lst = (LST)_lists.get(new Integer(override._lsid)); + LST lst = (LST)_lists.get(Integer.valueOf(override._lsid)); LVL lvl = lfolvl._override; lvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2); return lvl; } else if(lfolvl._fStartAt) { - LST lst = (LST)_lists.get(new Integer(override._lsid)); + LST lst = (LST)_lists.get(Integer.valueOf(override._lsid)); LVL lvl = lst._levels[level]; LVL newLvl = (LVL)lvl.clone(); newLvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2); @@ -68,7 +68,7 @@ } } - LST lst = (LST)_lists.get(new Integer(override._lsid)); + LST lst = (LST)_lists.get(Integer.valueOf(override._lsid)); LVL lvl = lst._levels[level]; lvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2); return lvl; @@ -89,7 +89,7 @@ byte code = plcflst[2 + 26 + (x * 28)]; lst._fSimpleList = StyleSheet.getFlag(code & 0x01); //lstArray[x] = lst; - _lists.put(new Integer(lst._lsid), lst); + _lists.put(Integer.valueOf(lst._lsid), lst); if(lst._fSimpleList) { Index: src/scratchpad/src/org/apache/poi/hdf/model/util/BTreeSet.java =================================================================== --- src/scratchpad/src/org/apache/poi/hdf/model/util/BTreeSet.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hdf/model/util/BTreeSet.java (working copy) @@ -235,7 +235,7 @@ while (temp.entries[0].child != null) { temp = temp.entries[0].child; - parentIndex.push(new Integer(0)); + parentIndex.push(Integer.valueOf(0)); } return temp; @@ -272,12 +272,12 @@ // else - You're not a leaf so simply find and return the successor of lastReturned currentNode = currentNode.entries[index].child; - parentIndex.push(new Integer(index)); + parentIndex.push(Integer.valueOf(index)); while (currentNode.entries[0].child != null) { currentNode = currentNode.entries[0].child; - parentIndex.push(new Integer(0)); + parentIndex.push(Integer.valueOf(0)); } index = 1; Index: src/scratchpad/src/org/apache/poi/hdf/extractor/WordDocument.java =================================================================== --- src/scratchpad/src/org/apache/poi/hdf/extractor/WordDocument.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hdf/extractor/WordDocument.java (working copy) @@ -394,7 +394,7 @@ byte[] chpx = new byte[size]; System.arraycopy(fkp, ++chpxOffset, chpx, 0, size); - //_papTable.put(new Integer(fcStart), papx); + //_papTable.put(Integer.valueOf(fcStart), papx); _characterTable.add(new ChpxNode(fcStart, fcEnd, chpx)); } @@ -734,12 +734,12 @@ lineWidth += 10 * tempString.length();//metrics.stringWidth(tempString); if(lineWidth > pageWidth) { - lineHeights.add(new Integer(maxHeight)); + lineHeights.add(Integer.valueOf(maxHeight)); maxHeight = 0; lineWidth = 0; } } - lineHeights.add(new Integer(maxHeight)); + lineHeights.add(Integer.valueOf(maxHeight)); } int sum = 0; size = lineHeights.size(); Index: src/scratchpad/src/org/apache/poi/hdf/extractor/data/ListTables.java =================================================================== --- src/scratchpad/src/org/apache/poi/hdf/extractor/data/ListTables.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hdf/extractor/data/ListTables.java (working copy) @@ -51,14 +51,14 @@ LFOLVL lfolvl = override._levels[x]; if(lfolvl._fFormatting) { - LST lst = (LST)_lists.get(new Integer(override._lsid)); + LST lst = (LST)_lists.get(Integer.valueOf(override._lsid)); LVL lvl = lfolvl._override; lvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2); return lvl; } else if(lfolvl._fStartAt) { - LST lst = (LST)_lists.get(new Integer(override._lsid)); + LST lst = (LST)_lists.get(Integer.valueOf(override._lsid)); LVL lvl = lst._levels[level]; LVL newLvl = (LVL)lvl.clone(); newLvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2); @@ -68,7 +68,7 @@ } } - LST lst = (LST)_lists.get(new Integer(override._lsid)); + LST lst = (LST)_lists.get(Integer.valueOf(override._lsid)); LVL lvl = lst._levels[level]; lvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2); return lvl; @@ -89,7 +89,7 @@ byte code = plcflst[2 + 26 + (x * 28)]; lst._fSimpleList = StyleSheet.getFlag(code & 0x01); //lstArray[x] = lst; - _lists.put(new Integer(lst._lsid), lst); + _lists.put(Integer.valueOf(lst._lsid), lst); if(lst._fSimpleList) { Index: src/scratchpad/src/org/apache/poi/hdf/extractor/util/BTreeSet.java =================================================================== --- src/scratchpad/src/org/apache/poi/hdf/extractor/util/BTreeSet.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hdf/extractor/util/BTreeSet.java (working copy) @@ -161,7 +161,7 @@ while (temp._entries[0].child != null) { temp = temp._entries[0].child; - parentIndex.push(new Integer(0)); + parentIndex.push(Integer.valueOf(0)); } return temp; @@ -193,11 +193,11 @@ // else - You're not a leaf so simply find and return the successor of lastReturned currentNode = currentNode._entries[index].child; - parentIndex.push(new Integer(index)); + parentIndex.push(Integer.valueOf(index)); while (currentNode._entries[0].child != null) { currentNode = currentNode._entries[0].child; - parentIndex.push(new Integer(0)); + parentIndex.push(Integer.valueOf(0)); } index = 1; Index: src/scratchpad/src/org/apache/poi/hwpf/usermodel/HeaderStories.java =================================================================== --- src/scratchpad/src/org/apache/poi/hwpf/usermodel/HeaderStories.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hwpf/usermodel/HeaderStories.java (working copy) @@ -169,7 +169,7 @@ // If you create a header/footer, then remove it again, word // will leave \r\r. Turn these back into an empty string, // which is more what you'd expect - if(text.equals("\r\r")) { + if("\r\r".equals(text)) { return ""; } Index: src/scratchpad/src/org/apache/poi/hwpf/model/FSPATable.java =================================================================== --- src/scratchpad/src/org/apache/poi/hwpf/model/FSPATable.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hwpf/model/FSPATable.java (working copy) @@ -48,13 +48,13 @@ FSPA fspa = new FSPA(property.getBytes(), 0); _shapes.add(fspa); - _shapeIndexesByPropertyStart.put(new Integer(property.getStart()), new Integer(i)); + _shapeIndexesByPropertyStart.put(Integer.valueOf(property.getStart()), Integer.valueOf(i)); } } public FSPA getFspaFromCp(int cp) { - Integer idx = (Integer)_shapeIndexesByPropertyStart.get(new Integer(cp)); + Integer idx = (Integer)_shapeIndexesByPropertyStart.get(Integer.valueOf(cp)); if (idx == null) { return null; } Index: src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java =================================================================== --- src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java (working copy) @@ -58,18 +58,18 @@ public void fillVariableFields(byte[] mainDocument, byte[] tableStream) { HashSet fieldSet = new HashSet(); - fieldSet.add(new Integer(FIBFieldHandler.STSHF)); - fieldSet.add(new Integer(FIBFieldHandler.CLX)); - fieldSet.add(new Integer(FIBFieldHandler.DOP)); - fieldSet.add(new Integer(FIBFieldHandler.PLCFBTECHPX)); - fieldSet.add(new Integer(FIBFieldHandler.PLCFBTEPAPX)); - fieldSet.add(new Integer(FIBFieldHandler.PLCFSED)); - fieldSet.add(new Integer(FIBFieldHandler.PLCFLST)); - fieldSet.add(new Integer(FIBFieldHandler.PLFLFO)); - fieldSet.add(new Integer(FIBFieldHandler.PLCFFLDMOM)); - fieldSet.add(new Integer(FIBFieldHandler.STTBFFFN)); - fieldSet.add(new Integer(FIBFieldHandler.STTBSAVEDBY)); - fieldSet.add(new Integer(FIBFieldHandler.MODIFIED)); + fieldSet.add(Integer.valueOf(FIBFieldHandler.STSHF)); + fieldSet.add(Integer.valueOf(FIBFieldHandler.CLX)); + fieldSet.add(Integer.valueOf(FIBFieldHandler.DOP)); + fieldSet.add(Integer.valueOf(FIBFieldHandler.PLCFBTECHPX)); + fieldSet.add(Integer.valueOf(FIBFieldHandler.PLCFBTEPAPX)); + fieldSet.add(Integer.valueOf(FIBFieldHandler.PLCFSED)); + fieldSet.add(Integer.valueOf(FIBFieldHandler.PLCFLST)); + fieldSet.add(Integer.valueOf(FIBFieldHandler.PLFLFO)); + fieldSet.add(Integer.valueOf(FIBFieldHandler.PLCFFLDMOM)); + fieldSet.add(Integer.valueOf(FIBFieldHandler.STTBFFFN)); + fieldSet.add(Integer.valueOf(FIBFieldHandler.STTBSAVEDBY)); + fieldSet.add(Integer.valueOf(FIBFieldHandler.MODIFIED)); _shortHandler = new FIBShortHandler(mainDocument); Index: src/scratchpad/src/org/apache/poi/hwpf/model/FIBFieldHandler.java =================================================================== --- src/scratchpad/src/org/apache/poi/hwpf/model/FIBFieldHandler.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hwpf/model/FIBFieldHandler.java (working copy) @@ -146,7 +146,7 @@ fieldOffset += LittleEndian.INT_SIZE; int dsSize = LittleEndian.getInt(mainStream, fieldOffset); - if (offsetList.contains(new Integer(x)) ^ areKnown) + if (offsetList.contains(Integer.valueOf(x)) ^ areKnown) { if (dsSize > 0) { @@ -160,7 +160,7 @@ { UnhandledDataStructure unhandled = new UnhandledDataStructure( tableStream, dsOffset, dsSize); - _unknownMap.put(new Integer(x), unhandled); + _unknownMap.put(Integer.valueOf(x), unhandled); } } } @@ -208,7 +208,7 @@ for (int x = 0; x < length; x++) { - UnhandledDataStructure ds = (UnhandledDataStructure)_unknownMap.get(new Integer(x)); + UnhandledDataStructure ds = (UnhandledDataStructure)_unknownMap.get(Integer.valueOf(x)); if (ds != null) { LittleEndian.putInt(mainStream, offset, tableStream.getOffset()); Index: src/scratchpad/src/org/apache/poi/hwpf/model/ListTables.java =================================================================== --- src/scratchpad/src/org/apache/poi/hwpf/model/ListTables.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hwpf/model/ListTables.java (working copy) @@ -58,7 +58,7 @@ for (int x = 0; x < length; x++) { ListData lst = new ListData(tableStream, lstOffset); - _listMap.put(new Integer(lst.getLsid()), lst); + _listMap.put(Integer.valueOf(lst.getLsid()), lst); lstOffset += LIST_DATA_SIZE; int num = lst.numLevels(); @@ -96,12 +96,12 @@ public int addList(ListData lst, ListFormatOverride override) { int lsid = lst.getLsid(); - while (_listMap.get(new Integer(lsid)) != null) + while (_listMap.get(Integer.valueOf(lsid)) != null) { lsid = lst.resetListID(); override.setLsid(lsid); } - _listMap.put(new Integer(lsid), lst); + _listMap.put(Integer.valueOf(lsid), lst); _overrideList.add(override); return lsid; } @@ -190,7 +190,7 @@ public ListLevel getLevel(int listID, int level) { - ListData lst = (ListData)_listMap.get(new Integer(listID)); + ListData lst = (ListData)_listMap.get(Integer.valueOf(listID)); if(level < lst.numLevels()) { ListLevel lvl = lst.getLevels()[level]; return lvl; @@ -201,7 +201,7 @@ public ListData getListData(int listID) { - return (ListData) _listMap.get(new Integer(listID)); + return (ListData) _listMap.get(Integer.valueOf(listID)); } public boolean equals(Object obj) Index: src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java =================================================================== --- src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java (working copy) @@ -400,12 +400,12 @@ HashMap tabMap = new HashMap(); for (int x = 0; x < tabPositions.length; x++) { - tabMap.put(new Integer(tabPositions[x]), new Byte(tabDescriptors[x])); + tabMap.put(Integer.valueOf(tabPositions[x]), Byte.valueOf(tabDescriptors[x])); } for (int x = 0; x < delSize; x++) { - tabMap.remove(new Integer(LittleEndian.getShort(grpprl, offset))); + tabMap.remove(Integer.valueOf(LittleEndian.getShort(grpprl, offset))); offset += LittleEndian.SHORT_SIZE; } @@ -413,8 +413,8 @@ int start = offset; for (int x = 0; x < addSize; x++) { - Integer key = new Integer(LittleEndian.getShort(grpprl, offset)); - Byte val = new Byte(grpprl[start + ((LittleEndian.SHORT_SIZE * addSize) + x)]); + Integer key = Integer.valueOf(LittleEndian.getShort(grpprl, offset)); + Byte val = Byte.valueOf(grpprl[start + ((LittleEndian.SHORT_SIZE * addSize) + x)]); tabMap.put(key, val); offset += LittleEndian.SHORT_SIZE; } @@ -452,20 +452,20 @@ // HashMap tabMap = new HashMap(); // for (int x = 0; x < tabPositions.length; x++) // { -// tabMap.put(new Integer(tabPositions[x]), new Byte(tabDescriptors[x])); +// tabMap.put(Integer.valueOf(tabPositions[x]), Byte.valueOf(tabDescriptors[x])); // } // // for (int x = 0; x < delSize; x++) // { -// tabMap.remove(new Integer(LittleEndian.getInt(grpprl, offset))); +// tabMap.remove(Integer.valueOf(LittleEndian.getInt(grpprl, offset))); // offset += LittleEndian.INT_SIZE;; // } // // int addSize = grpprl[offset++]; // for (int x = 0; x < addSize; x++) // { -// Integer key = new Integer(LittleEndian.getInt(grpprl, offset)); -// Byte val = new Byte(grpprl[(LittleEndian.INT_SIZE * (addSize - x)) + x]); +// Integer key = Integer.valueOf(LittleEndian.getInt(grpprl, offset)); +// Byte val = Byte.valueOf(grpprl[(LittleEndian.INT_SIZE * (addSize - x)) + x]); // tabMap.put(key, val); // offset += LittleEndian.INT_SIZE; // } Index: src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java =================================================================== --- src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java (working copy) @@ -98,7 +98,7 @@ defsL.toArray(new CommandDefinition[defsL.size()]); // Add to the hashtable - chunkCommandDefinitions.put(new Integer(chunkType), defs); + chunkCommandDefinitions.put(Integer.valueOf(chunkType), defs); } inp.close(); cpd.close(); @@ -171,7 +171,7 @@ // Feed in the stuff from chunks_parse_cmds.tbl CommandDefinition[] defs = (CommandDefinition[]) - chunkCommandDefinitions.get(new Integer(header.getType())); + chunkCommandDefinitions.get(Integer.valueOf(header.getType())); if(defs == null) defs = new CommandDefinition[0]; chunk.commandDefinitions = defs; Index: src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java =================================================================== --- src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java (working copy) @@ -166,13 +166,13 @@ // Types 0->7 = a flat at bit 0->7 case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: int val = contents[offset] & (1< 0) ); + command.value = Boolean.valueOf( (val > 0) ); break; case 8: - command.value = new Byte( contents[offset] ); + command.value = Byte.valueOf( contents[offset] ); break; case 9: - command.value = new Double( + command.value = Double.valueOf( LittleEndian.getDouble(contents, offset) ); break; @@ -195,12 +195,12 @@ command.value = StringUtil.getFromUnicodeLE(contents, startsAt, strLen); break; case 25: - command.value = new Short( + command.value = Short.valueOf( LittleEndian.getShort(contents, offset) ); break; case 26: - command.value = new Integer( + command.value = Integer.valueOf( LittleEndian.getInt(contents, offset) ); break; @@ -273,7 +273,7 @@ } private void setOffset(int offset) { this.offset = offset; - value = new Integer(offset); + value = Integer.valueOf(offset); } } } Index: src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java =================================================================== --- src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java (working copy) @@ -162,7 +162,7 @@ // PersistPtr, remove their old positions int[] ids = pph.getKnownSlideIDs(); for (int j = 0; j < ids.length; j++) { - Integer id = new Integer(ids[j]); + Integer id = Integer.valueOf(ids[j]); if (mostRecentByBytes.containsKey(id)) { mostRecentByBytes.remove(id); } @@ -171,7 +171,7 @@ // Now, update the byte level locations with their latest values Hashtable thisSetOfLocations = pph.getSlideLocationsLookup(); for (int j = 0; j < ids.length; j++) { - Integer id = new Integer(ids[j]); + Integer id = Integer.valueOf(ids[j]); mostRecentByBytes.put(id, thisSetOfLocations.get(id)); } } @@ -192,18 +192,18 @@ } Arrays.sort(allIDs); for (int i = 0; i < allIDs.length; i++) { - _sheetIdToCoreRecordsLookup.put(new Integer(allIDs[i]), new Integer(i)); + _sheetIdToCoreRecordsLookup.put(Integer.valueOf(allIDs[i]), Integer.valueOf(i)); } // Now convert the byte offsets back into record offsets for (int i = 0; i < _records.length; i++) { if (_records[i] instanceof PositionDependentRecord) { PositionDependentRecord pdr = (PositionDependentRecord) _records[i]; - Integer recordAt = new Integer(pdr.getLastOnDiskOffset()); + Integer recordAt = Integer.valueOf(pdr.getLastOnDiskOffset()); // Is it one we care about? for (int j = 0; j < allIDs.length; j++) { - Integer thisID = new Integer(allIDs[j]); + Integer thisID = Integer.valueOf(allIDs[j]); Integer thatRecordAt = (Integer) mostRecentByBytes.get(thisID); if (thatRecordAt.equals(recordAt)) { @@ -258,7 +258,7 @@ * the refID */ private Record getCoreRecordForRefID(int refID) { - Integer coreRecordId = (Integer) _sheetIdToCoreRecordsLookup.get(new Integer(refID)); + Integer coreRecordId = (Integer) _sheetIdToCoreRecordsLookup.get(Integer.valueOf(refID)); if (coreRecordId != null) { Record r = _mostRecentCoreRecords[coreRecordId.intValue()]; return r; @@ -364,8 +364,8 @@ // Record the match between slide id and these notes SlidePersistAtom spa = notesSets[i].getSlidePersistAtom(); - Integer slideId = new Integer(spa.getSlideIdentifier()); - slideIdToNotes.put(slideId, new Integer(i)); + Integer slideId = Integer.valueOf(spa.getSlideIdentifier()); + slideIdToNotes.put(slideId, Integer.valueOf(i)); } else { logger.log(POILogger.ERROR, "A Notes SlideAtomSet at " + i + " said its record was at refID " @@ -422,7 +422,7 @@ // 0 if slide has no notes. int noteId = slidesRecords[i].getSlideAtom().getNotesID(); if (noteId != 0) { - Integer notesPos = (Integer) slideIdToNotes.get(new Integer(noteId)); + Integer notesPos = (Integer) slideIdToNotes.get(Integer.valueOf(noteId)); if (notesPos != null) notes = _notes[notesPos.intValue()]; else Index: src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java =================================================================== --- src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java (working copy) @@ -117,7 +117,7 @@ int offset = ( (Integer)pph.getSlideLocationsLookup().get( - new Integer(maxSlideId) + Integer.valueOf(maxSlideId) ) ).intValue(); Record r3 = Record.buildRecordAtOffset( hss.getUnderlyingBytes(), Index: src/scratchpad/src/org/apache/poi/hslf/model/TextPainter.java =================================================================== --- src/scratchpad/src/org/apache/poi/hslf/model/TextPainter.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hslf/model/TextPainter.java (working copy) @@ -156,7 +156,7 @@ if (run == null) return null; String text = run.getText(); - if (text == null || text.equals("")) return null; + if (text == null || "".equals(text)) return null; AttributedString at = getAttributedString(run); Index: src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java =================================================================== --- src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java (working copy) @@ -34,7 +34,7 @@ * @return the name of the shape */ public static String typeName(int type) { - String name = (String)types.get(new Integer(type)); + String name = (String)types.get(Integer.valueOf(type)); return name; } Index: src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java =================================================================== --- src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java (working copy) @@ -237,7 +237,7 @@ if (notes == null) { continue; } - Integer id = new Integer(notes._getSheetNumber()); + Integer id = Integer.valueOf(notes._getSheetNumber()); if (seenNotes.contains(id)) { continue; } Index: src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java =================================================================== --- src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java (working copy) @@ -193,8 +193,8 @@ String text = cs.getText(); // Ignore the ones we know to be rubbish - if(text.equals("___PPT10")) { - } else if(text.equals("Default Design")) { + if("___PPT10".equals(text)) { + } else if("Default Design".equals(text)) { } else { textV.add(text); } Index: src/scratchpad/src/org/apache/poi/hslf/dev/SlideIdListing.java =================================================================== --- src/scratchpad/src/org/apache/poi/hslf/dev/SlideIdListing.java (revision 823070) +++ src/scratchpad/src/org/apache/poi/hslf/dev/SlideIdListing.java (working copy) @@ -124,7 +124,7 @@ int[] sheetIDs = pph.getKnownSlideIDs(); Hashtable sheetOffsets = pph.getSlideLocationsLookup(); for(int j=0; j " + newPos); } @@ -438,7 +438,7 @@ // Update and write out the Current User atom int oldLastUserEditAtomPos = (int)currentUser.getCurrentEditOffset(); - Integer newLastUserEditAtomPos = (Integer)oldToNewPositions.get(new Integer(oldLastUserEditAtomPos)); + Integer newLastUserEditAtomPos = (Integer)oldToNewPositions.get(Integer.valueOf(oldLastUserEditAtomPos)); if(newLastUserEditAtomPos == null) { throw new HSLFException("Couldn't find the new location of the UserEditAtom that used to be at " + oldLastUserEditAtomPos); } Index: src/scratchpad/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java =================================================================== --- src/scratchpad/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java (revision 823070) +++ src/scratchpad/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java (working copy) @@ -368,10 +368,10 @@ tr3.setText( " //bar chart data. The first value is the bar color, the second is the width\r" + " Object[] def = new Object[]{\r" + - " Color.yellow, new Integer(100),\r" + - " Color.green, new Integer(150),\r" + - " Color.gray, new Integer(75),\r" + - " Color.red, new Integer(200),\r" + + " Color.yellow, Integer.valueOf(100),\r" + + " Color.green, Integer.valueOf(150),\r" + + " Color.gray, Integer.valueOf(75),\r" + + " Color.red, Integer.valueOf(200),\r" + " };\r" + "\r" + " SlideShow ppt = new SlideShow();\r" + @@ -411,10 +411,10 @@ public static void slide10(SlideShow ppt) throws IOException { //bar chart data. The first value is the bar color, the second is the width Object[] def = new Object[]{ - Color.yellow, new Integer(100), - Color.green, new Integer(150), - Color.gray, new Integer(75), - Color.red, new Integer(200), + Color.yellow, Integer.valueOf(100), + Color.green, Integer.valueOf(150), + Color.gray, Integer.valueOf(75), + Color.red, Integer.valueOf(200), }; Slide slide = ppt.createSlide(); Index: src/scratchpad/examples/src/org/apache/poi/hslf/examples/Graphics2DDemo.java =================================================================== --- src/scratchpad/examples/src/org/apache/poi/hslf/examples/Graphics2DDemo.java (revision 823070) +++ src/scratchpad/examples/src/org/apache/poi/hslf/examples/Graphics2DDemo.java (working copy) @@ -39,10 +39,10 @@ //bar chart data. The first value is the bar color, the second is the width Object[] def = new Object[]{ - Color.yellow, new Integer(40), - Color.green, new Integer(60), - Color.gray, new Integer(30), - Color.red, new Integer(80), + Color.yellow, Integer.valueOf(40), + Color.green, Integer.valueOf(60), + Color.gray, Integer.valueOf(30), + Color.red, Integer.valueOf(80), }; Slide slide = ppt.createSlide(); Index: src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java =================================================================== --- src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java (revision 823070) +++ src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java (working copy) @@ -109,15 +109,15 @@ //map slide number and starting phrase of its notes Map notesMap = new HashMap(); - notesMap.put(new Integer(4), "For decades before calculators"); - notesMap.put(new Integer(5), "Several commercial applications"); - notesMap.put(new Integer(6), "There are three variations of LNS that are discussed here"); - notesMap.put(new Integer(7), "Although multiply and square root are easier"); - notesMap.put(new Integer(8), "The bus Z is split into Z_H and Z_L"); + notesMap.put(Integer.valueOf(4), "For decades before calculators"); + notesMap.put(Integer.valueOf(5), "Several commercial applications"); + notesMap.put(Integer.valueOf(6), "There are three variations of LNS that are discussed here"); + notesMap.put(Integer.valueOf(7), "Although multiply and square root are easier"); + notesMap.put(Integer.valueOf(8), "The bus Z is split into Z_H and Z_L"); Slide[] slide = ppt.getSlides(); for (int i = 0; i < slide.length; i++) { - Integer slideNumber = new Integer(slide[i].getSlideNumber()); + Integer slideNumber = Integer.valueOf(slide[i].getSlideNumber()); Notes notes = slide[i].getNotesSheet(); if (notesMap.containsKey(slideNumber)){ assertNotNull(notes); Index: src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java =================================================================== --- src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java (revision 823070) +++ src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java (working copy) @@ -105,19 +105,19 @@ assertEquals(txtbox.getTextRun().getRichTextRuns().length, 1); RichTextRun rt = txtbox.getTextRun().getRichTextRuns()[0]; - if (text.equals("Hello, World!!!")){ + if ("Hello, World!!!".equals(text)){ assertEquals(32, rt.getFontSize()); assertTrue(rt.isBold()); assertTrue(rt.isItalic()); - } else if (text.equals("I am just a poor boy")){ + } else if ("I am just a poor boy".equals(text)){ assertEquals(44, rt.getFontSize()); assertTrue(rt.isBold()); - } else if (text.equals("This is Times New Roman")){ + } else if ("This is Times New Roman".equals(text)){ assertEquals(16, rt.getFontSize()); assertTrue(rt.isBold()); assertTrue(rt.isItalic()); assertTrue(rt.isUnderlined()); - } else if (text.equals("Plain Text")){ + } else if ("Plain Text".equals(text)){ assertEquals(18, rt.getFontSize()); } } Index: src/scratchpad/testcases/org/apache/poi/hslf/TestReWriteSanity.java =================================================================== --- src/scratchpad/testcases/org/apache/poi/hslf/TestReWriteSanity.java (revision 823070) +++ src/scratchpad/testcases/org/apache/poi/hslf/TestReWriteSanity.java (working copy) @@ -59,16 +59,16 @@ Record[] r = wss.getRecords(); Hashtable pp = new Hashtable(); Hashtable ue = new Hashtable(); - ue.put(new Integer(0),new Integer(0)); // Will show 0 if first + ue.put(Integer.valueOf(0),Integer.valueOf(0)); // Will show 0 if first int pos = 0; int lastUEPos = -1; for(int i=0; i cell - if(name.equals("c")) { + if("c".equals(name)) { // Print the cell reference System.out.print(attributes.getValue("r") + " - "); // Figure out if the value is an index in the SST String cellType = attributes.getValue("t"); - if(cellType != null && cellType.equals("s")) { + if(cellType != null && "s".equals(cellType)) { nextIsString = true; } else { nextIsString = false; @@ -119,7 +119,7 @@ // v => contents of a cell // Output after we've seen the string contents - if(name.equals("v")) { + if("v".equals(name)) { System.out.println(lastContents); } } Index: src/examples/src/org/apache/poi/ss/examples/LoanCalculator.java =================================================================== --- src/examples/src/org/apache/poi/ss/examples/LoanCalculator.java (revision 823070) +++ src/examples/src/org/apache/poi/ss/examples/LoanCalculator.java (working copy) @@ -39,7 +39,7 @@ public static void main(String[] args) throws Exception { Workbook wb; - if(args.length > 0 && args[0].equals("-xls")) wb = new HSSFWorkbook(); + if(args.length > 0 && "-xls".equals(args[0])) wb = new HSSFWorkbook(); else wb = new XSSFWorkbook(); Map styles = createStyles(wb); Index: src/examples/src/org/apache/poi/ss/examples/BusinessPlan.java =================================================================== --- src/examples/src/org/apache/poi/ss/examples/BusinessPlan.java (revision 823070) +++ src/examples/src/org/apache/poi/ss/examples/BusinessPlan.java (working copy) @@ -81,7 +81,7 @@ public static void main(String[] args) throws Exception { Workbook wb; - if(args.length > 0 && args[0].equals("-xls")) wb = new HSSFWorkbook(); + if(args.length > 0 && "-xls".equals(args[0])) wb = new HSSFWorkbook(); else wb = new XSSFWorkbook(); Map styles = createStyles(wb); Index: src/examples/src/org/apache/poi/ss/examples/TimesheetDemo.java =================================================================== --- src/examples/src/org/apache/poi/ss/examples/TimesheetDemo.java (revision 823070) +++ src/examples/src/org/apache/poi/ss/examples/TimesheetDemo.java (working copy) @@ -47,7 +47,7 @@ public static void main(String[] args) throws Exception { Workbook wb; - if(args.length > 0 && args[0].equals("-xls")) wb = new HSSFWorkbook(); + if(args.length > 0 && "-xls".equals(args[0])) wb = new HSSFWorkbook(); else wb = new XSSFWorkbook(); Map styles = createStyles(wb); Index: src/examples/src/org/apache/poi/ss/examples/CalendarDemo.java =================================================================== --- src/examples/src/org/apache/poi/ss/examples/CalendarDemo.java (revision 823070) +++ src/examples/src/org/apache/poi/ss/examples/CalendarDemo.java (working copy) @@ -53,7 +53,7 @@ boolean xlsx = true; for (int i = 0; i < args.length; i++) { if(args[i].charAt(0) == '-'){ - xlsx = args[i].equals("-xlsx"); + xlsx = "-xlsx".equals(args[i]); } else { calendar.set(Calendar.YEAR, Integer.parseInt(args[i])); } Index: src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java =================================================================== --- src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java (revision 823070) +++ src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java (working copy) @@ -314,12 +314,12 @@ // If we didn't have a good match or at least except a first empty element if ((segmentsTheSame == 0 || segmentsTheSame == 1) && - segmentsSource[0].equals("") && segmentsTarget[0].equals("")) { + "".equals(segmentsSource[0]) && "".equals(segmentsTarget[0])) { for (int i = 0; i < segmentsSource.length - 2; i++) { retVal.append("../"); } for (int i = 0; i < segmentsTarget.length; i++) { - if (segmentsTarget[i].equals("")) + if ("".equals(segmentsTarget[i])) continue; retVal.append(segmentsTarget[i]); if (i != segmentsTarget.length - 1) Index: src/ooxml/java/org/apache/poi/openxml4j/opc/PackagePartName.java =================================================================== --- src/ooxml/java/org/apache/poi/openxml4j/opc/PackagePartName.java (revision 823070) +++ src/ooxml/java/org/apache/poi/openxml4j/opc/PackagePartName.java (working copy) @@ -239,7 +239,7 @@ // Split the URI into several part and analyze each String[] segments = partUri.toASCIIString().split("/"); - if (segments.length <= 1 || !segments[0].equals("")) + if (segments.length <= 1 || !"".equals(segments[0])) throw new InvalidFormatException( "A part name shall not have empty segments [M1.3]: " + partUri.getPath()); Index: src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java =================================================================== --- src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java (revision 823070) +++ src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java (working copy) @@ -543,7 +543,7 @@ * Convert a strig value into a Nullable */ private Nullable setStringValue(String s) { - if (s == null || s.equals("")) { + if (s == null || "".equals(s)) { return new Nullable(); } return new Nullable(s); @@ -556,7 +556,7 @@ * Throws if the date format isnot valid. */ private Nullable setDateValue(String s) throws InvalidFormatException { - if (s == null || s.equals("")) { + if (s == null || "".equals(s)) { return new Nullable(); } SimpleDateFormat df = new SimpleDateFormat( Index: src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java =================================================================== --- src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java (revision 823070) +++ src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java (working copy) @@ -682,7 +682,7 @@ throw new IllegalArgumentException("partName"); } - if (contentType == null || contentType.equals("")) { + if (contentType == null || "".equals(contentType)) { throw new IllegalArgumentException("contentType"); } Index: src/ooxml/java/org/apache/poi/openxml4j/opc/PackagePartCollection.java =================================================================== --- src/ooxml/java/org/apache/poi/openxml4j/opc/PackagePartCollection.java (revision 823070) +++ src/ooxml/java/org/apache/poi/openxml4j/opc/PackagePartCollection.java (working copy) @@ -59,7 +59,7 @@ PackagingURIHelper.FORWARD_SLASH_STRING); StringBuffer concatSeg = new StringBuffer(); for (String seg : segments) { - if (!seg.equals("")) + if (!"".equals(seg)) concatSeg.append(PackagingURIHelper.FORWARD_SLASH_CHAR); concatSeg.append(seg); if (this.registerPartNameStr.contains(concatSeg.toString())) { Index: src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java =================================================================== --- src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java (revision 823070) +++ src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java (working copy) @@ -393,7 +393,7 @@ private boolean isNamespaceDeclared(){ String schemaNamespace = getNamespace(); - return schemaNamespace!=null && !schemaNamespace.equals(""); + return schemaNamespace!=null && !"".equals(schemaNamespace); } private String getNamespace(){ @@ -505,7 +505,7 @@ } } // Note: we expect that all the complex types are defined at root level - if(!complexTypeName.equals("")){ + if(!"".equals(complexTypeName)){ NodeList complexTypeList = xmlSchema.getChildNodes(); for(int i=0; i< complexTypeList.getLength();i++){ Node node = list.item(i); Index: src/ooxml/java/org/apache/poi/xwpf/usermodel/Borders.java =================================================================== --- src/ooxml/java/org/apache/poi/xwpf/usermodel/Borders.java (revision 823070) +++ src/ooxml/java/org/apache/poi/xwpf/usermodel/Borders.java (working copy) @@ -612,12 +612,12 @@ private static Map imap = new HashMap(); static { for (Borders p : values()) { - imap.put(new Integer(p.getValue()), p); + imap.put(Integer.valueOf(p.getValue()), p); } } public static Borders valueOf(int type) { - Borders pBorder = imap.get(new Integer(type)); + Borders pBorder = imap.get(Integer.valueOf(type)); if (pBorder == null) { throw new IllegalArgumentException("Unknown paragraph border: " + type); } Index: src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java =================================================================== --- src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java (revision 823070) +++ src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java (working copy) @@ -381,7 +381,7 @@ String parStyle = par.getStyle(); if (parStyle != null && parStyle.substring(0, 7).equals("Heading")) { try { - int level = new Integer(parStyle.substring("Heading".length())); + int level = Integer.valueOf(parStyle.substring("Heading".length())); toc.addRow(level, par.getText(), 1, "112723803"); } catch (NumberFormatException e) { Index: src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java =================================================================== --- src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java (revision 823070) +++ src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java (working copy) @@ -96,7 +96,7 @@ // page number run run = p.addNewR(); run.addNewRPr().addNewNoProof(); - run.addNewT().set(new Integer(page).toString()); + run.addNewT().set(Integer.valueOf(page).toString()); run = p.addNewR(); run.addNewRPr().addNewNoProof(); run.addNewFldChar().setFldCharType(STFldCharType.END); Index: src/ooxml/java/org/apache/poi/POIXMLProperties.java =================================================================== --- src/ooxml/java/org/apache/poi/POIXMLProperties.java (revision 823070) +++ src/ooxml/java/org/apache/poi/POIXMLProperties.java (working copy) @@ -252,7 +252,7 @@ } public void setRevision(String revision) { try { - new Long(revision); + Long.valueOf(revision); part.setRevisionProperty(revision); } catch (NumberFormatException e) {} Index: src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePartName.java =================================================================== --- src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePartName.java (revision 823070) +++ src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePartName.java (working copy) @@ -91,7 +91,7 @@ try { uri = new URI(s); } catch (URISyntaxException e) { - assertTrue(s.equals("[Content_Types].xml")); + assertTrue("[Content_Types].xml".equals(s)); continue; } assertFalse("This part name SHOULD NOT be valid: " + s, Index: src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java =================================================================== --- src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java (revision 823070) +++ src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java (working copy) @@ -52,7 +52,7 @@ String xml = os.toString("UTF-8"); assertNotNull(xml); - assertTrue(!xml.equals("")); + assertTrue(!"".equals(xml)); String docente = xml.split("")[1].split("")[0].trim(); String nome = xml.split("")[1].split("")[0].trim(); @@ -95,7 +95,7 @@ String xml = os.toString("UTF-8"); assertNotNull(xml); - assertTrue(!xml.equals("")); + assertTrue(!"".equals(xml)); String docente = xml.split("")[1].split("")[0].trim(); String nome = xml.split("")[1].split("")[0].trim(); Index: src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java =================================================================== --- src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java (revision 823070) +++ src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java (working copy) @@ -279,12 +279,12 @@ /* Insert some custom properties into the container. */ customProperties.put("Key1", "Value1"); customProperties.put("Schl\u00fcssel2", "Wert2"); - customProperties.put("Sample Integer", new Integer(12345)); - customProperties.put("Sample Boolean", new Boolean(true)); + customProperties.put("Sample Integer", Integer.valueOf(12345)); + customProperties.put("Sample Boolean", Boolean.valueOf(true)); Date date=new Date(); customProperties.put("Sample Date", date); - customProperties.put("Sample Double", new Double(-1.0001)); - customProperties.put("Sample Negative Integer", new Integer(-100000)); + customProperties.put("Sample Double", Double.valueOf(-1.0001)); + customProperties.put("Sample Negative Integer", Integer.valueOf(-100000)); dsi.setCustomProperties(customProperties); @@ -320,17 +320,17 @@ String a2=(String) customProperties.get("Schl\u00fcssel2"); assertEquals("Schl\u00fcssel2","Wert2",a2); Integer a3=(Integer) customProperties.get("Sample Integer"); - assertEquals("Sample Number",new Integer(12345),a3); + assertEquals("Sample Number",Integer.valueOf(12345),a3); Boolean a4=(Boolean) customProperties.get("Sample Boolean"); - assertEquals("Sample Boolean",new Boolean(true),a4); + assertEquals("Sample Boolean",Boolean.valueOf(true),a4); Date a5=(Date) customProperties.get("Sample Date"); assertEquals("Custom Date:",date,a5); Double a6=(Double) customProperties.get("Sample Double"); - assertEquals("Custom Float",new Double(-1.0001),a6); + assertEquals("Custom Float",Double.valueOf(-1.0001),a6); Integer a7=(Integer) customProperties.get("Sample Negative Integer"); - assertEquals("Neg", new Integer(-100000),a7); + assertEquals("Neg", Integer.valueOf(-100000),a7); } @@ -386,8 +386,8 @@ /* Insert some custom properties into the container. */ customProperties.put(k1, p1); customProperties.put(k2, p2); - customProperties.put("Sample Number", new Integer(12345)); - customProperties.put("Sample Boolean", new Boolean(true)); + customProperties.put("Sample Number", Integer.valueOf(12345)); + customProperties.put("Sample Boolean", Boolean.valueOf(true)); Date date=new Date(); customProperties.put("Sample Date", date); @@ -425,9 +425,9 @@ String a2=(String) customProperties.get(k2); assertEquals("Schl\u00fcssel2",p2,a2); Integer a3=(Integer) customProperties.get("Sample Number"); - assertEquals("Sample Number",new Integer(12345),a3); + assertEquals("Sample Number",Integer.valueOf(12345),a3); Boolean a4=(Boolean) customProperties.get("Sample Boolean"); - assertEquals("Sample Boolean",new Boolean(true),a4); + assertEquals("Sample Boolean",Boolean.valueOf(true),a4); Date a5=(Date) customProperties.get("Sample Date"); assertEquals("Custom Date:",date,a5); @@ -498,8 +498,8 @@ /* Insert some custom properties into the container. */ customProperties.put(k1, p1); customProperties.put(k2, p2); - customProperties.put("Sample Number", new Integer(12345)); - customProperties.put("Sample Boolean", new Boolean(false)); + customProperties.put("Sample Number", Integer.valueOf(12345)); + customProperties.put("Sample Boolean", Boolean.valueOf(false)); Date date=new Date(0); customProperties.put("Sample Date", date); @@ -538,9 +538,9 @@ String a2=(String) customProperties.get(k2); assertEquals("Schl\u00fcssel2",p2,a2); Integer a3=(Integer) customProperties.get("Sample Number"); - assertEquals("Sample Number",new Integer(12345),a3); + assertEquals("Sample Number",Integer.valueOf(12345),a3); Boolean a4=(Boolean) customProperties.get("Sample Boolean"); - assertEquals("Sample Boolean",new Boolean(false),a4); + assertEquals("Sample Boolean",Boolean.valueOf(false),a4); Date a5=(Date) customProperties.get("Sample Date"); assertEquals("Custom Date:",date,a5); @@ -622,8 +622,8 @@ /* Insert some custom properties into the container. */ customProperties.put(k1, p1); customProperties.put(k2, p2); - customProperties.put("Sample Number", new Integer(12345)); - customProperties.put("Sample Boolean", new Boolean(true)); + customProperties.put("Sample Number", Integer.valueOf(12345)); + customProperties.put("Sample Boolean", Boolean.valueOf(true)); Date date=new Date(); customProperties.put("Sample Date", date); @@ -662,9 +662,9 @@ String a2=(String) customProperties.get(k2); assertEquals("Schl\u00fcssel2",p2,a2); Integer a3=(Integer) customProperties.get("Sample Number"); - assertEquals("Sample Number",new Integer(12345),a3); + assertEquals("Sample Number",Integer.valueOf(12345),a3); Boolean a4=(Boolean) customProperties.get("Sample Boolean"); - assertEquals("Sample Boolean",new Boolean(true),a4); + assertEquals("Sample Boolean",Boolean.valueOf(true),a4); Date a5=(Date) customProperties.get("Sample Date"); assertEquals("Custom Date:",date,a5); @@ -699,16 +699,16 @@ } /* Insert some custom properties into the container. */ - customProperties.put("int", new Integer(12345)); - customProperties.put("negint", new Integer(-12345)); - customProperties.put("long", new Long(12345)); - customProperties.put("neglong", new Long(-12345)); - customProperties.put("boolean", new Boolean(true)); + customProperties.put("int", Integer.valueOf(12345)); + customProperties.put("negint", Integer.valueOf(-12345)); + customProperties.put("long", Long.valueOf(12345)); + customProperties.put("neglong", Long.valueOf(-12345)); + customProperties.put("boolean", Boolean.valueOf(true)); customProperties.put("string", "a String"); //customProperties.put("float", new Float(12345.0)); is not valid //customProperties.put("negfloat", new Float(-12345.1)); is not valid - customProperties.put("double", new Double(12345.2)); - customProperties.put("negdouble", new Double(-12345.3)); + customProperties.put("double", Double.valueOf(12345.2)); + customProperties.put("negdouble", Double.valueOf(-12345.3)); //customProperties.put("char", new Character('a')); is not valid Date date=new Date(); @@ -745,28 +745,28 @@ /* Insert some custom properties into the container. */ Integer a3=(Integer) customProperties.get("int"); - assertEquals("int",new Integer(12345),a3); + assertEquals("int",Integer.valueOf(12345),a3); a3=(Integer) customProperties.get("negint"); - assertEquals("negint",new Integer(-12345),a3); + assertEquals("negint",Integer.valueOf(-12345),a3); Long al=(Long) customProperties.get("neglong"); - assertEquals("neglong",new Long(-12345),al); + assertEquals("neglong",Long.valueOf(-12345),al); al=(Long) customProperties.get("long"); - assertEquals("long",new Long(12345),al); + assertEquals("long",Long.valueOf(12345),al); Boolean a4=(Boolean) customProperties.get("boolean"); - assertEquals("boolean",new Boolean(true),a4); + assertEquals("boolean",Boolean.valueOf(true),a4); Date a5=(Date) customProperties.get("date"); assertEquals("Custom Date:",date,a5); Double d=(Double) customProperties.get("double"); - assertEquals("int",new Double(12345.2),d); + assertEquals("int",Double.valueOf(12345.2),d); d=(Double) customProperties.get("negdouble"); - assertEquals("string",new Double(-12345.3),d); + assertEquals("string",Double.valueOf(-12345.3),d); String s=(String) customProperties.get("string"); assertEquals("sring","a String",s); Index: src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java =================================================================== --- src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java (revision 823070) +++ src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java (working copy) @@ -82,9 +82,9 @@ Assert.assertEquals(ps.getSectionCount(), 2); Section s = (Section) ps.getSections().get(1); Assert.assertEquals(s.getProperty(1), - new Integer(Constants.CP_UTF16)); + Integer.valueOf(Constants.CP_UTF16)); Assert.assertEquals(s.getProperty(2), - new Integer(-96070278)); + Integer.valueOf(-96070278)); Assert.assertEquals(s.getProperty(3), "MCon_Info zu Office bei Schreiner"); Assert.assertEquals(s.getProperty(4), Index: src/testcases/org/apache/poi/hpsf/basic/TestWrite.java =================================================================== --- src/testcases/org/apache/poi/hpsf/basic/TestWrite.java (revision 823070) +++ src/testcases/org/apache/poi/hpsf/basic/TestWrite.java (working copy) @@ -375,8 +375,8 @@ try { check(Variant.VT_EMPTY, null, codepage); - check(Variant.VT_BOOL, new Boolean(true), codepage); - check(Variant.VT_BOOL, new Boolean(false), codepage); + check(Variant.VT_BOOL, Boolean.valueOf(true), codepage); + check(Variant.VT_BOOL, Boolean.valueOf(false), codepage); check(Variant.VT_CF, new byte[]{0}, codepage); check(Variant.VT_CF, new byte[]{0, 1}, codepage); check(Variant.VT_CF, new byte[]{0, 1, 2}, codepage); @@ -385,19 +385,19 @@ check(Variant.VT_CF, new byte[]{0, 1, 2, 3, 4, 5}, codepage); check(Variant.VT_CF, new byte[]{0, 1, 2, 3, 4, 5, 6}, codepage); check(Variant.VT_CF, new byte[]{0, 1, 2, 3, 4, 5, 6, 7}, codepage); - check(Variant.VT_I4, new Integer(27), codepage); - check(Variant.VT_I8, new Long(28), codepage); - check(Variant.VT_R8, new Double(29.0), codepage); - check(Variant.VT_I4, new Integer(-27), codepage); - check(Variant.VT_I8, new Long(-28), codepage); - check(Variant.VT_R8, new Double(-29.0), codepage); + check(Variant.VT_I4, Integer.valueOf(27), codepage); + check(Variant.VT_I8, Long.valueOf(28), codepage); + check(Variant.VT_R8, Double.valueOf(29.0), codepage); + check(Variant.VT_I4, Integer.valueOf(-27), codepage); + check(Variant.VT_I8, Long.valueOf(-28), codepage); + check(Variant.VT_R8, Double.valueOf(-29.0), codepage); check(Variant.VT_FILETIME, new Date(), codepage); - check(Variant.VT_I4, new Integer(Integer.MAX_VALUE), codepage); - check(Variant.VT_I4, new Integer(Integer.MIN_VALUE), codepage); - check(Variant.VT_I8, new Long(Long.MAX_VALUE), codepage); - check(Variant.VT_I8, new Long(Long.MIN_VALUE), codepage); - check(Variant.VT_R8, new Double(Double.MAX_VALUE), codepage); - check(Variant.VT_R8, new Double(Double.MIN_VALUE), codepage); + check(Variant.VT_I4, Integer.valueOf(Integer.MAX_VALUE), codepage); + check(Variant.VT_I4, Integer.valueOf(Integer.MIN_VALUE), codepage); + check(Variant.VT_I8, Long.valueOf(Long.MAX_VALUE), codepage); + check(Variant.VT_I8, Long.valueOf(Long.MIN_VALUE), codepage); + check(Variant.VT_R8, Double.valueOf(Double.MAX_VALUE), codepage); + check(Variant.VT_R8, Double.valueOf(Double.MIN_VALUE), codepage); check(Variant.VT_LPSTR, "", codepage); @@ -761,14 +761,14 @@ final MutablePropertySet ps1 = new MutablePropertySet(); final MutableSection s = (MutableSection) ps1.getSections().get(0); final Map m = new HashMap(3, 1.0f); - m.put(new Long(1), "String 1"); - m.put(new Long(2), "String 2"); - m.put(new Long(3), "String 3"); + m.put(Long.valueOf(1), "String 1"); + m.put(Long.valueOf(2), "String 2"); + m.put(Long.valueOf(3), "String 3"); s.setDictionary(m); s.setFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[0]); int codepage = Constants.CP_UNICODE; s.setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2, - new Integer(codepage)); + Integer.valueOf(codepage)); poiFs.createDocument(ps1.toInputStream(), "Test"); poiFs.writeFilesystem(out); out.close(); @@ -813,14 +813,14 @@ final MutablePropertySet ps1 = new MutablePropertySet(); final MutableSection s = (MutableSection) ps1.getSections().get(0); final Map m = new HashMap(3, 1.0f); - m.put(new Long(1), "String 1"); - m.put(new Long(2), "String 2"); - m.put(new Long(3), "String 3"); + m.put(Long.valueOf(1), "String 1"); + m.put(Long.valueOf(2), "String 2"); + m.put(Long.valueOf(3), "String 3"); s.setDictionary(m); s.setFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[0]); int codepage = 12345; s.setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2, - new Integer(codepage)); + Integer.valueOf(codepage)); poiFs.createDocument(ps1.toInputStream(), "Test"); poiFs.writeFilesystem(out); out.close(); Index: src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java =================================================================== --- src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java (revision 823070) +++ src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java (working copy) @@ -283,19 +283,19 @@ final int P_SLIDE_COUNT = ++nr; final Date now = new Date(); - final Integer POSITIVE_INTEGER = new Integer(2222); + final Integer POSITIVE_INTEGER = Integer.valueOf(2222); final Long POSITIVE_LONG = new Long(3333); final Double POSITIVE_DOUBLE = new Double(4444); - final Integer NEGATIVE_INTEGER = new Integer(2222); + final Integer NEGATIVE_INTEGER = Integer.valueOf(2222); final Long NEGATIVE_LONG = new Long(3333); final Double NEGATIVE_DOUBLE = new Double(4444); - final Integer MAX_INTEGER = new Integer(Integer.MAX_VALUE); - final Integer MIN_INTEGER = new Integer(Integer.MIN_VALUE); - final Long MAX_LONG = new Long(Long.MAX_VALUE); - final Long MIN_LONG = new Long(Long.MIN_VALUE); - final Double MAX_DOUBLE = new Double(Double.MAX_VALUE); - final Double MIN_DOUBLE = new Double(Double.MIN_VALUE); + final Integer MAX_INTEGER = Integer.valueOf(Integer.MAX_VALUE); + final Integer MIN_INTEGER = Integer.valueOf(Integer.MIN_VALUE); + final Long MAX_LONG = Long.valueOf(Long.MAX_VALUE); + final Long MIN_LONG = Long.valueOf(Long.MIN_VALUE); + final Double MAX_DOUBLE = Double.valueOf(Double.MAX_VALUE); + final Double MIN_DOUBLE = Double.valueOf(Double.MIN_VALUE); si.setApplicationName(P_APPLICATION_NAME); si.setAuthor(P_AUTHOR); @@ -345,7 +345,7 @@ customProperties.put("negative_Integer", NEGATIVE_INTEGER); customProperties.put("negative_Long", NEGATIVE_LONG); customProperties.put("negative_Double", NEGATIVE_DOUBLE); - customProperties.put("Boolean", new Boolean(true)); + customProperties.put("Boolean", Boolean.valueOf(true)); customProperties.put("Date", now); customProperties.put("max_Integer", MAX_INTEGER); customProperties.put("min_Integer", MIN_INTEGER); @@ -434,7 +434,7 @@ assertEquals(NEGATIVE_INTEGER, cps.get("negative_Integer")); assertEquals(NEGATIVE_LONG, cps.get("negative_Long")); assertEquals(NEGATIVE_DOUBLE, cps.get("negative_Double")); - assertEquals(new Boolean(true), cps.get("Boolean")); + assertEquals(Boolean.valueOf(true), cps.get("Boolean")); assertEquals(now, cps.get("Date")); assertEquals(MAX_INTEGER, cps.get("max_Integer")); assertEquals(MIN_INTEGER, cps.get("min_Integer")); @@ -715,7 +715,7 @@ p.setType(Variant.VT_LPWSTR); p.setValue(VALUE_1); s.setProperty(p); - dictionary.put(new Long(ID_1), NAME_1); + dictionary.put(Long.valueOf(ID_1), NAME_1); s.setDictionary(dictionary); cps = dsi.getCustomProperties(); assertEquals(1, cps.size()); @@ -723,7 +723,7 @@ /* Add another custom property. */ s.setProperty(ID_2, Variant.VT_LPWSTR, VALUE_1); - dictionary.put(new Long(ID_2), NAME_1); + dictionary.put(Long.valueOf(ID_2), NAME_1); s.setDictionary(dictionary); cps = dsi.getCustomProperties(); assertEquals(1, cps.size()); Index: src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java =================================================================== --- src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java (revision 823070) +++ src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java (working copy) @@ -67,7 +67,7 @@ Ptg[] ptgs = r.getParsedExpression(); String cellRef = new CellReference(row.getRowNum(), cell.getColumnIndex(), false, false).formatAsString(); - if(false && cellRef.equals("BP24")) { // TODO - replace System.out.println()s with asserts + if(false && "BP24".equals(cellRef)) { // TODO - replace System.out.println()s with asserts System.out.print(cellRef); System.out.println(" - has " + ptgs.length + " ptgs:"); for(int i=0; i 0; - Integer funcIxKey = new Integer(funcIx); + Integer funcIxKey = Integer.valueOf(funcIx); if(!_groupFunctionIndexes.add(funcIxKey)) { throw new RuntimeException("Duplicate function index (" + funcIx + ")"); } @@ -207,7 +207,7 @@ throw new RuntimeException("changing function '" + funcName + "' definition without foot-note"); } - _allFunctionsByIndex.remove(new Integer(fdPrev.getIndex())); + _allFunctionsByIndex.remove(Integer.valueOf(fdPrev.getIndex())); } } @@ -364,7 +364,7 @@ _elemNameStack.add(name); if(matchesTargetPath()) { String tableName = atts.getValue("table:name"); - if(tableName.startsWith("tab_fml_func") && !tableName.equals("tab_fml_func0")) { + if(tableName.startsWith("tab_fml_func") && !"tab_fml_func0".equals(tableName)) { _isInsideTable = true; } return; Index: src/testcases/org/apache/poi/hssf/record/formula/functions/TestStatsLib.java =================================================================== --- src/testcases/org/apache/poi/hssf/record/formula/functions/TestStatsLib.java (revision 823070) +++ src/testcases/org/apache/poi/hssf/record/formula/functions/TestStatsLib.java (working copy) @@ -214,7 +214,7 @@ confirmMode(v, 0.0); } private static void confirmMode(double[] v, double expectedResult) { - confirmMode(v, new Double(expectedResult)); + confirmMode(v, Double.valueOf(expectedResult)); } private static void confirmMode(double[] v, Double expectedResult) { double actual; Index: src/testcases/org/apache/poi/hssf/record/formula/TestArrayPtg.java =================================================================== --- src/testcases/org/apache/poi/hssf/record/formula/TestArrayPtg.java (revision 823070) +++ src/testcases/org/apache/poi/hssf/record/formula/TestArrayPtg.java (working copy) @@ -65,7 +65,7 @@ assertEquals(Boolean.TRUE, values[0][0]); assertEquals("ABCD", values[0][1]); - assertEquals(new Double(0), values[1][0]); + assertEquals(Double.valueOf(0), values[1][0]); assertEquals(Boolean.FALSE, values[1][1]); assertEquals("FG", values[1][2]); Index: src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java =================================================================== --- src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java (revision 823070) +++ src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java (working copy) @@ -241,16 +241,16 @@ String cellFormula; cellFormula = getFormulaFromFirstCell(s, 0); // row "1" // the problem is not observable in the first row of the shared formula - if(!cellFormula.equals("\"first formula\"")) { + if(!"\"first formula\"".equals(cellFormula)) { throw new RuntimeException("Something else wrong with this test case"); } // but the problem is observable in rows 2,3,4 cellFormula = getFormulaFromFirstCell(s, 1); // row "2" - if(cellFormula.equals("\"second formula\"")) { + if("\"second formula\"".equals(cellFormula)) { throw new AssertionFailedError("found bug 44449 (Wrong SharedFormulaRecord was used)."); } - if(!cellFormula.equals("\"first formula\"")) { + if(!"\"first formula\"".equals(cellFormula)) { throw new RuntimeException("Something else wrong with this test case"); } } Index: src/testcases/org/apache/poi/ss/usermodel/BaseTestDataFormat.java =================================================================== --- src/testcases/org/apache/poi/ss/usermodel/BaseTestDataFormat.java (revision 823070) +++ src/testcases/org/apache/poi/ss/usermodel/BaseTestDataFormat.java (working copy) @@ -40,7 +40,7 @@ Map formats = BuiltinFormats.getBuiltinFormats(); for (int idx : formats.keySet()) { - String fmt = formats.get(new Integer(idx)); + String fmt = formats.get(Integer.valueOf(idx)); assertEquals(idx, df.getFormat(fmt)); } Index: src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java =================================================================== --- src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java (revision 823070) +++ src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java (working copy) @@ -63,7 +63,7 @@ public void addTestRow(long rawBits, String expectedExcelRendering) { writeDataRow(_sheet, _rowIndex++, rawBits, expectedExcelRendering); if(Double.isNaN(Double.longBitsToDouble(rawBits))) { - _replacementNaNs.add(new Long(rawBits)); + _replacementNaNs.add(Long.valueOf(rawBits)); } } Index: src/testcases/org/apache/poi/util/LocalTestNode.java =================================================================== --- src/testcases/org/apache/poi/util/LocalTestNode.java (revision 823070) +++ src/testcases/org/apache/poi/util/LocalTestNode.java (working copy) @@ -33,7 +33,7 @@ LocalTestNode(final int key) { - _key = new Integer(key); + _key = Integer.valueOf(key); _value = String.valueOf(key); } Index: src/testcases/org/apache/poi/util/TestStringUtil.java =================================================================== --- src/testcases/org/apache/poi/util/TestStringUtil.java (revision 823070) +++ src/testcases/org/apache/poi/util/TestStringUtil.java (working copy) @@ -132,32 +132,32 @@ assertEquals( "This is a test " + fmt( 1.2345, 2, 2 ), StringUtil.format( "This is a test %2.2", new Object[] { - new Double( 1.2345 ) + Double.valueOf( 1.2345 ) } ) ); assertEquals( "This is a test " + fmt( 1.2345, -1, 3 ), StringUtil.format( "This is a test %.3", new Object[] { - new Double( 1.2345 ) + Double.valueOf( 1.2345 ) } ) ); assertEquals( "This is a great test " + fmt( 1.2345, -1, 3 ), StringUtil.format( "This is a % test %.3", new Object[] { - "great", new Double( 1.2345 ) + "great", Double.valueOf( 1.2345 ) } ) ); assertEquals( "This is a test 1", StringUtil.format( "This is a test %", new Object[] { - new Integer( 1 ) + Integer.valueOf( 1 ) } ) ); assertEquals( "This is a test 1", StringUtil.format( "This is a test %", new Object[] { - new Integer( 1 ), new Integer( 1 ) + Integer.valueOf( 1 ), Integer.valueOf( 1 ) } ) ); assertEquals( "This is a test 1.x", StringUtil.format( "This is a test %1.x", new Object[] { - new Integer( 1 ) + Integer.valueOf( 1 ) } ) ); assertEquals( "This is a test ?missing data?1.x", StringUtil.format( "This is a test %1.x", new Object[] Index: src/testcases/org/apache/poi/util/TestBinaryTree.java =================================================================== --- src/testcases/org/apache/poi/util/TestBinaryTree.java (revision 823070) +++ src/testcases/org/apache/poi/util/TestBinaryTree.java (working copy) @@ -120,7 +120,7 @@ m.put(nodes[ k ].getKey(), nodes[ k ]); assertTrue(m.containsKey(nodes[ k ].getKey())); } - assertTrue(!m.containsKey(new Integer(-1))); + assertTrue(!m.containsKey(Integer.valueOf(-1))); try { m.containsKey("foo"); @@ -179,7 +179,7 @@ m.put(nodes[ k ].getKey(), nodes[ k ]); assertSame(m.get(nodes[ k ].getKey()), nodes[ k ]); } - assertNull(m.get(new Integer(-1))); + assertNull(m.get(Integer.valueOf(-1))); try { m.get("foo"); @@ -270,7 +270,7 @@ catch (ClassCastException ignored) { } - assertNull(m.remove(new Integer(-1))); + assertNull(m.remove(Integer.valueOf(-1))); try { m.remove("foo"); @@ -450,7 +450,7 @@ Collection c1 = new LinkedList(); Collection c2 = new LinkedList(); - c2.add(new Integer(-99)); + c2.add(Integer.valueOf(-99)); for (int k = 0; k < nodes.length; k++) { m.put(nodes[ k ].getKey(), nodes[ k ]); @@ -461,7 +461,7 @@ assertTrue(!m.keySet().containsAll(c2)); m = new BinaryTree(); c1 = new LinkedList(); - c1.add(new Integer(-55)); + c1.add(Integer.valueOf(-55)); try { m.keySet().addAll(c1); @@ -869,7 +869,7 @@ } // reject incompatible values - m2.put("2", new Integer(2)); + m2.put("2", Integer.valueOf(2)); try { m = new BinaryTree(m2); @@ -881,7 +881,7 @@ // reject incompatible keys m2.remove("2"); - m2.put(new Integer(2), "bad key"); + m2.put(Integer.valueOf(2), "bad key"); try { m = new BinaryTree(m2); @@ -973,7 +973,7 @@ catch (ClassCastException ignored) { } - assertNull(m.remove(new Integer(-1))); + assertNull(m.remove(Integer.valueOf(-1))); try { m.removeValue("foo"); @@ -1135,7 +1135,7 @@ Collection c1 = new LinkedList(); Collection c2 = new LinkedList(); - c2.add(new Integer(-99)); + c2.add(Integer.valueOf(-99)); for (int k = 0; k < nodes.length; k++) { m.put(nodes[ k ].getKey(), nodes[ k ]); @@ -1146,7 +1146,7 @@ assertTrue(!m.keySetByValue().containsAll(c2)); m = new BinaryTree(); c1 = new LinkedList(); - c1.add(new Integer(-55)); + c1.add(Integer.valueOf(-55)); try { m.keySetByValue().addAll(c1); @@ -1390,7 +1390,7 @@ } for (int k = 0; k < m.size(); k++) { - assertTrue(s.contains(new Integer(k))); + assertTrue(s.contains(Integer.valueOf(k))); } int count = 0; @@ -1616,7 +1616,7 @@ } for (int k = 0; k < m.size(); k++) { - assertTrue(s.contains(new Integer(k))); + assertTrue(s.contains(Integer.valueOf(k))); } int count = 0; Index: src/testcases/org/apache/poi/util/TestArrayUtil.java =================================================================== --- src/testcases/org/apache/poi/util/TestArrayUtil.java (revision 823070) +++ src/testcases/org/apache/poi/util/TestArrayUtil.java (working copy) @@ -51,16 +51,16 @@ */ private Integer[] getIntsList() { return new Integer[] { - new Integer(0), - new Integer(1), - new Integer(2), - new Integer(3), - new Integer(4), - new Integer(5), - new Integer(6), - new Integer(7), - new Integer(8), - new Integer(9) + Integer.valueOf(0), + Integer.valueOf(1), + Integer.valueOf(2), + Integer.valueOf(3), + Integer.valueOf(4), + Integer.valueOf(5), + Integer.valueOf(6), + Integer.valueOf(7), + Integer.valueOf(8), + Integer.valueOf(9) }; } @@ -70,16 +70,16 @@ public void testArrayMoveWithin() { Integer[] ints = getIntsList(); - assertEquals(new Integer(0), ints[0]); - assertEquals(new Integer(1), ints[1]); - assertEquals(new Integer(2), ints[2]); - assertEquals(new Integer(3), ints[3]); - assertEquals(new Integer(4), ints[4]); - assertEquals(new Integer(5), ints[5]); - assertEquals(new Integer(6), ints[6]); - assertEquals(new Integer(7), ints[7]); - assertEquals(new Integer(8), ints[8]); - assertEquals(new Integer(9), ints[9]); + assertEquals(Integer.valueOf(0), ints[0]); + assertEquals(Integer.valueOf(1), ints[1]); + assertEquals(Integer.valueOf(2), ints[2]); + assertEquals(Integer.valueOf(3), ints[3]); + assertEquals(Integer.valueOf(4), ints[4]); + assertEquals(Integer.valueOf(5), ints[5]); + assertEquals(Integer.valueOf(6), ints[6]); + assertEquals(Integer.valueOf(7), ints[7]); + assertEquals(Integer.valueOf(8), ints[8]); + assertEquals(Integer.valueOf(9), ints[9]); // @@ -89,44 +89,44 @@ // Shift 1 back ints = getIntsList(); ArrayUtil.arrayMoveWithin(ints, 4, 8, 1); - assertEquals(new Integer(0), ints[0]); - assertEquals(new Integer(1), ints[1]); - assertEquals(new Integer(2), ints[2]); - assertEquals(new Integer(3), ints[3]); - assertEquals(new Integer(5), ints[4]); - assertEquals(new Integer(6), ints[5]); - assertEquals(new Integer(7), ints[6]); - assertEquals(new Integer(8), ints[7]); - assertEquals(new Integer(4), ints[8]); - assertEquals(new Integer(9), ints[9]); + assertEquals(Integer.valueOf(0), ints[0]); + assertEquals(Integer.valueOf(1), ints[1]); + assertEquals(Integer.valueOf(2), ints[2]); + assertEquals(Integer.valueOf(3), ints[3]); + assertEquals(Integer.valueOf(5), ints[4]); + assertEquals(Integer.valueOf(6), ints[5]); + assertEquals(Integer.valueOf(7), ints[6]); + assertEquals(Integer.valueOf(8), ints[7]); + assertEquals(Integer.valueOf(4), ints[8]); + assertEquals(Integer.valueOf(9), ints[9]); // Shift front 1 back ints = getIntsList(); ArrayUtil.arrayMoveWithin(ints, 0, 7, 1); - assertEquals(new Integer(1), ints[0]); - assertEquals(new Integer(2), ints[1]); - assertEquals(new Integer(3), ints[2]); - assertEquals(new Integer(4), ints[3]); - assertEquals(new Integer(5), ints[4]); - assertEquals(new Integer(6), ints[5]); - assertEquals(new Integer(7), ints[6]); - assertEquals(new Integer(0), ints[7]); - assertEquals(new Integer(8), ints[8]); - assertEquals(new Integer(9), ints[9]); + assertEquals(Integer.valueOf(1), ints[0]); + assertEquals(Integer.valueOf(2), ints[1]); + assertEquals(Integer.valueOf(3), ints[2]); + assertEquals(Integer.valueOf(4), ints[3]); + assertEquals(Integer.valueOf(5), ints[4]); + assertEquals(Integer.valueOf(6), ints[5]); + assertEquals(Integer.valueOf(7), ints[6]); + assertEquals(Integer.valueOf(0), ints[7]); + assertEquals(Integer.valueOf(8), ints[8]); + assertEquals(Integer.valueOf(9), ints[9]); // Shift 1 to end ints = getIntsList(); ArrayUtil.arrayMoveWithin(ints, 4, 9, 1); - assertEquals(new Integer(0), ints[0]); - assertEquals(new Integer(1), ints[1]); - assertEquals(new Integer(2), ints[2]); - assertEquals(new Integer(3), ints[3]); - assertEquals(new Integer(5), ints[4]); - assertEquals(new Integer(6), ints[5]); - assertEquals(new Integer(7), ints[6]); - assertEquals(new Integer(8), ints[7]); - assertEquals(new Integer(9), ints[8]); - assertEquals(new Integer(4), ints[9]); + assertEquals(Integer.valueOf(0), ints[0]); + assertEquals(Integer.valueOf(1), ints[1]); + assertEquals(Integer.valueOf(2), ints[2]); + assertEquals(Integer.valueOf(3), ints[3]); + assertEquals(Integer.valueOf(5), ints[4]); + assertEquals(Integer.valueOf(6), ints[5]); + assertEquals(Integer.valueOf(7), ints[6]); + assertEquals(Integer.valueOf(8), ints[7]); + assertEquals(Integer.valueOf(9), ints[8]); + assertEquals(Integer.valueOf(4), ints[9]); // @@ -136,44 +136,44 @@ // Shift 1 forward ints = getIntsList(); ArrayUtil.arrayMoveWithin(ints, 8, 3, 1); - assertEquals(new Integer(0), ints[0]); - assertEquals(new Integer(1), ints[1]); - assertEquals(new Integer(2), ints[2]); - assertEquals(new Integer(8), ints[3]); - assertEquals(new Integer(3), ints[4]); - assertEquals(new Integer(4), ints[5]); - assertEquals(new Integer(5), ints[6]); - assertEquals(new Integer(6), ints[7]); - assertEquals(new Integer(7), ints[8]); - assertEquals(new Integer(9), ints[9]); + assertEquals(Integer.valueOf(0), ints[0]); + assertEquals(Integer.valueOf(1), ints[1]); + assertEquals(Integer.valueOf(2), ints[2]); + assertEquals(Integer.valueOf(8), ints[3]); + assertEquals(Integer.valueOf(3), ints[4]); + assertEquals(Integer.valueOf(4), ints[5]); + assertEquals(Integer.valueOf(5), ints[6]); + assertEquals(Integer.valueOf(6), ints[7]); + assertEquals(Integer.valueOf(7), ints[8]); + assertEquals(Integer.valueOf(9), ints[9]); // Shift end 1 forward ints = getIntsList(); ArrayUtil.arrayMoveWithin(ints, 9, 2, 1); - assertEquals(new Integer(0), ints[0]); - assertEquals(new Integer(1), ints[1]); - assertEquals(new Integer(9), ints[2]); - assertEquals(new Integer(2), ints[3]); - assertEquals(new Integer(3), ints[4]); - assertEquals(new Integer(4), ints[5]); - assertEquals(new Integer(5), ints[6]); - assertEquals(new Integer(6), ints[7]); - assertEquals(new Integer(7), ints[8]); - assertEquals(new Integer(8), ints[9]); + assertEquals(Integer.valueOf(0), ints[0]); + assertEquals(Integer.valueOf(1), ints[1]); + assertEquals(Integer.valueOf(9), ints[2]); + assertEquals(Integer.valueOf(2), ints[3]); + assertEquals(Integer.valueOf(3), ints[4]); + assertEquals(Integer.valueOf(4), ints[5]); + assertEquals(Integer.valueOf(5), ints[6]); + assertEquals(Integer.valueOf(6), ints[7]); + assertEquals(Integer.valueOf(7), ints[8]); + assertEquals(Integer.valueOf(8), ints[9]); // Shift 1 to front ints = getIntsList(); ArrayUtil.arrayMoveWithin(ints, 5, 0, 1); - assertEquals(new Integer(5), ints[0]); - assertEquals(new Integer(0), ints[1]); - assertEquals(new Integer(1), ints[2]); - assertEquals(new Integer(2), ints[3]); - assertEquals(new Integer(3), ints[4]); - assertEquals(new Integer(4), ints[5]); - assertEquals(new Integer(6), ints[6]); - assertEquals(new Integer(7), ints[7]); - assertEquals(new Integer(8), ints[8]); - assertEquals(new Integer(9), ints[9]); + assertEquals(Integer.valueOf(5), ints[0]); + assertEquals(Integer.valueOf(0), ints[1]); + assertEquals(Integer.valueOf(1), ints[2]); + assertEquals(Integer.valueOf(2), ints[3]); + assertEquals(Integer.valueOf(3), ints[4]); + assertEquals(Integer.valueOf(4), ints[5]); + assertEquals(Integer.valueOf(6), ints[6]); + assertEquals(Integer.valueOf(7), ints[7]); + assertEquals(Integer.valueOf(8), ints[8]); + assertEquals(Integer.valueOf(9), ints[9]); // @@ -183,44 +183,44 @@ // Shift 3 back ints = getIntsList(); ArrayUtil.arrayMoveWithin(ints, 2, 6, 3); - assertEquals(new Integer(0), ints[0]); - assertEquals(new Integer(1), ints[1]); - assertEquals(new Integer(5), ints[2]); - assertEquals(new Integer(6), ints[3]); - assertEquals(new Integer(7), ints[4]); - assertEquals(new Integer(8), ints[5]); - assertEquals(new Integer(2), ints[6]); - assertEquals(new Integer(3), ints[7]); - assertEquals(new Integer(4), ints[8]); - assertEquals(new Integer(9), ints[9]); + assertEquals(Integer.valueOf(0), ints[0]); + assertEquals(Integer.valueOf(1), ints[1]); + assertEquals(Integer.valueOf(5), ints[2]); + assertEquals(Integer.valueOf(6), ints[3]); + assertEquals(Integer.valueOf(7), ints[4]); + assertEquals(Integer.valueOf(8), ints[5]); + assertEquals(Integer.valueOf(2), ints[6]); + assertEquals(Integer.valueOf(3), ints[7]); + assertEquals(Integer.valueOf(4), ints[8]); + assertEquals(Integer.valueOf(9), ints[9]); // Shift 3 to back ints = getIntsList(); ArrayUtil.arrayMoveWithin(ints, 2, 7, 3); - assertEquals(new Integer(0), ints[0]); - assertEquals(new Integer(1), ints[1]); - assertEquals(new Integer(5), ints[2]); - assertEquals(new Integer(6), ints[3]); - assertEquals(new Integer(7), ints[4]); - assertEquals(new Integer(8), ints[5]); - assertEquals(new Integer(9), ints[6]); - assertEquals(new Integer(2), ints[7]); - assertEquals(new Integer(3), ints[8]); - assertEquals(new Integer(4), ints[9]); + assertEquals(Integer.valueOf(0), ints[0]); + assertEquals(Integer.valueOf(1), ints[1]); + assertEquals(Integer.valueOf(5), ints[2]); + assertEquals(Integer.valueOf(6), ints[3]); + assertEquals(Integer.valueOf(7), ints[4]); + assertEquals(Integer.valueOf(8), ints[5]); + assertEquals(Integer.valueOf(9), ints[6]); + assertEquals(Integer.valueOf(2), ints[7]); + assertEquals(Integer.valueOf(3), ints[8]); + assertEquals(Integer.valueOf(4), ints[9]); // Shift from 3 front ints = getIntsList(); ArrayUtil.arrayMoveWithin(ints, 0, 5, 3); - assertEquals(new Integer(3), ints[0]); - assertEquals(new Integer(4), ints[1]); - assertEquals(new Integer(5), ints[2]); - assertEquals(new Integer(6), ints[3]); - assertEquals(new Integer(7), ints[4]); - assertEquals(new Integer(0), ints[5]); - assertEquals(new Integer(1), ints[6]); - assertEquals(new Integer(2), ints[7]); - assertEquals(new Integer(8), ints[8]); - assertEquals(new Integer(9), ints[9]); + assertEquals(Integer.valueOf(3), ints[0]); + assertEquals(Integer.valueOf(4), ints[1]); + assertEquals(Integer.valueOf(5), ints[2]); + assertEquals(Integer.valueOf(6), ints[3]); + assertEquals(Integer.valueOf(7), ints[4]); + assertEquals(Integer.valueOf(0), ints[5]); + assertEquals(Integer.valueOf(1), ints[6]); + assertEquals(Integer.valueOf(2), ints[7]); + assertEquals(Integer.valueOf(8), ints[8]); + assertEquals(Integer.valueOf(9), ints[9]); // @@ -230,44 +230,44 @@ // Shift 3 forward ints = getIntsList(); ArrayUtil.arrayMoveWithin(ints, 6, 2, 3); - assertEquals(new Integer(0), ints[0]); - assertEquals(new Integer(1), ints[1]); - assertEquals(new Integer(6), ints[2]); - assertEquals(new Integer(7), ints[3]); - assertEquals(new Integer(8), ints[4]); - assertEquals(new Integer(2), ints[5]); - assertEquals(new Integer(3), ints[6]); - assertEquals(new Integer(4), ints[7]); - assertEquals(new Integer(5), ints[8]); - assertEquals(new Integer(9), ints[9]); + assertEquals(Integer.valueOf(0), ints[0]); + assertEquals(Integer.valueOf(1), ints[1]); + assertEquals(Integer.valueOf(6), ints[2]); + assertEquals(Integer.valueOf(7), ints[3]); + assertEquals(Integer.valueOf(8), ints[4]); + assertEquals(Integer.valueOf(2), ints[5]); + assertEquals(Integer.valueOf(3), ints[6]); + assertEquals(Integer.valueOf(4), ints[7]); + assertEquals(Integer.valueOf(5), ints[8]); + assertEquals(Integer.valueOf(9), ints[9]); // Shift 3 to front ints = getIntsList(); ArrayUtil.arrayMoveWithin(ints, 6, 0, 3); - assertEquals(new Integer(6), ints[0]); - assertEquals(new Integer(7), ints[1]); - assertEquals(new Integer(8), ints[2]); - assertEquals(new Integer(0), ints[3]); - assertEquals(new Integer(1), ints[4]); - assertEquals(new Integer(2), ints[5]); - assertEquals(new Integer(3), ints[6]); - assertEquals(new Integer(4), ints[7]); - assertEquals(new Integer(5), ints[8]); - assertEquals(new Integer(9), ints[9]); + assertEquals(Integer.valueOf(6), ints[0]); + assertEquals(Integer.valueOf(7), ints[1]); + assertEquals(Integer.valueOf(8), ints[2]); + assertEquals(Integer.valueOf(0), ints[3]); + assertEquals(Integer.valueOf(1), ints[4]); + assertEquals(Integer.valueOf(2), ints[5]); + assertEquals(Integer.valueOf(3), ints[6]); + assertEquals(Integer.valueOf(4), ints[7]); + assertEquals(Integer.valueOf(5), ints[8]); + assertEquals(Integer.valueOf(9), ints[9]); // Shift from 3 back ints = getIntsList(); ArrayUtil.arrayMoveWithin(ints, 7, 3, 3); - assertEquals(new Integer(0), ints[0]); - assertEquals(new Integer(1), ints[1]); - assertEquals(new Integer(2), ints[2]); - assertEquals(new Integer(7), ints[3]); - assertEquals(new Integer(8), ints[4]); - assertEquals(new Integer(9), ints[5]); - assertEquals(new Integer(3), ints[6]); - assertEquals(new Integer(4), ints[7]); - assertEquals(new Integer(5), ints[8]); - assertEquals(new Integer(6), ints[9]); + assertEquals(Integer.valueOf(0), ints[0]); + assertEquals(Integer.valueOf(1), ints[1]); + assertEquals(Integer.valueOf(2), ints[2]); + assertEquals(Integer.valueOf(7), ints[3]); + assertEquals(Integer.valueOf(8), ints[4]); + assertEquals(Integer.valueOf(9), ints[5]); + assertEquals(Integer.valueOf(3), ints[6]); + assertEquals(Integer.valueOf(4), ints[7]); + assertEquals(Integer.valueOf(5), ints[8]); + assertEquals(Integer.valueOf(6), ints[9]); // Check can't shift more than we have Index: src/testcases/org/apache/poi/util/TestPOILogger.java =================================================================== --- src/testcases/org/apache/poi/util/TestPOILogger.java (revision 823070) +++ src/testcases/org/apache/poi/util/TestPOILogger.java (working copy) @@ -39,8 +39,8 @@ POILogger log = POILogFactory.getLogger( "foo" ); - log.log( POILogger.WARN, "Test = ", new Integer( 1 ) ); - log.logFormatted( POILogger.ERROR, "Test param 1 = %, param 2 = %", "2", new Integer( 3 ) ); + log.log( POILogger.WARN, "Test = ", Integer.valueOf( 1 ) ); + log.logFormatted( POILogger.ERROR, "Test param 1 = %, param 2 = %", "2", Integer.valueOf( 3 ) ); log.logFormatted( POILogger.ERROR, "Test param 1 = %, param 2 = %", new int[]{4, 5} ); log.logFormatted( POILogger.ERROR, "Test param 1 = %1.1, param 2 = %0.1", new double[]{4, 5.23} );