poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1648156 [1/2] - in /poi/trunk/src: examples/src/org/apache/poi/hssf/usermodel/examples/ java/org/apache/poi/ddf/ java/org/apache/poi/hpsf/ java/org/apache/poi/hpsf/extractor/ java/org/apache/poi/hpsf/wellknown/ java/org/apache/poi/hssf/dev...
Date Sun, 28 Dec 2014 09:06:13 GMT
Author: centic
Date: Sun Dec 28 09:06:12 2014
New Revision: 1648156

URL: http://svn.apache.org/r1648156
Log:
Fix Eclipse warnings, unnecessary casts, use generics, static access...

Modified:
    poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java
    poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/EventExample.java
    poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/OfficeDrawing.java
    poi/trunk/src/java/org/apache/poi/ddf/EscherChildAnchorRecord.java
    poi/trunk/src/java/org/apache/poi/ddf/EscherDgRecord.java
    poi/trunk/src/java/org/apache/poi/ddf/EscherSpRecord.java
    poi/trunk/src/java/org/apache/poi/hpsf/CustomProperties.java
    poi/trunk/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java
    poi/trunk/src/java/org/apache/poi/hpsf/MutableSection.java
    poi/trunk/src/java/org/apache/poi/hpsf/Section.java
    poi/trunk/src/java/org/apache/poi/hpsf/Variant.java
    poi/trunk/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java
    poi/trunk/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java
    poi/trunk/src/java/org/apache/poi/hssf/dev/ReSave.java
    poi/trunk/src/java/org/apache/poi/hssf/model/DrawingManager2.java
    poi/trunk/src/java/org/apache/poi/hssf/model/RecordStream.java
    poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java
    poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java
    poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/DataValidityTable.java
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/DVConstraint.java
    poi/trunk/src/java/org/apache/poi/ss/formula/constant/ErrorConstant.java
    poi/trunk/src/java/org/apache/poi/ss/formula/eval/ErrorEval.java
    poi/trunk/src/java/org/apache/poi/ss/formula/ptg/ErrPtg.java
    poi/trunk/src/java/org/apache/poi/ss/util/AreaReference.java
    poi/trunk/src/java/org/apache/poi/ss/util/CellRangeAddressList.java
    poi/trunk/src/java/org/apache/poi/util/BinaryTree.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/TextFragment.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeader.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestDocumentProperties.java
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java
    poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestEqualEval.java
    poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestFormulaBugs.java
    poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java
    poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestIndirect.java
    poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestRoundFuncs.java
    poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java
    poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java
    poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestDataValidation.java
    poi/trunk/src/testcases/org/apache/poi/util/DummyPOILogger.java

