You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2010/01/03 21:56:40 UTC

svn commit: r895477 - in /poi/trunk/src: java/org/apache/poi/poifs/filesystem/DirectoryEntry.java java/org/apache/poi/poifs/filesystem/DirectoryNode.java ooxml/java/org/apache/poi/extractor/ExtractorFactory.java

Author: nick
Date: Sun Jan  3 20:56:40 2010
New Revision: 895477

URL: http://svn.apache.org/viewvc?rev=895477&view=rev
Log:
Add in a few bits of Generics to avoid warnings

Modified:
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryEntry.java
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java
    poi/trunk/src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java

Modified: poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryEntry.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryEntry.java?rev=895477&r1=895476&r2=895477&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryEntry.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryEntry.java Sun Jan  3 20:56:40 2010
@@ -47,7 +47,7 @@
      *         implementations of Entry.
      */
 
-    public Iterator getEntries();
+    public Iterator<Entry> getEntries();
 
     /**
      * is this DirectoryEntry empty?

Modified: poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java?rev=895477&r1=895476&r2=895477&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java Sun Jan  3 20:56:40 2010
@@ -41,7 +41,7 @@
 {
 
     // Map of Entry instances, keyed by their names
-    private Map               _entries;
+    private Map<String,Entry> _entries;
 
     // the POIFSFileSystem we belong to
     private POIFSFileSystem   _filesystem;
@@ -75,12 +75,12 @@
             });
         }
         _filesystem = filesystem;
-        _entries    = new HashMap();
-        Iterator iter = property.getChildren();
+        _entries    = new HashMap<String, Entry>();
+        Iterator<Property> iter = property.getChildren();
 
         while (iter.hasNext())
         {
-            Property child     = ( Property ) iter.next();
+            Property child     = iter.next();
             Entry    childNode = null;
 
             if (child.isDirectory())
@@ -215,7 +215,7 @@
      *         implementations of Entry.
      */
 
-    public Iterator getEntries()
+    public Iterator<Entry> getEntries()
     {
         return _entries.values().iterator();
     }
@@ -263,7 +263,7 @@
 
         if (name != null)
         {
-            rval = ( Entry ) _entries.get(name);
+            rval = _entries.get(name);
         }
         if (rval == null)
         {
@@ -416,8 +416,9 @@
         List components = new ArrayList();
 
         components.add(getProperty());
-        SortedMap sortedEntries = new TreeMap(_entries);
-        Iterator  iter          = sortedEntries.values().iterator();
+        SortedMap<String,Entry> sortedEntries = 
+        	new TreeMap<String,Entry>(_entries);
+        Iterator<Entry> iter = sortedEntries.values().iterator();
 
         while (iter.hasNext())
         {

Modified: poi/trunk/src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java?rev=895477&r1=895476&r2=895477&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java Sun Jan  3 20:56:40 2010
@@ -123,8 +123,8 @@
 	public static POIOLE2TextExtractor createExtractor(DirectoryNode poifsDir, POIFSFileSystem fs) throws IOException {
 		// Look for certain entries in the stream, to figure it
 		//  out from
-		for(Iterator entries = poifsDir.getEntries(); entries.hasNext(); ) {
-			Entry entry = (Entry)entries.next();
+		for(Iterator<Entry> entries = poifsDir.getEntries(); entries.hasNext(); ) {
+			Entry entry = entries.next();
 			
 			if(entry.getName().equals("Workbook")) {
 				return new ExcelExtractor(poifsDir, fs);
@@ -160,9 +160,9 @@
 		
 		if(ext instanceof ExcelExtractor) {
 			// These are in MBD... under the root
-			Iterator it = fs.getRoot().getEntries();
+			Iterator<Entry> it = fs.getRoot().getEntries();
 			while(it.hasNext()) {
-				Entry entry = (Entry)it.next();
+				Entry entry = it.next();
 				if(entry.getName().startsWith("MBD")) {
 					dirs.add(entry);
 				}
@@ -172,9 +172,9 @@
 			try {
 				DirectoryEntry op = (DirectoryEntry)
 					fs.getRoot().getEntry("ObjectPool");
-				Iterator it = op.getEntries();
+				Iterator<Entry> it = op.getEntries();
 				while(it.hasNext()) {
-					Entry entry = (Entry)it.next();
+					Entry entry = it.next();
 					if(entry.getName().startsWith("_")) {
 						dirs.add(entry);
 					}



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