View | Details | Raw Unified | Return to bug 47962
Collapse All | Expand All

(-)src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableUtils.java (-1 / +1 lines)
Lines 73-79 Link Here
73
   * @return        The aWTColor value
73
   * @return        The aWTColor value
74
   */
74
   */
75
  public final static Color getAWTColor(int index, Color deflt) {
75
  public final static Color getAWTColor(int index, Color deflt) {
76
    HSSFColor clr = (HSSFColor) colors.get(new Integer(index));
76
    HSSFColor clr = (HSSFColor) colors.get(Integer.valueOf(index));
77
    if (clr == null) {
77
    if (clr == null) {
78
      return deflt;
78
      return deflt;
79
    }
79
    }
(-)src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellEditor.java (-1 / +1 lines)
Lines 192-198 Link Here
192
     *
192
     *
193
     */
193
     */
194
    private final Color getAWTColor(int index, Color deflt) {
194
    private final Color getAWTColor(int index, Color deflt) {
195
      HSSFColor clr = (HSSFColor)colors.get(new Integer(index));
195
      HSSFColor clr = (HSSFColor)colors.get(Integer.valueOf(index));
196
      if (clr == null) return deflt;
196
      if (clr == null) return deflt;
197
      return getAWTColor(clr);
197
      return getAWTColor(clr);
198
    }
198
    }
(-)src/contrib/src/org/apache/poi/ss/usermodel/contrib/RegionUtil.java (-1 / +1 lines)
Lines 48-54 Link Here
48
		public CellPropertySetter(Workbook workbook, String propertyName, int value) {
48
		public CellPropertySetter(Workbook workbook, String propertyName, int value) {
49
			_workbook = workbook;
49
			_workbook = workbook;
50
			_propertyName = propertyName;
50
			_propertyName = propertyName;
51
			_propertyValue = new Short((short) value);
51
			_propertyValue = Short.valueOf((short) value);
52
		}
52
		}
53
53
54
54
(-)src/contrib/src/org/apache/poi/ss/usermodel/contrib/CellUtil.java (-3 / +3 lines)
Lines 154-160 Link Here
154
	 * @see CellStyle for alignment options
154
	 * @see CellStyle for alignment options
155
	 */
155
	 */
156
	public static void setAlignment(Cell cell, Workbook workbook, short align) {
156
	public static void setAlignment(Cell cell, Workbook workbook, short align) {
157
		setCellStyleProperty(cell, workbook, ALIGNMENT, new Short(align));
157
		setCellStyleProperty(cell, workbook, ALIGNMENT, Short.valueOf(align));
158
	}
158
	}
159
159
160
	/**
160
	/**
Lines 311-317 Link Here
311
	 * @param value property value
311
	 * @param value property value
312
	 */
312
	 */
313
	private static void putShort(Map<String, Object> properties, String name, short value) {
313
	private static void putShort(Map<String, Object> properties, String name, short value) {
314
		properties.put(name, new Short(value));
314
		properties.put(name, Short.valueOf(value));
315
	}
315
	}
316
316
317
	/**
317
	/**
Lines 322-328 Link Here
322
	 * @param value property value
322
	 * @param value property value
323
	 */
323
	 */
324
	private static void putBoolean(Map<String, Object> properties, String name, boolean value) {
324
	private static void putBoolean(Map<String, Object> properties, String name, boolean value) {
325
		properties.put(name, new Boolean(value));
325
		properties.put(name, Boolean.valueOf(value));
326
	}
326
	}
327
327
328
	/**
328
	/**
(-)src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java (-1 / +1 lines)
Lines 589-595 Link Here
589
                {
589
                {
590
                    propertyCount++;
590
                    propertyCount++;
591
                    final CustomProperty cp = new CustomProperty(p,
591
                    final CustomProperty cp = new CustomProperty(p,
592
                            (String) dictionary.get(new Long(id)));
592
                            (String) dictionary.get(Long.valueOf(id)));
593
                    cps.put(cp.getName(), cp);
593
                    cps.put(cp.getName(), cp);
594
                }
594
                }
595
            }
595
            }
(-)src/java/org/apache/poi/hpsf/Variant.java (-88 / +88 lines)
Lines 351-382 Link Here
351
    /**
351
    /**
352
     * <p>Denotes a variant type with a length that is unknown to HPSF yet.</p>
352
     * <p>Denotes a variant type with a length that is unknown to HPSF yet.</p>
353
     */
353
     */
354
    public static final Integer LENGTH_UNKNOWN = new Integer(-2);
354
    public static final Integer LENGTH_UNKNOWN = Integer.valueOf(-2);
355
355
356
    /**
356
    /**
357
     * <p>Denotes a variant type with a variable length.</p>
357
     * <p>Denotes a variant type with a variable length.</p>
358
     */
358
     */
359
    public static final Integer LENGTH_VARIABLE = new Integer(-1);
359
    public static final Integer LENGTH_VARIABLE = Integer.valueOf(-1);
360
360
361
    /**
361
    /**
362
     * <p>Denotes a variant type with a length of 0 bytes.</p>
362
     * <p>Denotes a variant type with a length of 0 bytes.</p>
363
     */
363
     */
364
    public static final Integer LENGTH_0 = new Integer(0);
364
    public static final Integer LENGTH_0 = Integer.valueOf(0);
365
365
366
    /**
366
    /**
367
     * <p>Denotes a variant type with a length of 2 bytes.</p>
367
     * <p>Denotes a variant type with a length of 2 bytes.</p>
368
     */
368
     */
369
    public static final Integer LENGTH_2 = new Integer(2);
369
    public static final Integer LENGTH_2 = Integer.valueOf(2);
370
370
371
    /**
371
    /**
372
     * <p>Denotes a variant type with a length of 4 bytes.</p>
372
     * <p>Denotes a variant type with a length of 4 bytes.</p>
373
     */
373
     */
374
    public static final Integer LENGTH_4 = new Integer(4);
374
    public static final Integer LENGTH_4 = Integer.valueOf(4);
375
375
376
    /**
376
    /**
377
     * <p>Denotes a variant type with a length of 8 bytes.</p>
377
     * <p>Denotes a variant type with a length of 8 bytes.</p>
378
     */
378
     */
379
    public static final Integer LENGTH_8 = new Integer(8);
379
    public static final Integer LENGTH_8 = Integer.valueOf(8);
380
380
381
381
382
382
Lines 384-475 Link Here
384
    {
384
    {
385
        /* Initialize the number-to-name map: */
385
        /* Initialize the number-to-name map: */
386
        Map tm1 = new HashMap();
386
        Map tm1 = new HashMap();
387
        tm1.put(new Long(0), "VT_EMPTY");
387
        tm1.put(Long.valueOf(0), "VT_EMPTY");
388
        tm1.put(new Long(1), "VT_NULL");
388
        tm1.put(Long.valueOf(1), "VT_NULL");
389
        tm1.put(new Long(2), "VT_I2");
389
        tm1.put(Long.valueOf(2), "VT_I2");
390
        tm1.put(new Long(3), "VT_I4");
390
        tm1.put(Long.valueOf(3), "VT_I4");
391
        tm1.put(new Long(4), "VT_R4");
391
        tm1.put(Long.valueOf(4), "VT_R4");
392
        tm1.put(new Long(5), "VT_R8");
392
        tm1.put(Long.valueOf(5), "VT_R8");
393
        tm1.put(new Long(6), "VT_CY");
393
        tm1.put(Long.valueOf(6), "VT_CY");
394
        tm1.put(new Long(7), "VT_DATE");
394
        tm1.put(Long.valueOf(7), "VT_DATE");
395
        tm1.put(new Long(8), "VT_BSTR");
395
        tm1.put(Long.valueOf(8), "VT_BSTR");
396
        tm1.put(new Long(9), "VT_DISPATCH");
396
        tm1.put(Long.valueOf(9), "VT_DISPATCH");
397
        tm1.put(new Long(10), "VT_ERROR");
397
        tm1.put(Long.valueOf(10), "VT_ERROR");
398
        tm1.put(new Long(11), "VT_BOOL");
398
        tm1.put(Long.valueOf(11), "VT_BOOL");
399
        tm1.put(new Long(12), "VT_VARIANT");
399
        tm1.put(Long.valueOf(12), "VT_VARIANT");
400
        tm1.put(new Long(13), "VT_UNKNOWN");
400
        tm1.put(Long.valueOf(13), "VT_UNKNOWN");
401
        tm1.put(new Long(14), "VT_DECIMAL");
401
        tm1.put(Long.valueOf(14), "VT_DECIMAL");
402
        tm1.put(new Long(16), "VT_I1");
402
        tm1.put(Long.valueOf(16), "VT_I1");
403
        tm1.put(new Long(17), "VT_UI1");
403
        tm1.put(Long.valueOf(17), "VT_UI1");
404
        tm1.put(new Long(18), "VT_UI2");
404
        tm1.put(Long.valueOf(18), "VT_UI2");
405
        tm1.put(new Long(19), "VT_UI4");
405
        tm1.put(Long.valueOf(19), "VT_UI4");
406
        tm1.put(new Long(20), "VT_I8");
406
        tm1.put(Long.valueOf(20), "VT_I8");
407
        tm1.put(new Long(21), "VT_UI8");
407
        tm1.put(Long.valueOf(21), "VT_UI8");
408
        tm1.put(new Long(22), "VT_INT");
408
        tm1.put(Long.valueOf(22), "VT_INT");
409
        tm1.put(new Long(23), "VT_UINT");
409
        tm1.put(Long.valueOf(23), "VT_UINT");
410
        tm1.put(new Long(24), "VT_VOID");
410
        tm1.put(Long.valueOf(24), "VT_VOID");
411
        tm1.put(new Long(25), "VT_HRESULT");
411
        tm1.put(Long.valueOf(25), "VT_HRESULT");
412
        tm1.put(new Long(26), "VT_PTR");
412
        tm1.put(Long.valueOf(26), "VT_PTR");
413
        tm1.put(new Long(27), "VT_SAFEARRAY");
413
        tm1.put(Long.valueOf(27), "VT_SAFEARRAY");
414
        tm1.put(new Long(28), "VT_CARRAY");
414
        tm1.put(Long.valueOf(28), "VT_CARRAY");
415
        tm1.put(new Long(29), "VT_USERDEFINED");
415
        tm1.put(Long.valueOf(29), "VT_USERDEFINED");
416
        tm1.put(new Long(30), "VT_LPSTR");
416
        tm1.put(Long.valueOf(30), "VT_LPSTR");
417
        tm1.put(new Long(31), "VT_LPWSTR");
417
        tm1.put(Long.valueOf(31), "VT_LPWSTR");
418
        tm1.put(new Long(64), "VT_FILETIME");
418
        tm1.put(Long.valueOf(64), "VT_FILETIME");
419
        tm1.put(new Long(65), "VT_BLOB");
419
        tm1.put(Long.valueOf(65), "VT_BLOB");
420
        tm1.put(new Long(66), "VT_STREAM");
420
        tm1.put(Long.valueOf(66), "VT_STREAM");
421
        tm1.put(new Long(67), "VT_STORAGE");
421
        tm1.put(Long.valueOf(67), "VT_STORAGE");
422
        tm1.put(new Long(68), "VT_STREAMED_OBJECT");
422
        tm1.put(Long.valueOf(68), "VT_STREAMED_OBJECT");
423
        tm1.put(new Long(69), "VT_STORED_OBJECT");
423
        tm1.put(Long.valueOf(69), "VT_STORED_OBJECT");
424
        tm1.put(new Long(70), "VT_BLOB_OBJECT");
424
        tm1.put(Long.valueOf(70), "VT_BLOB_OBJECT");
425
        tm1.put(new Long(71), "VT_CF");
425
        tm1.put(Long.valueOf(71), "VT_CF");
426
        tm1.put(new Long(72), "VT_CLSID");
426
        tm1.put(Long.valueOf(72), "VT_CLSID");
427
        Map tm2 = new HashMap(tm1.size(), 1.0F);
427
        Map tm2 = new HashMap(tm1.size(), 1.0F);
428
        tm2.putAll(tm1);
428
        tm2.putAll(tm1);
429
        numberToName = Collections.unmodifiableMap(tm2);
429
        numberToName = Collections.unmodifiableMap(tm2);
430
430
431
        /* Initialize the number-to-length map: */
431
        /* Initialize the number-to-length map: */
432
        tm1.clear();
432
        tm1.clear();
433
        tm1.put(new Long(0), LENGTH_0);
433
        tm1.put(Long.valueOf(0), LENGTH_0);
434
        tm1.put(new Long(1), LENGTH_UNKNOWN);
434
        tm1.put(Long.valueOf(1), LENGTH_UNKNOWN);
435
        tm1.put(new Long(2), LENGTH_2);
435
        tm1.put(Long.valueOf(2), LENGTH_2);
436
        tm1.put(new Long(3), LENGTH_4);
436
        tm1.put(Long.valueOf(3), LENGTH_4);
437
        tm1.put(new Long(4), LENGTH_4);
437
        tm1.put(Long.valueOf(4), LENGTH_4);
438
        tm1.put(new Long(5), LENGTH_8);
438
        tm1.put(Long.valueOf(5), LENGTH_8);
439
        tm1.put(new Long(6), LENGTH_UNKNOWN);
439
        tm1.put(Long.valueOf(6), LENGTH_UNKNOWN);
440
        tm1.put(new Long(7), LENGTH_UNKNOWN);
440
        tm1.put(Long.valueOf(7), LENGTH_UNKNOWN);
441
        tm1.put(new Long(8), LENGTH_UNKNOWN);
441
        tm1.put(Long.valueOf(8), LENGTH_UNKNOWN);
442
        tm1.put(new Long(9), LENGTH_UNKNOWN);
442
        tm1.put(Long.valueOf(9), LENGTH_UNKNOWN);
443
        tm1.put(new Long(10), LENGTH_UNKNOWN);
443
        tm1.put(Long.valueOf(10), LENGTH_UNKNOWN);
444
        tm1.put(new Long(11), LENGTH_UNKNOWN);
444
        tm1.put(Long.valueOf(11), LENGTH_UNKNOWN);
445
        tm1.put(new Long(12), LENGTH_UNKNOWN);
445
        tm1.put(Long.valueOf(12), LENGTH_UNKNOWN);
446
        tm1.put(new Long(13), LENGTH_UNKNOWN);
446
        tm1.put(Long.valueOf(13), LENGTH_UNKNOWN);
447
        tm1.put(new Long(14), LENGTH_UNKNOWN);
447
        tm1.put(Long.valueOf(14), LENGTH_UNKNOWN);
448
        tm1.put(new Long(16), LENGTH_UNKNOWN);
448
        tm1.put(Long.valueOf(16), LENGTH_UNKNOWN);
449
        tm1.put(new Long(17), LENGTH_UNKNOWN);
449
        tm1.put(Long.valueOf(17), LENGTH_UNKNOWN);
450
        tm1.put(new Long(18), LENGTH_UNKNOWN);
450
        tm1.put(Long.valueOf(18), LENGTH_UNKNOWN);
451
        tm1.put(new Long(19), LENGTH_UNKNOWN);
451
        tm1.put(Long.valueOf(19), LENGTH_UNKNOWN);
452
        tm1.put(new Long(20), LENGTH_UNKNOWN);
452
        tm1.put(Long.valueOf(20), LENGTH_UNKNOWN);
453
        tm1.put(new Long(21), LENGTH_UNKNOWN);
453
        tm1.put(Long.valueOf(21), LENGTH_UNKNOWN);
454
        tm1.put(new Long(22), LENGTH_UNKNOWN);
454
        tm1.put(Long.valueOf(22), LENGTH_UNKNOWN);
455
        tm1.put(new Long(23), LENGTH_UNKNOWN);
455
        tm1.put(Long.valueOf(23), LENGTH_UNKNOWN);
456
        tm1.put(new Long(24), LENGTH_UNKNOWN);
456
        tm1.put(Long.valueOf(24), LENGTH_UNKNOWN);
457
        tm1.put(new Long(25), LENGTH_UNKNOWN);
457
        tm1.put(Long.valueOf(25), LENGTH_UNKNOWN);
458
        tm1.put(new Long(26), LENGTH_UNKNOWN);
458
        tm1.put(Long.valueOf(26), LENGTH_UNKNOWN);
459
        tm1.put(new Long(27), LENGTH_UNKNOWN);
459
        tm1.put(Long.valueOf(27), LENGTH_UNKNOWN);
460
        tm1.put(new Long(28), LENGTH_UNKNOWN);
460
        tm1.put(Long.valueOf(28), LENGTH_UNKNOWN);
461
        tm1.put(new Long(29), LENGTH_UNKNOWN);
461
        tm1.put(Long.valueOf(29), LENGTH_UNKNOWN);
462
        tm1.put(new Long(30), LENGTH_VARIABLE);
462
        tm1.put(Long.valueOf(30), LENGTH_VARIABLE);
463
        tm1.put(new Long(31), LENGTH_UNKNOWN);
463
        tm1.put(Long.valueOf(31), LENGTH_UNKNOWN);
464
        tm1.put(new Long(64), LENGTH_8);
464
        tm1.put(Long.valueOf(64), LENGTH_8);
465
        tm1.put(new Long(65), LENGTH_UNKNOWN);
465
        tm1.put(Long.valueOf(65), LENGTH_UNKNOWN);
466
        tm1.put(new Long(66), LENGTH_UNKNOWN);
466
        tm1.put(Long.valueOf(66), LENGTH_UNKNOWN);
467
        tm1.put(new Long(67), LENGTH_UNKNOWN);
467
        tm1.put(Long.valueOf(67), LENGTH_UNKNOWN);
468
        tm1.put(new Long(68), LENGTH_UNKNOWN);
468
        tm1.put(Long.valueOf(68), LENGTH_UNKNOWN);
469
        tm1.put(new Long(69), LENGTH_UNKNOWN);
469
        tm1.put(Long.valueOf(69), LENGTH_UNKNOWN);
470
        tm1.put(new Long(70), LENGTH_UNKNOWN);
470
        tm1.put(Long.valueOf(70), LENGTH_UNKNOWN);
471
        tm1.put(new Long(71), LENGTH_UNKNOWN);
471
        tm1.put(Long.valueOf(71), LENGTH_UNKNOWN);
472
        tm1.put(new Long(72), LENGTH_UNKNOWN);
472
        tm1.put(Long.valueOf(72), LENGTH_UNKNOWN);
473
        tm2 = new HashMap(tm1.size(), 1.0F);
473
        tm2 = new HashMap(tm1.size(), 1.0F);
474
        tm2.putAll(tm1);
474
        tm2.putAll(tm1);
475
        numberToLength = Collections.unmodifiableMap(tm2);
475
        numberToLength = Collections.unmodifiableMap(tm2);
Lines 486-492 Link Here
486
     */
486
     */
487
    public static String getVariantName(final long variantType)
487
    public static String getVariantName(final long variantType)
488
    {
488
    {
489
        final String name = (String) numberToName.get(new Long(variantType));
489
        final String name = (String) numberToName.get(Long.valueOf(variantType));
490
        return name != null ? name : "unknown variant type";
490
        return name != null ? name : "unknown variant type";
491
    }
491
    }
492
492
Lines 501-507 Link Here
501
     */
501
     */
502
    public static int getVariantLength(final long variantType)
502
    public static int getVariantLength(final long variantType)
503
    {
503
    {
504
        final Long key = new Long((int) variantType);
504
        final Long key = Long.valueOf((int) variantType);
505
        final Long length = (Long) numberToLength.get(key);
505
        final Long length = (Long) numberToLength.get(key);
506
        if (length == null)
506
        if (length == null)
507
            return -2;
507
            return -2;
(-)src/java/org/apache/poi/hpsf/Section.java (-2 / +2 lines)
Lines 278-284 Link Here
278
                    this.offset + ple.offset,
278
                    this.offset + ple.offset,
279
                    ple.length, codepage);
279
                    ple.length, codepage);
280
            if (p.getID() == PropertyIDMap.PID_CODEPAGE)
280
            if (p.getID() == PropertyIDMap.PID_CODEPAGE)
281
                p = new Property(p.getID(), p.getType(), new Integer(codepage));
281
                p = new Property(p.getID(), p.getType(), Integer.valueOf(codepage));
282
            properties[i1++] = p;
282
            properties[i1++] = p;
283
        }
283
        }
284
284
Lines 450-456 Link Here
450
    {
450
    {
451
        String s = null;
451
        String s = null;
452
        if (dictionary != null)
452
        if (dictionary != null)
453
            s = (String) dictionary.get(new Long(pid));
453
            s = (String) dictionary.get(Long.valueOf(pid));
454
        if (s == null)
454
        if (s == null)
455
            s = SectionIDMap.getPIDString(getFormatID().getBytes(), pid);
455
            s = SectionIDMap.getPIDString(getFormatID().getBytes(), pid);
456
        if (s == null)
456
        if (s == null)
(-)src/java/org/apache/poi/hpsf/MutableSection.java (-7 / +7 lines)
Lines 182-188 Link Here
182
     */
182
     */
183
    public void setProperty(final int id, final int value)
183
    public void setProperty(final int id, final int value)
184
    {
184
    {
185
        setProperty(id, Variant.VT_I4, new Integer(value));
185
        setProperty(id, Variant.VT_I4, Integer.valueOf(value));
186
        dirty = true;
186
        dirty = true;
187
    }
187
    }
188
188
Lines 199-205 Link Here
199
     */
199
     */
200
    public void setProperty(final int id, final long value)
200
    public void setProperty(final int id, final long value)
201
    {
201
    {
202
        setProperty(id, Variant.VT_I8, new Long(value));
202
        setProperty(id, Variant.VT_I8, Long.valueOf(value));
203
        dirty = true;
203
        dirty = true;
204
    }
204
    }
205
205
Lines 216-222 Link Here
216
     */
216
     */
217
    public void setProperty(final int id, final boolean value)
217
    public void setProperty(final int id, final boolean value)
218
    {
218
    {
219
        setProperty(id, Variant.VT_BOOL, new Boolean(value));
219
        setProperty(id, Variant.VT_BOOL, Boolean.valueOf(value));
220
        dirty = true;
220
        dirty = true;
221
    }
221
    }
222
222
Lines 300-306 Link Here
300
     */
300
     */
301
    protected void setPropertyBooleanValue(final int id, final boolean value)
301
    protected void setPropertyBooleanValue(final int id, final boolean value)
302
    {
302
    {
303
        setProperty(id, Variant.VT_BOOL, new Boolean(value));
303
        setProperty(id, Variant.VT_BOOL, Boolean.valueOf(value));
304
    }
304
    }
305
305
306
306
Lines 418-424 Link Here
418
                 * dictionary is present. In order to cope with this problem we
418
                 * dictionary is present. In order to cope with this problem we
419
                 * add the codepage property and set it to Unicode. */
419
                 * add the codepage property and set it to Unicode. */
420
                setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2,
420
                setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2,
421
                            new Integer(Constants.CP_UNICODE));
421
                            Integer.valueOf(Constants.CP_UNICODE));
422
            codepage = getCodepage();
422
            codepage = getCodepage();
423
        }
423
        }
424
424
Lines 646-652 Link Here
646
                (Integer) getProperty(PropertyIDMap.PID_CODEPAGE);
646
                (Integer) getProperty(PropertyIDMap.PID_CODEPAGE);
647
            if (codepage == null)
647
            if (codepage == null)
648
                setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2,
648
                setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2,
649
                            new Integer(Constants.CP_UNICODE));
649
                            Integer.valueOf(Constants.CP_UNICODE));
650
        }
650
        }
651
        else
651
        else
652
            /* Setting the dictionary to null means to remove property 0.
652
            /* Setting the dictionary to null means to remove property 0.
Lines 707-713 Link Here
707
    public void setCodepage(final int codepage)
707
    public void setCodepage(final int codepage)
708
    {
708
    {
709
        setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2,
709
        setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2,
710
                new Integer(codepage));
710
                Integer.valueOf(codepage));
711
    }
711
    }
712
712
713
}
713
}
(-)src/java/org/apache/poi/hpsf/Property.java (-1 / +1 lines)
Lines 217-223 Link Here
217
            for (int i = 0; i < nrEntries; i++)
217
            for (int i = 0; i < nrEntries; i++)
218
            {
218
            {
219
                /* The key. */
219
                /* The key. */
220
                final Long id = new Long(LittleEndian.getUInt(src, o));
220
                final Long id = Long.valueOf(LittleEndian.getUInt(src, o));
221
                o += LittleEndian.INT_SIZE;
221
                o += LittleEndian.INT_SIZE;
222
222
223
                /* The value (a string). The length is the either the
223
                /* The value (a string). The length is the either the
(-)src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java (-2 / +2 lines)
Lines 291-297 Link Here
291
     */
291
     */
292
    public Object put(final long id, final String idString)
292
    public Object put(final long id, final String idString)
293
    {
293
    {
294
        return put(new Long(id), idString);
294
        return put(Long.valueOf(id), idString);
295
    }
295
    }
296
296
297
297
Lines 305-311 Link Here
305
     */
305
     */
306
    public Object get(final long id)
306
    public Object get(final long id)
307
    {
307
    {
308
        return get(new Long(id));
308
        return get(Long.valueOf(id));
309
    }
309
    }
310
310
311
311
(-)src/java/org/apache/poi/hpsf/VariantSupport.java (-5 / +5 lines)
Lines 97-103 Link Here
97
        {
97
        {
98
            if (unsupportedMessage == null)
98
            if (unsupportedMessage == null)
99
                unsupportedMessage = new LinkedList();
99
                unsupportedMessage = new LinkedList();
100
            Long vt = new Long(ex.getVariantType());
100
            Long vt = Long.valueOf(ex.getVariantType());
101
            if (!unsupportedMessage.contains(vt))
101
            if (!unsupportedMessage.contains(vt))
102
            {
102
            {
103
                System.err.println(ex.getMessage());
103
                System.err.println(ex.getMessage());
Lines 182-188 Link Here
182
                 * Read a short. In Java it is represented as an
182
                 * Read a short. In Java it is represented as an
183
                 * Integer object.
183
                 * Integer object.
184
                 */
184
                 */
185
                value = new Integer(LittleEndian.getShort(src, o1));
185
                value = Integer.valueOf(LittleEndian.getShort(src, o1));
186
                break;
186
                break;
187
            }
187
            }
188
            case Variant.VT_I4:
188
            case Variant.VT_I4:
Lines 191-197 Link Here
191
                 * Read a word. In Java it is represented as an
191
                 * Read a word. In Java it is represented as an
192
                 * Integer object.
192
                 * Integer object.
193
                 */
193
                 */
194
                value = new Integer(LittleEndian.getInt(src, o1));
194
                value = Integer.valueOf(LittleEndian.getInt(src, o1));
195
                break;
195
                break;
196
            }
196
            }
197
            case Variant.VT_I8:
197
            case Variant.VT_I8:
Lines 200-206 Link Here
200
                 * Read a double word. In Java it is represented as a
200
                 * Read a double word. In Java it is represented as a
201
                 * Long object.
201
                 * Long object.
202
                 */
202
                 */
203
                value = new Long(LittleEndian.getLong(src, o1));
203
                value = Long.valueOf(LittleEndian.getLong(src, o1));
204
                break;
204
                break;
205
            }
205
            }
206
            case Variant.VT_R8:
206
            case Variant.VT_R8:
Lines 209-215 Link Here
209
                 * Read an eight-byte double value. In Java it is represented as
209
                 * Read an eight-byte double value. In Java it is represented as
210
                 * a Double object.
210
                 * a Double object.
211
                 */
211
                 */
212
                value = new Double(LittleEndian.getDouble(src, o1));
212
                value = Double.valueOf(LittleEndian.getDouble(src, o1));
213
                break;
213
                break;
214
            }
214
            }
215
            case Variant.VT_FILETIME:
215
            case Variant.VT_FILETIME:
(-)src/java/org/apache/poi/hpsf/CustomProperties.java (-2 / +2 lines)
Lines 96-102 Link Here
96
                    ") do not match.");
96
                    ") do not match.");
97
97
98
        /* Register name and ID in the dictionary. Mapping in both directions is possible. If there is already a  */
98
        /* Register name and ID in the dictionary. Mapping in both directions is possible. If there is already a  */
99
        final Long idKey = new Long(cp.getID());
99
        final Long idKey = Long.valueOf(cp.getID());
100
        final Object oldID = dictionaryNameToID.get(name);
100
        final Object oldID = dictionaryNameToID.get(name);
101
        dictionaryIDToName.remove(oldID);
101
        dictionaryIDToName.remove(oldID);
102
        dictionaryNameToID.put(name, idKey);
102
        dictionaryNameToID.put(name, idKey);
Lines 313-319 Link Here
313
        final MutableProperty p = new MutableProperty();
313
        final MutableProperty p = new MutableProperty();
314
        p.setID(PropertyIDMap.PID_CODEPAGE);
