Author: nick
Date: Tue Oct 19 19:22:24 2010
New Revision: 1024368

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

Modified:
    
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java
    
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java
    
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecord.java
    
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordAtom.java

Modified: 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java?rev=1024368&r1=1024367&r2=1024368&view=diff
==============================================================================
--- 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java
 (original)
+++ 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java
 Tue Oct 19 19:22:24 2010
@@ -122,9 +122,8 @@ public final class QuickButCruddyTextExt
         */
        public String getTextAsString() {
                StringBuffer ret = new StringBuffer();
-               Vector textV = getTextAsVector();
-               for(int i=0; i<textV.size(); i++) {
-                       String text = (String)textV.get(i);
+               Vector<String> textV = getTextAsVector();
+               for(String text : textV) {
                        ret.append(text);
                        if(! text.endsWith("\n")) {
                                ret.append('\n');
@@ -137,8 +136,8 @@ public final class QuickButCruddyTextExt
         * Fetches the ALL the text of the powerpoint file, in a vector of
         *  strings, one per text record
         */
-       public Vector getTextAsVector() {
-               Vector textV = new Vector();
+       public Vector<String> getTextAsVector() {
+               Vector<String> textV = new Vector<String>();
 
                // Set to the start of the file
                int walkPos = 0;
@@ -159,7 +158,7 @@ public final class QuickButCruddyTextExt
         * If it is a text record, grabs out the text. Whatever happens, returns
         *  the position of the next record, or -1 if no more.
         */
-       public int findTextRecords(int startPos, Vector textV) {
+       public int findTextRecords(int startPos, Vector<String> textV) {
                // Grab the length, and the first option byte
                // Note that the length doesn't include the 8 byte atom header
                int len = (int)LittleEndian.getUInt(pptContents,startPos+4);

Modified: 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java?rev=1024368&r1=1024367&r2=1024368&view=diff
==============================================================================
--- 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java 
(original)
+++ 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java 
Tue Oct 19 19:22:24 2010
@@ -48,13 +48,13 @@ public final class PersistPtrHolder exte
         * You always need to check the most recent PersistPtrHolder
         *  that knows about a given slide to find the right location
         */
-       private Hashtable _slideLocations;
+       private Hashtable<Integer,Integer> _slideLocations;
        /**
         * Holds the lookup from slide id to where their offset is
         *  held inside _ptrData. Used when writing out, and updating
         *  the positions of the slides
         */
-       private Hashtable _slideOffsetDataLocation;
+       private Hashtable<Integer,Integer> _slideOffsetDataLocation;
 
        /**
         * Get the list of slides that this PersistPtrHolder knows about.
@@ -63,9 +63,9 @@ public final class PersistPtrHolder exte
         */
        public int[] getKnownSlideIDs() {
                int[] ids = new int[_slideLocations.size()];
-               Enumeration e = _slideLocations.keys();
+               Enumeration<Integer> e = _slideLocations.keys();
                for(int i=0; i<ids.length; i++) {
-                       Integer id = (Integer)e.nextElement();
+                       Integer id = e.nextElement();
                        ids[i] = id.intValue();
                }
                return ids;
@@ -75,14 +75,14 @@ public final class PersistPtrHolder exte
         * Get the lookup from slide numbers to byte offsets, for the slides
         *  known about by this PersistPtrHolder.
         */
-       public Hashtable getSlideLocationsLookup() {
+       public Hashtable<Integer,Integer> getSlideLocationsLookup() {
                return _slideLocations;
        }
        /**
         * Get the lookup from slide numbers to their offsets inside
         *  _ptrData, used when adding or moving slides.
         */
-       public Hashtable getSlideOffsetDataLocationsLookup() {
+       public Hashtable<Integer,Integer> getSlideOffsetDataLocationsLookup() {
                return _slideOffsetDataLocation;
        }
 
@@ -140,8 +140,8 @@ public final class PersistPtrHolder exte
                //      base number for these entries
                //   count * 32 bit offsets
                // Repeat as many times as you have data
-               _slideLocations = new Hashtable();
-               _slideOffsetDataLocation = new Hashtable();
+               _slideLocations = new Hashtable<Integer,Integer>();
+               _slideOffsetDataLocation = new Hashtable<Integer,Integer>();
                _ptrData = new byte[len-8];
                System.arraycopy(source,start+8,_ptrData,0,_ptrData.length);
 
@@ -181,7 +181,7 @@ public final class PersistPtrHolder exte
         * At write-out time, update the references to the sheets to their
         *  new positions
         */
-       public void updateOtherRecordReferences(Hashtable 
oldToNewReferencesLookup) {
+       public void updateOtherRecordReferences(Hashtable<Integer,Integer> 
oldToNewReferencesLookup) {
                int[] slideIDs = getKnownSlideIDs();
 
                // Loop over all the slides we know about

Modified: 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecord.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecord.java?rev=1024368&r1=1024367&r2=1024368&view=diff
==============================================================================
--- 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecord.java
 (original)
+++ 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecord.java
 Tue Oct 19 19:22:24 2010
@@ -47,5 +47,5 @@ public interface PositionDependentRecord
         * Offer the record the list of records that have changed their
         *  location as part of the writeout.
         */
-       public void updateOtherRecordReferences(Hashtable 
oldToNewReferencesLookup);
+       public void updateOtherRecordReferences(Hashtable<Integer,Integer> 
oldToNewReferencesLookup);
 }

Modified: 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordAtom.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordAtom.java?rev=1024368&r1=1024367&r2=1024368&view=diff
==============================================================================
--- 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordAtom.java
 (original)
+++ 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/PositionDependentRecordAtom.java
 Tue Oct 19 19:22:24 2010
@@ -48,5 +48,5 @@ public abstract class PositionDependentR
         * Allows records to update their internal pointers to other records
         *  locations
         */
-       public abstract void updateOtherRecordReferences(Hashtable 
oldToNewReferencesLookup);
+       public abstract void 
updateOtherRecordReferences(Hashtable<Integer,Integer> 
oldToNewReferencesLookup);
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to