Modified: poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/BigExample.java Sun Dec 28 09:06:12 2014
@@ -19,6 +19,8 @@ package org.apache.poi.hssf.usermodel.ex
 
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.Font;
 
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -57,14 +59,14 @@ public class BigExample {
         f.setColor(HSSFColor.RED.index);
         // make it bold
         //arial is the default font
-        f.setBoldweight(f.BOLDWEIGHT_BOLD);
+        f.setBoldweight(Font.BOLDWEIGHT_BOLD);
 
         //set font 2 to 10 point type
         f2.setFontHeightInPoints((short) 10);
         //make it the color at palette index 0xf (white)
         f2.setColor(HSSFColor.WHITE.index);
         //make it bold
-        f2.setBoldweight(f2.BOLDWEIGHT_BOLD);
+        f2.setBoldweight(Font.BOLDWEIGHT_BOLD);
 
         //set cell stlye
         cs.setFont(f);
@@ -72,7 +74,7 @@ public class BigExample {
         cs.setDataFormat(HSSFDataFormat.getBuiltinFormat("($#,##0_);[Red]($#,##0)"));
 
         //set a thin border
-        cs2.setBorderBottom(cs2.BORDER_THIN);
+        cs2.setBorderBottom(CellStyle.BORDER_THIN);
         //fill w fg fill color
         cs2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
         // set foreground fill to red
@@ -141,7 +143,7 @@ public class BigExample {
 
         // define the third style to be the default
         // except with a thick black border at the bottom
-        cs3.setBorderBottom(cs3.BORDER_THICK);
+        cs3.setBorderBottom(CellStyle.BORDER_THICK);
 
         //create 50 cells
         for (int cellnum =0; cellnum < 50; cellnum++) {

Modified: poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/EventExample.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/EventExample.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/EventExample.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/EventExample.java Sun Dec 28 09:06:12 2014
@@ -47,11 +47,11 @@ public class EventExample
             // the BOFRecord can represent either the beginning of a sheet or the workbook
             case BOFRecord.sid:
                 BOFRecord bof = (BOFRecord) record;
-                if (bof.getType() == bof.TYPE_WORKBOOK)
+                if (bof.getType() == BOFRecord.TYPE_WORKBOOK)
                 {
                     System.out.println("Encountered workbook");
                     // assigned to the class level member
-                } else if (bof.getType() == bof.TYPE_WORKSHEET)
+                } else if (bof.getType() == BOFRecord.TYPE_WORKSHEET)
                 {
                     System.out.println("Encountered sheet reference");
                 }

Modified: poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/OfficeDrawing.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/OfficeDrawing.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/OfficeDrawing.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hssf/usermodel/examples/OfficeDrawing.java Sun Dec 28 09:06:12 2014
@@ -164,7 +164,7 @@ public class OfficeDrawing {
         HSSFPicture picture = patriarch.createPicture(anchor, loadPicture( "src/resources/logos/logoKarmokar4s.png", wb ));
         //Reset the image to the original size.
         picture.resize();
-        picture.setLineStyle( picture.LINESTYLE_DASHDOTGEL );
+        picture.setLineStyle( HSSFShape.LINESTYLE_DASHDOTGEL );
 
     }
 

Modified: poi/trunk/src/java/org/apache/poi/ddf/EscherChildAnchorRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ddf/EscherChildAnchorRecord.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ddf/EscherChildAnchorRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/ddf/EscherChildAnchorRecord.java Sun Dec 28 09:06:12 2014
@@ -40,7 +40,7 @@ public class EscherChildAnchorRecord
     private int field_4_dy2;
 
     public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory) {
-        int bytesRemaining = readHeader( data, offset );
+        /*int bytesRemaining =*/ readHeader( data, offset );
         int pos            = offset + 8;
         int size           = 0;
         field_1_dx1    =  LittleEndian.getInt( data, pos + size );size+=4;

Modified: poi/trunk/src/java/org/apache/poi/ddf/EscherDgRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ddf/EscherDgRecord.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ddf/EscherDgRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/ddf/EscherDgRecord.java Sun Dec 28 09:06:12 2014
@@ -37,7 +37,7 @@ public class EscherDgRecord
     private int field_2_lastMSOSPID;
 
     public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory) {
-        int bytesRemaining = readHeader( data, offset );
+        /*int bytesRemaining =*/ readHeader( data, offset );
         int pos            = offset + 8;
         int size           = 0;
         field_1_numShapes   =  LittleEndian.getInt( data, pos + size );     size += 4;

Modified: poi/trunk/src/java/org/apache/poi/ddf/EscherSpRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ddf/EscherSpRecord.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ddf/EscherSpRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/ddf/EscherSpRecord.java Sun Dec 28 09:06:12 2014
@@ -49,7 +49,7 @@ public class EscherSpRecord
     private int field_2_flags;
 
     public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory) {
-        int bytesRemaining = readHeader( data, offset );
+        /*int bytesRemaining =*/ readHeader( data, offset );
         int pos            = offset + 8;
         int size           = 0;
         field_1_shapeId    =  LittleEndian.getInt( data, pos + size );     size += 4;

Modified: poi/trunk/src/java/org/apache/poi/hpsf/CustomProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/CustomProperties.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hpsf/CustomProperties.java (original)
+++ poi/trunk/src/java/org/apache/poi/hpsf/CustomProperties.java Sun Dec 28 09:06:12 2014
@@ -131,7 +131,7 @@ public class CustomProperties extends Ha
         final String name = customProperty.getName();
 
         /* Check whether a property with this name is in the map already. */
-        final Long oldId = (Long) dictionaryNameToID.get(name);
+        final Long oldId = dictionaryNameToID.get(name);
         if (oldId != null)
             customProperty.setID(oldId.longValue());
         else
@@ -159,7 +159,7 @@ public class CustomProperties extends Ha
      */
     public Object remove(final String name)
     {
-        final Long id = (Long) dictionaryNameToID.get(name);
+        final Long id = dictionaryNameToID.get(name);
         if (id == null)
             return null;
         dictionaryIDToName.remove(id);
@@ -267,8 +267,8 @@ public class CustomProperties extends Ha
      */
     public Object get(final String name)
     {
-        final Long id = (Long) dictionaryNameToID.get(name);
-        final CustomProperty cp = (CustomProperty) super.get(id);
+        final Long id = dictionaryNameToID.get(name);
+        final CustomProperty cp = super.get(id);
         return cp != null ? cp.getValue() : null;
     }
 
@@ -351,10 +351,10 @@ public class CustomProperties extends Ha
      */
    public boolean containsKey(Object key) {
       if(key instanceof Long) {
-         return super.containsKey((Long)key);
+         return super.containsKey(key);
       }
       if(key instanceof String) {
-         return super.containsKey((Long)dictionaryNameToID.get(key));
+         return super.containsKey(dictionaryNameToID.get(key));
       }
       return false;
    }
@@ -364,7 +364,7 @@ public class CustomProperties extends Ha
     */
    public boolean containsValue(Object value) {
       if(value instanceof CustomProperty) {
-         return super.containsValue((CustomProperty)value);
+         return super.containsValue(value);
       } else {
          for(CustomProperty cp : super.values()) {
             if(cp.getValue() == value) {

Modified: poi/trunk/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java (original)
+++ poi/trunk/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java Sun Dec 28 09:06:12 2014
@@ -569,7 +569,7 @@ public class DocumentSummaryInformation
         if (getSectionCount() >= 2)
         {
             cps = new CustomProperties();
-            final Section section = (Section) getSections().get(1);
+            final Section section = getSections().get(1);
             final Map<Long,String> dictionary = section.getDictionary();
             final Property[] properties = section.getProperties();
             int propertyCount = 0;

Modified: poi/trunk/src/java/org/apache/poi/hpsf/MutableSection.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/MutableSection.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hpsf/MutableSection.java (original)
+++ poi/trunk/src/java/org/apache/poi/hpsf/MutableSection.java Sun Dec 28 09:06:12 2014
@@ -576,7 +576,7 @@ public class MutableSection extends Sect
      */
     public Property[] getProperties()
     {
-        properties = (Property[]) preprops.toArray(new Property[0]);
+        properties = preprops.toArray(new Property[0]);
         return properties;
     }
 

Modified: poi/trunk/src/java/org/apache/poi/hpsf/Section.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/Section.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hpsf/Section.java (original)
+++ poi/trunk/src/java/org/apache/poi/hpsf/Section.java Sun Dec 28 09:06:12 2014
@@ -448,7 +448,7 @@ public class Section
     {
         String s = null;
         if (dictionary != null)
-            s = (String) dictionary.get(Long.valueOf(pid));
+            s = dictionary.get(Long.valueOf(pid));
         if (s == null)
             s = SectionIDMap.getPIDString(getFormatID().getBytes(), pid);
         if (s == null)

Modified: poi/trunk/src/java/org/apache/poi/hpsf/Variant.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/Variant.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hpsf/Variant.java (original)
+++ poi/trunk/src/java/org/apache/poi/hpsf/Variant.java Sun Dec 28 09:06:12 2014
@@ -352,9 +352,9 @@ public class Variant
      * <p>Maps the numbers denoting the variant types to their corresponding
      * variant type names.</p>
      */
-    private static Map numberToName;
+    private static Map<Long,String> numberToName;
 
-    private static Map numberToLength;
+    private static Map<Long,Integer> numberToLength;
 
     /**
      * <p>Denotes a variant type with a length that is unknown to HPSF yet.</p>
@@ -391,7 +391,7 @@ public class Variant
     static
     {
         /* Initialize the number-to-name map: */
-        Map tm1 = new HashMap();
+        Map<Long,String> tm1 = new HashMap<Long,String>();
         tm1.put(Long.valueOf(0), "VT_EMPTY");
         tm1.put(Long.valueOf(1), "VT_NULL");
         tm1.put(Long.valueOf(2), "VT_I2");
@@ -432,55 +432,55 @@ public class Variant
         tm1.put(Long.valueOf(70), "VT_BLOB_OBJECT");
         tm1.put(Long.valueOf(71), "VT_CF");
         tm1.put(Long.valueOf(72), "VT_CLSID");
-        Map tm2 = new HashMap(tm1.size(), 1.0F);
+        Map<Long,String> tm2 = new HashMap<Long,String>(tm1.size(), 1.0F);
         tm2.putAll(tm1);
         numberToName = Collections.unmodifiableMap(tm2);
 
         /* Initialize the number-to-length map: */
-        tm1.clear();
-        tm1.put(Long.valueOf(0), LENGTH_0);
-        tm1.put(Long.valueOf(1), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(2), LENGTH_2);
-        tm1.put(Long.valueOf(3), LENGTH_4);
-        tm1.put(Long.valueOf(4), LENGTH_4);
-        tm1.put(Long.valueOf(5), LENGTH_8);
-        tm1.put(Long.valueOf(6), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(7), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(8), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(9), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(10), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(11), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(12), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(13), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(14), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(16), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(17), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(18), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(19), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(20), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(21), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(22), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(23), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(24), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(25), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(26), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(27), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(28), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(29), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(30), LENGTH_VARIABLE);
-        tm1.put(Long.valueOf(31), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(64), LENGTH_8);
-        tm1.put(Long.valueOf(65), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(66), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(67), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(68), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(69), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(70), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(71), LENGTH_UNKNOWN);
-        tm1.put(Long.valueOf(72), LENGTH_UNKNOWN);
-        tm2 = new HashMap(tm1.size(), 1.0F);
-        tm2.putAll(tm1);
-        numberToLength = Collections.unmodifiableMap(tm2);
+        Map<Long,Integer> tm3 = new HashMap<Long,Integer>();
+        tm3.put(Long.valueOf(0), LENGTH_0);
+        tm3.put(Long.valueOf(1), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(2), LENGTH_2);
+        tm3.put(Long.valueOf(3), LENGTH_4);
+        tm3.put(Long.valueOf(4), LENGTH_4);
+        tm3.put(Long.valueOf(5), LENGTH_8);
+        tm3.put(Long.valueOf(6), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(7), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(8), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(9), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(10), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(11), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(12), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(13), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(14), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(16), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(17), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(18), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(19), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(20), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(21), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(22), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(23), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(24), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(25), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(26), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(27), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(28), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(29), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(30), LENGTH_VARIABLE);
+        tm3.put(Long.valueOf(31), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(64), LENGTH_8);
+        tm3.put(Long.valueOf(65), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(66), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(67), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(68), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(69), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(70), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(71), LENGTH_UNKNOWN);
+        tm3.put(Long.valueOf(72), LENGTH_UNKNOWN);
+        Map<Long,Integer> tm4 = new HashMap<Long,Integer>(tm1.size(), 1.0F);
+        tm4.putAll(tm3);
+        numberToLength = Collections.unmodifiableMap(tm4);
     }
 
 
@@ -494,7 +494,7 @@ public class Variant
      */
     public static String getVariantName(final long variantType)
     {
-        final String name = (String) numberToName.get(Long.valueOf(variantType));
+        final String name = numberToName.get(Long.valueOf(variantType));
         return name != null ? name : "unknown variant type";
     }
 
@@ -510,7 +510,7 @@ public class Variant
     public static int getVariantLength(final long variantType)
     {
         final Long key = Long.valueOf((int) variantType);
-        final Long length = (Long) numberToLength.get(key);
+        final Integer length = numberToLength.get(key);
         if (length == null)
             return -2;
         return length.intValue();

Modified: poi/trunk/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java (original)
+++ poi/trunk/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java Sun Dec 28 09:06:12 2014
@@ -17,6 +17,7 @@
 
 package org.apache.poi.hpsf.extractor;
 
+import java.io.Closeable;
 import java.io.File;
 import java.io.IOException;
 import java.util.Iterator;
@@ -39,6 +40,8 @@ import org.apache.poi.poifs.filesystem.P
  *  textual form.
  */
 public class HPSFPropertiesExtractor extends POITextExtractor {
+    private Closeable toClose;
+
     public HPSFPropertiesExtractor(POITextExtractor mainExtractor) {
         super(mainExtractor);
     }
@@ -50,6 +53,7 @@ public class HPSFPropertiesExtractor ext
     }
     public HPSFPropertiesExtractor(NPOIFSFileSystem fs) {
         super(new HPSFPropertiesOnlyDocument(fs));
+        this.toClose = fs;
     }
 
     public String getDocumentSummaryInformationText() {
@@ -119,6 +123,19 @@ public class HPSFPropertiesExtractor ext
         throw new IllegalStateException("You already have the Metadata Text Extractor, not recursing!");
     }
     
+    
+    
+    public void close() throws IOException {
+        super.close();
+        
+        if(toClose != null) {
+            toClose.close();
+            toClose = null;
+        }
+    }
+
+
+
     private static abstract class HelperPropertySet extends SpecialPropertySet {
         public HelperPropertySet() {
             super(null);
@@ -135,7 +152,11 @@ public class HPSFPropertiesExtractor ext
         for (String file : args) {
             HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(
                     new NPOIFSFileSystem(new File(file)));
-            System.out.println(ext.getText());
+            try {
+                System.out.println(ext.getText());
+            } finally {
+                ext.close();
+            }
         }
     }
 }

Modified: poi/trunk/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java (original)
+++ poi/trunk/src/java/org/apache/poi/hpsf/wellknown/PropertyIDMap.java Sun Dec 28 09:06:12 2014
@@ -34,7 +34,7 @@ import java.util.Map;
  * @author Rainer Klute <a
  * href="mailto:klute@rainer-klute.de">&lt;klute@rainer-klute.de&gt;</a>
  */
-public class PropertyIDMap extends HashMap {
+public class PropertyIDMap extends HashMap<Long,String> {
 
     /*
      * The following definitions are for property IDs in the first
@@ -271,7 +271,7 @@ public class PropertyIDMap extends HashM
      *
      * @param map The instance to be created is backed by this map.
      */
-    public PropertyIDMap(final Map map)
+    public PropertyIDMap(final Map<Long,String> map)
     {
         super(map);
     }

Modified: poi/trunk/src/java/org/apache/poi/hssf/dev/ReSave.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/dev/ReSave.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/dev/ReSave.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/dev/ReSave.java Sun Dec 28 09:06:12 2014
@@ -17,13 +17,12 @@
 
 package org.apache.poi.hssf.dev;
 
-import org.apache.poi.hssf.usermodel.HSSFPatriarch;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+
 /**
  *  Utility to test that POI produces readable output
  *  after re-saving xls files.
@@ -40,22 +39,28 @@ public class ReSave {
                 System.out.print("reading " + arg + "...");
                 FileInputStream is = new FileInputStream(arg);
                 HSSFWorkbook wb = new HSSFWorkbook(is);
-                is.close();
-                System.out.println("done");
-
-                for(int i = 0; i < wb.getNumberOfSheets(); i++){
-                    HSSFSheet sheet = wb.getSheetAt(i);
-                    if(initDrawing) {
-                        HSSFPatriarch dg = sheet.getDrawingPatriarch();
+                try {
+                    System.out.println("done");
+    
+                    for(int i = 0; i < wb.getNumberOfSheets(); i++){
+                        HSSFSheet sheet = wb.getSheetAt(i);
+                        if(initDrawing) {
+                            /*HSSFPatriarch dg =*/ sheet.getDrawingPatriarch();
+                        }
                     }
+    
+                    String outputFile = arg.replace(".xls", "-saved.xls");
+                    System.out.print("saving to " + outputFile + "...");
+                    FileOutputStream out = new FileOutputStream(outputFile);
+                    try {
+                        wb.write(out);
+                    } finally {
+                        out.close();
+                    }
+                    System.out.println("done");
+                } finally {
+                    wb.close();
                 }
-
-                String outputFile = arg.replace(".xls", "-saved.xls");
-                System.out.print("saving to " + outputFile + "...");
-                FileOutputStream out = new FileOutputStream(outputFile);
-                wb.write(out);
-                out.close();
-                System.out.println("done");
             }
         }
     }

Modified: poi/trunk/src/java/org/apache/poi/hssf/model/DrawingManager2.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/model/DrawingManager2.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/model/DrawingManager2.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/model/DrawingManager2.java Sun Dec 28 09:06:12 2014
@@ -30,7 +30,7 @@ import java.util.ArrayList;
 public class DrawingManager2
 {
     EscherDggRecord dgg;
-    List drawingGroups = new ArrayList( );
+    List<EscherDgRecord> drawingGroups = new ArrayList<EscherDgRecord>();
 
 
     public DrawingManager2( EscherDggRecord dgg )
@@ -120,7 +120,7 @@ public class DrawingManager2
 
     EscherDgRecord getDrawingGroup(int drawingGroupId)
     {
-        return (EscherDgRecord) drawingGroups.get(drawingGroupId-1);
+        return drawingGroups.get(drawingGroupId-1);
     }
 
     boolean drawingGroupExists( short dgId )

Modified: poi/trunk/src/java/org/apache/poi/hssf/model/RecordStream.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/model/RecordStream.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/model/RecordStream.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/model/RecordStream.java Sun Dec 28 09:06:12 2014
@@ -53,7 +53,7 @@ public final class RecordStream {
 			throw new RuntimeException("Attempt to read past end of record stream");
 		}
 		_countRead ++;
-		return (Record) _list.get(_nextIndex++);
+		return _list.get(_nextIndex++);
 	}
 
 	/**
@@ -73,7 +73,7 @@ public final class RecordStream {
 		if(!hasNext()) {
 			return -1;
 		}
-		return ((Record)_list.get(_nextIndex)).getSid();
+		return _list.get(_nextIndex).getSid();
 	}
 
 	public int getCountRead() {

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java Sun Dec 28 09:06:12 2014
@@ -212,7 +212,7 @@ public final class TextObjectRecord exte
 		for (int i = 0; i < nRuns; i++) {
 			out.writeShort(str.getIndexOfFormattingRun(i));
 			int fontIndex = str.getFontOfFormattingRun(i);
-			out.writeShort(fontIndex == str.NO_FONT ? 0 : fontIndex);
+			out.writeShort(fontIndex == HSSFRichTextString.NO_FONT ? 0 : fontIndex);
 			out.writeInt(0); // skip reserved
 		}
 		out.writeShort(str.length());

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java Sun Dec 28 09:06:12 2014
@@ -32,16 +32,16 @@ public final class ColumnInfoRecordsAggr
 	/**
 	 * List of {@link ColumnInfoRecord}s assumed to be in order
 	 */
-	private final List records;
+	private final List<ColumnInfoRecord> records;
 
 
-	private static final class CIRComparator implements Comparator {
-		public static final Comparator instance = new CIRComparator();
+	private static final class CIRComparator implements Comparator<ColumnInfoRecord> {
+		public static final Comparator<ColumnInfoRecord> instance = new CIRComparator();
 		private CIRComparator() {
 			// enforce singleton
 		}
-		public int compare(Object a, Object b) {
-			return compareColInfos((ColumnInfoRecord)a, (ColumnInfoRecord)b);
+		public int compare(ColumnInfoRecord a, ColumnInfoRecord b) {
+			return compareColInfos(a, b);
 		}
 		public static int compareColInfos(ColumnInfoRecord a, ColumnInfoRecord b) {
 			return a.getFirstColumn()-b.getFirstColumn();
@@ -52,7 +52,7 @@ public final class ColumnInfoRecordsAggr
 	 * Creates an empty aggregate
 	 */
 	public ColumnInfoRecordsAggregate() {
-		records = new ArrayList();
+		records = new ArrayList<ColumnInfoRecord>();
 	}
 	public ColumnInfoRecordsAggregate(RecordStream rs) {
 		this();
@@ -81,8 +81,8 @@ public final class ColumnInfoRecordsAggr
 	public Object clone() {
 		ColumnInfoRecordsAggregate rec = new ColumnInfoRecordsAggregate();
 		for (int k = 0; k < records.size(); k++) {
-			ColumnInfoRecord ci = ( ColumnInfoRecord ) records.get(k);
-			rec.records.add(ci.clone());
+			ColumnInfoRecord ci = records.get(k);
+			rec.records.add((ColumnInfoRecord) ci.clone());
 		}
 		return rec;
 	}
@@ -114,7 +114,7 @@ public final class ColumnInfoRecordsAggr
 		}
 		ColumnInfoRecord cirPrev = null;
 		for(int i=0; i<nItems; i++) {
-			ColumnInfoRecord cir = (ColumnInfoRecord)records.get(i);
+			ColumnInfoRecord cir = records.get(i);
 			rv.visitRecord(cir);
 			if (cirPrev != null && CIRComparator.compareColInfos(cirPrev, cir) > 0) {
 				// Excel probably wouldn't mind, but there is much logic in this class
@@ -127,11 +127,11 @@ public final class ColumnInfoRecordsAggr
 
 	private int findStartOfColumnOutlineGroup(int pIdx) {
 		// Find the start of the group.
-		ColumnInfoRecord columnInfo = (ColumnInfoRecord) records.get(pIdx);
+		ColumnInfoRecord columnInfo = records.get(pIdx);
 		int level = columnInfo.getOutlineLevel();
 		int idx = pIdx;
 		while (idx != 0) {
-			ColumnInfoRecord prevColumnInfo = (ColumnInfoRecord) records.get(idx - 1);
+			ColumnInfoRecord prevColumnInfo = records.get(idx - 1);
 			if (!prevColumnInfo.isAdjacentBefore(columnInfo)) {
 				break;
 			}
@@ -147,11 +147,11 @@ public final class ColumnInfoRecordsAggr
 
 	private int findEndOfColumnOutlineGroup(int colInfoIndex) {
 		// Find the end of the group.
-		ColumnInfoRecord columnInfo = (ColumnInfoRecord) records.get(colInfoIndex);
+		ColumnInfoRecord columnInfo = records.get(colInfoIndex);
 		int level = columnInfo.getOutlineLevel();
 		int idx = colInfoIndex;
 		while (idx < records.size() - 1) {
-			ColumnInfoRecord nextColumnInfo = (ColumnInfoRecord) records.get(idx + 1);
+			ColumnInfoRecord nextColumnInfo = records.get(idx + 1);
 			if (!columnInfo.isAdjacentBefore(nextColumnInfo)) {
 				break;
 			}
@@ -165,7 +165,7 @@ public final class ColumnInfoRecordsAggr
 	}
 
 	private ColumnInfoRecord getColInfo(int idx) {
-		return (ColumnInfoRecord) records.get( idx );
+		return records.get( idx );
 	}
 
 	/**
@@ -305,7 +305,7 @@ public final class ColumnInfoRecordsAggr
 		int k  = 0;
 
 		for (k = 0; k < records.size(); k++) {
-			ColumnInfoRecord tci = (ColumnInfoRecord) records.get(k);
+			ColumnInfoRecord tci = records.get(k);
 			if (tci.containsColumn(targetColumnIx)) {
 				ci = tci;
 				break;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java Sun Dec 28 09:06:12 2014
@@ -33,18 +33,18 @@ import org.apache.poi.ss.formula.Formula
  */
 public final class ConditionalFormattingTable extends RecordAggregate {
 
-	private final List _cfHeaders;
+	private final List<CFRecordsAggregate> _cfHeaders;
 
 	/**
 	 * Creates an empty ConditionalFormattingTable
 	 */
 	public ConditionalFormattingTable() {
-		_cfHeaders = new ArrayList();
+		_cfHeaders = new ArrayList<CFRecordsAggregate>();
 	}
 
 	public ConditionalFormattingTable(RecordStream rs) {
 
-		List temp = new ArrayList();
+		List<CFRecordsAggregate> temp = new ArrayList<CFRecordsAggregate>();
 		while (rs.peekNextClass() == CFHeaderRecord.class) {
 			temp.add(CFRecordsAggregate.createCFAggregate(rs));
 		}
@@ -53,7 +53,7 @@ public final class ConditionalFormatting
 
 	public void visitContainedRecords(RecordVisitor rv) {
 		for (int i = 0; i < _cfHeaders.size(); i++) {
-			CFRecordsAggregate subAgg = (CFRecordsAggregate) _cfHeaders.get(i);
+			CFRecordsAggregate subAgg = _cfHeaders.get(i);
 			subAgg.visitContainedRecords(rv);
 		}
 	}
@@ -72,7 +72,7 @@ public final class ConditionalFormatting
 
 	public CFRecordsAggregate get(int index) {
 		checkIndex(index);
-		return (CFRecordsAggregate) _cfHeaders.get(index);
+		return _cfHeaders.get(index);
 	}
 
 	public void remove(int index) {
@@ -89,7 +89,7 @@ public final class ConditionalFormatting
 
 	public void updateFormulasAfterCellShift(FormulaShifter shifter, int externSheetIndex) {
 		for (int i = 0; i < _cfHeaders.size(); i++) {
-			CFRecordsAggregate subAgg = (CFRecordsAggregate) _cfHeaders.get(i);
+			CFRecordsAggregate subAgg = _cfHeaders.get(i);
 			boolean shouldKeep = subAgg.updateFormulasAfterCellShift(shifter, externSheetIndex);
 			if (!shouldKeep) {
 				_cfHeaders.remove(i);

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/DataValidityTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/DataValidityTable.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/DataValidityTable.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/DataValidityTable.java Sun Dec 28 09:06:12 2014
@@ -23,7 +23,6 @@ import java.util.List;
 import org.apache.poi.hssf.model.RecordStream;
 import org.apache.poi.hssf.record.DVALRecord;
 import org.apache.poi.hssf.record.DVRecord;
-import org.apache.poi.hssf.record.Record;
 
 /**
  * Manages the DVALRecord and DVRecords for a single sheet<br/>
@@ -37,20 +36,20 @@ public final class DataValidityTable ext
 	 * The list of data validations for the current sheet.
 	 * Note - this may be empty (contrary to OOO documentation)
 	 */
-	private final List _validationList;
+	private final List<DVRecord> _validationList;
 
 	public DataValidityTable(RecordStream rs) {
 		_headerRec = (DVALRecord) rs.getNext();
-		List temp = new ArrayList();
+		List<DVRecord> temp = new ArrayList<DVRecord>();
 		while (rs.peekNextClass() == DVRecord.class) {
-			temp.add(rs.getNext());
+			temp.add((DVRecord) rs.getNext());
 		}
 		_validationList = temp;
 	}
 
 	public DataValidityTable() {
 		_headerRec = new DVALRecord();
-		_validationList = new ArrayList();
+		_validationList = new ArrayList<DVRecord>();
 	}
 
 	public void visitContainedRecords(RecordVisitor rv) {
@@ -59,7 +58,7 @@ public final class DataValidityTable ext
 		}
 		rv.visitRecord(_headerRec);
 		for (int i = 0; i < _validationList.size(); i++) {
-			rv.visitRecord((Record) _validationList.get(i));
+			rv.visitRecord(_validationList.get(i));
 		}
 	}
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/DVConstraint.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/DVConstraint.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/DVConstraint.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/DVConstraint.java Sun Dec 28 09:06:12 2014
@@ -162,7 +162,7 @@ public class DVConstraint implements Dat
 		// formula2 and value2 are mutually exclusive
 		String formula2 = getFormulaFromTextExpression(expr2);
 		Double value2 = formula2 == null ? convertTime(expr2) : null;
-		return new DVConstraint(VT.TIME, comparisonOperator, formula1, formula2, value1, value2, null);
+		return new DVConstraint(ValidationType.TIME, comparisonOperator, formula1, formula2, value1, value2, null);
 	}
 	
 	/**
@@ -192,7 +192,7 @@ public class DVConstraint implements Dat
 		// formula2 and value2 are mutually exclusive
 		String formula2 = getFormulaFromTextExpression(expr2);
 		Double value2 = formula2 == null ? convertDate(expr2, df) : null;
-		return new DVConstraint(VT.DATE, comparisonOperator, formula1, formula2, value1, value2, null);
+		return new DVConstraint(ValidationType.DATE, comparisonOperator, formula1, formula2, value1, value2, null);
 	}
 	
 	/**
@@ -270,7 +270,7 @@ public class DVConstraint implements Dat
 		if (formula == null) {
 			throw new IllegalArgumentException("formula must be supplied");
 		}
-		return new DVConstraint(VT.FORMULA, OperatorType.IGNORED, formula, null, null, null, null);
+		return new DVConstraint(ValidationType.FORMULA, OperatorType.IGNORED, formula, null, null, null, null);
 	}
 	
 	/* (non-Javadoc)
@@ -284,14 +284,14 @@ public class DVConstraint implements Dat
 	 * @return <code>true</code> if this constraint is a 'list' validation
 	 */
 	public boolean isListValidationType() {
-		return _validationType == VT.LIST;
+		return _validationType == ValidationType.LIST;
 	}
 	/**
 	 * Convenience method
 	 * @return <code>true</code> if this constraint is a 'list' validation with explicit values
 	 */
 	public boolean isExplicitList() {
-		return _validationType == VT.LIST && _explicitListValues != null;
+		return _validationType == ValidationType.LIST && _explicitListValues != null;
 	}
 	/* (non-Javadoc)
 	 * @see org.apache.poi.hssf.usermodel.DataValidationConstraint#getOperator()
@@ -316,7 +316,7 @@ public class DVConstraint implements Dat
 	 * @see org.apache.poi.hssf.usermodel.DataValidationConstraint#setExplicitListValues(java.lang.String[])
 	 */
 	public void setExplicitListValues(String[] explicitListValues) {
-		if (_validationType != VT.LIST) {
+		if (_validationType != ValidationType.LIST) {
 			throw new RuntimeException("Cannot setExplicitListValues on non-list constraint");
 		}
 		_formula1 = null;

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/constant/ErrorConstant.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/constant/ErrorConstant.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/constant/ErrorConstant.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/constant/ErrorConstant.java Sun Dec 28 09:06:12 2014
@@ -33,13 +33,20 @@ public class ErrorConstant {
 	// convenient access to name space
 	private static final ErrorConstants EC = null;
 
-	private static final ErrorConstant NULL = new ErrorConstant(EC.ERROR_NULL);
-	private static final ErrorConstant DIV_0 = new ErrorConstant(EC.ERROR_DIV_0);
-	private static final ErrorConstant VALUE = new ErrorConstant(EC.ERROR_VALUE);
-	private static final ErrorConstant REF = new ErrorConstant(EC.ERROR_REF);
-	private static final ErrorConstant NAME = new ErrorConstant(EC.ERROR_NAME);
-	private static final ErrorConstant NUM = new ErrorConstant(EC.ERROR_NUM);
-	private static final ErrorConstant NA = new ErrorConstant(EC.ERROR_NA);
+	@SuppressWarnings("static-access")
+    private static final ErrorConstant NULL = new ErrorConstant(EC.ERROR_NULL);
+	@SuppressWarnings("static-access")
+    private static final ErrorConstant DIV_0 = new ErrorConstant(EC.ERROR_DIV_0);
+	@SuppressWarnings("static-access")
+    private static final ErrorConstant VALUE = new ErrorConstant(EC.ERROR_VALUE);
+	@SuppressWarnings("static-access")
+    private static final ErrorConstant REF = new ErrorConstant(EC.ERROR_REF);
+	@SuppressWarnings("static-access")
+    private static final ErrorConstant NAME = new ErrorConstant(EC.ERROR_NAME);
+	@SuppressWarnings("static-access")
+    private static final ErrorConstant NUM = new ErrorConstant(EC.ERROR_NUM);
+	@SuppressWarnings("static-access")
+    private static final ErrorConstant NA = new ErrorConstant(EC.ERROR_NA);
 
 	private final int _errorCode;
 

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/eval/ErrorEval.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/eval/ErrorEval.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/eval/ErrorEval.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/eval/ErrorEval.java Sun Dec 28 09:06:12 2014
@@ -29,18 +29,25 @@ public final class ErrorEval implements
     private static final ErrorConstants EC = null;
 
     /** <b>#NULL!</b>  - Intersection of two cell ranges is empty */
+    @SuppressWarnings("static-access")
     public static final ErrorEval NULL_INTERSECTION = new ErrorEval(EC.ERROR_NULL);
     /** <b>#DIV/0!</b> - Division by zero */
+    @SuppressWarnings("static-access")
     public static final ErrorEval DIV_ZERO = new ErrorEval(EC.ERROR_DIV_0);
     /** <b>#VALUE!</b> - Wrong type of operand */
+    @SuppressWarnings("static-access")
     public static final ErrorEval VALUE_INVALID = new ErrorEval(EC.ERROR_VALUE);
     /** <b>#REF!</b> - Illegal or deleted cell reference */
+    @SuppressWarnings("static-access")
     public static final ErrorEval REF_INVALID = new ErrorEval(EC.ERROR_REF);
     /** <b>#NAME?</b> - Wrong function or range name */
+    @SuppressWarnings("static-access")
     public static final ErrorEval NAME_INVALID = new ErrorEval(EC.ERROR_NAME);
     /** <b>#NUM!</b> - Value range overflow */
+    @SuppressWarnings("static-access")
     public static final ErrorEval NUM_ERROR = new ErrorEval(EC.ERROR_NUM);
     /** <b>#N/A</b> - Argument or function not available */
+    @SuppressWarnings("static-access")
     public static final ErrorEval NA = new ErrorEval(EC.ERROR_NA);
 
 

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/ptg/ErrPtg.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/ptg/ErrPtg.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/ptg/ErrPtg.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/ptg/ErrPtg.java Sun Dec 28 09:06:12 2014
@@ -30,18 +30,25 @@ public final class ErrPtg extends Scalar
     private static final ErrorConstants EC = null;
 
     /** <b>#NULL!</b>  - Intersection of two cell ranges is empty */
+    @SuppressWarnings("static-access")
     public static final ErrPtg NULL_INTERSECTION = new ErrPtg(EC.ERROR_NULL);
     /** <b>#DIV/0!</b> - Division by zero */
+    @SuppressWarnings("static-access")
     public static final ErrPtg DIV_ZERO = new ErrPtg(EC.ERROR_DIV_0);
     /** <b>#VALUE!</b> - Wrong type of operand */
+    @SuppressWarnings("static-access")
     public static final ErrPtg VALUE_INVALID = new ErrPtg(EC.ERROR_VALUE);
     /** <b>#REF!</b> - Illegal or deleted cell reference */
+    @SuppressWarnings("static-access")
     public static final ErrPtg REF_INVALID = new ErrPtg(EC.ERROR_REF);
     /** <b>#NAME?</b> - Wrong function or range name */
+    @SuppressWarnings("static-access")
     public static final ErrPtg NAME_INVALID = new ErrPtg(EC.ERROR_NAME);
     /** <b>#NUM!</b> - Value range overflow */
+    @SuppressWarnings("static-access")
     public static final ErrPtg NUM_ERROR = new ErrPtg(EC.ERROR_NUM);
     /** <b>#N/A</b> - Argument or function not available */
+    @SuppressWarnings("static-access")
     public static final ErrPtg N_A = new ErrPtg(EC.ERROR_NA);
 
 

Modified: poi/trunk/src/java/org/apache/poi/ss/util/AreaReference.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/AreaReference.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/util/AreaReference.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/util/AreaReference.java Sun Dec 28 09:06:12 2014
@@ -17,11 +17,12 @@
 
 package org.apache.poi.ss.util;
 
-import org.apache.poi.ss.SpreadsheetVersion;
-
 import java.util.ArrayList;
+import java.util.List;
 import java.util.StringTokenizer;
 
+import org.apache.poi.ss.SpreadsheetVersion;
+
 public class AreaReference {
 
     /** The character (!) that separates sheet names from cell references */ 
@@ -199,14 +200,14 @@ public class AreaReference {
      *  returns an array of contiguous area references.
      */
     public static AreaReference[] generateContiguous(String reference) {
-        ArrayList refs = new ArrayList();
+        List<AreaReference> refs = new ArrayList<AreaReference>();
         StringTokenizer st = new StringTokenizer(reference, ",");
         while(st.hasMoreTokens()) {
             refs.add(
                     new AreaReference(st.nextToken())
             );
         }
-        return (AreaReference[])refs.toArray(new AreaReference[refs.size()]);
+        return refs.toArray(new AreaReference[refs.size()]);
     }
 
     /**
@@ -250,14 +251,14 @@ public class AreaReference {
         int maxCol = Math.max(_firstCell.getCol(), _lastCell.getCol());
         String sheetName = _firstCell.getSheetName();
         
-        ArrayList refs = new ArrayList();
+        List<CellReference> refs = new ArrayList<CellReference>();
         for(int row=minRow; row<=maxRow; row++) {
             for(int col=minCol; col<=maxCol; col++) {
                 CellReference ref = new CellReference(sheetName, row, col, _firstCell.isRowAbsolute(), _firstCell.isColAbsolute());
                 refs.add(ref);
             }
         }
-        return (CellReference[])refs.toArray(new CellReference[refs.size()]);
+        return refs.toArray(new CellReference[refs.size()]);
     }
 
     /**

Modified: poi/trunk/src/java/org/apache/poi/ss/util/CellRangeAddressList.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/CellRangeAddressList.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/util/CellRangeAddressList.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/util/CellRangeAddressList.java Sun Dec 28 09:06:12 2014
@@ -42,10 +42,10 @@ public class CellRangeAddressList {
 	/**
 	 * List of <tt>CellRangeAddress</tt>es. Each structure represents a cell range
 	 */
-	protected final List _list;
+	protected final List<CellRangeAddress> _list;
 
 	public CellRangeAddressList() {
-		_list = new ArrayList();
+		_list = new ArrayList<CellRangeAddress>();
 	}
 	/**
 	 * Convenience constructor for creating a <tt>CellRangeAddressList</tt> with a single 
@@ -101,14 +101,14 @@ public class CellRangeAddressList {
 			throw new RuntimeException("Range index (" + rangeIndex 
 					+ ") is outside allowable range (0.." + (_list.size()-1) + ")");
 		}
-		return (CellRangeAddress) _list.remove(rangeIndex);
+		return _list.remove(rangeIndex);
 	}
 
 	/**
 	 * @return <tt>CellRangeAddress</tt> at the given index
 	 */
 	public CellRangeAddress getCellRangeAddress(int index) {
-		return (CellRangeAddress) _list.get(index);
+		return _list.get(index);
 	}
 
 	public int getSize() {
@@ -131,7 +131,7 @@ public class CellRangeAddressList {
 		int nItems = _list.size();
 		out.writeShort(nItems);
 		for (int k = 0; k < nItems; k++) {
-			CellRangeAddress region = (CellRangeAddress) _list.get(k);
+			CellRangeAddress region = _list.get(k);
 			region.serialize(out);
 		}
 	}
@@ -142,7 +142,7 @@ public class CellRangeAddressList {
 		
 		int nItems = _list.size();
 		for (int k = 0; k < nItems; k++) {
-			CellRangeAddress region = (CellRangeAddress) _list.get(k);
+			CellRangeAddress region = _list.get(k);
 			result.addCellRangeAddress(region.copy());
 		}
 		return result;

Modified: poi/trunk/src/java/org/apache/poi/util/BinaryTree.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/util/BinaryTree.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/util/BinaryTree.java (original)
+++ poi/trunk/src/java/org/apache/poi/util/BinaryTree.java Sun Dec 28 09:06:12 2014
@@ -88,6 +88,7 @@ import java.util.*;
  * @author Marc Johnson (mjohnson at apache dot org)
  */
 //for performance
+@SuppressWarnings("rawtypes")
 public class BinaryTree extends AbstractMap {
     final Node[] _root;
     int _size = 0;

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/TextFragment.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/TextFragment.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/TextFragment.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/TextFragment.java Sun Dec 28 09:06:12 2014
@@ -23,6 +23,7 @@ import java.awt.*;
 import java.awt.font.TextLayout;
 import java.text.AttributedCharacterIterator;
 import java.text.AttributedString;
+import java.text.CharacterIterator;
 
 /**
  * a renderable text fragment
@@ -76,7 +77,7 @@ class TextFragment {
 
         AttributedCharacterIterator it = _str.getIterator();
          StringBuffer buf = new StringBuffer();
-         for (char c = it.first(); c != it.DONE; c = it.next()) {
+         for (char c = it.first(); c != CharacterIterator.DONE; c = it.next()) {
              buf.append(c);
          }
         return buf.toString();

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java Sun Dec 28 09:06:12 2014
@@ -33,7 +33,6 @@ import org.apache.poi.ss.formula.udf.UDF
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellValue;
 import org.apache.poi.ss.usermodel.FormulaEvaluator;
-import org.apache.poi.ss.usermodel.Workbook;
 
 /**
  * Evaluates formula cells.<p/>
@@ -239,7 +238,7 @@ public class XSSFFormulaEvaluator implem
 	 *  cells, and calling evaluateFormulaCell on each one.
 	 */
 	public static void evaluateAllFormulaCells(XSSFWorkbook wb) {
-	   HSSFFormulaEvaluator.evaluateAllFormulaCells((Workbook)wb);
+	   HSSFFormulaEvaluator.evaluateAllFormulaCells(wb);
 	}
    /**
     * Loops over all cells in all sheets of the supplied

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java Sun Dec 28 09:06:12 2014
@@ -312,7 +312,7 @@ public class XWPFHeaderFooterPolicy {
 
 
     private XmlOptions commit(XWPFHeaderFooter wrapper) {
-        XmlOptions xmlOptions = new XmlOptions(wrapper.DEFAULT_XML_OPTIONS);
+        XmlOptions xmlOptions = new XmlOptions(POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
         Map<String, String> map = new HashMap<String, String>();
         map.put("http://schemas.openxmlformats.org/officeDocument/2006/math", "m");
         map.put("urn:schemas-microsoft-com:office:office", "o");

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java Sun Dec 28 09:06:12 2014
@@ -109,7 +109,7 @@ public final class TestColumnHelper exte
         assertEquals(9, cols1.sizeOfColArray());
         assertEquals(20, cols1.getColArray(8).getMin());
         assertEquals(30, cols1.getColArray(8).getMax());
-        helper.sortColumns(cols1);
+        ColumnHelper.sortColumns(cols1);
         assertEquals(9, cols1.sizeOfColArray());
         assertEquals(25, cols1.getColArray(8).getMin());
         assertEquals(27, cols1.getColArray(8).getMax());

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeader.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeader.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeader.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFHeader.java Sun Dec 28 09:06:12 2014
@@ -93,10 +93,10 @@ public final class TestXWPFHeader extend
         pars2[1] = p3;
 
         // Set headers
-        XWPFHeader headerD = policy.createHeader(policy.DEFAULT, pars);
-        XWPFHeader headerF = policy.createHeader(policy.FIRST);
+        XWPFHeader headerD = policy.createHeader(XWPFHeaderFooterPolicy.DEFAULT, pars);
+        XWPFHeader headerF = policy.createHeader(XWPFHeaderFooterPolicy.FIRST);
         // Set a default footer and capture the returned XWPFFooter object.
-        XWPFFooter footer = policy.createFooter(policy.DEFAULT, pars2);
+        XWPFFooter footer = policy.createFooter(XWPFHeaderFooterPolicy.DEFAULT, pars2);
 
         // Ensure the headers and footer were set correctly....
         assertNotNull(policy.getDefaultHeader());

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestDocumentProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestDocumentProperties.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestDocumentProperties.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestDocumentProperties.java Sun Dec 28 09:06:12 2014
@@ -22,7 +22,9 @@ import java.lang.reflect.Field;
 import java.util.Arrays;
 
 import junit.framework.TestCase;
+
 import org.apache.poi.hwpf.HWPFDocFixture;
+import org.apache.poi.hwpf.model.types.DOPAbstractType;
 
 public final class TestDocumentProperties
   extends TestCase
@@ -33,7 +35,7 @@ public final class TestDocumentPropertie
   public void testReadWrite()
     throws Exception
   {
-    int size = _documentProperties.getSize();
+    int size = DOPAbstractType.getSize();
     byte[] buf = new byte[size];
 
     _documentProperties.serialize(buf, 0);

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java Sun Dec 28 09:06:12 2014
@@ -45,6 +45,9 @@ import org.apache.poi.ss.usermodel.DateU
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.usermodel.DataValidation.ErrorStyle;
+import org.apache.poi.ss.usermodel.DataValidationConstraint.OperatorType;
 import org.apache.poi.ss.util.CellRangeAddressList;
 
 /**
@@ -149,11 +152,11 @@ public final class TestDataValidation ex
 		int dvRow = 0;
 		Sheet sheet = wb.getSheetAt(0);
 		DataValidationHelper dataValidationHelper = sheet.getDataValidationHelper();
-		DataValidationConstraint dc = dataValidationHelper.createIntegerConstraint(OP.EQUAL, "42", null);
+		DataValidationConstraint dc = dataValidationHelper.createIntegerConstraint(OperatorType.EQUAL, "42", null);
 		DataValidation dv = dataValidationHelper.createValidation(dc,new CellRangeAddressList(dvRow, dvRow, 0, 0));
 		
 		dv.setEmptyCellAllowed(false);
-		dv.setErrorStyle(ES.STOP);
+		dv.setErrorStyle(ErrorStyle.STOP);
 		dv.setShowPromptBox(true);
 		dv.createErrorBox("Xxx", "Yyy");
 		dv.setSuppressDropDownArrow(true);

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java Sun Dec 28 09:06:12 2014
@@ -31,6 +31,7 @@ import org.apache.poi.hssf.record.LabelS
 import org.apache.poi.hssf.record.Record;
 import org.apache.poi.hssf.record.aggregates.RecordAggregate.RecordVisitor;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.Region;
 import org.apache.poi.util.TempFile;
@@ -395,7 +396,7 @@ public final class TestWorkbook extends
         HSSFCell        c  = s.getRow(0).getCell(0);
         int             a  = c.getCellType();
 
-        assertEquals(a, c.CELL_TYPE_NUMERIC);
+        assertEquals(a, Cell.CELL_TYPE_NUMERIC);
     }
 
     /**

Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestEqualEval.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestEqualEval.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestEqualEval.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestEqualEval.java Sun Dec 28 09:06:12 2014
@@ -43,7 +43,7 @@ public final class TestEqualEval extends
 			EvalFactory.createAreaEval("B1:B1", values),
 			BoolEval.FALSE,
 		};
-		ValueEval result = evaluate(EI.Equal, args, 10, 10);
+		ValueEval result = evaluate(EvalInstances.Equal, args, 10, 10);
 		if (result instanceof ErrorEval) {
 			if (result == ErrorEval.VALUE_INVALID) {
 				throw new AssertionFailedError("Identified bug in evaluation of 1x1 area");
@@ -61,7 +61,7 @@ public final class TestEqualEval extends
 			new StringEval(""),
 			BlankEval.instance,
 		};
-		ValueEval result = evaluate(EI.Equal, args, 10, 10);
+		ValueEval result = evaluate(EvalInstances.Equal, args, 10, 10);
 		assertEquals(BoolEval.class, result.getClass());
 		BoolEval be = (BoolEval) result;
 		if (!be.getBooleanValue()) {
@@ -74,14 +74,14 @@ public final class TestEqualEval extends
 	 * Test for bug 46613 (observable at svn r737248)
 	 */
 	public void testStringInsensitive_bug46613() {
-		if (!evalStringCmp("abc", "aBc", EI.Equal)) {
+		if (!evalStringCmp("abc", "aBc", EvalInstances.Equal)) {
 			throw new AssertionFailedError("Identified bug 46613");
 		}
-		assertTrue(evalStringCmp("abc", "aBc", EI.Equal));
-		assertTrue(evalStringCmp("ABC", "azz", EI.LessThan));
-		assertTrue(evalStringCmp("abc", "AZZ", EI.LessThan));
-		assertTrue(evalStringCmp("ABC", "aaa", EI.GreaterThan));
-		assertTrue(evalStringCmp("abc", "AAA", EI.GreaterThan));
+		assertTrue(evalStringCmp("abc", "aBc", EvalInstances.Equal));
+		assertTrue(evalStringCmp("ABC", "azz", EvalInstances.LessThan));
+		assertTrue(evalStringCmp("abc", "AZZ", EvalInstances.LessThan));
+		assertTrue(evalStringCmp("ABC", "aaa", EvalInstances.GreaterThan));
+		assertTrue(evalStringCmp("abc", "AAA", EvalInstances.GreaterThan));
 	}
 
 	private static boolean evalStringCmp(String a, String b, Function cmpOp) {
@@ -107,17 +107,17 @@ public final class TestEqualEval extends
 		confirmCompares(BoolEval.FALSE, BoolEval.FALSE, 0);
 	}
 	private static void confirmCompares(ValueEval a, ValueEval b, int expRes) {
-		confirm(a, b, expRes>0,  EI.GreaterThan);
-		confirm(a, b, expRes>=0, EI.GreaterEqual);
-		confirm(a, b, expRes==0, EI.Equal);
-		confirm(a, b, expRes<=0, EI.LessEqual);
-		confirm(a, b, expRes<0,  EI.LessThan);
-
-		confirm(b, a, expRes<0,  EI.GreaterThan);
-		confirm(b, a, expRes<=0, EI.GreaterEqual);
-		confirm(b, a, expRes==0, EI.Equal);
-		confirm(b, a, expRes>=0, EI.LessEqual);
-		confirm(b, a, expRes>0,  EI.LessThan);
+		confirm(a, b, expRes>0,  EvalInstances.GreaterThan);
+		confirm(a, b, expRes>=0, EvalInstances.GreaterEqual);
+		confirm(a, b, expRes==0, EvalInstances.Equal);
+		confirm(a, b, expRes<=0, EvalInstances.LessEqual);
+		confirm(a, b, expRes<0,  EvalInstances.LessThan);
+
+		confirm(b, a, expRes<0,  EvalInstances.GreaterThan);
+		confirm(b, a, expRes<=0, EvalInstances.GreaterEqual);
+		confirm(b, a, expRes==0, EvalInstances.Equal);
+		confirm(b, a, expRes>=0, EvalInstances.LessEqual);
+		confirm(b, a, expRes>0,  EvalInstances.LessThan);
 	}
 	private static void confirm(ValueEval a, ValueEval b, boolean expectedResult, Function cmpOp) {
 		ValueEval[] args = { a, b, };
@@ -142,7 +142,7 @@ public final class TestEqualEval extends
 			throw new AssertionFailedError("Identified bug 47198: unary minus should convert -0.0 to 0.0");
 		}
 		ValueEval[] args = { zero, mZero, };
-		BoolEval result = (BoolEval) evaluate(EI.Equal, args, 0, 0);
+		BoolEval result = (BoolEval) evaluate(EvalInstances.Equal, args, 0, 0);
 		if (!result.getBooleanValue()) {
 			throw new AssertionFailedError("Identified bug 47198: -0.0 != 0.0");
 		}
@@ -157,7 +157,7 @@ public final class TestEqualEval extends
 		assertEquals("1.0055", b.getStringValue());
 
 		ValueEval[] args = { a, b, };
-		BoolEval result = (BoolEval) evaluate(EI.Equal, args, 0, 0);
+		BoolEval result = (BoolEval) evaluate(EvalInstances.Equal, args, 0, 0);
 		if (!result.getBooleanValue()) {
 			throw new AssertionFailedError("Identified bug 47598: 1+1.0028-0.9973 != 1.0055");
 		}

Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestFormulaBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestFormulaBugs.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestFormulaBugs.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestFormulaBugs.java Sun Dec 28 09:06:12 2014
@@ -124,49 +124,54 @@ public final class TestFormulaBugs exten
 
 	/**
 	 * Bug 42448 - Can't parse SUMPRODUCT(A!C7:A!C67, B8:B68) / B69 <p/>
+	 * @throws IOException 
 	 */
-	public void test42448() {
+	public void test42448() throws IOException {
 		HSSFWorkbook wb = new HSSFWorkbook();
-		HSSFSheet sheet1 = wb.createSheet("Sheet1");
-
-		HSSFRow row = sheet1.createRow(0);
-		HSSFCell cell = row.createCell(0);
-
-		// it's important to create the referenced sheet first
-		HSSFSheet sheet2 = wb.createSheet("A"); // note name 'A'
-		// TODO - POI crashes if the formula is added before this sheet
-		// RuntimeException("Zero length string is an invalid sheet name")
-		// Excel doesn't crash but the formula doesn't work until it is
-		// re-entered
-
-		String inputFormula = "SUMPRODUCT(A!C7:A!C67, B8:B68) / B69"; // as per bug report
 		try {
-			cell.setCellFormula(inputFormula); 
-		} catch (StringIndexOutOfBoundsException e) {
-			throw new AssertionFailedError("Identified bug 42448");
+    		HSSFSheet sheet1 = wb.createSheet("Sheet1");
+    
+    		HSSFRow row = sheet1.createRow(0);
+    		HSSFCell cell = row.createCell(0);
+    
+    		// it's important to create the referenced sheet first
+    		HSSFSheet sheet2 = wb.createSheet("A"); // note name 'A'
+    		// TODO - POI crashes if the formula is added before this sheet
+    		// RuntimeException("Zero length string is an invalid sheet name")
+    		// Excel doesn't crash but the formula doesn't work until it is
+    		// re-entered
+    
+    		String inputFormula = "SUMPRODUCT(A!C7:A!C67, B8:B68) / B69"; // as per bug report
+    		try {
+    			cell.setCellFormula(inputFormula); 
+    		} catch (StringIndexOutOfBoundsException e) {
+    			throw new AssertionFailedError("Identified bug 42448");
+    		}
+    
+    		assertEquals("SUMPRODUCT(A!C7:A!C67,B8:B68)/B69", cell.getCellFormula());
+    
+    		// might as well evaluate the sucker...
+    
+    		addCell(sheet2, 5, 2, 3.0); // A!C6
+    		addCell(sheet2, 6, 2, 4.0); // A!C7
+    		addCell(sheet2, 66, 2, 5.0); // A!C67
+    		addCell(sheet2, 67, 2, 6.0); // A!C68
+    
+    		addCell(sheet1, 6, 1, 7.0); // B7
+    		addCell(sheet1, 7, 1, 8.0); // B8
+    		addCell(sheet1, 67, 1, 9.0); // B68
+    		addCell(sheet1, 68, 1, 10.0); // B69
+    
+    		double expectedResult = (4.0 * 8.0 + 5.0 * 9.0) / 10.0;
+    
+    		HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
+    		CellValue cv = fe.evaluate(cell);
+    
+    		assertEquals(HSSFCell.CELL_TYPE_NUMERIC, cv.getCellType());
+    		assertEquals(expectedResult, cv.getNumberValue(), 0.0);
+		} finally {
+		    wb.close();
 		}
-
-		assertEquals("SUMPRODUCT(A!C7:A!C67,B8:B68)/B69", cell.getCellFormula());
-
-		// might as well evaluate the sucker...
-
-		addCell(sheet2, 5, 2, 3.0); // A!C6
-		addCell(sheet2, 6, 2, 4.0); // A!C7
-		addCell(sheet2, 66, 2, 5.0); // A!C67
-		addCell(sheet2, 67, 2, 6.0); // A!C68
-
-		addCell(sheet1, 6, 1, 7.0); // B7
-		addCell(sheet1, 7, 1, 8.0); // B8
-		addCell(sheet1, 67, 1, 9.0); // B68
-		addCell(sheet1, 68, 1, 10.0); // B69
-
-		double expectedResult = (4.0 * 8.0 + 5.0 * 9.0) / 10.0;
-
-		HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
-		CellValue cv = fe.evaluate(cell);
-
-		assertEquals(HSSFCell.CELL_TYPE_NUMERIC, cv.getCellType());
-		assertEquals(expectedResult, cv.getNumberValue(), 0.0);
 	}
 
 	private static void addCell(HSSFSheet sheet, int rowIx, int colIx,

Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java Sun Dec 28 09:06:12 2014
@@ -40,24 +40,21 @@ import org.apache.poi.util.HexDump;
 public final class TestMinusZeroResult extends TestCase {
 	private static final double MINUS_ZERO = -0.0;
 
-	// convenient access to namepace
-	private static final EvalInstances EI = null;
-
 	public void testSimpleOperators() {
 
 		// unary plus is a no-op
 		checkEval(MINUS_ZERO, UnaryPlusEval.instance, MINUS_ZERO);
 
 		// most simple operators convert -0.0 to +0.0
-		checkEval(0.0, EI.UnaryMinus, 0.0);
-		checkEval(0.0, EI.Percent, MINUS_ZERO);
-		checkEval(0.0, EI.Multiply, MINUS_ZERO, 1.0);
-		checkEval(0.0, EI.Divide, MINUS_ZERO, 1.0);
-		checkEval(0.0, EI.Power, MINUS_ZERO, 1.0);
+		checkEval(0.0, EvalInstances.UnaryMinus, 0.0);
+		checkEval(0.0, EvalInstances.Percent, MINUS_ZERO);
+		checkEval(0.0, EvalInstances.Multiply, MINUS_ZERO, 1.0);
+		checkEval(0.0, EvalInstances.Divide, MINUS_ZERO, 1.0);
+		checkEval(0.0, EvalInstances.Power, MINUS_ZERO, 1.0);
 
 		// but SubtractEval does not convert -0.0, so '-' and '+' work like java
-		checkEval(MINUS_ZERO, EI.Subtract, MINUS_ZERO, 0.0); // this is the main point of bug 47198
-		checkEval(0.0, EI.Add, MINUS_ZERO, 0.0);
+		checkEval(MINUS_ZERO, EvalInstances.Subtract, MINUS_ZERO, 0.0); // this is the main point of bug 47198
+		checkEval(0.0, EvalInstances.Add, MINUS_ZERO, 0.0);
 	}
 
 	/**
@@ -65,9 +62,9 @@ public final class TestMinusZeroResult e
 	 * gets to the comparison operator)
 	 */
 	public void testComparisonOperators() {
-		checkEval(false, EI.Equal, 0.0, MINUS_ZERO);
-		checkEval(true, EI.GreaterThan, 0.0, MINUS_ZERO);
-		checkEval(true, EI.LessThan, MINUS_ZERO, 0.0);
+		checkEval(false, EvalInstances.Equal, 0.0, MINUS_ZERO);
+		checkEval(true, EvalInstances.GreaterThan, 0.0, MINUS_ZERO);
+		checkEval(true, EvalInstances.LessThan, MINUS_ZERO, 0.0);
 	}
 
 	public void testTextRendering() {
@@ -81,7 +78,7 @@ public final class TestMinusZeroResult e
 	 */
 	private static void confirmTextRendering(String expRendering, double d) {
 		ValueEval[] args = { StringEval.EMPTY_INSTANCE, new NumberEval(d), };
-		StringEval se = (StringEval) EI.Concat.evaluate(args, -1, (short)-1);
+		StringEval se = (StringEval) EvalInstances.Concat.evaluate(args, -1, (short)-1);
 		String result = se.getStringValue();
 		assertEquals(expRendering, result);
 	}

Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestIndirect.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestIndirect.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestIndirect.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestIndirect.java Sun Dec 28 09:06:12 2014
@@ -118,31 +118,31 @@ public final class TestIndirect extends
 		// simple error propagation:
 
 		// arg0 is evaluated to text first
-		confirm(feA, c, "INDIRECT(#DIV/0!)", EE.DIV_ZERO);
-		confirm(feA, c, "INDIRECT(#DIV/0!)", EE.DIV_ZERO);
-		confirm(feA, c, "INDIRECT(#NAME?, \"x\")", EE.NAME_INVALID);
-		confirm(feA, c, "INDIRECT(#NUM!, #N/A)", EE.NUM_ERROR);
+		confirm(feA, c, "INDIRECT(#DIV/0!)", ErrorEval.DIV_ZERO);
+		confirm(feA, c, "INDIRECT(#DIV/0!)", ErrorEval.DIV_ZERO);
+		confirm(feA, c, "INDIRECT(#NAME?, \"x\")", ErrorEval.NAME_INVALID);
+		confirm(feA, c, "INDIRECT(#NUM!, #N/A)", ErrorEval.NUM_ERROR);
 
 		// arg1 is evaluated to boolean before arg0 is decoded
-		confirm(feA, c, "INDIRECT(\"garbage\", #N/A)", EE.NA);
-		confirm(feA, c, "INDIRECT(\"garbage\", \"\")", EE.VALUE_INVALID); // empty string is not valid boolean
-		confirm(feA, c, "INDIRECT(\"garbage\", \"flase\")", EE.VALUE_INVALID); // must be "TRUE" or "FALSE"
+		confirm(feA, c, "INDIRECT(\"garbage\", #N/A)", ErrorEval.NA);
+		confirm(feA, c, "INDIRECT(\"garbage\", \"\")", ErrorEval.VALUE_INVALID); // empty string is not valid boolean
+		confirm(feA, c, "INDIRECT(\"garbage\", \"flase\")", ErrorEval.VALUE_INVALID); // must be "TRUE" or "FALSE"
 
 
 		// spaces around sheet name (with or without quotes makes no difference)
-		confirm(feA, c, "INDIRECT(\"'Sheet1 '!D3\")", EE.REF_INVALID);
-		confirm(feA, c, "INDIRECT(\" Sheet1!D3\")", EE.REF_INVALID);
-		confirm(feA, c, "INDIRECT(\"'Sheet1' !D3\")", EE.REF_INVALID);
+		confirm(feA, c, "INDIRECT(\"'Sheet1 '!D3\")", ErrorEval.REF_INVALID);
+		confirm(feA, c, "INDIRECT(\" Sheet1!D3\")", ErrorEval.REF_INVALID);
+		confirm(feA, c, "INDIRECT(\"'Sheet1' !D3\")", ErrorEval.REF_INVALID);
 
 
-		confirm(feA, c, "SUM(INDIRECT(\"'John's sales'!A1:C1\"))", EE.REF_INVALID); // bad quote escaping
-		confirm(feA, c, "INDIRECT(\"[Book1]Sheet1!A1\")", EE.REF_INVALID); // unknown external workbook
-		confirm(feA, c, "INDIRECT(\"Sheet3!A1\")", EE.REF_INVALID); // unknown sheet
+		confirm(feA, c, "SUM(INDIRECT(\"'John's sales'!A1:C1\"))", ErrorEval.REF_INVALID); // bad quote escaping
+		confirm(feA, c, "INDIRECT(\"[Book1]Sheet1!A1\")", ErrorEval.REF_INVALID); // unknown external workbook
+		confirm(feA, c, "INDIRECT(\"Sheet3!A1\")", ErrorEval.REF_INVALID); // unknown sheet
 		if (false) { // TODO - support evaluation of defined names
-			confirm(feA, c, "INDIRECT(\"Sheet1!IW1\")", EE.REF_INVALID); // bad column
-			confirm(feA, c, "INDIRECT(\"Sheet1!A65537\")", EE.REF_INVALID); // bad row
+			confirm(feA, c, "INDIRECT(\"Sheet1!IW1\")", ErrorEval.REF_INVALID); // bad column
+			confirm(feA, c, "INDIRECT(\"Sheet1!A65537\")", ErrorEval.REF_INVALID); // bad row
 		}
-		confirm(feA, c, "INDIRECT(\"Sheet1!A 1\")", EE.REF_INVALID); // space in cell ref
+		confirm(feA, c, "INDIRECT(\"Sheet1!A 1\")", ErrorEval.REF_INVALID); // space in cell ref
 	}
 
 	public void testMultipleWorkbooks() {
@@ -186,7 +186,7 @@ public final class TestIndirect extends
 		}
 		int expCode = expectedResult.getErrorCode();
 		if (cv.getErrorValue() != expCode) {
-			throw new AssertionFailedError("Expected error '" + EE.getText(expCode)
+			throw new AssertionFailedError("Expected error '" + ErrorEval.getText(expCode)
 					+ "' but got '" + cv.formatAsString() + "'.");
 		}
 	}

Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestRoundFuncs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestRoundFuncs.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestRoundFuncs.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestRoundFuncs.java Sun Dec 28 09:06:12 2014
@@ -35,7 +35,7 @@ public final class TestRoundFuncs extend
 
 		ValueEval strArg = new StringEval("abc");
 		ValueEval[] args = { strArg, new NumberEval(2), };
-		ValueEval result = F.ROUNDDOWN.evaluate(args, -1, (short)-1);
+		ValueEval result = NumericFunction.ROUNDDOWN.evaluate(args, -1, (short)-1);
 		assertEquals(ErrorEval.VALUE_INVALID, result);
 	}
 
@@ -43,7 +43,7 @@ public final class TestRoundFuncs extend
 
 		ValueEval strArg = new StringEval("abc");
 		ValueEval[] args = { strArg, new NumberEval(2), };
-		ValueEval result = F.ROUNDUP.evaluate(args, -1, (short)-1);
+		ValueEval result = NumericFunction.ROUNDUP.evaluate(args, -1, (short)-1);
 		assertEquals(ErrorEval.VALUE_INVALID, result);
 	}
 

Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java Sun Dec 28 09:06:12 2014
@@ -33,7 +33,7 @@ public final class TestTrunc extends Abs
 
 		ValueEval strArg = new StringEval("abc");
 		ValueEval[] args = { strArg, new NumberEval(2) };
-		ValueEval result = F.TRUNC.evaluate(args, -1, (short)-1);
+		ValueEval result = NumericFunction.TRUNC.evaluate(args, -1, (short)-1);
 		assertEquals(ErrorEval.VALUE_INVALID, result);
 	}
 
@@ -53,7 +53,7 @@ public final class TestTrunc extends Abs
 	
 	public void testTruncWithDecimalNumberOneArg() {
 		ValueEval[] args = { new NumberEval(2.612777) };
-		ValueEval result = F.TRUNC.evaluate(args, -1, (short)-1);
+		ValueEval result = NumericFunction.TRUNC.evaluate(args, -1, (short)-1);
 		assertEquals("TRUNC", (new NumberEval(2d)).getNumberValue(), ((NumberEval)result).getNumberValue());
 	}
 

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java?rev=1648156&r1=1648155&r2=1648156&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java Sun Dec 28 09:06:12 2014
@@ -178,7 +178,7 @@ public abstract class BaseTestCell exten
 		Font f = wb.createFont();
 		f.setFontHeightInPoints((short) 20);
 		f.setColor(IndexedColors.RED.getIndex());
-		f.setBoldweight(f.BOLDWEIGHT_BOLD);
+		f.setBoldweight(Font.BOLDWEIGHT_BOLD);
 		f.setFontName("Arial Unicode MS");
 		cs.setFillBackgroundColor((short)3);
 		cs.setFont(f);
@@ -197,7 +197,7 @@ public abstract class BaseTestCell exten
 		r = s.getRow(0);
 		c = r.getCell(0);
 
-		assertTrue("Formula Cell at 0,0", (c.getCellType()==c.CELL_TYPE_FORMULA));
+		assertTrue("Formula Cell at 0,0", (c.getCellType()==Cell.CELL_TYPE_FORMULA));
 		cs = c.getCellStyle();
 
 		assertNotNull("Formula Cell Style", cs);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message