314
        p.setID(PropertyIDMap.PID_CODEPAGE);
315
        p.setType(Variant.VT_I2);
315
        p.setType(Variant.VT_I2);
316
        p.setValue(new Integer(codepage));
316
        p.setValue(Integer.valueOf(codepage));
317
        put(new CustomProperty(p));
317
        put(new CustomProperty(p));
318
    }
318
    }
319
319
(-)src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java (-6 / +6 lines)
Lines 149-155 Link Here
149
149
150
        if (log.check( POILogger.DEBUG ))
150
        if (log.check( POILogger.DEBUG ))
151
            log.log(DEBUG, "Time at start of cell creating in HSSF sheet = ",
151
            log.log(DEBUG, "Time at start of cell creating in HSSF sheet = ",
152
                new Long(timestart));
152
                Long.valueOf(timestart));
153
        HSSFRow lastrow = null;
153
        HSSFRow lastrow = null;
154
154
155
        // Add every cell to its row
155
        // Add every cell to its row
Lines 180-191 Link Here
180
            hrow.createCellFromRecord( cval );
180
            hrow.createCellFromRecord( cval );
181
            if (log.check( POILogger.DEBUG ))
181
            if (log.check( POILogger.DEBUG ))
182
                log.log( DEBUG, "record took ",
182
                log.log( DEBUG, "record took ",
183
                    new Long( System.currentTimeMillis() - cellstart ) );
183
                    Long.valueOf( System.currentTimeMillis() - cellstart ) );
184
184
185
        }
185
        }
186
        if (log.check( POILogger.DEBUG ))
186
        if (log.check( POILogger.DEBUG ))
187
            log.log(DEBUG, "total sheet cell creation took ",
187
            log.log(DEBUG, "total sheet cell creation took ",
188
                new Long(System.currentTimeMillis() - timestart));
188
                Long.valueOf(System.currentTimeMillis() - timestart));
189
    }
189
    }
190
190
191
    /**
191
    /**
Lines 231-237 Link Here
231
        }
231
        }
232
232
233
        if (_rows.size() > 0) {
233
        if (_rows.size() > 0) {
234
            Integer key = new Integer(row.getRowNum());
234
            Integer key = Integer.valueOf(row.getRowNum());
235
            HSSFRow removedRow = _rows.remove(key);
235
            HSSFRow removedRow = _rows.remove(key);
236
            if (removedRow != row) {
236
            if (removedRow != row) {
237
                //should not happen if the input argument is valid
237
                //should not happen if the input argument is valid
Lines 296-302 Link Here
296
296
297
    private void addRow(HSSFRow row, boolean addLow)
297
    private void addRow(HSSFRow row, boolean addLow)
298
    {
298
    {
299
        _rows.put(new Integer(row.getRowNum()), row);
299
        _rows.put(Integer.valueOf(row.getRowNum()), row);
300
        if (addLow)
300
        if (addLow)
301
        {
301
        {
302
            _sheet.addRow(row.getRowRecord());
302
            _sheet.addRow(row.getRowRecord());
Lines 319-325 Link Here
319
     * @return HSSFRow representing the row number or null if its not defined on the sheet
319
     * @return HSSFRow representing the row number or null if its not defined on the sheet
320
     */
320
     */
321
    public HSSFRow getRow(int rowIndex) {
321
    public HSSFRow getRow(int rowIndex) {
322
        return _rows.get(new Integer(rowIndex));
322
        return _rows.get(Integer.valueOf(rowIndex));
323
    }
323
    }
324
324
325
    /**
325
    /**
(-)src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java (-1 / +1 lines)
Lines 211-217 Link Here
211
                EscherComplexProperty cp = (EscherComplexProperty)prop;
211
                EscherComplexProperty cp = (EscherComplexProperty)prop;
212
                String str = StringUtil.getFromUnicodeLE(cp.getComplexData());
212
                String str = StringUtil.getFromUnicodeLE(cp.getComplexData());
213
213
214
                if(str.equals("Chart 1\0")) {
214
                if("Chart 1\0".equals(str)) {
215
                    return true;
215
                    return true;
216
                }
216
                }
217
            }
217
            }
(-)src/java/org/apache/poi/hssf/usermodel/FontDetails.java (-2 / +2 lines)
Lines 57-63 Link Here
57
57
58
    public void addChar( char c, int width )
58
    public void addChar( char c, int width )
59
    {
59
    {
60
        charWidths.put(new Character(c), new Integer(width));
60
        charWidths.put(new Character(c), Integer.valueOf(width));
61
    }
61
    }
62
62
63
    /**
63
    /**
Lines 78-84 Link Here
78
    {
78
    {
79
        for ( int i = 0; i < characters.length; i++ )
79
        for ( int i = 0; i < characters.length; i++ )
80
        {
80
        {
81
            charWidths.put( new Character(characters[i]), new Integer(widths[i]));
81
            charWidths.put( new Character(characters[i]), Integer.valueOf(widths[i]));
82
        }
82
        }
83
    }
83
    }
84
84
(-)src/java/org/apache/poi/hssf/usermodel/DVConstraint.java (-5 / +5 lines)
Lines 276-282 Link Here
276
			return null;
276
			return null;
277
		}
277
		}
278
		try {
278
		try {
279
			return new Double(numberStr);
279
			return Double.valueOf(numberStr);
280
		} catch (NumberFormatException e) {
280
		} catch (NumberFormatException e) {
281
			throw new RuntimeException("The supplied text '" + numberStr 
281
			throw new RuntimeException("The supplied text '" + numberStr 
282
					+ "' could not be parsed as a number");
282
					+ "' could not be parsed as a number");
Lines 290-296 Link Here
290
		if (timeStr == null) {
290
		if (timeStr == null) {
291
			return null;
291
			return null;
292
		}
292
		}
293
		return new Double(HSSFDateUtil.convertTime(timeStr));
293
		return Double.valueOf(HSSFDateUtil.convertTime(timeStr));
294
	}
294
	}
295
	/**
295
	/**
296
	 * @param dateFormat pass <code>null</code> for default YYYYMMDD
296
	 * @param dateFormat pass <code>null</code> for default YYYYMMDD
Lines 311-317 Link Here
311
						+ "' using specified format '" + dateFormat + "'", e);
311
						+ "' using specified format '" + dateFormat + "'", e);
312
			}
312
			}
313
		}
313
		}
314
		return new Double(HSSFDateUtil.getExcelDate(dateVal));
314
		return Double.valueOf(HSSFDateUtil.getExcelDate(dateVal));
315
	}
315
	}
316
316
317
	public static DVConstraint createCustomFormulaConstraint(String formula) {
317
	public static DVConstraint createCustomFormulaConstraint(String formula) {
Lines 464-470 Link Here
464
	 */
464
	 */
465
	public void setValue1(double value1) {
465
	public void setValue1(double value1) {
466
		_formula1 = null;
466
		_formula1 = null;
467
		_value1 = new Double(value1);
467
		_value1 = Double.valueOf(value1);
468
	}
468
	}
469
469
470
	/**
470
	/**
Lines 478-483 Link Here
478
	 */
478
	 */
479
	public void setValue2(double value2) {
479
	public void setValue2(double value2) {
480
		_formula2 = null;
480
		_formula2 = null;
481
		_value2 = new Double(value2);
481
		_value2 = Double.valueOf(value2);
482
	}
482
	}
483
}
483
}
(-)src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java (-1 / +1 lines)
Lines 1081-1087 Link Here
1081
        // So we don't confuse users, give them back
1081
        // So we don't confuse users, give them back
1082
        //  the same object every time, but create
1082
        //  the same object every time, but create
1083
        //  them lazily
1083
        //  them lazily
1084
        Short sIdx = new Short(idx);
1084
        Short sIdx = Short.valueOf(idx);
1085
        if(fonts.containsKey(sIdx)) {
1085
        if(fonts.containsKey(sIdx)) {
1086
            return (HSSFFont)fonts.get(sIdx);
1086
            return (HSSFFont)fonts.get(sIdx);
1087
        }
1087
        }
(-)src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java (-1 / +1 lines)
Lines 270-276 Link Here
270
270
271
    public void drawString(String str, int x, int y)
271
    public void drawString(String str, int x, int y)
272
    {
272
    {
273
        if (str == null || str.equals(""))
273
        if (str == null || "".equals(str))
274
            return;
274
            return;
275
275
276
        Font excelFont = font;
276
        Font excelFont = font;
(-)src/java/org/apache/poi/hssf/model/Sheet.java (-2 / +2 lines)
Lines 1031-1037 Link Here
1031
    public void setColumnWidth(int column, int width) {
1031
    public void setColumnWidth(int column, int width) {
1032
        if(width > 255*256) throw new IllegalArgumentException("The maximum column width for an individual cell is 255 characters.");
1032
        if(width > 255*256) throw new IllegalArgumentException("The maximum column width for an individual cell is 255 characters.");
1033
1033
1034
        setColumn(column, null, new Integer(width), null, null, null);
1034
        setColumn(column, null, Integer.valueOf(width), null, null, null);
1035
    }
1035
    }
1036
1036
1037
    /**
1037
    /**
Lines 1059-1065 Link Here
1059
        setColumn( column, null, null, null, Boolean.valueOf(hidden), null);
1059
        setColumn( column, null, null, null, Boolean.valueOf(hidden), null);
1060
    }
1060
    }
1061
    public void setDefaultColumnStyle(int column, int styleIndex) {
1061
    public void setDefaultColumnStyle(int column, int styleIndex) {
1062
        setColumn(column, new Short((short)styleIndex), null, null, null, null);
1062
        setColumn(column, Short.valueOf((short)styleIndex), null, null, null, null);
1063
    }
1063
    }
1064
1064
1065
    private void setColumn(int column, Short xfStyle, Integer width, Integer level, Boolean hidden, Boolean collapsed) {
1065
    private void setColumn(int column, Short xfStyle, Integer width, Integer level, Boolean hidden, Boolean collapsed) {
(-)src/java/org/apache/poi/hssf/model/DrawingManager.java (-2 / +2 lines)
Lines 48-54 Link Here
48
        dg.setLastMSOSPID( -1 );
48
        dg.setLastMSOSPID( -1 );
49
        dgg.addCluster( dgId, 0 );
49
        dgg.addCluster( dgId, 0 );
50
        dgg.setDrawingsSaved( dgg.getDrawingsSaved() + 1 );
50
        dgg.setDrawingsSaved( dgg.getDrawingsSaved() + 1 );
51
        dgMap.put( new Short( dgId ), dg );
51
        dgMap.put( Short.valueOf( dgId ), dg );
52
        return dg;
52
        return dg;
53
    }
53
    }
54
54
Lines 60-66 Link Here
60
    public int allocateShapeId(short drawingGroupId)
60
    public int allocateShapeId(short drawingGroupId)
61
    {
61
    {
62
        // Get the last shape id for this drawing group.
62
        // Get the last shape id for this drawing group.
63
        EscherDgRecord dg = (EscherDgRecord) dgMap.get(new Short(drawingGroupId));
63
        EscherDgRecord dg = (EscherDgRecord) dgMap.get(Short.valueOf(drawingGroupId));
64
        int lastShapeId = dg.getLastMSOSPID();
64
        int lastShapeId = dg.getLastMSOSPID();
65
65
66
66
(-)src/java/org/apache/poi/hssf/model/Workbook.java (-6 / +6 lines)
Lines 180-186 Link Here
180
    public static Workbook createWorkbook(List<Record> recs) {
180
    public static Workbook createWorkbook(List<Record> recs) {
181
        if (log.check( POILogger.DEBUG ))
181
        if (log.check( POILogger.DEBUG ))
182
            log.log(DEBUG, "Workbook (readfile) created with reclen=",
182
            log.log(DEBUG, "Workbook (readfile) created with reclen=",
183
                    new Integer(recs.size()));
183
                    Integer.valueOf(recs.size()));
184
        Workbook retval = new Workbook();
184
        Workbook retval = new Workbook();
185
        List<Record> records = new ArrayList<Record>(recs.size() / 3);
185
        List<Record> records = new ArrayList<Record>(recs.size() / 3);
186
        retval.records.setRecords(records);
186
        retval.records.setRecords(records);
Lines 517-524 Link Here
517
517
518
    public void setSheetBof(int sheetIndex, int pos) {
518
    public void setSheetBof(int sheetIndex, int pos) {
519
        if (log.check( POILogger.DEBUG ))
519
        if (log.check( POILogger.DEBUG ))
520
            log.log(DEBUG, "setting bof for sheetnum =", new Integer(sheetIndex),
520
            log.log(DEBUG, "setting bof for sheetnum =", Integer.valueOf(sheetIndex),
521
                " at pos=", new Integer(pos));
521
                " at pos=", Integer.valueOf(pos));
522
        checkSheets(sheetIndex);
522
        checkSheets(sheetIndex);
523
        getBoundSheetRec(sheetIndex)
523
        getBoundSheetRec(sheetIndex)
524
        .setPositionOfBof(pos);
524
        .setPositionOfBof(pos);
Lines 757-763 Link Here
757
757
758
    public int getNumSheets() {
758
    public int getNumSheets() {
759
        if (log.check( POILogger.DEBUG ))
759
        if (log.check( POILogger.DEBUG ))
760
            log.log(DEBUG, "getNumSheets=", new Integer(boundsheets.size()));
760
            log.log(DEBUG, "getNumSheets=", Integer.valueOf(boundsheets.size()));
761
        return boundsheets.size();
761
        return boundsheets.size();
762
    }
762
    }
763
763
Lines 769-775 Link Here
769
769
770
    public int getNumExFormats() {
770
    public int getNumExFormats() {
771
        if (log.check( POILogger.DEBUG ))
771
        if (log.check( POILogger.DEBUG ))
772
            log.log(DEBUG, "getXF=", new Integer(numxfs));
772
            log.log(DEBUG, "getXF=", Integer.valueOf(numxfs));
773
        return numxfs;
773
        return numxfs;
774
    }
774
    }
775
775
Lines 903-909 Link Here
903
        UnicodeString retval = sst.getString(str);
903
        UnicodeString retval = sst.getString(str);
904
904
905
        if (log.check( POILogger.DEBUG ))
905
        if (log.check( POILogger.DEBUG ))
906
            log.log(DEBUG, "Returning SST for index=", new Integer(str),
906
            log.log(DEBUG, "Returning SST for index=", Integer.valueOf(str),
907
                " String= ", retval);
907
                " String= ", retval);
908
        return retval;
908
        return retval;
909
    }
909
    }
(-)src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java (-2 / +2 lines)
Lines 73-79 Link Here
73
	public void processRecordInternally(Record record) {
73
	public void processRecordInternally(Record record) {
74
		if (record instanceof FormatRecord) {
74
		if (record instanceof FormatRecord) {
75
			FormatRecord fr = (FormatRecord) record;
75
			FormatRecord fr = (FormatRecord) record;
76
			_customFormatRecords.put(new Integer(fr.getIndexCode()), fr);
76
			_customFormatRecords.put(Integer.valueOf(fr.getIndexCode()), fr);
77
		}
77
		}
78
		if (record instanceof ExtendedFormatRecord) {
78
		if (record instanceof ExtendedFormatRecord) {
79
			ExtendedFormatRecord xr = (ExtendedFormatRecord) record;
79
			ExtendedFormatRecord xr = (ExtendedFormatRecord) record;
Lines 117-123 Link Here
117
	public String getFormatString(int formatIndex) {
117
	public String getFormatString(int formatIndex) {
118
		String format = null;
118
		String format = null;
119
		if (formatIndex >= HSSFDataFormat.getNumberOfBuiltinBuiltinFormats()) {
119
		if (formatIndex >= HSSFDataFormat.getNumberOfBuiltinBuiltinFormats()) {
120
			FormatRecord tfr = _customFormatRecords.get(new Integer(formatIndex));
120
			FormatRecord tfr = _customFormatRecords.get(Integer.valueOf(formatIndex));
121
			if (tfr == null) {
121
			if (tfr == null) {
122
				System.err.println("Requested format at index " + formatIndex
122
				System.err.println("Requested format at index " + formatIndex
123
						+ ", but it wasn't found");
123
						+ ", but it wasn't found");
(-)src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java (-3 / +3 lines)
Lines 67-73 Link Here
67
    public void addListener(HSSFListener lsnr, short sid)
67
    public void addListener(HSSFListener lsnr, short sid)
68
    {
68
    {
69
        List   list = null;
69
        List   list = null;
70
        Object obj  = records.get(new Short(sid));
70
        Object obj  = records.get(Short.valueOf(sid));
71
71
72
        if (obj != null)
72
        if (obj != null)
73
        {
73
        {
Lines 78-84 Link Here
78
            list = new ArrayList(
78
            list = new ArrayList(
79
                1);   // probably most people will use one listener
79
                1);   // probably most people will use one listener
80
            list.add(lsnr);
80
            list.add(lsnr);
81
            records.put(new Short(sid), list);
81
            records.put(Short.valueOf(sid), list);
82
        }
82
        }
83
    }
83
    }
84
84
Lines 115-121 Link Here
115
115
116
    protected short processRecord(Record rec) throws HSSFUserException
116
    protected short processRecord(Record rec) throws HSSFUserException
117
    {
117
    {
118
        Object obj = records.get(new Short(rec.getSid()));
118
        Object obj = records.get(Short.valueOf(rec.getSid()));
119
        short userCode = 0;
119
        short userCode = 0;
120
120
121
        if (obj != null)
121
        if (obj != null)
(-)src/java/org/apache/poi/hssf/util/HSSFColor.java (-2 / +2 lines)
Lines 63-69 Link Here
63
        for (int i = 0; i < colors.length; i++) {
63
        for (int i = 0; i < colors.length; i++) {
64
            HSSFColor color = colors[i];
64
            HSSFColor color = colors[i];
65
65
66
            Integer index1 = new Integer(color.getIndex());
66
            Integer index1 = Integer.valueOf(color.getIndex());
67
            if (result.containsKey(index1)) {
67
            if (result.containsKey(index1)) {
68
                HSSFColor prevColor = (HSSFColor)result.get(index1);
68
                HSSFColor prevColor = (HSSFColor)result.get(index1);
69
                throw new RuntimeException("Dup color index (" + index1
69
                throw new RuntimeException("Dup color index (" + index1
Lines 111-117 Link Here
111
        } catch (IllegalAccessException e) {
111
        } catch (IllegalAccessException e) {
112
            throw new RuntimeException(e);
112
            throw new RuntimeException(e);
113
        }
113
        }
114
        return new Integer(s.intValue());
114
        return Integer.valueOf(s.intValue());
115
    }
115
    }
116
116
117
    private static HSSFColor[] getAllColors() {
117
    private static HSSFColor[] getAllColors() {
(-)src/java/org/apache/poi/hssf/record/constant/ConstantValueParser.java (-1 / +1 lines)
Lines 61-67 Link Here
61
				in.readLong(); // 8 byte 'not used' field
61
				in.readLong(); // 8 byte 'not used' field
62
				return EMPTY_REPRESENTATION; 
62
				return EMPTY_REPRESENTATION; 
63
			case TYPE_NUMBER:
63
			case TYPE_NUMBER:
64
				return new Double(in.readDouble());
64
				return Double.valueOf(in.readDouble());
65
			case TYPE_STRING:
65
			case TYPE_STRING:
66
				return StringUtil.readUnicodeString(in);
66
				return StringUtil.readUnicodeString(in);
67
			case TYPE_BOOLEAN:
67
			case TYPE_BOOLEAN:
(-)src/java/org/apache/poi/hssf/record/EscherAggregate.java (-1 / +1 lines)
Lines 434-440 Link Here
434
				{
434
				{
435
					if ( recordId == EscherClientDataRecord.RECORD_ID || recordId == EscherTextboxRecord.RECORD_ID )
435
					if ( recordId == EscherClientDataRecord.RECORD_ID || recordId == EscherTextboxRecord.RECORD_ID )
436
					{
436
					{
437
						spEndingOffsets.add( new Integer( offset ) );
437
						spEndingOffsets.add( Integer.valueOf( offset ) );
438
						shapes.add( record );
438
						shapes.add( record );
439
					}
439
					}
440
				}
440
				}
(-)src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java (-2 / +2 lines)
Lines 131-137 Link Here
131
			int b = in.readByte();
131
			int b = in.readByte();
132
			remaining -= LittleEndian.BYTE_SIZE;
132
			remaining -= LittleEndian.BYTE_SIZE;
133
			if (field_2_refPtg != null && field_4_ole_classname == null) {
133
			if (field_2_refPtg != null && field_4_ole_classname == null) {
134
				field_4_unknownByte = new Byte((byte)b);
134
				field_4_unknownByte = Byte.valueOf((byte)b);
135
			}
135
			}
136
		}
136
		}
137
		int nUnexpectedPadding = remaining - dataLenAfterFormula;
137
		int nUnexpectedPadding = remaining - dataLenAfterFormula;
Lines 144-150 Link Here
144
144
145
		// Fetch the stream ID
145
		// Fetch the stream ID
146
		if (dataLenAfterFormula >= 4) {
146
		if (dataLenAfterFormula >= 4) {
147
			field_5_stream_id = new Integer(in.readInt());
147
			field_5_stream_id = Integer.valueOf(in.readInt());
148
			remaining -= LittleEndian.INT_SIZE;
148
			remaining -= LittleEndian.INT_SIZE;
149
		} else {
149
		} else {
150
			field_5_stream_id = null;
150
			field_5_stream_id = null;
(-)src/java/org/apache/poi/hssf/record/RecordFactory.java (-4 / +4 lines)
Lines 227-233 Link Here
227
	 * <code>null</code> if the specified record is not interpreted by POI.
227
	 * <code>null</code> if the specified record is not interpreted by POI.
228
	 */
228
	 */
229
	public static Class<? extends Record> getRecordClass(int sid) {
229
	public static Class<? extends Record> getRecordClass(int sid) {
230
		I_RecordCreator rc = _recordCreatorsById.get(new Integer(sid));
230
		I_RecordCreator rc = _recordCreatorsById.get(Integer.valueOf(sid));
231
		if (rc == null) {
231
		if (rc == null) {
232
			return null;
232
			return null;
233
		}
233
		}
Lines 254-260 Link Here
254
	}
254
	}
255
255
256
	public static Record createSingleRecord(RecordInputStream in) {
256
	public static Record createSingleRecord(RecordInputStream in) {
257
		I_RecordCreator constructor = _recordCreatorsById.get(new Integer(in.getSid()));
257
		I_RecordCreator constructor = _recordCreatorsById.get(Integer.valueOf(in.getSid()));
258
258
259
		if (constructor == null) {
259
		if (constructor == null) {
260
			return new UnknownRecord(in);
260
			return new UnknownRecord(in);
Lines 346-352 Link Here
346
				throw new RecordFormatException(
346
				throw new RecordFormatException(
347
					"Unable to determine record types");
347
					"Unable to determine record types");
348
			}
348
			}
349
			Integer key = new Integer(sid);
349
			Integer key = Integer.valueOf(sid);
350
			if (result.containsKey(key)) {
350
			if (result.containsKey(key)) {
351
				Class<?> prevClass = result.get(key).getRecordClass();
351
				Class<?> prevClass = result.get(key).getRecordClass();
352
				throw new RuntimeException("duplicate record sid 0x" + Integer.toHexString(sid).toUpperCase()
352
				throw new RuntimeException("duplicate record sid 0x" + Integer.toHexString(sid).toUpperCase()
Lines 354-360 Link Here
354
			}
354
			}
355
			result.put(key, new ReflectionRecordCreator(constructor));
355
			result.put(key, new ReflectionRecordCreator(constructor));
356
		}
356
		}
357
//		result.put(new Integer(0x0406), result.get(new Integer(0x06)));
357
//		result.put(Integer.valueOf(0x0406), result.get(Integer.valueOf(0x06)));
358
		return result;
358
		return result;
359
	}
359
	}
360
360
(-)src/java/org/apache/poi/hssf/record/formula/eval/OperandResolver.java (-1 / +1 lines)
Lines 256-262 Link Here
256
		} catch (NumberFormatException e) {
256
		} catch (NumberFormatException e) {
257
			return null;
257
			return null;
258
		}
258
		}
259
		return new Double(isPositive ? +val : -val);
259
		return Double.valueOf(isPositive ? +val : -val);
260
	}
260
	}
261
261
262
	/**
262
	/**
(-)src/java/org/apache/poi/hssf/record/formula/function/FunctionDataBuilder.java (-2 / +2 lines)
Lines 47-53 Link Here
47
		FunctionMetadata fm = new FunctionMetadata(functionIndex, functionName, minParams, maxParams,
47
		FunctionMetadata fm = new FunctionMetadata(functionIndex, functionName, minParams, maxParams,
48
				returnClassCode, parameterClassCodes);
48
				returnClassCode, parameterClassCodes);
49
		
49
		
50
		Integer indexKey = new Integer(functionIndex);
50
		Integer indexKey = Integer.valueOf(functionIndex);
51
		
51
		
52
		
52
		
53
		if(functionIndex > _maxFunctionIndex) {
53
		if(functionIndex > _maxFunctionIndex) {
Lines 60-66 Link Here
60
			if(!hasFootnote || !_mutatingFunctionIndexes.contains(indexKey)) {
60
			if(!hasFootnote || !_mutatingFunctionIndexes.contains(indexKey)) {
61
				throw new RuntimeException("Multiple entries for function name '" + functionName + "'");
61
				throw new RuntimeException("Multiple entries for function name '" + functionName + "'");
62
			}
62
			}
63
			_functionDataByIndex.remove(new Integer(prevFM.getIndex()));
63
			_functionDataByIndex.remove(Integer.valueOf(prevFM.getIndex()));
64
		}
64
		}
65
		prevFM = (FunctionMetadata) _functionDataByIndex.get(indexKey);
65
		prevFM = (FunctionMetadata) _functionDataByIndex.get(indexKey);
66
		if(prevFM != null) {
66
		if(prevFM != null) {
(-)src/java/org/apache/poi/hssf/record/formula/functions/Value.java (-2 / +2 lines)
Lines 39-45 Link Here
39
39
40
	/** "1,0000" is valid, "1,00" is not */
40
	/** "1,0000" is valid, "1,00" is not */
41
	private static final int MIN_DISTANCE_BETWEEN_THOUSANDS_SEPARATOR = 4;
41
	private static final int MIN_DISTANCE_BETWEEN_THOUSANDS_SEPARATOR = 4;
42
	private static final Double ZERO = new Double(0.0);
42
	private static final Double ZERO = Double.valueOf(0.0);
43
43
44
	public ValueEval evaluate(ValueEval[] args, int srcCellRow, short srcCellCol) {
44
	public ValueEval evaluate(ValueEval[] args, int srcCellRow, short srcCellCol) {
45
		if (args.length != 1) {
45
		if (args.length != 1) {
Lines 182-187 Link Here
182
			// still a problem parsing the number - probably out of range
182
			// still a problem parsing the number - probably out of range
183
			return null;
183
			return null;
184
		}
184
		}
185
		return new Double(foundUnaryMinus ? -d : d);
185
		return Double.valueOf(foundUnaryMinus ? -d : d);
186
	}
186
	}
187
}
187
}
(-)src/java/org/apache/poi/hssf/record/formula/functions/Mode.java (-1 / +1 lines)
Lines 125-131 Link Here
125
			return;
125
			return;
126
		}
126
		}
127
		if (arg instanceof NumberEval) {
127
		if (arg instanceof NumberEval) {
128
			temp.add(new Double(((NumberEval) arg).getNumberValue()));
128
			temp.add(Double.valueOf(((NumberEval) arg).getNumberValue()));
129
			return;
129
			return;
130
		}
130
		}
131
		throw new RuntimeException("Unexpected value type (" + arg.getClass().getName() + ")");
131
		throw new RuntimeException("Unexpected value type (" + arg.getClass().getName() + ")");
(-)src/java/org/apache/poi/hssf/record/formula/functions/Countif.java (-7 / +7 lines)
Lines 501-513 Link Here
501
		if (value.length() < 4 || value.charAt(0) != '#') {
501
		if (value.length() < 4 || value.charAt(0) != '#') {
502
			return null;
502
			return null;
503
		}
503
		}
504
		if (value.equals("#NULL!"))  return ErrorEval.NULL_INTERSECTION;
504
		if ("#NULL!".equals(value))  return ErrorEval.NULL_INTERSECTION;
505
		if (value.equals("#DIV/0!")) return ErrorEval.DIV_ZERO;
505
		if ("#DIV/0!".equals(value)) return ErrorEval.DIV_ZERO;
506
		if (value.equals("#VALUE!")) return ErrorEval.VALUE_INVALID;
506
		if ("#VALUE!".equals(value)) return ErrorEval.VALUE_INVALID;
507
		if (value.equals("#REF!"))   return ErrorEval.REF_INVALID;
507
		if ("#REF!".equals(value))   return ErrorEval.REF_INVALID;
