poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r960094 - in /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model: PAPBinTable.java PAPFormattedDiskPage.java
Date Fri, 02 Jul 2010 20:01:43 GMT
Author: nick
Date: Fri Jul  2 20:01:42 2010
New Revision: 960094

URL: http://svn.apache.org/viewvc?rev=960094&view=rev
Log:
Fix generics warnings

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPBinTable.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPFormattedDiskPage.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPBinTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPBinTable.java?rev=960094&r1=960093&r2=960094&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPBinTable.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPBinTable.java Fri Jul  2 20:01:42
2010
@@ -36,7 +36,7 @@ import org.apache.poi.util.LittleEndian;
  */
 public final class PAPBinTable
 {
-  protected ArrayList _paragraphs = new ArrayList();
+  protected ArrayList<PAPX> _paragraphs = new ArrayList<PAPX>();
   byte[] _dataStream;
 
   /** So we can know if things are unicode or not */
@@ -89,7 +89,7 @@ public final class PAPBinTable
     }
     else
     {
-      PAPX currentPap = (PAPX)_paragraphs.get(listIndex);
+      PAPX currentPap = _paragraphs.get(listIndex);
       if (currentPap != null && currentPap.getStart() < cpStart)
       {
         SprmBuffer clonedBuf = null;
@@ -131,33 +131,33 @@ public final class PAPBinTable
     int endMark = offset + length;
     int endIndex = listIndex;
 
-    PAPX papx = (PAPX)_paragraphs.get(endIndex);
+    PAPX papx = _paragraphs.get(endIndex);
     while (papx.getEnd() < endMark)
     {
-      papx = (PAPX)_paragraphs.get(++endIndex);
+      papx = _paragraphs.get(++endIndex);
     }
     if (listIndex == endIndex)
     {
-      papx = (PAPX)_paragraphs.get(endIndex);
+      papx = _paragraphs.get(endIndex);
       papx.setEnd((papx.getEnd() - endMark) + offset);
     }
     else
     {
-      papx = (PAPX)_paragraphs.get(listIndex);
+      papx = _paragraphs.get(listIndex);
       papx.setEnd(offset);
       for (int x = listIndex + 1; x < endIndex; x++)
       {
-        papx = (PAPX)_paragraphs.get(x);
+        papx = _paragraphs.get(x);
         papx.setStart(offset);
         papx.setEnd(offset);
       }
-      papx = (PAPX)_paragraphs.get(endIndex);
+      papx = _paragraphs.get(endIndex);
       papx.setEnd((papx.getEnd() - endMark) + offset);
     }
 
     for (int x = endIndex + 1; x < size; x++)
     {
-      papx = (PAPX)_paragraphs.get(x);
+      papx = _paragraphs.get(x);
       papx.setStart(papx.getStart() - length);
       papx.setEnd(papx.getEnd() - length);
     }
@@ -179,7 +179,7 @@ public final class PAPBinTable
   }
 
 
-  public ArrayList getParagraphs()
+  public ArrayList<PAPX> getParagraphs()
   {
     return _paragraphs;
   }
@@ -211,7 +211,7 @@ public final class PAPBinTable
     endingFc += fcMin;
 
 
-    ArrayList overflow = _paragraphs;
+    ArrayList<PAPX> overflow = _paragraphs;
     do
     {
       PropertyNode startingProp = (PropertyNode)overflow.get(0);

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPFormattedDiskPage.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPFormattedDiskPage.java?rev=960094&r1=960093&r2=960094&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPFormattedDiskPage.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/PAPFormattedDiskPage.java Fri Jul
 2 20:01:42 2010
@@ -44,8 +44,8 @@ public final class PAPFormattedDiskPage 
     private static final int BX_SIZE = 13;
     private static final int FC_SIZE = 4;
 
-    private ArrayList _papxList = new ArrayList();
-    private ArrayList _overFlow;
+    private ArrayList<PAPX> _papxList = new ArrayList<PAPX>();
+    private ArrayList<PAPX> _overFlow;
     private byte[] _dataStream;
 
 
@@ -74,7 +74,7 @@ public final class PAPFormattedDiskPage 
      *
      * @param filler a List of PAPXs
      */
-    public void fill(List filler)
+    public void fill(List<PAPX> filler)
     {
       _papxList.addAll(filler);
     }
@@ -91,7 +91,7 @@ public final class PAPFormattedDiskPage 
      *
      * @return The remaining PAPXs that didn't fit into this FKP.
      */
-    ArrayList getOverflow()
+    ArrayList<PAPX> getOverflow()
     {
       return _overFlow;
     }
@@ -103,7 +103,7 @@ public final class PAPFormattedDiskPage 
      */
     public PAPX getPAPX(int index)
     {
-      return (PAPX)_papxList.get(index);
+      return _papxList.get(index);
     }
 
     /**
@@ -198,7 +198,7 @@ public final class PAPFormattedDiskPage 
       // see if we couldn't fit some
       if (index != size)
       {
-        _overFlow = new ArrayList();
+        _overFlow = new ArrayList<PAPX>();
         _overFlow.addAll(_papxList.subList(index, size));
       }
 
@@ -212,7 +212,7 @@ public final class PAPFormattedDiskPage 
       lastGrpprl = new byte[0];
       for (int x = 0; x < index; x++)
       {
-        papx = (PAPX)_papxList.get(x);
+        papx = _papxList.get(x);
         byte[] phe = papx.getParagraphHeight().toByteArray();
         byte[] grpprl = papx.getGrpprl();
 



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


Mime
View raw message