]> source.dussan.org Git - poi.git/commitdiff
code cleanup as suggested in Bugzilla 50446
authorYegor Kozlov <yegor@apache.org>
Fri, 10 Dec 2010 15:43:59 +0000 (15:43 +0000)
committerYegor Kozlov <yegor@apache.org>
Fri, 10 Dec 2010 15:43:59 +0000 (15:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1044405 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/java/org/apache/poi/hssf/record/SSTSerializer.java
src/java/org/apache/poi/hssf/record/common/UnicodeString.java
src/java/org/apache/poi/hssf/usermodel/EscherGraphics2d.java
src/java/org/apache/poi/hssf/usermodel/FontDetails.java
src/java/org/apache/poi/poifs/dev/POIFSHeaderDumper.java
src/java/org/apache/poi/util/POILogger.java
src/testcases/org/apache/poi/hpsf/basic/TestMetaDataIPI.java
src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java
src/testcases/org/apache/poi/util/DummyPOILogger.java

index f120102386ac8f360afc8251fa183224106ef8c4..9ee283fcb039b8ecc7729a5d78d86bfa05da3cf0 100644 (file)
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta1" date="2010-??-??">
+           <action dev="POI-DEVELOPERS" type="add">50446 - Code cleanup and optimizations to keep some IDE quiet</action>
            <action dev="POI-DEVELOPERS" type="add">50437 - Support passing ranges to NPV()</action>
            <action dev="POI-DEVELOPERS" type="add">50409 - Added implementation for IRR()</action>
            <action dev="poi-developers" type="add">47405 - Improved performance of RowRecordsAggregate.getStartRowNumberForBlock / getEndRowNumberForBlock</action>
index 44980f54e5ad709ac5299513e4d973faa32a9706..c15c7ad1ffb9736cf81540c20f16c70f2b8672d1 100644 (file)
@@ -38,7 +38,6 @@ final class SSTSerializer {
     private final int[] bucketAbsoluteOffsets;
     /** Offsets relative the start of the current SST or continue record */
     private final int[] bucketRelativeOffsets;
-    int startOfSST, startOfRecord;
 
     public SSTSerializer( IntMapper<UnicodeString> strings, int numStrings, int numUniqueStrings )
     {
index 235d5470916fb96d33f4c86787822961031d79a6..3d0813c87b79bfcfd43e16b77847f4ad83b9e3f2 100644 (file)
@@ -266,7 +266,7 @@ public class UnicodeString implements Comparable<UnicodeString> { // TODO - make
           ext.formattingFontIndex = formattingFontIndex;
           ext.formattingOptions = formattingOptions;
           ext.numberOfRuns = numberOfRuns;
-          ext.phoneticText = new String(phoneticText);
+          ext.phoneticText = phoneticText;
           ext.phRuns = new PhRun[phRuns.length];
           for(int i=0; i<ext.phRuns.length; i++) {
              ext.phRuns[i] = new PhRun(
index 41b94ffd487acc41a2a23202a619b5a988c6003d..1dff3d8ed18f132e1802d75fdcf26117deff3734 100644 (file)
@@ -308,7 +308,7 @@ public final class EscherGraphics2d extends Graphics2D {
 
     public void drawString(AttributedCharacterIterator attributedcharacteriterator, int x, int y)
     {
-        drawString(attributedcharacteriterator, x, y);
+        getEscherGraphics().drawString(attributedcharacteriterator, x, y);
     }
 
     public void fill(Shape shape)
index f9b2bc8138c2373b8d94403920d2636722ea5439..073bcba5d8fe8317d8d4895a3aef905e39aee520 100644 (file)
@@ -57,7 +57,7 @@ public class FontDetails
 
     public void addChar( char c, int width )
     {
-        charWidths.put(new Character(c), Integer.valueOf(width));
+        charWidths.put(Character.valueOf(c), Integer.valueOf(width));
     }
 
     /**
@@ -67,7 +67,7 @@ public class FontDetails
      */
     public int getCharWidth( char c )
     {
-        Integer widthInteger = charWidths.get(new Character(c));
+        Integer widthInteger = charWidths.get(Character.valueOf(c));
         if (widthInteger == null && c != 'W') {
             return getCharWidth('W');
         }
@@ -78,7 +78,7 @@ public class FontDetails
     {
         for ( int i = 0; i < characters.length; i++ )
         {
-            charWidths.put( new Character(characters[i]), Integer.valueOf(widths[i]));
+            charWidths.put( Character.valueOf(characters[i]), Integer.valueOf(widths[i]));
         }
     }
 
index 75f69caebfee6ed243f871e5e010b4a3ca907fad..7a6b187fe0fbbcce60b4be9a53f4a6e5dec40443 100644 (file)
@@ -123,7 +123,7 @@ public class POIFSHeaderDumper {
       gbm.setAccessible(true);
       
       for(int i=0; i<Math.min(16, data_blocks.blockCount()); i++) {
-         ListManagedBlock block = (ListManagedBlock)gbm.invoke(data_blocks, new Integer(i));
+         ListManagedBlock block = (ListManagedBlock)gbm.invoke(data_blocks, Integer.valueOf(i));
          byte[] data = new byte[Math.min(48, block.getData().length)];
          System.arraycopy(block.getData(), 0, data, 0, data.length);
          
index 241196ec640911e26ae26f4cd67b51dbbea09df6..cf722c465320ffe77a24d4a0977f8750c4396a24 100644 (file)
@@ -610,7 +610,7 @@ public abstract class POILogger {
 
             for (int j = 0; j < array.length; j++)
             {
-                results.add(new Character(array[ j ]));
+                results.add(Character.valueOf(array[ j ]));
             }
         }
         else if (object instanceof short [])
index 7f579c83c5031dc5ce4a02b57c6a92a6dde8598c..9fb58081fa6e2c4d629c1d8f98163ca3d4224211 100644 (file)
@@ -383,7 +383,7 @@ public final class TestMetaDataIPI extends TestCase{
                        j += 33;
                        // System.out.println(j);
                        sb.append(">");
-                       sb.append(new Character(j));
+                       sb.append(Character.valueOf(j));
                        sb.append("=");
                        sb.append(umlaute[rand.nextInt(umlaute.length)]);
                        sb.append("<");
@@ -509,7 +509,7 @@ public final class TestMetaDataIPI extends TestCase{
                        j += 33;
                        // System.out.println(j);
                        sb.append(">");
-                       sb.append(new Character(j));
+                       sb.append(Character.valueOf(j));
                        sb.append("=");
                        sb.append(umlaute[rand.nextInt(umlaute.length)]);
                        sb.append("<");
index a03bfb0848b741c6bc6d22161be02168c172f118..c074c97379dd91050f348429360172ebee739abf 100644 (file)
@@ -63,7 +63,7 @@ public class NumberRenderingSpreadsheetGenerator {
                public void addTestRow(long rawBits, String expectedExcelRendering) {
                        writeDataRow(_sheet, _rowIndex++, rawBits, expectedExcelRendering);
                        if(Double.isNaN(Double.longBitsToDouble(rawBits))) {
-                               _replacementNaNs.add(new Long(rawBits));
+                               _replacementNaNs.add(Long.valueOf(rawBits));
                        }
                }
 
index 7efbfac293b0bb71d4ca2658653dbffce45bafb3..f72e37b512267eef7dc869b78bd9adc907367ca6 100644 (file)
@@ -37,10 +37,10 @@ public class DummyPOILogger extends POILogger {
        public void initialize(String cat) {}
 
        public void log(int level, Object obj1) {
-               logged.add(new String(level + " - " + obj1));
+               logged.add(level + " - " + obj1);
        }
 
        public void log(int level, Object obj1, Throwable exception) {
-               logged.add(new String(level + " - " + obj1 + " - " + exception));
+               logged.add(level + " - " + obj1 + " - " + exception);
        }
 }