508
		if (value.equals("#NAME?"))  return ErrorEval.NAME_INVALID;
508
		if ("#NAME?".equals(value))  return ErrorEval.NAME_INVALID;
509
		if (value.equals("#NUM!"))   return ErrorEval.NUM_ERROR;
509
		if ("#NUM!".equals(value))   return ErrorEval.NUM_ERROR;
510
		if (value.equals("#N/A"))    return ErrorEval.NA;
510
		if ("#N/A".equals(value))    return ErrorEval.NA;
511
511
512
		return null;
512
		return null;
513
	}
513
	}
(-)src/java/org/apache/poi/hssf/record/SubRecord.java (-1 / +1 lines)
Lines 143-149 Link Here
143
				_linkPtg = readRefPtg(buf);
143
				_linkPtg = readRefPtg(buf);
144
				switch (linkSize - formulaSize - 6) {
144
				switch (linkSize - formulaSize - 6) {
145
					case 1:
145
					case 1:
146
						_unknownByte6 = new Byte(in.readByte());
146
						_unknownByte6 = Byte.valueOf(in.readByte());
147
						break;
147
						break;
148
					case 0:
148
					case 0:
149
						_unknownByte6 = null;
149
						_unknownByte6 = null;
(-)src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java (-4 / +4 lines)
Lines 114-121 Link Here
114
		_unknownRecords.add(rec);
114
		_unknownRecords.add(rec);
115
	}
115
	}
116
	public void insertRow(RowRecord row) {
116
	public void insertRow(RowRecord row) {
117
		// Integer integer = new Integer(row.getRowNumber());
117
		// Integer integer = Integer.valueOf(row.getRowNumber());
118
		_rowRecords.put(new Integer(row.getRowNumber()), row);
118
		_rowRecords.put(Integer.valueOf(row.getRowNumber()), row);
119
		if ((row.getRowNumber() < _firstrow) || (_firstrow == -1)) {
119
		if ((row.getRowNumber() < _firstrow) || (_firstrow == -1)) {
120
			_firstrow = row.getRowNumber();
120
			_firstrow = row.getRowNumber();
121
		}
121
		}
Lines 127-133 Link Here
127
	public void removeRow(RowRecord row) {
127
	public void removeRow(RowRecord row) {
128
		int rowIndex = row.getRowNumber();
128
		int rowIndex = row.getRowNumber();
129
		_valuesAgg.removeAllCellsValuesForRow(rowIndex);
129
		_valuesAgg.removeAllCellsValuesForRow(rowIndex);
130
		Integer key = new Integer(rowIndex);
130
		Integer key = Integer.valueOf(rowIndex);
131
		RowRecord rr = _rowRecords.remove(key);
131
		RowRecord rr = _rowRecords.remove(key);
132
		if (rr == null) {
132
		if (rr == null) {
133
			throw new RuntimeException("Invalid row index (" + key.intValue() + ")");
133
			throw new RuntimeException("Invalid row index (" + key.intValue() + ")");
Lines 143-149 Link Here
143
        if (rowIndex < 0 || rowIndex > maxrow) {
143
        if (rowIndex < 0 || rowIndex > maxrow) {
144
			throw new IllegalArgumentException("The row number must be between 0 and " + maxrow);
144
			throw new IllegalArgumentException("The row number must be between 0 and " + maxrow);
145
		}
145
		}
146
		return _rowRecords.get(new Integer(rowIndex));
146
		return _rowRecords.get(Integer.valueOf(rowIndex));
147
	}
147
	}
148
148
149
	public int getPhysicalNumberOfRows()
149
	public int getPhysicalNumberOfRows()
(-)src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java (-1 / +1 lines)
Lines 493-499 Link Here
493
				level = Math.min(7, level);
493
				level = Math.min(7, level);
494
				colInfoSearchStartIdx = Math.max(0, colInfoIdx - 1); // -1 just in case this column is collapsed later.
494
				colInfoSearchStartIdx = Math.max(0, colInfoIdx - 1); // -1 just in case this column is collapsed later.
495
			}
495
			}
496
			setColumn(i, null, null, new Integer(level), null, null);
496
			setColumn(i, null, null, Integer.valueOf(level), null, null);
497
		}
497
		}
498
	}
498
	}
499
	/**
499
	/**
(-)src/java/org/apache/poi/hssf/record/NoteRecord.java (-2 / +2 lines)
Lines 40-46 Link Here
40
	 */
40
	 */
41
	public final static short NOTE_VISIBLE = 0x2;
41
	public final static short NOTE_VISIBLE = 0x2;
42
42
43
	private static final Byte DEFAULT_PADDING = new Byte((byte)0);
43
	private static final Byte DEFAULT_PADDING = Byte.valueOf((byte)0);
44
44
45
	private int field_1_row;
45
	private int field_1_row;
46
	private int field_2_col;
46
	private int field_2_col;
Lines 89-95 Link Here
89
			field_6_author = StringUtil.readCompressedUnicode(in, length);
89
			field_6_author = StringUtil.readCompressedUnicode(in, length);
90
		}
90
		}
91
 		if (in.available() == 1) {
91
 		if (in.available() == 1) {
92
			field_7_padding = new Byte(in.readByte());
92
			field_7_padding = Byte.valueOf(in.readByte());
93
		}
93
		}
94
	}
94
	}
95
95
(-)src/java/org/apache/poi/hssf/record/PageBreakRecord.java (-4 / +4 lines)
Lines 90-96 Link Here
90
        for(int k = 0; k < nBreaks; k++) {
90
        for(int k = 0; k < nBreaks; k++) {
91
            Break br = new Break(in);
91
            Break br = new Break(in);
92
            _breaks.add(br);
92
            _breaks.add(br);
93
            _breakMap.put(new Integer(br.main), br);
93
            _breakMap.put(Integer.valueOf(br.main), br);
94
        }
94
        }
95
95
96
    }
96
    }
Lines 160-166 Link Here
160
    */
160
    */
161
    public void addBreak(int main, int subFrom, int subTo) {
161
    public void addBreak(int main, int subFrom, int subTo) {
162
162
163
        Integer key = new Integer(main);
163
        Integer key = Integer.valueOf(main);
164
        Break region = _breakMap.get(key);
164
        Break region = _breakMap.get(key);
165
        if(region == null) {
165
        if(region == null) {
166
            region = new Break(main, subFrom, subTo);
166
            region = new Break(main, subFrom, subTo);
Lines 178-184 Link Here
178
     * @param main (zero-based)
178
     * @param main (zero-based)
179
     */
179
     */
180
    public final void removeBreak(int main) {
180
    public final void removeBreak(int main) {
181
        Integer rowKey = new Integer(main);
181
        Integer rowKey = Integer.valueOf(main);
182
        Break region = _breakMap.get(rowKey);
182
        Break region = _breakMap.get(rowKey);
183
        _breaks.remove(region);
183
        _breaks.remove(region);
184
        _breakMap.remove(rowKey);
184
        _breakMap.remove(rowKey);
Lines 190-196 Link Here
190
     * @return The Break or null if no break exists at the row/col specified.
190
     * @return The Break or null if no break exists at the row/col specified.
191
     */
191
     */
192
    public final Break getBreak(int main) {
192
    public final Break getBreak(int main) {
193
        Integer rowKey = new Integer(main);
193
        Integer rowKey = Integer.valueOf(main);
194
        return _breakMap.get(rowKey);
194
        return _breakMap.get(rowKey);
195
    }
195
    }
196
196
(-)src/java/org/apache/poi/hssf/record/TextObjectRecord.java (-1 / +1 lines)
Lines 108-114 Link Here
108
			}
108
			}
109
			_linkRefPtg = ptgs[0];
109
			_linkRefPtg = ptgs[0];
110
			if (in.remaining() > 0) {
110
			if (in.remaining() > 0) {
111
				_unknownPostFormulaByte = new Byte(in.readByte());
111
				_unknownPostFormulaByte = Byte.valueOf(in.readByte());
112
			} else {
112
			} else {
113
				_unknownPostFormulaByte = null;
113
				_unknownPostFormulaByte = null;
114
			}
114
			}
(-)src/java/org/apache/poi/ss/usermodel/BuiltinFormats.java (-1 / +1 lines)
Lines 142-148 Link Here
142
	public static Map<Integer, String> getBuiltinFormats() {
142
	public static Map<Integer, String> getBuiltinFormats() {
143
		Map<Integer, String> result = new LinkedHashMap<Integer, String>();
143
		Map<Integer, String> result = new LinkedHashMap<Integer, String>();
144
		for (int i=0; i<_formats.length; i++) {
144
		for (int i=0; i<_formats.length; i++) {
145
			result.put(new Integer(i), _formats[i]);
145
			result.put(Integer.valueOf(i), _formats[i]);
146
		}
146
		}
147
		return result;
147
		return result;
148
	}
148
	}
(-)src/java/org/apache/poi/ss/usermodel/DataFormatter.java (-4 / +4 lines)
Lines 147-153 Link Here
147
        if (format != null) {
147
        if (format != null) {
148
            return format;
148
            return format;
149
        }
149
        }
150
        if (formatStr.equals("General") || formatStr.equals("@")) {
150
        if ("General".equals(formatStr) || "@".equals(formatStr)) {
151
            if (DataFormatter.isWholeNumber(cellValue)) {
151
            if (DataFormatter.isWholeNumber(cellValue)) {
152
                return generalWholeNumFormat;
152
                return generalWholeNumFormat;
153
            }
153
            }
Lines 257-263 Link Here
257
                if(mIsMonth) {
257
                if(mIsMonth) {
258
                    sb.append('M');
258
                    sb.append('M');
259
                    ms.add(
259
                    ms.add(
260
                            new Integer(sb.length() -1)
260
                            Integer.valueOf(sb.length() -1)
261
                    );
261
                    );
262
                } else {
262
                } else {
263
                    sb.append('m');
263
                    sb.append('m');
Lines 407-413 Link Here
407
        if (numberFormat == null) {
407
        if (numberFormat == null) {
408
            return String.valueOf(d);
408
            return String.valueOf(d);
409
        }
409
        }
410
        return numberFormat.format(new Double(d));
410
        return numberFormat.format(Double.valueOf(d));
411
    }
411
    }
412
412
413
    /**
413
    /**
Lines 432-438 Link Here
432
        if (numberFormat == null) {
432
        if (numberFormat == null) {
433
            return String.valueOf(value);
433
            return String.valueOf(value);
434
        }
434
        }
435
        return numberFormat.format(new Double(value));
435
        return numberFormat.format(Double.valueOf(value));
436
    }
436
    }
437
437
438
    /**
438
    /**
(-)src/java/org/apache/poi/ss/formula/FormulaParser.java (-9 / +9 lines)
Lines 1218-1227 Link Here
1218
1218
1219
	private static Double convertArrayNumber(Ptg ptg) {
1219
	private static Double convertArrayNumber(Ptg ptg) {
1220
		if (ptg instanceof IntPtg) {
1220
		if (ptg instanceof IntPtg) {
1221
			return new Double(((IntPtg)ptg).getValue());
1221
			return Double.valueOf(((IntPtg)ptg).getValue());
1222
		}
1222
		}
1223
		if (ptg instanceof NumberPtg) {
1223
		if (ptg instanceof NumberPtg) {
1224
			return new Double(((NumberPtg)ptg).getValue());
1224
			return Double.valueOf(((NumberPtg)ptg).getValue());
1225
		}
1225
		}
1226
		throw new RuntimeException("Unexpected ptg (" + ptg.getClass().getName() + ")");
1226
		throw new RuntimeException("Unexpected ptg (" + ptg.getClass().getName() + ")");
1227
	}
1227
	}
Lines 1271-1289 Link Here
1271
1271
1272
		switch(part1.charAt(0)) {
1272
		switch(part1.charAt(0)) {
1273
			case 'V':
1273
			case 'V':
1274
				if(part1.equals("VALUE")) {
1274
				if("VALUE".equals(part1)) {
1275
					Match('!');
1275
					Match('!');
1276
					return HSSFErrorConstants.ERROR_VALUE;
1276
					return HSSFErrorConstants.ERROR_VALUE;
1277
				}
1277
				}
1278
				throw expected("#VALUE!");
1278
				throw expected("#VALUE!");
1279
			case 'R':
1279
			case 'R':
1280
				if(part1.equals("REF")) {
1280
				if("REF".equals(part1)) {
1281
					Match('!');
1281
					Match('!');
1282
					return HSSFErrorConstants.ERROR_REF;
1282
					return HSSFErrorConstants.ERROR_REF;
1283
				}
1283
				}
1284
				throw expected("#REF!");
1284
				throw expected("#REF!");
1285
			case 'D':
1285
			case 'D':
1286
				if(part1.equals("DIV")) {
1286
				if("DIV".equals(part1)) {
1287
					Match('/');
1287
					Match('/');
1288
					Match('0');
1288
					Match('0');
1289
					Match('!');
1289
					Match('!');
Lines 1291-1309 Link Here
1291
				}
1291
				}
1292
				throw expected("#DIV/0!");
1292
				throw expected("#DIV/0!");
1293
			case 'N':
1293
			case 'N':
1294
				if(part1.equals("NAME")) {
1294
				if("NAME".equals(part1)) {
1295
					Match('?');  // only one that ends in '?'
1295
					Match('?');  // only one that ends in '?'
1296
					return HSSFErrorConstants.ERROR_NAME;
1296
					return HSSFErrorConstants.ERROR_NAME;
1297
				}
1297
				}
1298
				if(part1.equals("NUM")) {
1298
				if("NUM".equals(part1)) {
1299
					Match('!');
1299
					Match('!');
1300
					return HSSFErrorConstants.ERROR_NUM;
1300
					return HSSFErrorConstants.ERROR_NUM;
1301
				}
1301
				}
1302
				if(part1.equals("NULL")) {
1302
				if("NULL".equals(part1)) {
1303
					Match('!');
1303
					Match('!');
1304
					return HSSFErrorConstants.ERROR_NULL;
1304
					return HSSFErrorConstants.ERROR_NULL;
1305
				}
1305
				}
1306
				if(part1.equals("N")) {
1306
				if("N".equals(part1)) {
1307
					Match('/');
1307
					Match('/');
1308
					if(look != 'A' && look != 'a') {
1308
					if(look != 'A' && look != 'a') {
1309
						throw expected("#N/A");
1309
						throw expected("#N/A");
(-)src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java (-2 / +2 lines)
Lines 192-198 Link Here
192
			if (sheetIndex < 0) {
192
			if (sheetIndex < 0) {
193
				throw new RuntimeException("Specified sheet from a different book");
193
				throw new RuntimeException("Specified sheet from a different book");
194
			}
194
			}
195
			result = new Integer(sheetIndex);
195
			result = Integer.valueOf(sheetIndex);
196
			_sheetIndexesBySheet.put(sheet, result);
196
			_sheetIndexesBySheet.put(sheet, result);
197
		}
197
		}
198
		return result.intValue();
198
		return result.intValue();
Lines 214-220 Link Here
214
			if (sheetIndex < 0) {
214
			if (sheetIndex < 0) {
215
				return -1;
215
				return -1;
216
			}
216
			}
217
			result = new Integer(sheetIndex);
217
			result = Integer.valueOf(sheetIndex);
218
			_sheetIndexesByName.put(sheetName, result);
218
			_sheetIndexesByName.put(sheetName, result);
219
		}
219
		}
220
		return result.intValue();
220
		return result.intValue();
(-)src/java/org/apache/poi/ss/util/SheetReferences.java (-2 / +2 lines)
Lines 36-46 Link Here
36
    }
36
    }
37
 
37
 
38
    public void addSheetReference(String sheetName, int number) {
38
    public void addSheetReference(String sheetName, int number) {
39
       map.put(new Integer(number), sheetName);
39
       map.put(Integer.valueOf(number), sheetName);
40
    } 
40
    } 
41
41
42
    public String getSheetName(int number) {
42
    public String getSheetName(int number) {
43
       return (String)map.get(new Integer(number));
43
       return (String)map.get(Integer.valueOf(number));
44
    }
44
    }
45
45
46
}
46
}
(-)src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java (-2 / +2 lines)
Lines 89-95 Link Here
89
            return r;
89
            return r;
90
        }
90
        }
91
91
92
        Constructor<? extends EscherRecord> recordConstructor = recordsMap.get(new Short(header.getRecordId()));
92
        Constructor<? extends EscherRecord> recordConstructor = recordsMap.get(Short.valueOf(header.getRecordId()));
93
        EscherRecord escherRecord = null;
93
        EscherRecord escherRecord = null;
94
        if (recordConstructor == null) {
94
        if (recordConstructor == null) {
95
            return new UnknownEscherRecord();
95
            return new UnknownEscherRecord();
Lines 135-141 Link Here
135
            } catch (NoSuchMethodException e) {
135
            } catch (NoSuchMethodException e) {
136
                throw new RuntimeException(e);
136
                throw new RuntimeException(e);
137
            }
137
            }
138
            result.put(new Short(sid), constructor);
138
            result.put(Short.valueOf(sid), constructor);
139
        }
139
        }
140
        return result;
140
        return result;
141
    }
141
    }
(-)src/java/org/apache/poi/ddf/EscherProperties.java (-4 / +4 lines)
Lines 586-605 Link Here
586
	}
586
	}
587
587
588
	private static void addProp(Map<Short, EscherPropertyMetaData> m, int s, String propName) {
588
	private static void addProp(Map<Short, EscherPropertyMetaData> m, int s, String propName) {
589
		m.put(new Short((short) s), new EscherPropertyMetaData(propName));
589
		m.put(Short.valueOf((short) s), new EscherPropertyMetaData(propName));
590
	}
590
	}
591
591
592
	private static void addProp(Map<Short, EscherPropertyMetaData> m, int s, String propName, byte type) {
592
	private static void addProp(Map<Short, EscherPropertyMetaData> m, int s, String propName, byte type) {
593
		m.put(new Short((short) s), new EscherPropertyMetaData(propName, type));
593
		m.put(Short.valueOf((short) s), new EscherPropertyMetaData(propName, type));
594
	}
594
	}
595
595
596
	public static String getPropertyName(short propertyId) {
596
	public static String getPropertyName(short propertyId) {
597
		EscherPropertyMetaData o = properties.get(new Short(propertyId));
597
		EscherPropertyMetaData o = properties.get(Short.valueOf(propertyId));
598
		return o == null ? "unknown" : o.getDescription();
598
		return o == null ? "unknown" : o.getDescription();
599
	}
599
	}
600
600
601
	public static byte getPropertyType(short propertyId) {
601
	public static byte getPropertyType(short propertyId) {
602
		EscherPropertyMetaData escherPropertyMetaData = properties.get(new Short(propertyId));
602
		EscherPropertyMetaData escherPropertyMetaData = properties.get(Short.valueOf(propertyId));
603
		return escherPropertyMetaData == null ? 0 : escherPropertyMetaData.getType();
603
		return escherPropertyMetaData == null ? 0 : escherPropertyMetaData.getType();
604
	}
604
	}
605
}
605
}
(-)src/java/org/apache/poi/ddf/EscherOptRecord.java (-1 / +1 lines)
Lines 158-164 Link Here
158
            {
158
            {
159
                EscherProperty p1 = (EscherProperty) o1;
159
                EscherProperty p1 = (EscherProperty) o1;
160
                EscherProperty p2 = (EscherProperty) o2;
160
                EscherProperty p2 = (EscherProperty) o2;
161
                return new Short( p1.getPropertyNumber() ).compareTo( new Short( p2.getPropertyNumber() ) );
161
                return Short.valueOf( p1.getPropertyNumber() ).compareTo( Short.valueOf( p2.getPropertyNumber() ) );
162
            }
162
            }
163
        } );
163
        } );
164
    }
164
    }
(-)src/java/org/apache/poi/util/HexRead.java (-2 / +2 lines)
Lines 128-134 Link Here
128
                    characterCount++;
128
                    characterCount++;
129
                    if ( characterCount == 2 )
129
                    if ( characterCount == 2 )
130
                    {
130
                    {
131
                        bytes.add( new Byte( b ) );
131
                        bytes.add( Byte.valueOf( b ) );
132
                        characterCount = 0;
132
                        characterCount = 0;
133
                        b = (byte) 0;
133
                        b = (byte) 0;
134
                    }
134
                    }
Lines 151-157 Link Here
151
                    characterCount++;
151
                    characterCount++;
152
                    if ( characterCount == 2 )
152
                    if ( characterCount == 2 )
153
                    {
153
                    {
154
                        bytes.add( new Byte( b ) );
154
                        bytes.add( Byte.valueOf( b ) );
155
                        characterCount = 0;
155
                        characterCount = 0;
156
                        b = (byte) 0;
156
                        b = (byte) 0;
157
                    }
157
                    }
(-)src/java/org/apache/poi/util/IntMapper.java (-1 / +1 lines)
Lines 69-75 Link Here
69
    {
69
    {
70
      int index = elements.size();
70
      int index = elements.size();
71
      elements.add(value);
71
      elements.add(value);
72
      valueKeyMap.put(value, new Integer(index));
72
      valueKeyMap.put(value, Integer.valueOf(index));
73
      return true;
73
      return true;
74
    }
74
    }
75
75
(-)src/java/org/apache/poi/util/BitFieldFactory.java (-2 / +2 lines)
Lines 32-41 Link Here
32
    private static Map instances = new HashMap();
32
    private static Map instances = new HashMap();
33
    
33
    
34
    public static BitField getInstance(final int mask) {
34
    public static BitField getInstance(final int mask) {
35
      BitField f = (BitField)instances.get(new Integer(mask));
35
      BitField f = (BitField)instances.get(Integer.valueOf(mask));
36
      if (f == null) {
36
      if (f == null) {
37
        f = new BitField(mask);
37
        f = new BitField(mask);
38
        instances.put(new Integer(mask), f);        
38
        instances.put(Integer.valueOf(mask), f);        
39
      }
39
      }
40
      return f;
40
      return f;
41
    }
41
    }
(-)src/java/org/apache/poi/util/POILogger.java (-5 / +5 lines)
Lines 601-607 Link Here
601
601
602
            for (int j = 0; j < array.length; j++)
602
            for (int j = 0; j < array.length; j++)
603
            {
603
            {
604
                results.add(new Byte(array[ j ]));
604
                results.add(Byte.valueOf(array[ j ]));
605
            }
605
            }
606
        }
606
        }
607
        if (object instanceof char [])
607
        if (object instanceof char [])
Lines 619-625 Link Here
619
619
620
            for (int j = 0; j < array.length; j++)
620
            for (int j = 0; j < array.length; j++)
621
            {
621
            {
622
                results.add(new Short(array[ j ]));
622
                results.add(Short.valueOf(array[ j ]));
623
            }
623
            }
624
        }
624
        }
625
        else if (object instanceof int [])
625
        else if (object instanceof int [])
Lines 628-634 Link Here
628
628
629
            for (int j = 0; j < array.length; j++)
629
            for (int j = 0; j < array.length; j++)
630
            {
630
            {
631
                results.add(new Integer(array[ j ]));
631
                results.add(Integer.valueOf(array[ j ]));
632
            }
632
            }
633
        }
633
        }
634
        else if (object instanceof long [])
634
        else if (object instanceof long [])
Lines 637-643 Link Here
637
637
638
            for (int j = 0; j < array.length; j++)
638
            for (int j = 0; j < array.length; j++)
639
            {
639
            {
640
                results.add(new Long(array[ j ]));
640
                results.add(Long.valueOf(array[ j ]));
641
            }
641
            }
642
        }
642
        }
643
        else if (object instanceof float [])
643
        else if (object instanceof float [])
Lines 655-661 Link Here
655
655
656
            for (int j = 0; j < array.length; j++)
656
            for (int j = 0; j < array.length; j++)
657
            {
657
            {
658
                results.add(new Double(array[ j ]));
658
                results.add(Double.valueOf(array[ j ]));
659
            }
659
            }
660
        }
660
        }
661
        else if (object instanceof Object [])
661
        else if (object instanceof Object [])
(-)src/scratchpad/src/org/apache/poi/hpbf/model/QuillContents.java (-3 / +3 lines)
Lines 41-47 Link Here
41
41
42
		// Check first 8 bytes
42
		// Check first 8 bytes
43
		String f8 = new String(data, 0, 8);
43
		String f8 = new String(data, 0, 8);
44
		if(! f8.equals("CHNKINK ")) {
44
		if(! "CHNKINK ".equals(f8)) {
45
			throw new IllegalArgumentException("Expecting 'CHNKINK ' but was '"+f8+"'");
45
			throw new IllegalArgumentException("Expecting 'CHNKINK ' but was '"+f8+"'");
46
		}
46
		}
47
		// Ignore the next 24, for now at least
47
		// Ignore the next 24, for now at least
Lines 64-72 Link Here
64
				System.arraycopy(data, from, bitData, 0, len);
64
				System.arraycopy(data, from, bitData, 0, len);
65
65
66
				// Create
66
				// Create
67
				if(bitType.equals("TEXT")) {
67
				if("TEXT".equals(bitType)) {
68
					bits[i] = new QCTextBit(thingType, bitType, bitData);
68
					bits[i] = new QCTextBit(thingType, bitType, bitData);
69
				} else if(bitType.equals("PLC ")) {
69
				} else if("PLC ".equals(bitType)) {
70
					bits[i] = QCPLCBit.createQCPLCBit(thingType, bitType, bitData);
70
					bits[i] = QCPLCBit.createQCPLCBit(thingType, bitType, bitData);
71
				} else {
71
				} else {
72
					bits[i] = new UnknownQCBit(thingType, bitType, bitData);
72
					bits[i] = new UnknownQCBit(thingType, bitType, bitData);
(-)src/scratchpad/src/org/apache/poi/hdf/model/HDFObjectFactory.java (-1 / +1 lines)
Lines 345-351 Link Here
345
345
346
                byte[] chpx = new byte[size];
346
                byte[] chpx = new byte[size];
347
                System.arraycopy(fkp, ++chpxOffset, chpx, 0, size);
347
                System.arraycopy(fkp, ++chpxOffset, chpx, 0, size);
348
                //_papTable.put(new Integer(fcStart), papx);
348
                //_papTable.put(Integer.valueOf(fcStart), papx);
349
                _characterRuns.add(new ChpxNode(fcStart, fcEnd, chpx));
349
                _characterRuns.add(new ChpxNode(fcStart, fcEnd, chpx));
350
            }
350
            }
351
351
(-)src/scratchpad/src/org/apache/poi/hdf/model/hdftypes/ListTables.java (-4 / +4 lines)
Lines 51-64 Link Here
51
        LFOLVL lfolvl = override._levels[x];
51
        LFOLVL lfolvl = override._levels[x];
52
        if(lfolvl._fFormatting)
52
        if(lfolvl._fFormatting)
53
        {
53
        {
54
          LST lst = (LST)_lists.get(new Integer(override._lsid));
54
          LST lst = (LST)_lists.get(Integer.valueOf(override._lsid));
55
          LVL lvl = lfolvl._override;
55
          LVL lvl = lfolvl._override;
56
          lvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2);
56
          lvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2);
57
          return lvl;
57
          return lvl;
58
        }
58
        }
59
        else if(lfolvl._fStartAt)
59
        else if(lfolvl._fStartAt)
60
        {
60
        {
61
          LST lst = (LST)_lists.get(new Integer(override._lsid));
61
          LST lst = (LST)_lists.get(Integer.valueOf(override._lsid));
62
          LVL lvl = lst._levels[level];
62
          LVL lvl = lst._levels[level];
63
          LVL newLvl = (LVL)lvl.clone();
63
          LVL newLvl = (LVL)lvl.clone();
64
          newLvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2);
64
          newLvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2);
Lines 68-74 Link Here
68
      }
68
      }
69
    }
69
    }
70
70
71
    LST lst = (LST)_lists.get(new Integer(override._lsid));
71
    LST lst = (LST)_lists.get(Integer.valueOf(override._lsid));
72
    LVL lvl = lst._levels[level];
72
    LVL lvl = lst._levels[level];
73
    lvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2);
73
    lvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2);
74
    return lvl;
74
    return lvl;
Lines 89-95 Link Here
89
      byte code = plcflst[2 + 26 + (x * 28)];
89
      byte code = plcflst[2 + 26 + (x * 28)];
90
      lst._fSimpleList = StyleSheet.getFlag(code & 0x01);
90
      lst._fSimpleList = StyleSheet.getFlag(code & 0x01);
91
      //lstArray[x] = lst;
91
      //lstArray[x] = lst;
92
      _lists.put(new Integer(lst._lsid), lst);
92
      _lists.put(Integer.valueOf(lst._lsid), lst);
93
93
94
      if(lst._fSimpleList)
94
      if(lst._fSimpleList)
95
      {
95
      {
(-)src/scratchpad/src/org/apache/poi/hdf/model/util/BTreeSet.java (-3 / +3 lines)
Lines 235-241 Link Here
235
            while (temp.entries[0].child != null)
235
            while (temp.entries[0].child != null)
236
            {
236
            {
237
                temp = temp.entries[0].child;
237
                temp = temp.entries[0].child;
238
                parentIndex.push(new Integer(0));
238
                parentIndex.push(Integer.valueOf(0));
239
            }
239
            }
240
240
241
            return temp;
241
            return temp;
Lines 272-283 Link Here
272
272
273
            // else - You're not a leaf so simply find and return the successor of lastReturned
273
            // else - You're not a leaf so simply find and return the successor of lastReturned
274
            currentNode = currentNode.entries[index].child;
274
            currentNode = currentNode.entries[index].child;
275
            parentIndex.push(new Integer(index));
275
            parentIndex.push(Integer.valueOf(index));
276
276
277
            while (currentNode.entries[0].child != null)
277
            while (currentNode.entries[0].child != null)
278
            {
278
            {
279
                currentNode = currentNode.entries[0].child;
279
                currentNode = currentNode.entries[0].child;
280
                parentIndex.push(new Integer(0));
280
                parentIndex.push(Integer.valueOf(0));
281
            }
281
            }
282
282
283
            index = 1;
283
            index = 1;
(-)src/scratchpad/src/org/apache/poi/hdf/extractor/WordDocument.java (-3 / +3 lines)
Lines 394-400 Link Here
394
394
395
              byte[] chpx = new byte[size];
395
              byte[] chpx = new byte[size];
396
              System.arraycopy(fkp, ++chpxOffset, chpx, 0, size);
396
              System.arraycopy(fkp, ++chpxOffset, chpx, 0, size);
397
              //_papTable.put(new Integer(fcStart), papx);
397
              //_papTable.put(Integer.valueOf(fcStart), papx);
398
              _characterTable.add(new ChpxNode(fcStart, fcEnd, chpx));
398
              _characterTable.add(new ChpxNode(fcStart, fcEnd, chpx));
399
          }
399
          }
400
400
Lines 734-745 Link Here
734
        lineWidth += 10 * tempString.length();//metrics.stringWidth(tempString);
734
        lineWidth += 10 * tempString.length();//metrics.stringWidth(tempString);
735
        if(lineWidth > pageWidth)
735
        if(lineWidth > pageWidth)
736
        {
736
        {
737
          lineHeights.add(new Integer(maxHeight));
737
          lineHeights.add(Integer.valueOf(maxHeight));
738
          maxHeight = 0;
738
          maxHeight = 0;
739
          lineWidth = 0;
739
          lineWidth = 0;
740
        }
740
        }
741
      }
741
      }
742
      lineHeights.add(new Integer(maxHeight));
742
      lineHeights.add(Integer.valueOf(maxHeight));
743
    }
743
    }
744
    int sum = 0;
744
    int sum = 0;
745
    size = lineHeights.size();
745
    size = lineHeights.size();
(-)src/scratchpad/src/org/apache/poi/hdf/extractor/data/ListTables.java (-4 / +4 lines)
Lines 51-64 Link Here
51
        LFOLVL lfolvl = override._levels[x];
51
        LFOLVL lfolvl = override._levels[x];
52
        if(lfolvl._fFormatting)
52
        if(lfolvl._fFormatting)
53
        {
53
        {
54
          LST lst = (LST)_lists.get(new Integer(override._lsid));
54
          LST lst = (LST)_lists.get(Integer.valueOf(override._lsid));
55
          LVL lvl = lfolvl._override;
55
          LVL lvl = lfolvl._override;
56
          lvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2);
56
          lvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2);
57
          return lvl;
57
          return lvl;
58
        }
58
        }
59
        else if(lfolvl._fStartAt)
59
        else if(lfolvl._fStartAt)
60
        {
60
        {
61
          LST lst = (LST)_lists.get(new Integer(override._lsid));
61
          LST lst = (LST)_lists.get(Integer.valueOf(override._lsid));
62
          LVL lvl = lst._levels[level];
62
          LVL lvl = lst._levels[level];
63
          LVL newLvl = (LVL)lvl.clone();
63
          LVL newLvl = (LVL)lvl.clone();
64
          newLvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2);
64
          newLvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2);
Lines 68-74 Link Here
68
      }
68
      }
69
    }
69
    }
70
70
71
    LST lst = (LST)_lists.get(new Integer(override._lsid));
71
    LST lst = (LST)_lists.get(Integer.valueOf(override._lsid));
72
    LVL lvl = lst._levels[level];
72
    LVL lvl = lst._levels[level];
73
    lvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2);
73
    lvl._istd = Utils.convertBytesToShort(lst._rgistd, level * 2);
74
    return lvl;
74
    return lvl;
Lines 89-95 Link Here
89
      byte code = plcflst[2 + 26 + (x * 28)];
89
      byte code = plcflst[2 + 26 + (x * 28)];
90
      lst._fSimpleList = StyleSheet.getFlag(code & 0x01);
90
      lst._fSimpleList = StyleSheet.getFlag(code & 0x01);
91
      //lstArray[x] = lst;
91
      //lstArray[x] = lst;
92
      _lists.put(new Integer(lst._lsid), lst);
92
      _lists.put(Integer.valueOf(lst._lsid), lst);
93
93
94
      if(lst._fSimpleList)
94
      if(lst._fSimpleList)
95
      {
95
      {
(-)src/scratchpad/src/org/apache/poi/hdf/extractor/util/BTreeSet.java (-3 / +3 lines)
Lines 161-167 Link Here
161
161
162
            while (temp._entries[0].child != null) {
162
            while (temp._entries[0].child != null) {
163
                temp = temp._entries[0].child;
163
                temp = temp._entries[0].child;
164
                parentIndex.push(new Integer(0));
164
                parentIndex.push(Integer.valueOf(0));
165
            }
165
            }
166
166
167
            return temp;
167
            return temp;
Lines 193-203 Link Here
193
193
194
            // else - You're not a leaf so simply find and return the successor of lastReturned
194
            // else - You're not a leaf so simply find and return the successor of lastReturned
195
            currentNode = currentNode._entries[index].child;
195
            currentNode = currentNode._entries[index].child;
196
            parentIndex.push(new Integer(index));
196
            parentIndex.push(Integer.valueOf(index));
197
197
198
            while (currentNode._entries[0].child != null) {
198
            while (currentNode._entries[0].child != null) {
199
                currentNode = currentNode._entries[0].child;
199
                currentNode = currentNode._entries[0].child;
200
                parentIndex.push(new Integer(0));
200
                parentIndex.push(Integer.valueOf(0));
201
            }
201
            }
202
202
203
            index = 1;
203
            index = 1;
(-)src/scratchpad/src/org/apache/poi/hwpf/usermodel/HeaderStories.java (-1 / +1 lines)
Lines 169-175 Link Here
169
		// If you create a header/footer, then remove it again, word
169
		// If you create a header/footer, then remove it again, word
170
		//  will leave \r\r. Turn these back into an empty string,
170
		//  will leave \r\r. Turn these back into an empty string,
171
		//  which is more what you'd expect
171
		//  which is more what you'd expect
172
		if(text.equals("\r\r")) {
172
		if("\r\r".equals(text)) {
173
			return "";
173
			return "";
174
		}
174
		}
175
175
(-)src/scratchpad/src/org/apache/poi/hwpf/model/FSPATable.java (-2 / +2 lines)
Lines 48-60 Link Here
48
            FSPA fspa = new FSPA(property.getBytes(), 0);
48
            FSPA fspa = new FSPA(property.getBytes(), 0);
49
49
50
            _shapes.add(fspa);
50
            _shapes.add(fspa);
51
            _shapeIndexesByPropertyStart.put(new Integer(property.getStart()), new Integer(i));
51
            _shapeIndexesByPropertyStart.put(Integer.valueOf(property.getStart()), Integer.valueOf(i));
52
        }
52
        }
53
    }
53
    }
54
54
55
    public FSPA getFspaFromCp(int cp)
55
    public FSPA getFspaFromCp(int cp)
56
    {
56
    {
57
        Integer idx = (Integer)_shapeIndexesByPropertyStart.get(new Integer(cp));
57
        Integer idx = (Integer)_shapeIndexesByPropertyStart.get(Integer.valueOf(cp));
58
        if (idx == null) {
58
        if (idx == null) {
59
            return null;
59
            return null;
60
        }
60
        }
(-)src/scratchpad/src/org/apache/poi/hwpf/model/FileInformationBlock.java (-12 / +12 lines)
Lines 58-75 Link Here
58
    public void fillVariableFields(byte[] mainDocument, byte[] tableStream)
58
    public void fillVariableFields(byte[] mainDocument, byte[] tableStream)
59
    {
59
    {
60
      HashSet fieldSet = new HashSet();
60
      HashSet fieldSet = new HashSet();
61
      fieldSet.add(new Integer(FIBFieldHandler.STSHF));
61
      fieldSet.add(Integer.valueOf(FIBFieldHandler.STSHF));
62
      fieldSet.add(new Integer(FIBFieldHandler.CLX));
62
      fieldSet.add(Integer.valueOf(FIBFieldHandler.CLX));
63
      fieldSet.add(new Integer(FIBFieldHandler.DOP));
63
      fieldSet.add(Integer.valueOf(FIBFieldHandler.DOP));
64
      fieldSet.add(new Integer(FIBFieldHandler.PLCFBTECHPX));
64
      fieldSet.add(Integer.valueOf(FIBFieldHandler.PLCFBTECHPX));
65
      fieldSet.add(new Integer(FIBFieldHandler.PLCFBTEPAPX));
65
      fieldSet.add(Integer.valueOf(FIBFieldHandler.PLCFBTEPAPX));
66
      fieldSet.add(new Integer(FIBFieldHandler.PLCFSED));
66
      fieldSet.add(Integer.valueOf(FIBFieldHandler.PLCFSED));
67
      fieldSet.add(new Integer(FIBFieldHandler.PLCFLST));
67
      fieldSet.add(Integer.valueOf(FIBFieldHandler.PLCFLST));
68
      fieldSet.add(new Integer(FIBFieldHandler.PLFLFO));
68
      fieldSet.add(Integer.valueOf(FIBFieldHandler.PLFLFO));
69
      fieldSet.add(new Integer(FIBFieldHandler.PLCFFLDMOM));
69
      fieldSet.add(Integer.valueOf(FIBFieldHandler.PLCFFLDMOM));
70
      fieldSet.add(new Integer(FIBFieldHandler.STTBFFFN));
70
      fieldSet.add(Integer.valueOf(FIBFieldHandler.STTBFFFN));
71
      fieldSet.add(new Integer(FIBFieldHandler.STTBSAVEDBY));
71
      fieldSet.add(Integer.valueOf(FIBFieldHandler.STTBSAVEDBY));
72
      fieldSet.add(new Integer(FIBFieldHandler.MODIFIED));
72
      fieldSet.add(Integer.valueOf(FIBFieldHandler.MODIFIED));
73
73
74
74
75
      _shortHandler = new FIBShortHandler(mainDocument);
75
      _shortHandler = new FIBShortHandler(mainDocument);
(-)src/scratchpad/src/org/apache/poi/hwpf/model/FIBFieldHandler.java (-3 / +3 lines)
Lines 146-152 Link Here
146
      fieldOffset += LittleEndian.INT_SIZE;
146
      fieldOffset += LittleEndian.INT_SIZE;
147
      int dsSize = LittleEndian.getInt(mainStream, fieldOffset);
147
      int dsSize = LittleEndian.getInt(mainStream, fieldOffset);
148
148
149
      if (offsetList.contains(new Integer(x)) ^ areKnown)
149
      if (offsetList.contains(Integer.valueOf(x)) ^ areKnown)
150
      {
150
      {
151
        if (dsSize > 0)
151
        if (dsSize > 0)
152
        {
152
        {
Lines 160-166 Link Here
160
          {
160
          {
161
            UnhandledDataStructure unhandled = new UnhandledDataStructure(
161
            UnhandledDataStructure unhandled = new UnhandledDataStructure(
162
              tableStream, dsOffset, dsSize);
162
              tableStream, dsOffset, dsSize);
163
            _unknownMap.put(new Integer(x), unhandled);
163
            _unknownMap.put(Integer.valueOf(x), unhandled);
164
          }
164
          }
165
        }
165
        }
166
      }
166
      }
Lines 208-214 Link Here
208
208
209
    for (int x = 0; x < length; x++)
209
    for (int x = 0; x < length; x++)
210
    {
210
    {
211
      UnhandledDataStructure ds = (UnhandledDataStructure)_unknownMap.get(new Integer(x));
211
      UnhandledDataStructure ds = (UnhandledDataStructure)_unknownMap.get(Integer.valueOf(x));
212
      if (ds != null)
212
      if (ds != null)
213
      {
213
      {
214
        LittleEndian.putInt(mainStream, offset, tableStream.getOffset());
214
        LittleEndian.putInt(mainStream, offset, tableStream.getOffset());
(-)src/scratchpad/src/org/apache/poi/hwpf/model/ListTables.java (-5 / +5 lines)
Lines 58-64 Link Here
58
    for (int x = 0; x < length; x++)
58
    for (int x = 0; x < length; x++)
59
    {
59
    {
60
      ListData lst = new ListData(tableStream, lstOffset);
60
      ListData lst = new ListData(tableStream, lstOffset);
61
      _listMap.put(new Integer(lst.getLsid()), lst);
61
      _listMap.put(Integer.valueOf(lst.getLsid()), lst);
62
      lstOffset += LIST_DATA_SIZE;
62
      lstOffset += LIST_DATA_SIZE;
63
63
64
      int num = lst.numLevels();
64
      int num = lst.numLevels();
Lines 96-107 Link Here
96
  public int addList(ListData lst, ListFormatOverride override)
96
  public int addList(ListData lst, ListFormatOverride override)
97
  {
97
  {
98
    int lsid = lst.getLsid();
98
    int lsid = lst.getLsid();
99
    while (_listMap.get(new Integer(lsid)) != null)
99
    while (_listMap.get(Integer.valueOf(lsid)) != null)
100
    {
100
    {
101
      lsid = lst.resetListID();
101
      lsid = lst.resetListID();
102
      override.setLsid(lsid);
102
      override.setLsid(lsid);
103
    }
103
    }
104
    _listMap.put(new Integer(lsid), lst);
104
    _listMap.put(Integer.valueOf(lsid), lst);
105
    _overrideList.add(override);
105
    _overrideList.add(override);
106
    return lsid;
106
    return lsid;
107
  }
107
  }
Lines 190-196 Link Here
190
190
191
  public ListLevel getLevel(int listID, int level)
191
  public ListLevel getLevel(int listID, int level)
192
  {
192
  {
193
    ListData lst = (ListData)_listMap.get(new Integer(listID));
193
    ListData lst = (ListData)_listMap.get(Integer.valueOf(listID));
194
    if(level < lst.numLevels()) {
194
    if(level < lst.numLevels()) {
195
    	ListLevel lvl = lst.getLevels()[level];
195
    	ListLevel lvl = lst.getLevels()[level];
196
    	return lvl;
196
    	return lvl;
Lines 201-207 Link Here
201
201
202
  public ListData getListData(int listID)
202
  public ListData getListData(int listID)
203
  {
203
  {
204
    return (ListData) _listMap.get(new Integer(listID));
204
    return (ListData) _listMap.get(Integer.valueOf(listID));
205
  }
205
  }
206
206
207
  public boolean equals(Object obj)
207
  public boolean equals(Object obj)
(-)src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java (-8 / +8 lines)
Lines 400-411 Link Here
400
    HashMap tabMap = new HashMap();
400
    HashMap tabMap = new HashMap();
401
    for (int x = 0; x < tabPositions.length; x++)
401
    for (int x = 0; x < tabPositions.length; x++)
402
    {
402
    {
403
      tabMap.put(new Integer(tabPositions[x]), new Byte(tabDescriptors[x]));
403
      tabMap.put(Integer.valueOf(tabPositions[x]), Byte.valueOf(tabDescriptors[x]));
404
    }
404
    }
405
405
406
    for (int x = 0; x < delSize; x++)
406
    for (int x = 0; x < delSize; x++)
407
    {
407
    {
408
      tabMap.remove(new Integer(LittleEndian.getShort(grpprl, offset)));
408
      tabMap.remove(Integer.valueOf(LittleEndian.getShort(grpprl, offset)));
409
      offset += LittleEndian.SHORT_SIZE;
409
      offset += LittleEndian.SHORT_SIZE;
410
    }
410
    }
411
411
Lines 413-420 Link Here
413
    int start = offset;
413
    int start = offset;
414
    for (int x = 0; x < addSize; x++)
414
    for (int x = 0; x < addSize; x++)
415
    {
415
    {
416
      Integer key = new Integer(LittleEndian.getShort(grpprl, offset));
416
      Integer key = Integer.valueOf(LittleEndian.getShort(grpprl, offset));
417
      Byte val = new Byte(grpprl[start + ((LittleEndian.SHORT_SIZE * addSize) + x)]);
417
      Byte val = Byte.valueOf(grpprl[start + ((LittleEndian.SHORT_SIZE * addSize) + x)]);
418
      tabMap.put(key, val);
418
      tabMap.put(key, val);
419
      offset += LittleEndian.SHORT_SIZE;
419
      offset += LittleEndian.SHORT_SIZE;
420
    }
420
    }
Lines 452-471 Link Here
452
//    HashMap tabMap = new HashMap();
452
//    HashMap tabMap = new HashMap();
453
//    for (int x = 0; x < tabPositions.length; x++)
453
//    for (int x = 0; x < tabPositions.length; x++)
454
//    {
454
//    {
455
//      tabMap.put(new Integer(tabPositions[x]), new Byte(tabDescriptors[x]));
455
//      tabMap.put(Integer.valueOf(tabPositions[x]), Byte.valueOf(tabDescriptors[x]));
456
//    }
456
//    }
457
//
457
//
458
//    for (int x = 0; x < delSize; x++)
458
//    for (int x = 0; x < delSize; x++)
459
//    {
459
//    {
460
//      tabMap.remove(new Integer(LittleEndian.getInt(grpprl, offset)));
460
//      tabMap.remove(Integer.valueOf(LittleEndian.getInt(grpprl, offset)));
461
//      offset += LittleEndian.INT_SIZE;;
461
//      offset += LittleEndian.INT_SIZE;;
462
//    }
462
//    }
463
//
463
//
464
//    int addSize = grpprl[offset++];
464
//    int addSize = grpprl[offset++];
465
//    for (int x = 0; x < addSize; x++)
465
//    for (int x = 0; x < addSize; x++)
466
//    {
466
//    {
467
//      Integer key = new Integer(LittleEndian.getInt(grpprl, offset));
467
//      Integer key = Integer.valueOf(LittleEndian.getInt(grpprl, offset));
468
//      Byte val = new Byte(grpprl[(LittleEndian.INT_SIZE * (addSize - x)) + x]);
468
//      Byte val = Byte.valueOf(grpprl[(LittleEndian.INT_SIZE * (addSize - x)) + x]);
469
//      tabMap.put(key, val);
469
//      tabMap.put(key, val);
470
//      offset += LittleEndian.INT_SIZE;
470
//      offset += LittleEndian.INT_SIZE;
471
//    }
471
//    }
(-)src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java (-2 / +2 lines)
Lines 98-104 Link Here
98
				defsL.toArray(new CommandDefinition[defsL.size()]);
98
				defsL.toArray(new CommandDefinition[defsL.size()]);
99
99
100
			// Add to the hashtable
100
			// Add to the hashtable
101
			chunkCommandDefinitions.put(new Integer(chunkType), defs);
101
			chunkCommandDefinitions.put(Integer.valueOf(chunkType), defs);
102
		}
102
		}
103
		inp.close();
103
		inp.close();
104
		cpd.close();
104
		cpd.close();
Lines 171-177 Link Here
171
171
172
		// Feed in the stuff from  chunks_parse_cmds.tbl
172
		// Feed in the stuff from  chunks_parse_cmds.tbl
173
		CommandDefinition[] defs = (CommandDefinition[])
173
		CommandDefinition[] defs = (CommandDefinition[])
174
			chunkCommandDefinitions.get(new Integer(header.getType()));
174
			chunkCommandDefinitions.get(Integer.valueOf(header.getType()));
175
		if(defs == null) defs = new CommandDefinition[0];
175
		if(defs == null) defs = new CommandDefinition[0];
176
		chunk.commandDefinitions = defs;
176
		chunk.commandDefinitions = defs;
177
177
(-)src/scratchpad/src/org/apache/poi/hdgf/chunks/Chunk.java (-6 / +6 lines)
Lines 166-178 Link Here
166
			// Types 0->7 = a flat at bit 0->7
166
			// Types 0->7 = a flat at bit 0->7
167
			case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
167
			case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
168
				int val = contents[offset] & (1<<type);
168
				int val = contents[offset] & (1<<type);
169
				command.value = new Boolean( (val > 0) );
169
				command.value = Boolean.valueOf( (val > 0) );
170
				break;
170
				break;
171
			case 8:
171
			case 8:
172
				command.value = new Byte( contents[offset] );
172
				command.value = Byte.valueOf( contents[offset] );
173
				break;
173
				break;
174
			case 9:
174
			case 9:
175
				command.value = new Double(
175
				command.value = Double.valueOf(
176
						LittleEndian.getDouble(contents, offset)
176
						LittleEndian.getDouble(contents, offset)
177
				);
177
				);
178
				break;
178
				break;
Lines 195-206 Link Here
195
				command.value = StringUtil.getFromUnicodeLE(contents, startsAt, strLen);
195
				command.value = StringUtil.getFromUnicodeLE(contents, startsAt, strLen);
196
				break;
196
				break;
197
			case 25:
197
			case 25:
198
				command.value = new Short(
198
				command.value = Short.valueOf(
199
					LittleEndian.getShort(contents, offset)
199
					LittleEndian.getShort(contents, offset)
200
				);
200
				);
201
				break;
201
				break;
202
			case 26:
202
			case 26:
203
				command.value = new Integer(
203
				command.value = Integer.valueOf(
204
						LittleEndian.getInt(contents, offset)
204
						LittleEndian.getInt(contents, offset)
205
				);
205
				);
206
				break;
206
				break;
Lines 273-279 Link Here
273
		}
273
		}
274
		private void setOffset(int offset) {
274
		private void setOffset(int offset) {
275
			this.offset = offset;
275
			this.offset = offset;
276
			value = new Integer(offset);
276
			value = Integer.valueOf(offset);
277
		}
277
		}
278
	}
278
	}
279
}
279
}
(-)src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java (-9 / +9 lines)
Lines 162-168 Link Here
162
				// PersistPtr, remove their old positions
162
				// PersistPtr, remove their old positions
163
				int[] ids = pph.getKnownSlideIDs();
163
				int[] ids = pph.getKnownSlideIDs();
164
				for (int j = 0; j < ids.length; j++) {
164
				for (int j = 0; j < ids.length; j++) {
165
					Integer id = new Integer(ids[j]);
165
					Integer id = Integer.valueOf(ids[j]);
166
					if (mostRecentByBytes.containsKey(id)) {
166
					if (mostRecentByBytes.containsKey(id)) {
167
						mostRecentByBytes.remove(id);
167
						mostRecentByBytes.remove(id);
168
					}
168
					}
Lines 171-177 Link Here
171
				// Now, update the byte level locations with their latest values
171
				// Now, update the byte level locations with their latest values
172
				Hashtable thisSetOfLocations = pph.getSlideLocationsLookup();
172
				Hashtable thisSetOfLocations = pph.getSlideLocationsLookup();
173
				for (int j = 0; j < ids.length; j++) {
173
				for (int j = 0; j < ids.length; j++) {
174
					Integer id = new Integer(ids[j]);
174
					Integer id = Integer.valueOf(ids[j]);
175
					mostRecentByBytes.put(id, thisSetOfLocations.get(id));
175
					mostRecentByBytes.put(id, thisSetOfLocations.get(id));
176
				}
176
				}
177
			}
177
			}
Lines 192-209 Link Here
192
		}
192
		}
193
		Arrays.sort(allIDs);
193
		Arrays.sort(allIDs);
194
		for (int i = 0; i < allIDs.length; i++) {
194
		for (int i = 0; i < allIDs.length; i++) {
195
			_sheetIdToCoreRecordsLookup.put(new Integer(allIDs[i]), new Integer(i));
195
			_sheetIdToCoreRecordsLookup.put(Integer.valueOf(allIDs[i]), Integer.valueOf(i));
196
		}
196
		}
197
197
198
		// Now convert the byte offsets back into record offsets
198
		// Now convert the byte offsets back into record offsets
199
		for (int i = 0; i < _records.length; i++) {
199
		for (int i = 0; i < _records.length; i++) {
200
			if (_records[i] instanceof PositionDependentRecord) {
200
			if (_records[i] instanceof PositionDependentRecord) {
201
				PositionDependentRecord pdr = (PositionDependentRecord) _records[i];
201
				PositionDependentRecord pdr = (PositionDependentRecord) _records[i];
202
				Integer recordAt = new Integer(pdr.getLastOnDiskOffset());
202
				Integer recordAt = Integer.valueOf(pdr.getLastOnDiskOffset());
203
203
204
				// Is it one we care about?
204
				// Is it one we care about?
205
				for (int j = 0; j < allIDs.length; j++) {
205
				for (int j = 0; j < allIDs.length; j++) {
206
					Integer thisID = new Integer(allIDs[j]);
206
					Integer thisID = Integer.valueOf(allIDs[j]);
207
					Integer thatRecordAt = (Integer) mostRecentByBytes.get(thisID);
207
					Integer thatRecordAt = (Integer) mostRecentByBytes.get(thisID);
208
208
209
					if (thatRecordAt.equals(recordAt)) {
209
					if (thatRecordAt.equals(recordAt)) {
Lines 258-264 Link Here
258
	 *            the refID
258
	 *            the refID
259
	 */
259
	 */
260
	private Record getCoreRecordForRefID(int refID) {
260
	private Record getCoreRecordForRefID(int refID) {
261
		Integer coreRecordId = (Integer) _sheetIdToCoreRecordsLookup.get(new Integer(refID));
261
		Integer coreRecordId = (Integer) _sheetIdToCoreRecordsLookup.get(Integer.valueOf(refID));
262
		if (coreRecordId != null) {
262
		if (coreRecordId != null) {
263
			Record r = _mostRecentCoreRecords[coreRecordId.intValue()];
263
			Record r = _mostRecentCoreRecords[coreRecordId.intValue()];
264
			return r;
264
			return r;
Lines 364-371 Link Here
364
364
365
					// Record the match between slide id and these notes
365
					// Record the match between slide id and these notes
366
					SlidePersistAtom spa = notesSets[i].getSlidePersistAtom();
366
					SlidePersistAtom spa = notesSets[i].getSlidePersistAtom();
367
					Integer slideId = new Integer(spa.getSlideIdentifier());
367
					Integer slideId = Integer.valueOf(spa.getSlideIdentifier());
368
					slideIdToNotes.put(slideId, new Integer(i));
368
					slideIdToNotes.put(slideId, Integer.valueOf(i));
369
				} else {
369
				} else {
370
					logger.log(POILogger.ERROR, "A Notes SlideAtomSet at " + i
370
					logger.log(POILogger.ERROR, "A Notes SlideAtomSet at " + i
371
							+ " said its record was at refID "
371
							+ " said its record was at refID "
Lines 422-428 Link Here
422
			// 0 if slide has no notes.
422
			// 0 if slide has no notes.
423
			int noteId = slidesRecords[i].getSlideAtom().getNotesID();
423
			int noteId = slidesRecords[i].getSlideAtom().getNotesID();
424
			if (noteId != 0) {
424
			if (noteId != 0) {
425
				Integer notesPos = (Integer) slideIdToNotes.get(new Integer(noteId));
425
				Integer notesPos = (Integer) slideIdToNotes.get(Integer.valueOf(noteId));
426
				if (notesPos != null)
426
				if (notesPos != null)
427
					notes = _notes[notesPos.intValue()];
427
					notes = _notes[notesPos.intValue()];
428
				else
428
				else
(-)src/scratchpad/src/org/apache/poi/hslf/EncryptedSlideShow.java (-1 / +1 lines)
Lines 117-123 Link Here
117
117
118
			int offset = (
118
			int offset = (
119
					(Integer)pph.getSlideLocationsLookup().get(
119
					(Integer)pph.getSlideLocationsLookup().get(
120
							new Integer(maxSlideId)
120
							Integer.valueOf(maxSlideId)
121
					) ).intValue();
121
					) ).intValue();
122
			Record r3 = Record.buildRecordAtOffset(
122
			Record r3 = Record.buildRecordAtOffset(
123
					hss.getUnderlyingBytes(),
123
					hss.getUnderlyingBytes(),
(-)src/scratchpad/src/org/apache/poi/hslf/model/TextPainter.java (-1 / +1 lines)
Lines 156-162 Link Here
156
        if (run == null) return null;
156
        if (run == null) return null;
157
157
158
        String text = run.getText();
158
        String text = run.getText();
159
        if (text == null || text.equals("")) return null;
159
        if (text == null || "".equals(text)) return null;
160
160
161
        AttributedString at = getAttributedString(run);
161
        AttributedString at = getAttributedString(run);
162
162
(-)src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java (-1 / +1 lines)
Lines 34-40 Link Here
34
     * @return  the name of the shape
34
     * @return  the name of the shape
35
     */
35
     */
36
    public static String typeName(int type) {
36
    public static String typeName(int type) {
37
        String name = (String)types.get(new Integer(type));
37
        String name = (String)types.get(Integer.valueOf(type));
38
        return name;
38
        return name;
39
    }
39
    }
40
40
(-)src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java (-1 / +1 lines)
Lines 237-243 Link Here
237
				if (notes == null) {
237
				if (notes == null) {
238
					continue;
238
					continue;
239
				}
239
				}
240
				Integer id = new Integer(notes._getSheetNumber());
240
				Integer id = Integer.valueOf(notes._getSheetNumber());
241
				if (seenNotes.contains(id)) {
241
				if (seenNotes.contains(id)) {
242
					continue;
242
					continue;
243
				}
243
				}
(-)src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java (-2 / +2 lines)
Lines 193-200 Link Here
193
			String text = cs.getText();
193
			String text = cs.getText();
194
194
195
			// Ignore the ones we know to be rubbish
195
			// Ignore the ones we know to be rubbish
196
			if(text.equals("___PPT10")) {
196
			if("___PPT10".equals(text)) {
197
			} else if(text.equals("Default Design")) {
197
			} else if("Default Design".equals(text)) {
198
			} else {
198
			} else {
199
				textV.add(text);
199
				textV.add(text);
200
			}
200
			}
(-)src/scratchpad/src/org/apache/poi/hslf/dev/SlideIdListing.java (-1 / +1 lines)
Lines 124-130 Link Here
124
				int[] sheetIDs = pph.getKnownSlideIDs();
124
				int[] sheetIDs = pph.getKnownSlideIDs();
125
				Hashtable sheetOffsets = pph.getSlideLocationsLookup();
125
				Hashtable sheetOffsets = pph.getSlideLocationsLookup();
126
				for(int j=0; j<sheetIDs.length; j++) {
126
				for(int j=0; j<sheetIDs.length; j++) {
127
					Integer id = new Integer(sheetIDs[j]);
127
					Integer id = Integer.valueOf(sheetIDs[j]);
128
					Integer offset = (Integer)sheetOffsets.get(id);
128
					Integer offset = (Integer)sheetOffsets.get(id);
129
129
130
					System.out.println("  Knows about sheet " + id);
130
					System.out.println("  Knows about sheet " + id);
(-)src/scratchpad/src/org/apache/poi/hslf/dev/UserEditAndPersistListing.java (-1 / +1 lines)
Lines 63-69 Link Here
63
				int[] sheetIDs = pph.getKnownSlideIDs();
63
				int[] sheetIDs = pph.getKnownSlideIDs();
64
				Hashtable sheetOffsets = pph.getSlideLocationsLookup();
64
				Hashtable sheetOffsets = pph.getSlideLocationsLookup();
65
				for(int j=0; j<sheetIDs.length; j++) {
65
				for(int j=0; j<sheetIDs.length; j++) {
66
					Integer id = new Integer(sheetIDs[j]);
66
					Integer id = Integer.valueOf(sheetIDs[j]);
67
					Integer offset = (Integer)sheetOffsets.get(id);
67
					Integer offset = (Integer)sheetOffsets.get(id);
68
68
69
					System.out.println("  Knows about sheet " + id);
69
					System.out.println("  Knows about sheet " + id);
(-)src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java (-3 / +3 lines)
Lines 61-69 Link Here
61
		if (!args[ndx].substring(0,1).equals("-"))
61
		if (!args[ndx].substring(0,1).equals("-"))
62
			break;
62
			break;
63
63
64
		if (args[ndx].equals("-escher")) {
64
		if ("-escher".equals(args[ndx])) {
65
			escher = true;
65
			escher = true;
66
		} else if (args[ndx].equals("-verbose")) {
66
		} else if ("-verbose".equals(args[ndx])) {
67
			verbose = true;
67
			verbose = true;
68
		} else {
68
		} else {
69
			printUsage();
69
			printUsage();
Lines 263-269 Link Here
263
		System.out.println(ind + " Len is " + (len-8) + " (" + makeHex((len-8),8) + "), on disk len is " + len );
263
		System.out.println(ind + " Len is " + (len-8) + " (" + makeHex((len-8),8) + "), on disk len is " + len );
264
264
265
		// print additional information for drawings and atoms
265
		// print additional information for drawings and atoms
266
		if (optEscher && cname.equals("PPDrawing")) {
266
		if (optEscher && "PPDrawing".equals(cname)) {
267
			DefaultEscherRecordFactory factory = new DefaultEscherRecordFactory();
267
			DefaultEscherRecordFactory factory = new DefaultEscherRecordFactory();
268
268
269
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
269
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
(-)src/scratchpad/src/org/apache/poi/hslf/record/UserEditAtom.java (-2 / +2 lines)
Lines 124-130 Link Here
124
	public void updateOtherRecordReferences(Hashtable oldToNewReferencesLookup) {
124
	public void updateOtherRecordReferences(Hashtable oldToNewReferencesLookup) {
125
		// Look up the new positions of our preceding UserEditAtomOffset
125
		// Look up the new positions of our preceding UserEditAtomOffset
126
		if(lastUserEditAtomOffset != 0) {
126
		if(lastUserEditAtomOffset != 0) {
127
			Integer newLocation = (Integer)oldToNewReferencesLookup.get(new Integer(lastUserEditAtomOffset));
127
			Integer newLocation = (Integer)oldToNewReferencesLookup.get(Integer.valueOf(lastUserEditAtomOffset));
128
			if(newLocation == null) {
128
			if(newLocation == null) {
129
				throw new RuntimeException("Couldn't find the new location of the UserEditAtom that used to be at " + lastUserEditAtomOffset);
129
				throw new RuntimeException("Couldn't find the new location of the UserEditAtom that used to be at " + lastUserEditAtomOffset);
130
			}
130
			}
Lines 132-138 Link Here
132
		}
132
		}
133
133
134
		// Ditto for our PersistPtr
134
		// Ditto for our PersistPtr
135
		Integer newLocation = (Integer)oldToNewReferencesLookup.get(new Integer(persistPointersOffset));
135
		Integer newLocation = (Integer)oldToNewReferencesLookup.get(Integer.valueOf(persistPointersOffset));
136
		if(newLocation == null) {
136
		if(newLocation == null) {
137
			throw new RuntimeException("Couldn't find the new location of the PersistPtr that used to be at " + persistPointersOffset);
137
			throw new RuntimeException("Couldn't find the new location of the PersistPtr that used to be at " + persistPointersOffset);
138
		}
138
		}
(-)src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java (-6 / +6 lines)
Lines 98-107 Link Here
98
		System.arraycopy(_ptrData,0,newPtrData,0,_ptrData.length);
98
		System.arraycopy(_ptrData,0,newPtrData,0,_ptrData.length);
99
99
100
		// Add to the slide location lookup hash
100
		// Add to the slide location lookup hash
101
		_slideLocations.put(new Integer(slideID), new Integer(posOnDisk));
101
		_slideLocations.put(Integer.valueOf(slideID), Integer.valueOf(posOnDisk));
102
		// Add to the ptrData offset lookup hash
102
		// Add to the ptrData offset lookup hash
103
		_slideOffsetDataLocation.put(new Integer(slideID),
103
		_slideOffsetDataLocation.put(Integer.valueOf(slideID),
104
				new Integer(_ptrData.length + 4));
104
				Integer.valueOf(_ptrData.length + 4));
105
105
106
		// Build the info block
106
		// Build the info block
107
		// First 20 bits = offset number = slide ID
107
		// First 20 bits = offset number = slide ID
Lines 163-170 Link Here
163
			for(int i=0; i<offset_count; i++) {
163
			for(int i=0; i<offset_count; i++) {
164
				int sheet_no = offset_no + i;
164
				int sheet_no = offset_no + i;
165
				long sheet_offset = LittleEndian.getUInt(_ptrData,pos);
165
				long sheet_offset = LittleEndian.getUInt(_ptrData,pos);
166
				_slideLocations.put(new Integer(sheet_no), new Integer((int)sheet_offset));
166
				_slideLocations.put(Integer.valueOf(sheet_no), Integer.valueOf((int)sheet_offset));
167
				_slideOffsetDataLocation.put(new Integer(sheet_no), new Integer(pos));
167
				_slideOffsetDataLocation.put(Integer.valueOf(sheet_no), Integer.valueOf(pos));
168
168
169
				// Wind on by 4 bytes per sheet found
169
				// Wind on by 4 bytes per sheet found
170
				pos += 4;
170
				pos += 4;
Lines 188-194 Link Here
188
		// Find where they used to live, and where they now live
188
		// Find where they used to live, and where they now live
189
		// Then, update the right bit of _ptrData with their new location
189
		// Then, update the right bit of _ptrData with their new location
190
		for(int i=0; i<slideIDs.length; i++) {
190
		for(int i=0; i<slideIDs.length; i++) {
191
			Integer id = new Integer(slideIDs[i]);
191
			Integer id = Integer.valueOf(slideIDs[i]);
192
			Integer oldPos = (Integer)_slideLocations.get(id);
192
			Integer oldPos = (Integer)_slideLocations.get(id);
193
			Integer newPos = (Integer)oldToNewReferencesLookup.get(oldPos);
193
			Integer newPos = (Integer)oldToNewReferencesLookup.get(oldPos);
194
194
(-)src/scratchpad/src/org/apache/poi/hslf/record/Record.java (-1 / +1 lines)
Lines 179-185 Link Here
179
			// Grab the right constructor
179
			// Grab the right constructor
180
			java.lang.reflect.Constructor con = c.getDeclaredConstructor(new Class[] { byte[].class, Integer.TYPE, Integer.TYPE });
180
			java.lang.reflect.Constructor con = c.getDeclaredConstructor(new Class[] { byte[].class, Integer.TYPE, Integer.TYPE });
181
			// Instantiate
181
			// Instantiate
182
			toReturn = (Record)(con.newInstance(new Object[] { b, new Integer(start), new Integer(len) }));
182
			toReturn = (Record)(con.newInstance(new Object[] { b, Integer.valueOf(start), Integer.valueOf(len) }));
183
		} catch(InstantiationException ie) {
183
		} catch(InstantiationException ie) {
184
			throw new RuntimeException("Couldn't instantiate the class for type with id " + type + " on class " + c + " : " + ie, ie);
184
			throw new RuntimeException("Couldn't instantiate the class for type with id " + type + " on class " + c + " : " + ie, ie);
185
		} catch(java.lang.reflect.InvocationTargetException ite) {
185
		} catch(java.lang.reflect.InvocationTargetException ite) {
(-)src/scratchpad/src/org/apache/poi/hslf/record/RecordContainer.java (-1 / +1 lines)
Lines 36-42 Link Here
36
public abstract class RecordContainer extends Record
36
public abstract class RecordContainer extends Record
37
{
37
{
38
	protected Record[] _children;
38
	protected Record[] _children;
39
	private Boolean changingChildRecordsLock = new Boolean(true);
39
	private Boolean changingChildRecordsLock = Boolean.valueOf(true);
40
40
41
	/**
41
	/**
42
	 * Return any children
42
	 * Return any children
(-)src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java (-3 / +3 lines)
Lines 217-223 Link Here
217
     * @return name of the record
217
     * @return name of the record
218
     */
218
     */
219
    public static String recordName(int type) {
219
    public static String recordName(int type) {
220
        String name = (String)typeToName.get(new Integer(type));
220
        String name = (String)typeToName.get(Integer.valueOf(type));
221
        if (name == null) name = "Unknown" + type;
221
        if (name == null) name = "Unknown" + type;
222
        return name;
222
        return name;
223
    }
223
    }
Lines 232-238 Link Here
232
     * @return class to handle the record, or null if an unknown (eg Escher) record
232
     * @return class to handle the record, or null if an unknown (eg Escher) record
233
     */
233
     */
234
	public static Class recordHandlingClass(int type) {
234
	public static Class recordHandlingClass(int type) {
235
		Class c = (Class)typeToClass.get(new Integer(type));
235
		Class c = (Class)typeToClass.get(Integer.valueOf(type));
236
		return c;
236
		return c;
237
	}
237
	}
238
238
Lines 252-258 Link Here
252
				if (val instanceof Type) {
252
				if (val instanceof Type) {
253
					Type t = (Type)val;
253
					Type t = (Type)val;
254
					Class c = t.handlingClass;
254
					Class c = t.handlingClass;
255
					Integer id = new Integer(t.typeID);
255
					Integer id = Integer.valueOf(t.typeID);
256
					if(c == null) { c = UnknownRecordPlaceholder.class; }
256
					if(c == null) { c = UnknownRecordPlaceholder.class; }
257
257
258
                    typeToName.put(id, f[i].getName());
258
                    typeToName.put(id, f[i].getName());
(-)src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java (-4 / +4 lines)
Lines 231-241 Link Here
231
        HashMap offset2id = new HashMap();
231
        HashMap offset2id = new HashMap();
232
        while (usrOffset != 0){
232
        while (usrOffset != 0){
233
            UserEditAtom usr = (UserEditAtom) Record.buildRecordAtOffset(docstream, usrOffset);
233
            UserEditAtom usr = (UserEditAtom) Record.buildRecordAtOffset(docstream, usrOffset);
234
            lst.add(new Integer(usrOffset));
234
            lst.add(Integer.valueOf(usrOffset));
235
            int psrOffset = usr.getPersistPointersOffset();
235
            int psrOffset = usr.getPersistPointersOffset();
236
236
237
            PersistPtrHolder ptr = (PersistPtrHolder)Record.buildRecordAtOffset(docstream, psrOffset);
237
            PersistPtrHolder ptr = (PersistPtrHolder)Record.buildRecordAtOffset(docstream, psrOffset);
238
            lst.add(new Integer(psrOffset));
238
            lst.add(Integer.valueOf(psrOffset));
239
            Hashtable entries = ptr.getSlideLocationsLookup();
239
            Hashtable entries = ptr.getSlideLocationsLookup();
240
            for (Iterator it = entries.keySet().iterator(); it.hasNext(); ) {
240
            for (Iterator it = entries.keySet().iterator(); it.hasNext(); ) {
241
                Integer id = (Integer)it.next();
241
                Integer id = (Integer)it.next();
Lines 401-407 Link Here
401
                int oldPos = pdr.getLastOnDiskOffset();
401
                int oldPos = pdr.getLastOnDiskOffset();
402
                int newPos = baos.size();
402
                int newPos = baos.size();
403
                pdr.setLastOnDiskOffset(newPos);
403
                pdr.setLastOnDiskOffset(newPos);
404
                oldToNewPositions.put(new Integer(oldPos),new Integer(newPos));
404
                oldToNewPositions.put(Integer.valueOf(oldPos),Integer.valueOf(newPos));
405
                //System.out.println(oldPos + " -> " + newPos);
405
                //System.out.println(oldPos + " -> " + newPos);
406
            }
406
            }
407
407
Lines 438-444 Link Here
438
438
439
        // Update and write out the Current User atom
439
        // Update and write out the Current User atom
440
        int oldLastUserEditAtomPos = (int)currentUser.getCurrentEditOffset();
440
        int oldLastUserEditAtomPos = (int)currentUser.getCurrentEditOffset();
441
        Integer newLastUserEditAtomPos = (Integer)oldToNewPositions.get(new Integer(oldLastUserEditAtomPos));
441
        Integer newLastUserEditAtomPos = (Integer)oldToNewPositions.get(Integer.valueOf(oldLastUserEditAtomPos));
442
        if(newLastUserEditAtomPos == null) {
442
        if(newLastUserEditAtomPos == null) {
443
            throw new HSLFException("Couldn't find the new location of the UserEditAtom that used to be at " + oldLastUserEditAtomPos);
443
            throw new HSLFException("Couldn't find the new location of the UserEditAtom that used to be at " + oldLastUserEditAtomPos);
444
        }
444
        }
(-)src/scratchpad/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java (-8 / +8 lines)
Lines 368-377 Link Here
368
        tr3.setText(
368
        tr3.setText(
369
                "        //bar chart data. The first value is the bar color, the second is the width\r" +
369
                "        //bar chart data. The first value is the bar color, the second is the width\r" +
370
                "        Object[] def = new Object[]{\r" +
370
                "        Object[] def = new Object[]{\r" +
371
                "            Color.yellow, new Integer(100),\r" +
371
                "            Color.yellow, Integer.valueOf(100),\r" +
372
                "            Color.green, new Integer(150),\r" +
372
                "            Color.green, Integer.valueOf(150),\r" +
373
                "            Color.gray, new Integer(75),\r" +
373
                "            Color.gray, Integer.valueOf(75),\r" +
374
                "            Color.red, new Integer(200),\r" +
374
                "            Color.red, Integer.valueOf(200),\r" +
375
                "        };\r" +
375
                "        };\r" +
376
                "\r" +
376
                "\r" +
377
                "        SlideShow ppt = new SlideShow();\r" +
377
                "        SlideShow ppt = new SlideShow();\r" +
Lines 411-420 Link Here
411
    public static void slide10(SlideShow ppt) throws IOException {
411
    public static void slide10(SlideShow ppt) throws IOException {
412
        //bar chart data. The first value is the bar color, the second is the width
412
        //bar chart data. The first value is the bar color, the second is the width
413
        Object[] def = new Object[]{
413
        Object[] def = new Object[]{
414
            Color.yellow, new Integer(100),
414
            Color.yellow, Integer.valueOf(100),
415
            Color.green, new Integer(150),
415
            Color.green, Integer.valueOf(150),
416
            Color.gray, new Integer(75),
416
            Color.gray, Integer.valueOf(75),
417
            Color.red, new Integer(200),
417
            Color.red, Integer.valueOf(200),
418
        };
418
        };
419
419
420
        Slide slide = ppt.createSlide();
420
        Slide slide = ppt.createSlide();
(-)src/scratchpad/examples/src/org/apache/poi/hslf/examples/Graphics2DDemo.java (-4 / +4 lines)
Lines 39-48 Link Here
39
39
40
        //bar chart data. The first value is the bar color, the second is the width
40
        //bar chart data. The first value is the bar color, the second is the width
41
        Object[] def = new Object[]{
41
        Object[] def = new Object[]{
42
            Color.yellow, new Integer(40),
42
            Color.yellow, Integer.valueOf(40),
43
            Color.green, new Integer(60),
43
            Color.green, Integer.valueOf(60),
44
            Color.gray, new Integer(30),
44
            Color.gray, Integer.valueOf(30),
45
            Color.red, new Integer(80),
45
            Color.red, Integer.valueOf(80),
46
        };
46
        };
47
47
48
        Slide slide = ppt.createSlide();
48
        Slide slide = ppt.createSlide();
(-)src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java (-6 / +6 lines)
Lines 109-123 Link Here
109
109
110
        //map slide number and starting phrase of its notes
110
        //map slide number and starting phrase of its notes
111
        Map<Integer, String> notesMap = new HashMap<Integer, String>();
111
        Map<Integer, String> notesMap = new HashMap<Integer, String>();
112
        notesMap.put(new Integer(4), "For  decades before calculators");
112
        notesMap.put(Integer.valueOf(4), "For  decades before calculators");
113
        notesMap.put(new Integer(5), "Several commercial applications");
113
        notesMap.put(Integer.valueOf(5), "Several commercial applications");
114
        notesMap.put(new Integer(6), "There are three variations of LNS that are discussed here");
114
        notesMap.put(Integer.valueOf(6), "There are three variations of LNS that are discussed here");
115
        notesMap.put(new Integer(7), "Although multiply and square root are easier");
115
        notesMap.put(Integer.valueOf(7), "Although multiply and square root are easier");
116
        notesMap.put(new Integer(8), "The bus Z is split into Z_H and Z_L");
116
        notesMap.put(Integer.valueOf(8), "The bus Z is split into Z_H and Z_L");
117
117
118
        Slide[] slide = ppt.getSlides();
118
        Slide[] slide = ppt.getSlides();
119
        for (int i = 0; i < slide.length; i++) {
119
        for (int i = 0; i < slide.length; i++) {
120
            Integer slideNumber = new Integer(slide[i].getSlideNumber());
120
            Integer slideNumber = Integer.valueOf(slide[i].getSlideNumber());
121
            Notes notes = slide[i].getNotesSheet();
121
            Notes notes = slide[i].getNotesSheet();
122
            if (notesMap.containsKey(slideNumber)){
122
            if (notesMap.containsKey(slideNumber)){
123
                assertNotNull(notes);
123
                assertNotNull(notes);
(-)src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java (-4 / +4 lines)
Lines 105-123 Link Here
105
            assertEquals(txtbox.getTextRun().getRichTextRuns().length, 1);
105
            assertEquals(txtbox.getTextRun().getRichTextRuns().length, 1);
106
            RichTextRun rt = txtbox.getTextRun().getRichTextRuns()[0];
106
            RichTextRun rt = txtbox.getTextRun().getRichTextRuns()[0];
107
107
108
            if (text.equals("Hello, World!!!")){
108
            if ("Hello, World!!!".equals(text)){
109
                assertEquals(32, rt.getFontSize());
109
                assertEquals(32, rt.getFontSize());
110
                assertTrue(rt.isBold());
110
                assertTrue(rt.isBold());
111
                assertTrue(rt.isItalic());
111
                assertTrue(rt.isItalic());
112
            } else if (text.equals("I am just a poor boy")){
112
            } else if ("I am just a poor boy".equals(text)){
113
                assertEquals(44, rt.getFontSize());
113
                assertEquals(44, rt.getFontSize());
114
                assertTrue(rt.isBold());
114
                assertTrue(rt.isBold());
115
            } else if (text.equals("This is Times New Roman")){
115
            } else if ("This is Times New Roman".equals(text)){
116
                assertEquals(16, rt.getFontSize());
116
                assertEquals(16, rt.getFontSize());
117
                assertTrue(rt.isBold());
117
                assertTrue(rt.isBold());
118
                assertTrue(rt.isItalic());
118
                assertTrue(rt.isItalic());
119
                assertTrue(rt.isUnderlined());
119
                assertTrue(rt.isUnderlined());
120
            } else if (text.equals("Plain Text")){
120
            } else if ("Plain Text".equals(text)){
121
                assertEquals(18, rt.getFontSize());
121
                assertEquals(18, rt.getFontSize());
122
            }
122
            }
123
        }
123
        }
(-)src/scratchpad/testcases/org/apache/poi/hslf/TestReWriteSanity.java (-5 / +5 lines)
Lines 59-74 Link Here
59
		Record[] r = wss.getRecords();
59
		Record[] r = wss.getRecords();
60
		Hashtable pp = new Hashtable();
60
		Hashtable pp = new Hashtable();
61
		Hashtable ue = new Hashtable();
61
		Hashtable ue = new Hashtable();
62
		ue.put(new Integer(0),new Integer(0)); // Will show 0 if first
62
		ue.put(Integer.valueOf(0),Integer.valueOf(0)); // Will show 0 if first
63
		int pos = 0;
63
		int pos = 0;
64
		int lastUEPos = -1;
64
		int lastUEPos = -1;
65
65
66
		for(int i=0; i<r.length; i++) {
66
		for(int i=0; i<r.length; i++) {
67
			if(r[i] instanceof PersistPtrHolder) {
67
			if(r[i] instanceof PersistPtrHolder) {
68
				pp.put(new Integer(pos), r[i]);
68
				pp.put(Integer.valueOf(pos), r[i]);
69
			}
69
			}
70
			if(r[i] instanceof UserEditAtom) {
70
			if(r[i] instanceof UserEditAtom) {
71
				ue.put(new Integer(pos), r[i]);
71
				ue.put(Integer.valueOf(pos), r[i]);
72
				lastUEPos = pos;
72
				lastUEPos = pos;
73
			}
73
			}
74
74
Lines 84-91 Link Here
84
				int luPos = uea.getLastUserEditAtomOffset();
84
				int luPos = uea.getLastUserEditAtomOffset();
85
				int ppPos = uea.getPersistPointersOffset();
85
				int ppPos = uea.getPersistPointersOffset();
86
86
87
				assertTrue(pp.containsKey(new Integer(ppPos)));
87
				assertTrue(pp.containsKey(Integer.valueOf(ppPos)));
88
				assertTrue(ue.containsKey(new Integer(luPos)));
88
				assertTrue(ue.containsKey(Integer.valueOf(luPos)));
89
			}
89
			}
90
		}
90
		}
91
91
(-)src/examples/src/org/apache/poi/hpsf/examples/ModifyDocumentSummaryInformation.java (-2 / +2 lines)
Lines 169-176 Link Here
169
        /* Insert some custom properties into the container. */
169
        /* Insert some custom properties into the container. */
170
        customProperties.put("Key 1", "Value 1");
170
        customProperties.put("Key 1", "Value 1");
171
        customProperties.put("Schl\u00fcssel 2", "Wert 2");
171
        customProperties.put("Schl\u00fcssel 2", "Wert 2");
172
        customProperties.put("Sample Number", new Integer(12345));
172
        customProperties.put("Sample Number", Integer.valueOf(12345));
173
        customProperties.put("Sample Boolean", new Boolean(true));
173
        customProperties.put("Sample Boolean", Boolean.valueOf(true));
174
        customProperties.put("Sample Date", new Date());
174
        customProperties.put("Sample Date", new Date());
175
175
176
        /* Read a custom property. */
176
        /* Read a custom property. */
(-)src/examples/src/org/apache/poi/hssf/usermodel/examples/EmeddedObjects.java (-3 / +3 lines)
Lines 37-51 Link Here
37
        for (HSSFObjectData obj : workbook.getAllEmbeddedObjects()) {
37
        for (HSSFObjectData obj : workbook.getAllEmbeddedObjects()) {
38
            //the OLE2 Class Name of the object
38
            //the OLE2 Class Name of the object
39
            String oleName = obj.getOLE2ClassName();
39
            String oleName = obj.getOLE2ClassName();
40
            if (oleName.equals("Worksheet")) {
40
            if ("Worksheet".equals(oleName)) {
41
                DirectoryNode dn = (DirectoryNode) obj.getDirectory();
41
                DirectoryNode dn = (DirectoryNode) obj.getDirectory();
42
                HSSFWorkbook embeddedWorkbook = new HSSFWorkbook(dn, fs, false);
42
                HSSFWorkbook embeddedWorkbook = new HSSFWorkbook(dn, fs, false);
43
                //System.out.println(entry.getName() + ": " + embeddedWorkbook.getNumberOfSheets());
43
                //System.out.println(entry.getName() + ": " + embeddedWorkbook.getNumberOfSheets());
44
            } else if (oleName.equals("Document")) {
44
            } else if ("Document".equals(oleName)) {
45
                DirectoryNode dn = (DirectoryNode) obj.getDirectory();
45
                DirectoryNode dn = (DirectoryNode) obj.getDirectory();
46
                HWPFDocument embeddedWordDocument = new HWPFDocument(dn, fs);
46
                HWPFDocument embeddedWordDocument = new HWPFDocument(dn, fs);
47
                //System.out.println(entry.getName() + ": " + embeddedWordDocument.getRange().text());
47
                //System.out.println(entry.getName() + ": " + embeddedWordDocument.getRange().text());
48
            }  else if (oleName.equals("Presentation")) {
48
            }  else if ("Presentation".equals(oleName)) {
49
                DirectoryNode dn = (DirectoryNode) obj.getDirectory();
49
                DirectoryNode dn = (DirectoryNode) obj.getDirectory();
50
                SlideShow embeddedPowerPointDocument = new SlideShow(new HSLFSlideShow(dn, fs));
50
                SlideShow embeddedPowerPointDocument = new SlideShow(new HSLFSlideShow(dn, fs));
51
                //System.out.println(entry.getName() + ": " + embeddedPowerPointDocument.getSlides().length);
51
                //System.out.println(entry.getName() + ": " + embeddedPowerPointDocument.getSlides().length);
(-)src/examples/src/org/apache/poi/xssf/usermodel/examples/EmbeddedObjects.java (-6 / +6 lines)
Lines 36-62 Link Here
36
        for (PackagePart pPart : workbook.getAllEmbedds()) {
36
        for (PackagePart pPart : workbook.getAllEmbedds()) {
37
            String contentType = pPart.getContentType();
37
            String contentType = pPart.getContentType();
38
            // Excel Workbook - either binary or OpenXML
38
            // Excel Workbook - either binary or OpenXML
39
            if (contentType.equals("application/vnd.ms-excel")) {
39
            if ("application/vnd.ms-excel".equals(contentType)) {
40
                HSSFWorkbook embeddedWorkbook = new HSSFWorkbook(pPart.getInputStream());
40
                HSSFWorkbook embeddedWorkbook = new HSSFWorkbook(pPart.getInputStream());
41
            }
41
            }
42
            // Excel Workbook - OpenXML file format
42
            // Excel Workbook - OpenXML file format
43
            else if (contentType.equals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")) {
43
            else if ("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet".equals(contentType)) {
44
                XSSFWorkbook embeddedWorkbook = new XSSFWorkbook(pPart.getInputStream());
44
                XSSFWorkbook embeddedWorkbook = new XSSFWorkbook(pPart.getInputStream());
45
            }
45
            }
46
            // Word Document - binary (OLE2CDF) file format
46
            // Word Document - binary (OLE2CDF) file format
47
            else if (contentType.equals("application/msword")) {
47
            else if ("application/msword".equals(contentType)) {
48
                HWPFDocument document = new HWPFDocument(pPart.getInputStream());
48
                HWPFDocument document = new HWPFDocument(pPart.getInputStream());
49
            }
49
            }
50
            // Word Document - OpenXML file format
50
            // Word Document - OpenXML file format
51
            else if (contentType.equals("application/vnd.openxmlformats-officedocument.wordprocessingml.document")) {
51
            else if ("application/vnd.openxmlformats-officedocument.wordprocessingml.document".equals(contentType)) {
52
                XWPFDocument document = new XWPFDocument(pPart.getInputStream());
52
                XWPFDocument document = new XWPFDocument(pPart.getInputStream());
53
            }
53
            }
54
            // PowerPoint Document - binary file format
54
            // PowerPoint Document - binary file format
55
            else if (contentType.equals("application/vnd.ms-powerpoint")) {
55
            else if ("application/vnd.ms-powerpoint".equals(contentType)) {
56
                HSLFSlideShow slideShow = new HSLFSlideShow(pPart.getInputStream());
56
                HSLFSlideShow slideShow = new HSLFSlideShow(pPart.getInputStream());
57
            }
57
            }
58
            // PowerPoint Document - OpenXML file format
58
            // PowerPoint Document - OpenXML file format
59
            else if (contentType.equals("application/vnd.openxmlformats-officedocument.presentationml.presentation")) {
59
            else if ("application/vnd.openxmlformats-officedocument.presentationml.presentation".equals(contentType)) {
60
                OPCPackage docPackage = OPCPackage.open(pPart.getInputStream());
60
                OPCPackage docPackage = OPCPackage.open(pPart.getInputStream());
61
                XSLFSlideShow slideShow = new XSLFSlideShow(docPackage);
61
                XSLFSlideShow slideShow = new XSLFSlideShow(docPackage);
62
            }
62
            }
(-)src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java (-3 / +3 lines)
Lines 93-104 Link Here
93
		public void startElement(String uri, String localName, String name,
93
		public void startElement(String uri, String localName, String name,
94
				Attributes attributes) throws SAXException {
94
				Attributes attributes) throws SAXException {
95
			// c => cell
95
			// c => cell
96
			if(name.equals("c")) {
96
			if("c".equals(name)) {
97
				// Print the cell reference
97
				// Print the cell reference
98
				System.out.print(attributes.getValue("r") + " - ");
98
				System.out.print(attributes.getValue("r") + " - ");
99
				// Figure out if the value is an index in the SST
99
				// Figure out if the value is an index in the SST
100
				String cellType = attributes.getValue("t");
100
				String cellType = attributes.getValue("t");
101
				if(cellType != null && cellType.equals("s")) {
101
				if(cellType != null && "s".equals(cellType)) {
102
					nextIsString = true;
102
					nextIsString = true;
103
				} else {
103
				} else {
104
					nextIsString = false;
104
					nextIsString = false;
Lines 119-125 Link Here
119
119
120
			// v => contents of a cell
120
			// v => contents of a cell
121
			// Output after we've seen the string contents
121
			// Output after we've seen the string contents
122
			if(name.equals("v")) {
122
			if("v".equals(name)) {
123
				System.out.println(lastContents);
123
				System.out.println(lastContents);
124
			}
124
			}
125
		}
125
		}
(-)src/examples/src/org/apache/poi/ss/examples/LoanCalculator.java (-1 / +1 lines)
Lines 39-45 Link Here
39
    public static void main(String[] args) throws Exception {
39
    public static void main(String[] args) throws Exception {
40
        Workbook wb;
40
        Workbook wb;
41
41
42
        if(args.length > 0 && args[0].equals("-xls")) wb = new HSSFWorkbook();
42
        if(args.length > 0 && "-xls".equals(args[0])) wb = new HSSFWorkbook();
43
        else wb = new XSSFWorkbook();
43
        else wb = new XSSFWorkbook();
44
44
45
        Map<String, CellStyle> styles = createStyles(wb);
45
        Map<String, CellStyle> styles = createStyles(wb);
(-)src/examples/src/org/apache/poi/ss/examples/BusinessPlan.java (-1 / +1 lines)
Lines 81-87 Link Here
81
    public static void main(String[] args) throws Exception {
81
    public static void main(String[] args) throws Exception {
82
        Workbook wb;
82
        Workbook wb;
83
83
84
        if(args.length > 0 && args[0].equals("-xls")) wb = new HSSFWorkbook();
84
        if(args.length > 0 && "-xls".equals(args[0])) wb = new HSSFWorkbook();
85
        else wb = new XSSFWorkbook();
85
        else wb = new XSSFWorkbook();
86
86
87
        Map<String, CellStyle> styles = createStyles(wb);
87
        Map<String, CellStyle> styles = createStyles(wb);
(-)src/examples/src/org/apache/poi/ss/examples/TimesheetDemo.java (-1 / +1 lines)
Lines 47-53 Link Here
47
    public static void main(String[] args) throws Exception {
47
    public static void main(String[] args) throws Exception {
48
        Workbook wb;
48
        Workbook wb;
49
49
50
        if(args.length > 0 && args[0].equals("-xls")) wb = new HSSFWorkbook();
50
        if(args.length > 0 && "-xls".equals(args[0])) wb = new HSSFWorkbook();
51
        else wb = new XSSFWorkbook();
51
        else wb = new XSSFWorkbook();
52
52
53
        Map<String, CellStyle> styles = createStyles(wb);
53
        Map<String, CellStyle> styles = createStyles(wb);
(-)src/examples/src/org/apache/poi/ss/examples/CalendarDemo.java (-1 / +1 lines)
Lines 53-59 Link Here
53
        boolean xlsx = true;
53
        boolean xlsx = true;
54
        for (int i = 0; i < args.length; i++) {
54
        for (int i = 0; i < args.length; i++) {
55
            if(args[i].charAt(0) == '-'){
55
            if(args[i].charAt(0) == '-'){
56
                xlsx = args[i].equals("-xlsx");
56
                xlsx = "-xlsx".equals(args[i]);
57
            } else {
57
            } else {
58
              calendar.set(Calendar.YEAR, Integer.parseInt(args[i]));
58
              calendar.set(Calendar.YEAR, Integer.parseInt(args[i]));
59
            }
59
            }
(-)src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java (-2 / +2 lines)
Lines 314-325 Link Here
314
314
315
		// If we didn't have a good match or at least except a first empty element
315
		// If we didn't have a good match or at least except a first empty element
316
		if ((segmentsTheSame == 0 || segmentsTheSame == 1) &&
316
		if ((segmentsTheSame == 0 || segmentsTheSame == 1) &&
317
				segmentsSource[0].equals("") && segmentsTarget[0].equals("")) {
317
				"".equals(segmentsSource[0]) && "".equals(segmentsTarget[0])) {
318
			for (int i = 0; i < segmentsSource.length - 2; i++) {
318
			for (int i = 0; i < segmentsSource.length - 2; i++) {
319
				retVal.append("../");
319
				retVal.append("../");
320
			}
320
			}
321
			for (int i = 0; i < segmentsTarget.length; i++) {
321
			for (int i = 0; i < segmentsTarget.length; i++) {
322
				if (segmentsTarget[i].equals(""))
322
				if ("".equals(segmentsTarget[i]))
323
					continue;
323
					continue;
324
				retVal.append(segmentsTarget[i]);
324
				retVal.append(segmentsTarget[i]);
325
				if (i != segmentsTarget.length - 1)
325
				if (i != segmentsTarget.length - 1)
(-)src/ooxml/java/org/apache/poi/openxml4j/opc/PackagePartName.java (-1 / +1 lines)
Lines 239-245 Link Here
239
239
240
		// Split the URI into several part and analyze each
240
		// Split the URI into several part and analyze each
241
		String[] segments = partUri.toASCIIString().split("/");
241
		String[] segments = partUri.toASCIIString().split("/");
242
		if (segments.length <= 1 || !segments[0].equals(""))
242
		if (segments.length <= 1 || !"".equals(segments[0]))
243
			throw new InvalidFormatException(
243
			throw new InvalidFormatException(
244
					"A part name shall not have empty segments [M1.3]: "
244
					"A part name shall not have empty segments [M1.3]: "
245
							+ partUri.getPath());
245
							+ partUri.getPath());
(-)src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java (-2 / +2 lines)
Lines 543-549 Link Here
543
	 * Convert a strig value into a Nullable<String>
543
	 * Convert a strig value into a Nullable<String>
544
	 */
544
	 */
545
	private Nullable<String> setStringValue(String s) {
545
	private Nullable<String> setStringValue(String s) {
546
		if (s == null || s.equals("")) {
546
		if (s == null || "".equals(s)) {
547
			return new Nullable<String>();
547
			return new Nullable<String>();
548
		}
548
		}
549
		return new Nullable<String>(s);
549
		return new Nullable<String>(s);
Lines 556-562 Link Here
556
	 *             Throws if the date format isnot valid.
556
	 *             Throws if the date format isnot valid.
557
	 */
557
	 */
558
	private Nullable<Date> setDateValue(String s) throws InvalidFormatException {
558
	private Nullable<Date> setDateValue(String s) throws InvalidFormatException {
559
		if (s == null || s.equals("")) {
559
		if (s == null || "".equals(s)) {
560
			return new Nullable<Date>();
560
			return new Nullable<Date>();
561
		}
561
		}
562
		SimpleDateFormat df = new SimpleDateFormat(
562
		SimpleDateFormat df = new SimpleDateFormat(
(-)src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java (-1 / +1 lines)
Lines 682-688 Link Here
682
			throw new IllegalArgumentException("partName");
682
			throw new IllegalArgumentException("partName");
683
		}
683
		}
684
684
685
		if (contentType == null || contentType.equals("")) {
685
		if (contentType == null || "".equals(contentType)) {
686
			throw new IllegalArgumentException("contentType");
686
			throw new IllegalArgumentException("contentType");
687
		}
687
		}
688
688
(-)src/ooxml/java/org/apache/poi/openxml4j/opc/PackagePartCollection.java (-1 / +1 lines)
Lines 59-65 Link Here
59
				PackagingURIHelper.FORWARD_SLASH_STRING);
59
				PackagingURIHelper.FORWARD_SLASH_STRING);
60
		StringBuffer concatSeg = new StringBuffer();
60
		StringBuffer concatSeg = new StringBuffer();
61
		for (String seg : segments) {
61
		for (String seg : segments) {
62
			if (!seg.equals(""))
62
			if (!"".equals(seg))
63
				concatSeg.append(PackagingURIHelper.FORWARD_SLASH_CHAR);
63
				concatSeg.append(PackagingURIHelper.FORWARD_SLASH_CHAR);
64
			concatSeg.append(seg);
64
			concatSeg.append(seg);
65
			if (this.registerPartNameStr.contains(concatSeg.toString())) {
65
			if (this.registerPartNameStr.contains(concatSeg.toString())) {
(-)src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java (-2 / +2 lines)
Lines 393-399 Link Here
393
	
393
	
394
	private boolean isNamespaceDeclared(){
394
	private boolean isNamespaceDeclared(){
395
		String schemaNamespace = getNamespace();
395
		String schemaNamespace = getNamespace();
396
		return schemaNamespace!=null && !schemaNamespace.equals("");
396
		return schemaNamespace!=null && !"".equals(schemaNamespace);
397
	}
397
	}
398
	
398
	
399
	private String getNamespace(){
399
	private String getNamespace(){
Lines 505-511 Link Here
505
			}
505
			}
506
		}
506
		}
507
		// Note: we expect that all the complex types are defined at root level
507
		// Note: we expect that all the complex types are defined at root level
508
		if(!complexTypeName.equals("")){
508
		if(!"".equals(complexTypeName)){
509
			NodeList  complexTypeList  = xmlSchema.getChildNodes();
509
			NodeList  complexTypeList  = xmlSchema.getChildNodes();
510
			for(int i=0; i< complexTypeList.getLength();i++){
510
			for(int i=0; i< complexTypeList.getLength();i++){
511
				Node node = list.item(i);
511
				Node node = list.item(i);
(-)src/ooxml/java/org/apache/poi/xwpf/usermodel/Borders.java (-2 / +2 lines)
Lines 612-623 Link Here
612
    private static Map<Integer, Borders> imap = new HashMap<Integer, Borders>();
612
    private static Map<Integer, Borders> imap = new HashMap<Integer, Borders>();
613
    static {
613
    static {
614
        for (Borders p : values()) {
614
        for (Borders p : values()) {
615
            imap.put(new Integer(p.getValue()), p);
615
            imap.put(Integer.valueOf(p.getValue()), p);
616
        }
616
        }
617
    }
617
    }
618
618
619
    public static Borders valueOf(int type) {
619
    public static Borders valueOf(int type) {
620
        Borders pBorder = imap.get(new Integer(type));
620
        Borders pBorder = imap.get(Integer.valueOf(type));
621
        if (pBorder == null) {
621
        if (pBorder == null) {
622
            throw new IllegalArgumentException("Unknown paragraph border: " + type);
622
            throw new IllegalArgumentException("Unknown paragraph border: " + type);
623
        }
623
        }
(-)src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java (-1 / +1 lines)
Lines 381-387 Link Here
381
    		String parStyle = par.getStyle();
381
    		String parStyle = par.getStyle();
382
    		if (parStyle != null && parStyle.substring(0, 7).equals("Heading")) {
382
    		if (parStyle != null && parStyle.substring(0, 7).equals("Heading")) {
383
    			try {
383
    			try {
384
    				int level = new Integer(parStyle.substring("Heading".length()));
384
    				int level = Integer.valueOf(parStyle.substring("Heading".length()));
385
        			toc.addRow(level, par.getText(), 1, "112723803");
385
        			toc.addRow(level, par.getText(), 1, "112723803");
386
    			}
386
    			}
387
    			catch (NumberFormatException e) {
387
    			catch (NumberFormatException e) {
(-)src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java (-1 / +1 lines)
Lines 96-102 Link Here
96
		// page number run
96
		// page number run
97
		run = p.addNewR();
97
		run = p.addNewR();
98
		run.addNewRPr().addNewNoProof();
98
		run.addNewRPr().addNewNoProof();
99
		run.addNewT().set(new Integer(page).toString());
99
		run.addNewT().set(Integer.valueOf(page).toString());
100
		run = p.addNewR();
100
		run = p.addNewR();
101
		run.addNewRPr().addNewNoProof();
101
		run.addNewRPr().addNewNoProof();
102
		run.addNewFldChar().setFldCharType(STFldCharType.END);
102
		run.addNewFldChar().setFldCharType(STFldCharType.END);
(-)src/ooxml/java/org/apache/poi/POIXMLProperties.java (-1 / +1 lines)
Lines 252-258 Link Here
252
		}
252
		}
253
		public void setRevision(String revision) {
253
		public void setRevision(String revision) {
254
			try {
254
			try {
255
				new Long(revision);
255
				Long.valueOf(revision);
256
				part.setRevisionProperty(revision);
256
				part.setRevisionProperty(revision);
257
			}
257
			}
258
			catch (NumberFormatException e) {}
258
			catch (NumberFormatException e) {}
(-)src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePartName.java (-1 / +1 lines)
Lines 91-97 Link Here
91
			try {
91
			try {
92
				uri = new URI(s);
92
				uri = new URI(s);
93
			} catch (URISyntaxException e) {
93
			} catch (URISyntaxException e) {
94
				assertTrue(s.equals("[Content_Types].xml"));
94
				assertTrue("[Content_Types].xml".equals(s));
95
				continue;
95
				continue;
96
			}
96
			}
97
			assertFalse("This part name SHOULD NOT be valid: " + s,
97
			assertFalse("This part name SHOULD NOT be valid: " + s,
(-)src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java (-2 / +2 lines)
Lines 52-58 Link Here
52
			String xml = os.toString("UTF-8");
52
			String xml = os.toString("UTF-8");
53
53
54
			assertNotNull(xml);
54
			assertNotNull(xml);
55
			assertTrue(!xml.equals(""));
55
			assertTrue(!"".equals(xml));
56
56
57
			String docente = xml.split("<DOCENTE>")[1].split("</DOCENTE>")[0].trim();
57
			String docente = xml.split("<DOCENTE>")[1].split("</DOCENTE>")[0].trim();
58
			String nome = xml.split("<NOME>")[1].split("</NOME>")[0].trim();
58
			String nome = xml.split("<NOME>")[1].split("</NOME>")[0].trim();
Lines 95-101 Link Here
95
			String xml = os.toString("UTF-8");
95
			String xml = os.toString("UTF-8");
96
96
97
			assertNotNull(xml);
97
			assertNotNull(xml);
98
			assertTrue(!xml.equals(""));
98
			assertTrue(!"".equals(xml));
99
99
100
			String docente = xml.split("<DOCENTE>")[1].split("</DOCENTE>")[0].trim();
100
			String docente = xml.split("<DOCENTE>")[1].split("</DOCENTE>")[0].trim();
101
			String nome = xml.split("<NOME>")[1].split("</NOME>")[0].trim();
101
			String nome = xml.split("<NOME>")[1].split("</NOME>")[0].trim();
(-)src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java (-34 / +34 lines)
Lines 279-290 Link Here
279
     /* Insert some custom properties into the container. */
279
     /* Insert some custom properties into the container. */
280
     customProperties.put("Key1", "Value1");
280
     customProperties.put("Key1", "Value1");
281
     customProperties.put("Schl\u00fcssel2", "Wert2");
281
     customProperties.put("Schl\u00fcssel2", "Wert2");
282
     customProperties.put("Sample Integer", new Integer(12345));
282
     customProperties.put("Sample Integer", Integer.valueOf(12345));
283
     customProperties.put("Sample Boolean", new Boolean(true));
283
     customProperties.put("Sample Boolean", Boolean.valueOf(true));
284
     Date date=new Date();
284
     Date date=new Date();
285
     customProperties.put("Sample Date", date);
285
     customProperties.put("Sample Date", date);
286
     customProperties.put("Sample Double", new Double(-1.0001));
286
     customProperties.put("Sample Double", Double.valueOf(-1.0001));
287
     customProperties.put("Sample Negative Integer", new Integer(-100000));
287
     customProperties.put("Sample Negative Integer", Integer.valueOf(-100000));
288
288
289
     dsi.setCustomProperties(customProperties);
289
     dsi.setCustomProperties(customProperties);
290
290
Lines 320-336 Link Here
320
     String a2=(String) customProperties.get("Schl\u00fcssel2");
320
     String a2=(String) customProperties.get("Schl\u00fcssel2");
321
     assertEquals("Schl\u00fcssel2","Wert2",a2);
321
     assertEquals("Schl\u00fcssel2","Wert2",a2);
322
     Integer a3=(Integer) customProperties.get("Sample Integer");
322
     Integer a3=(Integer) customProperties.get("Sample Integer");
323
     assertEquals("Sample Number",new Integer(12345),a3);
323
     assertEquals("Sample Number",Integer.valueOf(12345),a3);
324
     Boolean a4=(Boolean) customProperties.get("Sample Boolean");
324
     Boolean a4=(Boolean) customProperties.get("Sample Boolean");
325
     assertEquals("Sample Boolean",new Boolean(true),a4);
325
     assertEquals("Sample Boolean",Boolean.valueOf(true),a4);
326
     Date a5=(Date) customProperties.get("Sample Date");
326
     Date a5=(Date) customProperties.get("Sample Date");
327
     assertEquals("Custom Date:",date,a5);
327
     assertEquals("Custom Date:",date,a5);
328
     
328
     
329
     Double a6=(Double) customProperties.get("Sample Double");
329
     Double a6=(Double) customProperties.get("Sample Double");
330
     assertEquals("Custom Float",new Double(-1.0001),a6);
330
     assertEquals("Custom Float",Double.valueOf(-1.0001),a6);
331
     
331
     
332
     Integer a7=(Integer) customProperties.get("Sample Negative Integer");
332
     Integer a7=(Integer) customProperties.get("Sample Negative Integer");
333
     assertEquals("Neg", new Integer(-100000),a7);
333
     assertEquals("Neg", Integer.valueOf(-100000),a7);
334
 }
334
 }
335
     
335
     
336
336
Lines 386-393 Link Here
386
    /* Insert some custom properties into the container. */
386
    /* Insert some custom properties into the container. */
387
    customProperties.put(k1, p1);
387
    customProperties.put(k1, p1);
388
    customProperties.put(k2, p2);
388
    customProperties.put(k2, p2);
389
    customProperties.put("Sample Number", new Integer(12345));
389
    customProperties.put("Sample Number", Integer.valueOf(12345));
390
    customProperties.put("Sample Boolean", new Boolean(true));
390
    customProperties.put("Sample Boolean", Boolean.valueOf(true));
391
    Date date=new Date();
391
    Date date=new Date();
392
    customProperties.put("Sample Date", date);
392
    customProperties.put("Sample Date", date);
393
393
Lines 425-433 Link Here
425
    String a2=(String) customProperties.get(k2);
425
    String a2=(String) customProperties.get(k2);
426
    assertEquals("Schl\u00fcssel2",p2,a2);
426
    assertEquals("Schl\u00fcssel2",p2,a2);
427
    Integer a3=(Integer) customProperties.get("Sample Number");
427
    Integer a3=(Integer) customProperties.get("Sample Number");
428
    assertEquals("Sample Number",new Integer(12345),a3);
428
    assertEquals("Sample Number",Integer.valueOf(12345),a3);
429
    Boolean a4=(Boolean) customProperties.get("Sample Boolean");
429
    Boolean a4=(Boolean) customProperties.get("Sample Boolean");
430
    assertEquals("Sample Boolean",new Boolean(true),a4);
430
    assertEquals("Sample Boolean",Boolean.valueOf(true),a4);
431
    Date a5=(Date) customProperties.get("Sample Date");
431
    Date a5=(Date) customProperties.get("Sample Date");
432
    assertEquals("Custom Date:",date,a5);
432
    assertEquals("Custom Date:",date,a5);
433
433
Lines 498-505 Link Here
498
   /* Insert some custom properties into the container. */
498
   /* Insert some custom properties into the container. */
499
   customProperties.put(k1, p1);
499
   customProperties.put(k1, p1);
500
   customProperties.put(k2, p2);
500
   customProperties.put(k2, p2);
501
   customProperties.put("Sample Number", new Integer(12345));
501
   customProperties.put("Sample Number", Integer.valueOf(12345));
502
   customProperties.put("Sample Boolean", new Boolean(false));
502
   customProperties.put("Sample Boolean", Boolean.valueOf(false));
503
   Date date=new Date(0);
503
   Date date=new Date(0);
504
   customProperties.put("Sample Date", date);
504
   customProperties.put("Sample Date", date);
505
505
Lines 538-546 Link Here
538
   String a2=(String) customProperties.get(k2);
538
   String a2=(String) customProperties.get(k2);
539
   assertEquals("Schl\u00fcssel2",p2,a2);
539
   assertEquals("Schl\u00fcssel2",p2,a2);
540
   Integer a3=(Integer) customProperties.get("Sample Number");
540
   Integer a3=(Integer) customProperties.get("Sample Number");
541
   assertEquals("Sample Number",new Integer(12345),a3);
541
   assertEquals("Sample Number",Integer.valueOf(12345),a3);
542
   Boolean a4=(Boolean) customProperties.get("Sample Boolean");
542
   Boolean a4=(Boolean) customProperties.get("Sample Boolean");
543
   assertEquals("Sample Boolean",new Boolean(false),a4);
543
   assertEquals("Sample Boolean",Boolean.valueOf(false),a4);
544
   Date a5=(Date) customProperties.get("Sample Date");
544
   Date a5=(Date) customProperties.get("Sample Date");
545
   assertEquals("Custom Date:",date,a5);
545
   assertEquals("Custom Date:",date,a5);
546
  
546
  
Lines 622-629 Link Here
622
	   /* Insert some custom properties into the container. */
622
	   /* Insert some custom properties into the container. */
623
	   customProperties.put(k1, p1);
623
	   customProperties.put(k1, p1);
624
	   customProperties.put(k2, p2);
624
	   customProperties.put(k2, p2);
625
	   customProperties.put("Sample Number", new Integer(12345));
625
	   customProperties.put("Sample Number", Integer.valueOf(12345));
626
	   customProperties.put("Sample Boolean", new Boolean(true));
626
	   customProperties.put("Sample Boolean", Boolean.valueOf(true));
627
	   Date date=new Date();
627
	   Date date=new Date();
628
	   customProperties.put("Sample Date", date);
628
	   customProperties.put("Sample Date", date);
629
629
Lines 662-670 Link Here
662
	   String a2=(String) customProperties.get(k2);
662
	   String a2=(String) customProperties.get(k2);
663
	   assertEquals("Schl\u00fcssel2",p2,a2);
663
	   assertEquals("Schl\u00fcssel2",p2,a2);
664
       Integer a3=(Integer) customProperties.get("Sample Number");
664
       Integer a3=(Integer) customProperties.get("Sample Number");
665
	   assertEquals("Sample Number",new Integer(12345),a3);
665
	   assertEquals("Sample Number",Integer.valueOf(12345),a3);
666
	   Boolean a4=(Boolean) customProperties.get("Sample Boolean");
666
	   Boolean a4=(Boolean) customProperties.get("Sample Boolean");
667
	   assertEquals("Sample Boolean",new Boolean(true),a4);
667
	   assertEquals("Sample Boolean",Boolean.valueOf(true),a4);
668
	   Date a5=(Date) customProperties.get("Sample Date");
668
	   Date a5=(Date) customProperties.get("Sample Date");
669
	   assertEquals("Custom Date:",date,a5);
669
	   assertEquals("Custom Date:",date,a5);
670
	  
670
	  
Lines 699-714 Link Here
699
      }
699
      }
700
      
700
      
701
      /* Insert some custom properties into the container. */
701
      /* Insert some custom properties into the container. */
702
      customProperties.put("int", new Integer(12345));
702
      customProperties.put("int", Integer.valueOf(12345));
703
      customProperties.put("negint", new Integer(-12345));
703
      customProperties.put("negint", Integer.valueOf(-12345));
704
      customProperties.put("long", new Long(12345));
704
      customProperties.put("long", Long.valueOf(12345));
705
      customProperties.put("neglong", new Long(-12345));
705
      customProperties.put("neglong", Long.valueOf(-12345));
706
      customProperties.put("boolean", new Boolean(true));
706
      customProperties.put("boolean", Boolean.valueOf(true));
707
      customProperties.put("string", "a String");
707
      customProperties.put("string", "a String");
708
      //customProperties.put("float", new Float(12345.0));  is not valid
708
      //customProperties.put("float", new Float(12345.0));  is not valid
709
      //customProperties.put("negfloat", new Float(-12345.1)); is not valid
709
      //customProperties.put("negfloat", new Float(-12345.1)); is not valid
710
      customProperties.put("double", new Double(12345.2));
710
      customProperties.put("double", Double.valueOf(12345.2));
711
      customProperties.put("negdouble", new Double(-12345.3));
711
      customProperties.put("negdouble", Double.valueOf(-12345.3));
712
      //customProperties.put("char", new Character('a')); is not valid
712
      //customProperties.put("char", new Character('a')); is not valid
713
      
713
      
714
      Date date=new Date();
714
      Date date=new Date();
Lines 745-772 Link Here
745
      /* Insert some custom properties into the container. */
745
      /* Insert some custom properties into the container. */
746
746
747
      Integer a3=(Integer) customProperties.get("int");
747
      Integer a3=(Integer) customProperties.get("int");
748
      assertEquals("int",new Integer(12345),a3);
748
      assertEquals("int",Integer.valueOf(12345),a3);
749
      
749
      
750
      a3=(Integer) customProperties.get("negint");
750
      a3=(Integer) customProperties.get("negint");
751
      assertEquals("negint",new Integer(-12345),a3);
751
      assertEquals("negint",Integer.valueOf(-12345),a3);
752
      
752
      
753
      Long al=(Long) customProperties.get("neglong");
753
      Long al=(Long) customProperties.get("neglong");
754
      assertEquals("neglong",new Long(-12345),al);
754
      assertEquals("neglong",Long.valueOf(-12345),al);
755
      
755
      
756
      al=(Long) customProperties.get("long");
756
      al=(Long) customProperties.get("long");
757
      assertEquals("long",new Long(12345),al);
757
      assertEquals("long",Long.valueOf(12345),al);
758
      
758
      
759
      Boolean a4=(Boolean) customProperties.get("boolean");
759
      Boolean a4=(Boolean) customProperties.get("boolean");
760
      assertEquals("boolean",new Boolean(true),a4);
760
      assertEquals("boolean",Boolean.valueOf(true),a4);
761
      
761
      
762
      Date a5=(Date) customProperties.get("date");
762
      Date a5=(Date) customProperties.get("date");
763
      assertEquals("Custom Date:",date,a5);
763
      assertEquals("Custom Date:",date,a5);
764
  
764
  
765
      Double d=(Double) customProperties.get("double");
765
      Double d=(Double) customProperties.get("double");
766
      assertEquals("int",new Double(12345.2),d);
766
      assertEquals("int",Double.valueOf(12345.2),d);
767
      
767
      
768
      d=(Double) customProperties.get("negdouble");
768
      d=(Double) customProperties.get("negdouble");
769
      assertEquals("string",new Double(-12345.3),d);
769
      assertEquals("string",Double.valueOf(-12345.3),d);
770
770
771
      String s=(String) customProperties.get("string");
771
      String s=(String) customProperties.get("string");
772
      assertEquals("sring","a String",s);
772
      assertEquals("sring","a String",s);
(-)src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java (-2 / +2 lines)
Lines 82-90 Link Here
82
        Assert.assertEquals(ps.getSectionCount(), 2);
82
        Assert.assertEquals(ps.getSectionCount(), 2);
83
        Section s = (Section) ps.getSections().get(1);
83
        Section s = (Section) ps.getSections().get(1);
84
        Assert.assertEquals(s.getProperty(1),
84
        Assert.assertEquals(s.getProperty(1),
85
                            new Integer(Constants.CP_UTF16));
85
                            Integer.valueOf(Constants.CP_UTF16));
86
        Assert.assertEquals(s.getProperty(2),
86
        Assert.assertEquals(s.getProperty(2),
87
                            new Integer(-96070278));
87
                            Integer.valueOf(-96070278));
88
        Assert.assertEquals(s.getProperty(3),
88
        Assert.assertEquals(s.getProperty(3),
89
                            "MCon_Info zu Office bei Schreiner");
89
                            "MCon_Info zu Office bei Schreiner");
90
        Assert.assertEquals(s.getProperty(4),
90
        Assert.assertEquals(s.getProperty(4),
(-)src/testcases/org/apache/poi/hpsf/basic/TestWrite.java (-22 / +22 lines)
Lines 375-382 Link Here
375
        try
375
        try
376
        {
376
        {
377
            check(Variant.VT_EMPTY, null, codepage);
377
            check(Variant.VT_EMPTY, null, codepage);
378
            check(Variant.VT_BOOL, new Boolean(true), codepage);
378
            check(Variant.VT_BOOL, Boolean.valueOf(true), codepage);
379
            check(Variant.VT_BOOL, new Boolean(false), codepage);
379
            check(Variant.VT_BOOL, Boolean.valueOf(false), codepage);
380
            check(Variant.VT_CF, new byte[]{0}, codepage);
380
            check(Variant.VT_CF, new byte[]{0}, codepage);
381
            check(Variant.VT_CF, new byte[]{0, 1}, codepage);
381
            check(Variant.VT_CF, new byte[]{0, 1}, codepage);
382
            check(Variant.VT_CF, new byte[]{0, 1, 2}, codepage);
382
            check(Variant.VT_CF, new byte[]{0, 1, 2}, codepage);
Lines 385-403 Link Here
385
            check(Variant.VT_CF, new byte[]{0, 1, 2, 3, 4, 5}, codepage);
385
            check(Variant.VT_CF, new byte[]{0, 1, 2, 3, 4, 5}, codepage);
386
            check(Variant.VT_CF, new byte[]{0, 1, 2, 3, 4, 5, 6}, codepage);
386
            check(Variant.VT_CF, new byte[]{0, 1, 2, 3, 4, 5, 6}, codepage);
387
            check(Variant.VT_CF, new byte[]{0, 1, 2, 3, 4, 5, 6, 7}, codepage);
387
            check(Variant.VT_CF, new byte[]{0, 1, 2, 3, 4, 5, 6, 7}, codepage);
388
            check(Variant.VT_I4, new Integer(27), codepage);
388
            check(Variant.VT_I4, Integer.valueOf(27), codepage);
389
            check(Variant.VT_I8, new Long(28), codepage);
389
            check(Variant.VT_I8, Long.valueOf(28), codepage);
390
            check(Variant.VT_R8, new Double(29.0), codepage);
390
            check(Variant.VT_R8, Double.valueOf(29.0), codepage);
391
            check(Variant.VT_I4, new Integer(-27), codepage);
391
            check(Variant.VT_I4, Integer.valueOf(-27), codepage);
392
            check(Variant.VT_I8, new Long(-28), codepage);
392
            check(Variant.VT_I8, Long.valueOf(-28), codepage);
393
            check(Variant.VT_R8, new Double(-29.0), codepage);
393
            check(Variant.VT_R8, Double.valueOf(-29.0), codepage);
394
            check(Variant.VT_FILETIME, new Date(), codepage);
394
            check(Variant.VT_FILETIME, new Date(), codepage);
395
            check(Variant.VT_I4, new Integer(Integer.MAX_VALUE), codepage);
395
            check(Variant.VT_I4, Integer.valueOf(Integer.MAX_VALUE), codepage);
396
            check(Variant.VT_I4, new Integer(Integer.MIN_VALUE), codepage);
396
            check(Variant.VT_I4, Integer.valueOf(Integer.MIN_VALUE), codepage);
397
            check(Variant.VT_I8, new Long(Long.MAX_VALUE), codepage);
397
            check(Variant.VT_I8, Long.valueOf(Long.MAX_VALUE), codepage);
398
            check(Variant.VT_I8, new Long(Long.MIN_VALUE), codepage);
398
            check(Variant.VT_I8, Long.valueOf(Long.MIN_VALUE), codepage);
399
            check(Variant.VT_R8, new Double(Double.MAX_VALUE), codepage);
399
            check(Variant.VT_R8, Double.valueOf(Double.MAX_VALUE), codepage);
400
            check(Variant.VT_R8, new Double(Double.MIN_VALUE), codepage);
400
            check(Variant.VT_R8, Double.valueOf(Double.MIN_VALUE), codepage);
401
401
402
            check(Variant.VT_LPSTR,
402
            check(Variant.VT_LPSTR,
403
                  "", codepage);
403
                  "", codepage);
Lines 761-774 Link Here
761
            final MutablePropertySet ps1 = new MutablePropertySet();
761
            final MutablePropertySet ps1 = new MutablePropertySet();
762
            final MutableSection s = (MutableSection) ps1.getSections().get(0);
762
            final MutableSection s = (MutableSection) ps1.getSections().get(0);
763
            final Map m = new HashMap(3, 1.0f);
763
            final Map m = new HashMap(3, 1.0f);
764
            m.put(new Long(1), "String 1");
764
            m.put(Long.valueOf(1), "String 1");
765
            m.put(new Long(2), "String 2");
765
            m.put(Long.valueOf(2), "String 2");
766
            m.put(new Long(3), "String 3");
766
            m.put(Long.valueOf(3), "String 3");
767
            s.setDictionary(m);
767
            s.setDictionary(m);
768
            s.setFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[0]);
768
            s.setFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[0]);
769
            int codepage = Constants.CP_UNICODE;
769
            int codepage = Constants.CP_UNICODE;
770
            s.setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2,
770
            s.setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2,
771
                          new Integer(codepage));
771
                          Integer.valueOf(codepage));
772
            poiFs.createDocument(ps1.toInputStream(), "Test");
772
            poiFs.createDocument(ps1.toInputStream(), "Test");
773
            poiFs.writeFilesystem(out);
773
            poiFs.writeFilesystem(out);
774
            out.close();
774
            out.close();
Lines 813-826 Link Here
813
            final MutablePropertySet ps1 = new MutablePropertySet();
813
            final MutablePropertySet ps1 = new MutablePropertySet();
814
            final MutableSection s = (MutableSection) ps1.getSections().get(0);
814
            final MutableSection s = (MutableSection) ps1.getSections().get(0);
815
            final Map m = new HashMap(3, 1.0f);
815
            final Map m = new HashMap(3, 1.0f);
816
            m.put(new Long(1), "String 1");
816
            m.put(Long.valueOf(1), "String 1");
817
            m.put(new Long(2), "String 2");
817
            m.put(Long.valueOf(2), "String 2");
818
            m.put(new Long(3), "String 3");
818
            m.put(Long.valueOf(3), "String 3");
819
            s.setDictionary(m);
819
            s.setDictionary(m);
820
            s.setFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[0]);
820
            s.setFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[0]);
821
            int codepage = 12345;
821
            int codepage = 12345;
822
            s.setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2,
822
            s.setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2,
823
                          new Integer(codepage));
823
                          Integer.valueOf(codepage));
824
            poiFs.createDocument(ps1.toInputStream(), "Test");
824
            poiFs.createDocument(ps1.toInputStream(), "Test");
825
            poiFs.writeFilesystem(out);
825
            poiFs.writeFilesystem(out);
826
            out.close();
826
            out.close();
(-)src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java (-12 / +12 lines)
Lines 283-301 Link Here
283
        final int     P_SLIDE_COUNT = ++nr;
283
        final int     P_SLIDE_COUNT = ++nr;
284
        final Date    now = new Date();
284
        final Date    now = new Date();
285
285
286
        final Integer POSITIVE_INTEGER = new Integer(2222);
286
        final Integer POSITIVE_INTEGER = Integer.valueOf(2222);
287
        final Long POSITIVE_LONG = new  Long(3333);
287
        final Long POSITIVE_LONG = new  Long(3333);
288
        final Double POSITIVE_DOUBLE = new  Double(4444);
288
        final Double POSITIVE_DOUBLE = new  Double(4444);
289
        final Integer NEGATIVE_INTEGER = new Integer(2222);
289
        final Integer NEGATIVE_INTEGER = Integer.valueOf(2222);
290
        final Long NEGATIVE_LONG = new  Long(3333);
290
        final Long NEGATIVE_LONG = new  Long(3333);
291
        final Double NEGATIVE_DOUBLE = new  Double(4444);
291
        final Double NEGATIVE_DOUBLE = new  Double(4444);
292
292
293
        final Integer MAX_INTEGER = new Integer(Integer.MAX_VALUE);
293
        final Integer MAX_INTEGER = Integer.valueOf(Integer.MAX_VALUE);
294
        final Integer MIN_INTEGER = new Integer(Integer.MIN_VALUE);
294
        final Integer MIN_INTEGER = Integer.valueOf(Integer.MIN_VALUE);
295
        final Long MAX_LONG = new Long(Long.MAX_VALUE);
295
        final Long MAX_LONG = Long.valueOf(Long.MAX_VALUE);
296
        final Long MIN_LONG = new Long(Long.MIN_VALUE);
296
        final Long MIN_LONG = Long.valueOf(Long.MIN_VALUE);
297
        final Double MAX_DOUBLE = new Double(Double.MAX_VALUE);
297
        final Double MAX_DOUBLE = Double.valueOf(Double.MAX_VALUE);
298
        final Double MIN_DOUBLE = new Double(Double.MIN_VALUE);
298
        final Double MIN_DOUBLE = Double.valueOf(Double.MIN_VALUE);
299
        
299
        
300
        si.setApplicationName(P_APPLICATION_NAME);
300
        si.setApplicationName(P_APPLICATION_NAME);
301
        si.setAuthor(P_AUTHOR);
301
        si.setAuthor(P_AUTHOR);
Lines 345-351 Link Here
345
        customProperties.put("negative_Integer", NEGATIVE_INTEGER);
345
        customProperties.put("negative_Integer", NEGATIVE_INTEGER);
346
        customProperties.put("negative_Long", NEGATIVE_LONG);
346
        customProperties.put("negative_Long", NEGATIVE_LONG);
347
        customProperties.put("negative_Double", NEGATIVE_DOUBLE);
347
        customProperties.put("negative_Double", NEGATIVE_DOUBLE);
348
        customProperties.put("Boolean", new Boolean(true));
348
        customProperties.put("Boolean", Boolean.valueOf(true));
349
        customProperties.put("Date", now);
349
        customProperties.put("Date", now);
350
        customProperties.put("max_Integer", MAX_INTEGER);
350
        customProperties.put("max_Integer", MAX_INTEGER);
351
        customProperties.put("min_Integer", MIN_INTEGER);
351
        customProperties.put("min_Integer", MIN_INTEGER);
Lines 434-440 Link Here
434
        assertEquals(NEGATIVE_INTEGER, cps.get("negative_Integer"));
434
        assertEquals(NEGATIVE_INTEGER, cps.get("negative_Integer"));
435
        assertEquals(NEGATIVE_LONG, cps.get("negative_Long"));
435
        assertEquals(NEGATIVE_LONG, cps.get("negative_Long"));
436
        assertEquals(NEGATIVE_DOUBLE, cps.get("negative_Double"));
436
        assertEquals(NEGATIVE_DOUBLE, cps.get("negative_Double"));
437
        assertEquals(new Boolean(true), cps.get("Boolean"));
437
        assertEquals(Boolean.valueOf(true), cps.get("Boolean"));
438
        assertEquals(now, cps.get("Date"));
438
        assertEquals(now, cps.get("Date"));
439
        assertEquals(MAX_INTEGER, cps.get("max_Integer"));
439
        assertEquals(MAX_INTEGER, cps.get("max_Integer"));
440
        assertEquals(MIN_INTEGER, cps.get("min_Integer"));
440
        assertEquals(MIN_INTEGER, cps.get("min_Integer"));
Lines 715-721 Link Here
715
        p.setType(Variant.VT_LPWSTR);
715
        p.setType(Variant.VT_LPWSTR);
716
        p.setValue(VALUE_1);
716
        p.setValue(VALUE_1);
717
        s.setProperty(p);
717
        s.setProperty(p);
718
        dictionary.put(new Long(ID_1), NAME_1);
718
        dictionary.put(Long.valueOf(ID_1), NAME_1);
719
        s.setDictionary(dictionary);
719
        s.setDictionary(dictionary);
720
        cps = dsi.getCustomProperties();
720
        cps = dsi.getCustomProperties();
721
        assertEquals(1, cps.size());
721
        assertEquals(1, cps.size());
Lines 723-729 Link Here
723
723
724
        /* Add another custom property. */
724
        /* Add another custom property. */
725
        s.setProperty(ID_2, Variant.VT_LPWSTR, VALUE_1);
725
        s.setProperty(ID_2, Variant.VT_LPWSTR, VALUE_1);
726
        dictionary.put(new Long(ID_2), NAME_1);
726
        dictionary.put(Long.valueOf(ID_2), NAME_1);
727
        s.setDictionary(dictionary);
727
        s.setDictionary(dictionary);
728
        cps = dsi.getCustomProperties();
728
        cps = dsi.getCustomProperties();
729
        assertEquals(1, cps.size());
729
        assertEquals(1, cps.size());
(-)src/testcases/org/apache/poi/hssf/usermodel/TestBug42464.java (-1 / +1 lines)
Lines 67-73 Link Here
67
			Ptg[] ptgs = r.getParsedExpression();
67
			Ptg[] ptgs = r.getParsedExpression();
68
68
69
			String cellRef = new CellReference(row.getRowNum(), cell.getColumnIndex(), false, false).formatAsString();
69
			String cellRef = new CellReference(row.getRowNum(), cell.getColumnIndex(), false, false).formatAsString();
70
			if(false && cellRef.equals("BP24")) { // TODO - replace System.out.println()s with asserts
70
			if(false && "BP24".equals(cellRef)) { // TODO - replace System.out.println()s with asserts
71
				System.out.print(cellRef);
71
				System.out.print(cellRef);
72
				System.out.println(" - has " + ptgs.length + " ptgs:");
72
				System.out.println(" - has " + ptgs.length + " ptgs:");
73
				for(int i=0; i<ptgs.length; i++) {
73
				for(int i=0; i<ptgs.length; i++) {
(-)src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPictureData.java (-2 / +2 lines)
Lines 50-63 Link Here
50
            HSSFPictureData pict = (HSSFPictureData)it.next();
50
            HSSFPictureData pict = (HSSFPictureData)it.next();
51
            String ext = pict.suggestFileExtension();
51
            String ext = pict.suggestFileExtension();
52
            byte[] data = pict.getData();
52
            byte[] data = pict.getData();
53
            if (ext.equals("jpeg")){
53
            if ("jpeg".equals(ext)){
54
                //try to read image data using javax.imageio.* (JDK 1.4+)
54
                //try to read image data using javax.imageio.* (JDK 1.4+)
55
                BufferedImage jpg = ImageIO.read(new ByteArrayInputStream(data));
55
                BufferedImage jpg = ImageIO.read(new ByteArrayInputStream(data));
56
                assertNotNull(jpg);
56
                assertNotNull(jpg);
57
                assertEquals(192, jpg.getWidth());
57
                assertEquals(192, jpg.getWidth());
58
                assertEquals(176, jpg.getHeight());
58
                assertEquals(176, jpg.getHeight());
59
                assertEquals(HSSFWorkbook.PICTURE_TYPE_JPEG, pict.getFormat());
59
                assertEquals(HSSFWorkbook.PICTURE_TYPE_JPEG, pict.getFormat());
60
            } else if (ext.equals("png")){
60
            } else if ("png".equals(ext)){
61
                //try to read image data using javax.imageio.* (JDK 1.4+)
61
                //try to read image data using javax.imageio.* (JDK 1.4+)
62
                BufferedImage png = ImageIO.read(new ByteArrayInputStream(data));
62
                BufferedImage png = ImageIO.read(new ByteArrayInputStream(data));
63
                assertNotNull(png);
63
                assertNotNull(png);
(-)src/testcases/org/apache/poi/hssf/usermodel/StreamUtility.java (-1 / +1 lines)
Lines 97-103 Link Here
97
				return new int[] { -1, offset, };
97
				return new int[] { -1, offset, };
98
			}
98
			}
99
			if (b != b2 && !isIgnoredRegion(allowableDifferenceRegions, offset)) {
99
			if (b != b2 && !isIgnoredRegion(allowableDifferenceRegions, offset)) {
100
				temp.add(new Integer(offset));
100
				temp.add(Integer.valueOf(offset));
101
			}
101
			}
102
			offset++;
102
			offset++;
103
		}
103
		}
(-)src/testcases/org/apache/poi/hssf/record/constant/TestConstantValueParser.java (-1 / +1 lines)
Lines 34-40 Link Here
34
	private static final Object[] SAMPLE_VALUES = {
34
	private static final Object[] SAMPLE_VALUES = {
35
			Boolean.TRUE,
35
			Boolean.TRUE,
36
			null,
36
			null,
37
			new Double(1.1),
37
			Double.valueOf(1.1),
38
			"Sample text",
38
			"Sample text",
39
			ErrorConstant.valueOf(HSSFErrorConstants.ERROR_DIV_0),
39
			ErrorConstant.valueOf(HSSFErrorConstants.ERROR_DIV_0),
40
		};
40
		};
(-)src/testcases/org/apache/poi/hssf/record/formula/function/ExcelFileFormatDocFunctionExtractor.java (-3 / +3 lines)
Lines 169-175 Link Here
169
				String returnClass, String paramClasses, String volatileFlagStr) {
169
				String returnClass, String paramClasses, String volatileFlagStr) {
170
			boolean isVolatile = volatileFlagStr.length() > 0;
170
			boolean isVolatile = volatileFlagStr.length() > 0;
171
			
171
			
172
			Integer funcIxKey = new Integer(funcIx);
172
			Integer funcIxKey = Integer.valueOf(funcIx);
173
			if(!_groupFunctionIndexes.add(funcIxKey)) {
173
			if(!_groupFunctionIndexes.add(funcIxKey)) {
174
				throw new RuntimeException("Duplicate function index (" + funcIx + ")");
174
				throw new RuntimeException("Duplicate function index (" + funcIx + ")");
175
			}
175
			}
Lines 207-213 Link Here
207
					throw new RuntimeException("changing function '" 
207
					throw new RuntimeException("changing function '" 
208
							+ funcName + "' definition without foot-note");
208
							+ funcName + "' definition without foot-note");
209
				}
209
				}
210
				_allFunctionsByIndex.remove(new Integer(fdPrev.getIndex()));
210
				_allFunctionsByIndex.remove(Integer.valueOf(fdPrev.getIndex()));
211
			}
211
			}
212
		}
212
		}
213
213
Lines 364-370 Link Here
364
			_elemNameStack.add(name);
364
			_elemNameStack.add(name);
365
			if(matchesTargetPath()) {
365
			if(matchesTargetPath()) {
366
				String tableName = atts.getValue("table:name");
366
				String tableName = atts.getValue("table:name");
367
				if(tableName.startsWith("tab_fml_func") && !tableName.equals("tab_fml_func0")) {
367
				if(tableName.startsWith("tab_fml_func") && !"tab_fml_func0".equals(tableName)) {
368
					_isInsideTable = true;
368
					_isInsideTable = true;
369
				}
369
				}
370
				return;
370
				return;
(-)src/testcases/org/apache/poi/hssf/record/formula/functions/TestStatsLib.java (-1 / +1 lines)
Lines 214-220 Link Here
214
        confirmMode(v, 0.0);
214
        confirmMode(v, 0.0);
215
    }
215
    }
216
    private static void confirmMode(double[] v, double expectedResult) {
216
    private static void confirmMode(double[] v, double expectedResult) {
217
    	confirmMode(v, new Double(expectedResult));
217
    	confirmMode(v, Double.valueOf(expectedResult));
218
    }
218
    }
219
    private static void confirmMode(double[] v, Double expectedResult) {
219
    private static void confirmMode(double[] v, Double expectedResult) {
220
    	double actual;
220
    	double actual;
(-)src/testcases/org/apache/poi/hssf/record/formula/TestArrayPtg.java (-1 / +1 lines)
Lines 65-71 Link Here
65
65
66
		assertEquals(Boolean.TRUE, values[0][0]);
66
		assertEquals(Boolean.TRUE, values[0][0]);
67
		assertEquals("ABCD", values[0][1]);
67
		assertEquals("ABCD", values[0][1]);
68
		assertEquals(new Double(0), values[1][0]);
68
		assertEquals(Double.valueOf(0), values[1][0]);
69
		assertEquals(Boolean.FALSE, values[1][1]);
69
		assertEquals(Boolean.FALSE, values[1][1]);
70
		assertEquals("FG", values[1][2]);
70
		assertEquals("FG", values[1][2]);
71
71
(-)src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java (-3 / +3 lines)
Lines 241-256 Link Here
241
		String cellFormula;
241
		String cellFormula;
242
		cellFormula = getFormulaFromFirstCell(s, 0); // row "1"
242
		cellFormula = getFormulaFromFirstCell(s, 0); // row "1"
243
		// the problem is not observable in the first row of the shared formula
243
		// the problem is not observable in the first row of the shared formula
244
		if(!cellFormula.equals("\"first formula\"")) {
244
		if(!"\"first formula\"".equals(cellFormula)) {
245
			throw new RuntimeException("Something else wrong with this test case");
245
			throw new RuntimeException("Something else wrong with this test case");
246
		}
246
		}
247
247
248
		// but the problem is observable in rows 2,3,4
248
		// but the problem is observable in rows 2,3,4
249
		cellFormula = getFormulaFromFirstCell(s, 1); // row "2"
249
		cellFormula = getFormulaFromFirstCell(s, 1); // row "2"
250
		if(cellFormula.equals("\"second formula\"")) {
250
		if("\"second formula\"".equals(cellFormula)) {
251
			throw new AssertionFailedError("found bug 44449 (Wrong SharedFormulaRecord was used).");
251
			throw new AssertionFailedError("found bug 44449 (Wrong SharedFormulaRecord was used).");
252
		}
252
		}
253
		if(!cellFormula.equals("\"first formula\"")) {
253
		if(!"\"first formula\"".equals(cellFormula)) {
254
			throw new RuntimeException("Something else wrong with this test case");
254
			throw new RuntimeException("Something else wrong with this test case");
255
		}
255
		}
256
	}
256
	}
(-)src/testcases/org/apache/poi/ss/usermodel/BaseTestDataFormat.java (-1 / +1 lines)
Lines 40-46 Link Here
40
40
41
        Map<Integer, String> formats = BuiltinFormats.getBuiltinFormats();
41
        Map<Integer, String> formats = BuiltinFormats.getBuiltinFormats();
42
        for (int idx : formats.keySet()) {
42
        for (int idx : formats.keySet()) {
43
            String fmt = formats.get(new Integer(idx));
43
            String fmt = formats.get(Integer.valueOf(idx));
44
            assertEquals(idx, df.getFormat(fmt));
44
            assertEquals(idx, df.getFormat(fmt));
45
        }
45
        }
46
46
(-)src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java (-1 / +1 lines)
Lines 63-69 Link Here
63
		public void addTestRow(long rawBits, String expectedExcelRendering) {
63
		public void addTestRow(long rawBits, String expectedExcelRendering) {
64
			writeDataRow(_sheet, _rowIndex++, rawBits, expectedExcelRendering);
64
			writeDataRow(_sheet, _rowIndex++, rawBits, expectedExcelRendering);
65
			if(Double.isNaN(Double.longBitsToDouble(rawBits))) {
65
			if(Double.isNaN(Double.longBitsToDouble(rawBits))) {
66
				_replacementNaNs.add(new Long(rawBits));
66
				_replacementNaNs.add(Long.valueOf(rawBits));
67
			}
67
			}
68
		}
68
		}
69
69
(-)src/testcases/org/apache/poi/util/LocalTestNode.java (-1 / +1 lines)
Lines 33-39 Link Here
33
33
34
    LocalTestNode(final int key)
34
    LocalTestNode(final int key)
35
    {
35
    {
36
        _key   = new Integer(key);
36
        _key   = Integer.valueOf(key);
37
        _value = String.valueOf(key);
37
        _value = String.valueOf(key);
38
    }
38
    }
39
39
(-)src/testcases/org/apache/poi/util/TestStringUtil.java (-6 / +6 lines)
Lines 132-163 Link Here
132
        assertEquals( "This is a test " + fmt( 1.2345, 2, 2 ),
132
        assertEquals( "This is a test " + fmt( 1.2345, 2, 2 ),
133
                StringUtil.format( "This is a test %2.2", new Object[]
133
                StringUtil.format( "This is a test %2.2", new Object[]
134
                {
134
                {
135
                    new Double( 1.2345 )
135
                    Double.valueOf( 1.2345 )
136
                } ) );
136
                } ) );
137
        assertEquals( "This is a test " + fmt( 1.2345, -1, 3 ),
137
        assertEquals( "This is a test " + fmt( 1.2345, -1, 3 ),
138
                StringUtil.format( "This is a test %.3", new Object[]
138
                StringUtil.format( "This is a test %.3", new Object[]
139
                {
139
                {
140
                    new Double( 1.2345 )
140
                    Double.valueOf( 1.2345 )
141
                } ) );
141
                } ) );
142
        assertEquals( "This is a great test " + fmt( 1.2345, -1, 3 ),
142
        assertEquals( "This is a great test " + fmt( 1.2345, -1, 3 ),
143
                StringUtil.format( "This is a % test %.3", new Object[]
143
                StringUtil.format( "This is a % test %.3", new Object[]
144
                {
144
                {
145
                    "great", new Double( 1.2345 )
145
                    "great", Double.valueOf( 1.2345 )
146
                } ) );
146
                } ) );
147
        assertEquals( "This is a test 1",
147
        assertEquals( "This is a test 1",
148
                StringUtil.format( "This is a test %", new Object[]
148
                StringUtil.format( "This is a test %", new Object[]
149
                {
149
                {
150
                    new Integer( 1 )
150
                    Integer.valueOf( 1 )
151
                } ) );
151
                } ) );
152
        assertEquals( "This is a test 1",
152
        assertEquals( "This is a test 1",
153
                StringUtil.format( "This is a test %", new Object[]
153
                StringUtil.format( "This is a test %", new Object[]
154
                {
154
                {
155
                    new Integer( 1 ), new Integer( 1 )
155
                    Integer.valueOf( 1 ), Integer.valueOf( 1 )
156
                } ) );
156
                } ) );
157
        assertEquals( "This is a test 1.x",
157
        assertEquals( "This is a test 1.x",
158
                StringUtil.format( "This is a test %1.x", new Object[]
158
                StringUtil.format( "This is a test %1.x", new Object[]
159
                {
159
                {
160
                    new Integer( 1 )
160
                    Integer.valueOf( 1 )
161
                } ) );
161
                } ) );
162
        assertEquals( "This is a test ?missing data?1.x",
162
        assertEquals( "This is a test ?missing data?1.x",
163
                StringUtil.format( "This is a test %1.x", new Object[]
163
                StringUtil.format( "This is a test %1.x", new Object[]
(-)src/testcases/org/apache/poi/util/TestBinaryTree.java (-12 / +12 lines)
Lines 120-126 Link Here
120
            m.put(nodes[ k ].getKey(), nodes[ k ]);
120
            m.put(nodes[ k ].getKey(), nodes[ k ]);
121
            assertTrue(m.containsKey(nodes[ k ].getKey()));
121
            assertTrue(m.containsKey(nodes[ k ].getKey()));
122
        }
122
        }
123
        assertTrue(!m.containsKey(new Integer(-1)));
123
        assertTrue(!m.containsKey(Integer.valueOf(-1)));
124
        try
124
        try
125
        {
125
        {
126
            m.containsKey("foo");
126
            m.containsKey("foo");
Lines 179-185 Link Here
179
            m.put(nodes[ k ].getKey(), nodes[ k ]);
179
            m.put(nodes[ k ].getKey(), nodes[ k ]);
180
            assertSame(m.get(nodes[ k ].getKey()), nodes[ k ]);
180
            assertSame(m.get(nodes[ k ].getKey()), nodes[ k ]);
181
        }
181
        }
182
        assertNull(m.get(new Integer(-1)));
182
        assertNull(m.get(Integer.valueOf(-1)));
183
        try
183
        try
184
        {
184
        {
185
            m.get("foo");
185
            m.get("foo");
Lines 270-276 Link Here
270
        catch (ClassCastException ignored)
270
        catch (ClassCastException ignored)
271
        {
271
        {
272
        }
272
        }
273
        assertNull(m.remove(new Integer(-1)));
273
        assertNull(m.remove(Integer.valueOf(-1)));
274
        try
274
        try
275
        {
275
        {
276
            m.remove("foo");
276
            m.remove("foo");
Lines 450-456 Link Here
450
        Collection c1 = new LinkedList();
450
        Collection c1 = new LinkedList();
451
        Collection c2 = new LinkedList();
451
        Collection c2 = new LinkedList();
452
452
453
        c2.add(new Integer(-99));
453
        c2.add(Integer.valueOf(-99));
454
        for (int k = 0; k < nodes.length; k++)
454
        for (int k = 0; k < nodes.length; k++)
455
        {
455
        {
456
            m.put(nodes[ k ].getKey(), nodes[ k ]);
456
            m.put(nodes[ k ].getKey(), nodes[ k ]);
Lines 461-467 Link Here
461
        assertTrue(!m.keySet().containsAll(c2));
461
        assertTrue(!m.keySet().containsAll(c2));
462
        m  = new BinaryTree();
462
        m  = new BinaryTree();
463
        c1 = new LinkedList();
463
        c1 = new LinkedList();
464
        c1.add(new Integer(-55));
464
        c1.add(Integer.valueOf(-55));
465
        try
465
        try
466
        {
466
        {
467
            m.keySet().addAll(c1);
467
            m.keySet().addAll(c1);
Lines 869-875 Link Here
869
        }
869
        }
870
870
871
        // reject incompatible values
871
        // reject incompatible values
872
        m2.put("2", new Integer(2));
872
        m2.put("2", Integer.valueOf(2));
873
        try
873
        try
874
        {
874
        {
875
            m = new BinaryTree(m2);
875
            m = new BinaryTree(m2);
Lines 881-887 Link Here
881
881
882
        // reject incompatible keys
882
        // reject incompatible keys
883
        m2.remove("2");
883
        m2.remove("2");
884
        m2.put(new Integer(2), "bad key");
884
        m2.put(Integer.valueOf(2), "bad key");
885
        try
885
        try
886
        {
886
        {
887
            m = new BinaryTree(m2);
887
            m = new BinaryTree(m2);
Lines 973-979 Link Here
973
        catch (ClassCastException ignored)
973
        catch (ClassCastException ignored)
974
        {
974
        {
975
        }
975
        }
976
        assertNull(m.remove(new Integer(-1)));
976
        assertNull(m.remove(Integer.valueOf(-1)));
977
        try
977
        try
978
        {
978
        {
979
            m.removeValue("foo");
979
            m.removeValue("foo");
Lines 1135-1141 Link Here
1135
        Collection c1 = new LinkedList();
1135
        Collection c1 = new LinkedList();
1136
        Collection c2 = new LinkedList();
1136
        Collection c2 = new LinkedList();
1137
1137
1138
        c2.add(new Integer(-99));
1138
        c2.add(Integer.valueOf(-99));
1139
        for (int k = 0; k < nodes.length; k++)
1139
        for (int k = 0; k < nodes.length; k++)
1140
        {
1140
        {
1141
            m.put(nodes[ k ].getKey(), nodes[ k ]);
1141
            m.put(nodes[ k ].getKey(), nodes[ k ]);
Lines 1146-1152 Link Here
1146
        assertTrue(!m.keySetByValue().containsAll(c2));
1146
        assertTrue(!m.keySetByValue().containsAll(c2));
1147
        m  = new BinaryTree();
1147
        m  = new BinaryTree();
1148
        c1 = new LinkedList();
1148
        c1 = new LinkedList();
1149
        c1.add(new Integer(-55));
1149
        c1.add(Integer.valueOf(-55));
1150
        try
1150
        try
1151
        {
1151
        {
1152
            m.keySetByValue().addAll(c1);
1152
            m.keySetByValue().addAll(c1);
Lines 1390-1396 Link Here
1390
        }
1390
        }
1391
        for (int k = 0; k < m.size(); k++)
1391
        for (int k = 0; k < m.size(); k++)
1392
        {
1392
        {
1393
            assertTrue(s.contains(new Integer(k)));
1393
            assertTrue(s.contains(Integer.valueOf(k)));
1394
        }
1394
        }
1395
        int count = 0;
1395
        int count = 0;
1396
1396
Lines 1616-1622 Link Here
1616
        }
1616
        }
1617
        for (int k = 0; k < m.size(); k++)
1617
        for (int k = 0; k < m.size(); k++)
1618
        {
1618
        {
1619
            assertTrue(s.contains(new Integer(k)));
1619
            assertTrue(s.contains(Integer.valueOf(k)));
1620
        }
1620
        }
1621
        int count = 0;
1621
        int count = 0;
1622
1622
(-)src/testcases/org/apache/poi/util/TestArrayUtil.java (-140 / +140 lines)
Lines 51-66 Link Here
51
	 */
51
	 */
52
	private Integer[] getIntsList() { 
52
	private Integer[] getIntsList() { 
53
		return new Integer[] {
53
		return new Integer[] {
54
				new Integer(0),
54
				Integer.valueOf(0),
55
				new Integer(1),
55
				Integer.valueOf(1),
56
				new Integer(2),
56
				Integer.valueOf(2),
57
				new Integer(3),
57
				Integer.valueOf(3),
58
				new Integer(4),
58
				Integer.valueOf(4),
59
				new Integer(5),
59
				Integer.valueOf(5),
60
				new Integer(6),
60
				Integer.valueOf(6),
61
				new Integer(7),
61
				Integer.valueOf(7),
62
				new Integer(8),
62
				Integer.valueOf(8),
63
				new Integer(9)
63
				Integer.valueOf(9)
64
		};
64
		};
65
	}
65
	}
66
	
66
	
Lines 70-85 Link Here
70
	public void testArrayMoveWithin() {
70
	public void testArrayMoveWithin() {
71
		Integer[] ints = getIntsList();
71
		Integer[] ints = getIntsList();
72
		
72
		
73
		assertEquals(new Integer(0), ints[0]);
73
		assertEquals(Integer.valueOf(0), ints[0]);
74
		assertEquals(new Integer(1), ints[1]);
74
		assertEquals(Integer.valueOf(1), ints[1]);
75
		assertEquals(new Integer(2), ints[2]);
75
		assertEquals(Integer.valueOf(2), ints[2]);
76
		assertEquals(new Integer(3), ints[3]);
76
		assertEquals(Integer.valueOf(3), ints[3]);
77
		assertEquals(new Integer(4), ints[4]);
77
		assertEquals(Integer.valueOf(4), ints[4]);
78
		assertEquals(new Integer(5), ints[5]);
78
		assertEquals(Integer.valueOf(5), ints[5]);
79
		assertEquals(new Integer(6), ints[6]);
79
		assertEquals(Integer.valueOf(6), ints[6]);
80
		assertEquals(new Integer(7), ints[7]);
80
		assertEquals(Integer.valueOf(7), ints[7]);
81
		assertEquals(new Integer(8), ints[8]);
81
		assertEquals(Integer.valueOf(8), ints[8]);
82
		assertEquals(new Integer(9), ints[9]);
82
		assertEquals(Integer.valueOf(9), ints[9]);
83
		
83
		
84
		
84
		
85
		//
85
		//
Lines 89-132 Link Here
89
		// Shift 1 back
89
		// Shift 1 back
90
		ints = getIntsList();
90
		ints = getIntsList();
91
		ArrayUtil.arrayMoveWithin(ints, 4, 8, 1);
91
		ArrayUtil.arrayMoveWithin(ints, 4, 8, 1);
92
		assertEquals(new Integer(0), ints[0]);
92
		assertEquals(Integer.valueOf(0), ints[0]);
93
		assertEquals(new Integer(1), ints[1]);
93
		assertEquals(Integer.valueOf(1), ints[1]);
94
		assertEquals(new Integer(2), ints[2]);
94
		assertEquals(Integer.valueOf(2), ints[2]);
95
		assertEquals(new Integer(3), ints[3]);
95
		assertEquals(Integer.valueOf(3), ints[3]);
96
		assertEquals(new Integer(5), ints[4]);
96
		assertEquals(Integer.valueOf(5), ints[4]);
97
		assertEquals(new Integer(6), ints[5]);
97
		assertEquals(Integer.valueOf(6), ints[5]);
98
		assertEquals(new Integer(7), ints[6]);
98
		assertEquals(Integer.valueOf(7), ints[6]);
99
		assertEquals(new Integer(8), ints[7]);
99
		assertEquals(Integer.valueOf(8), ints[7]);
100
		assertEquals(new Integer(4), ints[8]);
100
		assertEquals(Integer.valueOf(4), ints[8]);
101
		assertEquals(new Integer(9), ints[9]);
101
		assertEquals(Integer.valueOf(9), ints[9]);
102
		
102
		
103
		// Shift front 1 back
103
		// Shift front 1 back
104
		ints = getIntsList();
104
		ints = getIntsList();
105
		ArrayUtil.arrayMoveWithin(ints, 0, 7, 1);
105
		ArrayUtil.arrayMoveWithin(ints, 0, 7, 1);
106
		assertEquals(new Integer(1), ints[0]);
106
		assertEquals(Integer.valueOf(1), ints[0]);
107
		assertEquals(new Integer(2), ints[1]);
107
		assertEquals(Integer.valueOf(2), ints[1]);
108
		assertEquals(new Integer(3), ints[2]);
108
		assertEquals(Integer.valueOf(3), ints[2]);
109
		assertEquals(new Integer(4), ints[3]);
109
		assertEquals(Integer.valueOf(4), ints[3]);
110
		assertEquals(new Integer(5), ints[4]);
110
		assertEquals(Integer.valueOf(5), ints[4]);
111
		assertEquals(new Integer(6), ints[5]);
111
		assertEquals(Integer.valueOf(6), ints[5]);
112
		assertEquals(new Integer(7), ints[6]);
112
		assertEquals(Integer.valueOf(7), ints[6]);
113
		assertEquals(new Integer(0), ints[7]);
113
		assertEquals(Integer.valueOf(0), ints[7]);
114
		assertEquals(new Integer(8), ints[8]);
114
		assertEquals(Integer.valueOf(8), ints[8]);
115
		assertEquals(new Integer(9), ints[9]);
115
		assertEquals(Integer.valueOf(9), ints[9]);
116
		
116
		
117
		// Shift 1 to end
117
		// Shift 1 to end
118
		ints = getIntsList();
118
		ints = getIntsList();
119
		ArrayUtil.arrayMoveWithin(ints, 4, 9, 1);
119
		ArrayUtil.arrayMoveWithin(ints, 4, 9, 1);
120
		assertEquals(new Integer(0), ints[0]);
120
		assertEquals(Integer.valueOf(0), ints[0]);
121
		assertEquals(new Integer(1), ints[1]);
121
		assertEquals(Integer.valueOf(1), ints[1]);
122
		assertEquals(new Integer(2), ints[2]);
122
		assertEquals(Integer.valueOf(2), ints[2]);
123
		assertEquals(new Integer(3), ints[3]);
123
		assertEquals(Integer.valueOf(3), ints[3]);
124
		assertEquals(new Integer(5), ints[4]);
124
		assertEquals(Integer.valueOf(5), ints[4]);
125
		assertEquals(new Integer(6), ints[5]);
125
		assertEquals(Integer.valueOf(6), ints[5]);
126
		assertEquals(new Integer(7), ints[6]);
126
		assertEquals(Integer.valueOf(7), ints[6]);
127
		assertEquals(new Integer(8), ints[7]);
127
		assertEquals(Integer.valueOf(8), ints[7]);
128
		assertEquals(new Integer(9), ints[8]);
128
		assertEquals(Integer.valueOf(9), ints[8]);
129
		assertEquals(new Integer(4), ints[9]);
129
		assertEquals(Integer.valueOf(4), ints[9]);
130
130
131
				
131
				
132
		//
132
		//
Lines 136-179 Link Here
136
		// Shift 1 forward
136
		// Shift 1 forward
137
		ints = getIntsList();
137
		ints = getIntsList();
138
		ArrayUtil.arrayMoveWithin(ints, 8, 3, 1);
138
		ArrayUtil.arrayMoveWithin(ints, 8, 3, 1);
139
		assertEquals(new Integer(0), ints[0]);
139
		assertEquals(Integer.valueOf(0), ints[0]);
140
		assertEquals(new Integer(1), ints[1]);
140
		assertEquals(Integer.valueOf(1), ints[1]);
141
		assertEquals(new Integer(2), ints[2]);
141
		assertEquals(Integer.valueOf(2), ints[2]);
142
		assertEquals(new Integer(8), ints[3]);
142
		assertEquals(Integer.valueOf(8), ints[3]);
143
		assertEquals(new Integer(3), ints[4]);
143
		assertEquals(Integer.valueOf(3), ints[4]);
144
		assertEquals(new Integer(4), ints[5]);
144
		assertEquals(Integer.valueOf(4), ints[5]);
145
		assertEquals(new Integer(5), ints[6]);
145
		assertEquals(Integer.valueOf(5), ints[6]);
146
		assertEquals(new Integer(6), ints[7]);
146
		assertEquals(Integer.valueOf(6), ints[7]);
147
		assertEquals(new Integer(7), ints[8]);
147
		assertEquals(Integer.valueOf(7), ints[8]);
148
		assertEquals(new Integer(9), ints[9]);
148
		assertEquals(Integer.valueOf(9), ints[9]);
149
		
149
		
150
		// Shift end 1 forward
150
		// Shift end 1 forward
151
		ints = getIntsList();
151
		ints = getIntsList();
152
		ArrayUtil.arrayMoveWithin(ints, 9, 2, 1);
152
		ArrayUtil.arrayMoveWithin(ints, 9, 2, 1);
153
		assertEquals(new Integer(0), ints[0]);
153
		assertEquals(Integer.valueOf(0), ints[0]);
154
		assertEquals(new Integer(1), ints[1]);
154
		assertEquals(Integer.valueOf(1), ints[1]);
155
		assertEquals(new Integer(9), ints[2]);
155
		assertEquals(Integer.valueOf(9), ints[2]);
156
		assertEquals(new Integer(2), ints[3]);
156
		assertEquals(Integer.valueOf(2), ints[3]);
157
		assertEquals(new Integer(3), ints[4]);
157
		assertEquals(Integer.valueOf(3), ints[4]);
158
		assertEquals(new Integer(4), ints[5]);
158
		assertEquals(Integer.valueOf(4), ints[5]);
159
		assertEquals(new Integer(5), ints[6]);
159
		assertEquals(Integer.valueOf(5), ints[6]);
160
		assertEquals(new Integer(6), ints[7]);
160
		assertEquals(Integer.valueOf(6), ints[7]);
161
		assertEquals(new Integer(7), ints[8]);
161
		assertEquals(Integer.valueOf(7), ints[8]);
162
		assertEquals(new Integer(8), ints[9]);
162
		assertEquals(Integer.valueOf(8), ints[9]);
163
		
163
		
164
		// Shift 1 to front
164
		// Shift 1 to front
165
		ints = getIntsList();
165
		ints = getIntsList();
166
		ArrayUtil.arrayMoveWithin(ints, 5, 0, 1);
166
		ArrayUtil.arrayMoveWithin(ints, 5, 0, 1);
167
		assertEquals(new Integer(5), ints[0]);
167
		assertEquals(Integer.valueOf(5), ints[0]);
168
		assertEquals(new Integer(0), ints[1]);
168
		assertEquals(Integer.valueOf(0), ints[1]);
169
		assertEquals(new Integer(1), ints[2]);
169
		assertEquals(Integer.valueOf(1), ints[2]);
170
		assertEquals(new Integer(2), ints[3]);
170
		assertEquals(Integer.valueOf(2), ints[3]);
171
		assertEquals(new Integer(3), ints[4]);
171
		assertEquals(Integer.valueOf(3), ints[4]);
172
		assertEquals(new Integer(4), ints[5]);
172
		assertEquals(Integer.valueOf(4), ints[5]);
173
		assertEquals(new Integer(6), ints[6]);
173
		assertEquals(Integer.valueOf(6), ints[6]);
174
		assertEquals(new Integer(7), ints[7]);
174
		assertEquals(Integer.valueOf(7), ints[7]);
175
		assertEquals(new Integer(8), ints[8]);
175
		assertEquals(Integer.valueOf(8), ints[8]);
176
		assertEquals(new Integer(9), ints[9]);
176
		assertEquals(Integer.valueOf(9), ints[9]);
177
177
178
		
178
		
179
		//
179
		//
Lines 183-226 Link Here
183
		// Shift 3 back
183
		// Shift 3 back
184
		ints = getIntsList();
184
		ints = getIntsList();
185
		ArrayUtil.arrayMoveWithin(ints, 2, 6, 3);
185
		ArrayUtil.arrayMoveWithin(ints, 2, 6, 3);
186
		assertEquals(new Integer(0), ints[0]);
186
		assertEquals(Integer.valueOf(0), ints[0]);
187
		assertEquals(new Integer(1), ints[1]);
187
		assertEquals(Integer.valueOf(1), ints[1]);
188
		assertEquals(new Integer(5), ints[2]);
188
		assertEquals(Integer.valueOf(5), ints[2]);
189
		assertEquals(new Integer(6), ints[3]);
189
		assertEquals(Integer.valueOf(6), ints[3]);
190
		assertEquals(new Integer(7), ints[4]);
190
		assertEquals(Integer.valueOf(7), ints[4]);
191
		assertEquals(new Integer(8), ints[5]);
191
		assertEquals(Integer.valueOf(8), ints[5]);
192
		assertEquals(new Integer(2), ints[6]);
192
		assertEquals(Integer.valueOf(2), ints[6]);
193
		assertEquals(new Integer(3), ints[7]);
193
		assertEquals(Integer.valueOf(3), ints[7]);
194
		assertEquals(new Integer(4), ints[8]);
194
		assertEquals(Integer.valueOf(4), ints[8]);
195
		assertEquals(new Integer(9), ints[9]);
195
		assertEquals(Integer.valueOf(9), ints[9]);
196
		
196
		
197
		// Shift 3 to back
197
		// Shift 3 to back
198
		ints = getIntsList();
198
		ints = getIntsList();
199
		ArrayUtil.arrayMoveWithin(ints, 2, 7, 3);
199
		ArrayUtil.arrayMoveWithin(ints, 2, 7, 3);
200
		assertEquals(new Integer(0), ints[0]);
200
		assertEquals(Integer.valueOf(0), ints[0]);
201
		assertEquals(new Integer(1), ints[1]);
201
		assertEquals(Integer.valueOf(1), ints[1]);
202
		assertEquals(new Integer(5), ints[2]);
202
		assertEquals(Integer.valueOf(5), ints[2]);
203
		assertEquals(new Integer(6), ints[3]);
203
		assertEquals(Integer.valueOf(6), ints[3]);
204
		assertEquals(new Integer(7), ints[4]);
204
		assertEquals(Integer.valueOf(7), ints[4]);
205
		assertEquals(new Integer(8), ints[5]);
205
		assertEquals(Integer.valueOf(8), ints[5]);
206
		assertEquals(new Integer(9), ints[6]);
206
		assertEquals(Integer.valueOf(9), ints[6]);
207
		assertEquals(new Integer(2), ints[7]);
207
		assertEquals(Integer.valueOf(2), ints[7]);
208
		assertEquals(new Integer(3), ints[8]);
208
		assertEquals(Integer.valueOf(3), ints[8]);
209
		assertEquals(new Integer(4), ints[9]);
209
		assertEquals(Integer.valueOf(4), ints[9]);
210
		
210
		
211
		// Shift from 3 front
211
		// Shift from 3 front
212
		ints = getIntsList();
212
		ints = getIntsList();
213
		ArrayUtil.arrayMoveWithin(ints, 0, 5, 3);
213
		ArrayUtil.arrayMoveWithin(ints, 0, 5, 3);
214
		assertEquals(new Integer(3), ints[0]);
214
		assertEquals(Integer.valueOf(3), ints[0]);
215
		assertEquals(new Integer(4), ints[1]);
215
		assertEquals(Integer.valueOf(4), ints[1]);
216
		assertEquals(new Integer(5), ints[2]);
216
		assertEquals(Integer.valueOf(5), ints[2]);
217
		assertEquals(new Integer(6), ints[3]);
217
		assertEquals(Integer.valueOf(6), ints[3]);
218
		assertEquals(new Integer(7), ints[4]);
218
		assertEquals(Integer.valueOf(7), ints[4]);
219
		assertEquals(new Integer(0), ints[5]);
219
		assertEquals(Integer.valueOf(0), ints[5]);
220
		assertEquals(new Integer(1), ints[6]);
220
		assertEquals(Integer.valueOf(1), ints[6]);
221
		assertEquals(new Integer(2), ints[7]);
221
		assertEquals(Integer.valueOf(2), ints[7]);
222
		assertEquals(new Integer(8), ints[8]);
222
		assertEquals(Integer.valueOf(8), ints[8]);
223
		assertEquals(new Integer(9), ints[9]);
223
		assertEquals(Integer.valueOf(9), ints[9]);
224
		
224
		
225
		
225
		
226
		//
226
		//
Lines 230-273 Link Here
230
		// Shift 3 forward
230
		// Shift 3 forward
231
		ints = getIntsList();
231
		ints = getIntsList();
232
		ArrayUtil.arrayMoveWithin(ints, 6, 2, 3);
232
		ArrayUtil.arrayMoveWithin(ints, 6, 2, 3);
233
		assertEquals(new Integer(0), ints[0]);
233
		assertEquals(Integer.valueOf(0), ints[0]);
234
		assertEquals(new Integer(1), ints[1]);
234
		assertEquals(Integer.valueOf(1), ints[1]);
235
		assertEquals(new Integer(6), ints[2]);
235
		assertEquals(Integer.valueOf(6), ints[2]);
236
		assertEquals(new Integer(7), ints[3]);
236
		assertEquals(Integer.valueOf(7), ints[3]);
237
		assertEquals(new Integer(8), ints[4]);
237
		assertEquals(Integer.valueOf(8), ints[4]);
238
		assertEquals(new Integer(2), ints[5]);
238
		assertEquals(Integer.valueOf(2), ints[5]);
239
		assertEquals(new Integer(3), ints[6]);
239
		assertEquals(Integer.valueOf(3), ints[6]);
240
		assertEquals(new Integer(4), ints[7]);
240
		assertEquals(Integer.valueOf(4), ints[7]);
241
		assertEquals(new Integer(5), ints[8]);
241
		assertEquals(Integer.valueOf(5), ints[8]);
242
		assertEquals(new Integer(9), ints[9]);
242
		assertEquals(Integer.valueOf(9), ints[9]);
243
		
243
		
244
		// Shift 3 to front
244
		// Shift 3 to front
245
		ints = getIntsList();
245
		ints = getIntsList();
246
		ArrayUtil.arrayMoveWithin(ints, 6, 0, 3);
246
		ArrayUtil.arrayMoveWithin(ints, 6, 0, 3);
247
		assertEquals(new Integer(6), ints[0]);
247
		assertEquals(Integer.valueOf(6), ints[0]);
248
		assertEquals(new Integer(7), ints[1]);
248
		assertEquals(Integer.valueOf(7), ints[1]);
249
		assertEquals(new Integer(8), ints[2]);
249
		assertEquals(Integer.valueOf(8), ints[2]);
250
		assertEquals(new Integer(0), ints[3]);
250
		assertEquals(Integer.valueOf(0), ints[3]);
251
		assertEquals(new Integer(1), ints[4]);
251
		assertEquals(Integer.valueOf(1), ints[4]);
252
		assertEquals(new Integer(2), ints[5]);
252
		assertEquals(Integer.valueOf(2), ints[5]);
253
		assertEquals(new Integer(3), ints[6]);
253
		assertEquals(Integer.valueOf(3), ints[6]);
254
		assertEquals(new Integer(4), ints[7]);
254
		assertEquals(Integer.valueOf(4), ints[7]);
255
		assertEquals(new Integer(5), ints[8]);
255
		assertEquals(Integer.valueOf(5), ints[8]);
256
		assertEquals(new Integer(9), ints[9]);
256
		assertEquals(Integer.valueOf(9), ints[9]);
257
		
257
		
258
		// Shift from 3 back
258
		// Shift from 3 back
259
		ints = getIntsList();
259
		ints = getIntsList();
260
		ArrayUtil.arrayMoveWithin(ints, 7, 3, 3);
260
		ArrayUtil.arrayMoveWithin(ints, 7, 3, 3);
261
		assertEquals(new Integer(0), ints[0]);
261
		assertEquals(Integer.valueOf(0), ints[0]);
262
		assertEquals(new Integer(1), ints[1]);
262
		assertEquals(Integer.valueOf(1), ints[1]);
263
		assertEquals(new Integer(2), ints[2]);
263
		assertEquals(Integer.valueOf(2), ints[2]);
264
		assertEquals(new Integer(7), ints[3]);
264
		assertEquals(Integer.valueOf(7), ints[3]);
265
		assertEquals(new Integer(8), ints[4]);
265
		assertEquals(Integer.valueOf(8), ints[4]);
266
		assertEquals(new Integer(9), ints[5]);
266
		assertEquals(Integer.valueOf(9), ints[5]);
267
		assertEquals(new Integer(3), ints[6]);
267
		assertEquals(Integer.valueOf(3), ints[6]);
268
		assertEquals(new Integer(4), ints[7]);
268
		assertEquals(Integer.valueOf(4), ints[7]);
269
		assertEquals(new Integer(5), ints[8]);
269
		assertEquals(Integer.valueOf(5), ints[8]);
270
		assertEquals(new Integer(6), ints[9]);
270
		assertEquals(Integer.valueOf(6), ints[9]);
271
		
271
		
272
		
272
		
273
		// Check can't shift more than we have
273
		// Check can't shift more than we have
(-)src/testcases/org/apache/poi/util/TestPOILogger.java (-2 / +2 lines)
Lines 39-46 Link Here
39
39
40
        POILogger log = POILogFactory.getLogger( "foo" );
40
        POILogger log = POILogFactory.getLogger( "foo" );
41
41
42
        log.log( POILogger.WARN, "Test = ", new Integer( 1 ) );
42
        log.log( POILogger.WARN, "Test = ", Integer.valueOf( 1 ) );
43
        log.logFormatted( POILogger.ERROR, "Test param 1 = %, param 2 = %", "2", new Integer( 3 ) );
43
        log.logFormatted( POILogger.ERROR, "Test param 1 = %, param 2 = %", "2", Integer.valueOf( 3 ) );
44
        log.logFormatted( POILogger.ERROR, "Test param 1 = %, param 2 = %", new int[]{4, 5} );
44
        log.logFormatted( POILogger.ERROR, "Test param 1 = %, param 2 = %", new int[]{4, 5} );
45
        log.logFormatted( POILogger.ERROR,
45
        log.logFormatted( POILogger.ERROR,
46
                "Test param 1 = %1.1, param 2 = %0.1", new double[]{4, 5.23} );
46
                "Test param 1 = %1.1, param 2 = %0.1", new double[]{4, 5.23} );

Return to bug 47962