harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r416116 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util: DeleteOnExit.java OIDDatabase.java
Date Wed, 21 Jun 2006 21:29:03 GMT
Author: ndbeyer
Date: Wed Jun 21 14:29:03 2006
New Revision: 416116

URL: http://svn.apache.org/viewvc?rev=416116&view=rev
Log:
Generification cleanup

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/OIDDatabase.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java?rev=416116&r1=416115&r2=416116&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java
Wed Jun 21 14:29:03 2006
@@ -22,7 +22,7 @@
 import org.apache.harmony.kernel.vm.VM;
 
 public class DeleteOnExit {
-	private static Vector deleteList = new Vector();
+	private static Vector<String> deleteList = new Vector<String>();
 
 	static {
 		VM.deleteOnExit();
@@ -34,7 +34,7 @@
 
 	public static void deleteOnExit() {
 		for (int i = 0; i < deleteList.size(); i++) {
-			String name = (String) deleteList.elementAt(i);
+			String name = deleteList.elementAt(i);
 			new File(name).delete();
 		}
 	}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/OIDDatabase.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/OIDDatabase.java?rev=416116&r1=416115&r2=416116&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/OIDDatabase.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/OIDDatabase.java
Wed Jun 21 14:29:03 2006
@@ -103,16 +103,16 @@
 
 	public String getFirstAlgorithmForOID(String oid) {
 		String result = null;
-		Iterator it = this.getAllAlgorithmsForOID(oid).iterator();
+		Iterator<String> it = this.getAllAlgorithmsForOID(oid).iterator();
 		if (it.hasNext()) {
-			result = ((String) it.next());
+			result = (it.next());
 		}
 		return result;
 	}
 
-	public Set getAllAlgorithmsForOID(String oid) {
-		Set result = null;
-		Iterator it = this.oids.iterator();
+	public Set<String> getAllAlgorithmsForOID(String oid) {
+		Set<String> result = null;
+		Iterator<DBEntry> it = this.oids.iterator();
 		result = getAllEquivalents(oid, it);
 		if (result == null) {
 			throw new IllegalArgumentException("Unknown OID : " + oid);
@@ -122,16 +122,16 @@
 
 	public String getFirstOIDForAlgorithm(String algorithm) {
 		String result = null;
-		Iterator it = this.getAllOIDsForAlgorithm(algorithm).iterator();
+		Iterator<String> it = this.getAllOIDsForAlgorithm(algorithm).iterator();
 		if (it.hasNext()) {
-			result = ((String) it.next());
+			result = (it.next());
 		}
 		return result;
 	}
 
-	public Set getAllOIDsForAlgorithm(String algorithm) {
-		Set result = null;
-		Iterator it = this.algorithms.iterator();
+	public Set<String> getAllOIDsForAlgorithm(String algorithm) {
+		Set<String> result = null;
+		Iterator<DBEntry> it = this.algorithms.iterator();
 		result = getAllEquivalents(algorithm, it);
 		if (result == null) {
 			throw new IllegalArgumentException("Unsupported algorithm : "
@@ -140,16 +140,16 @@
 		return result;
 	}
 
-	private Set getAllEquivalents(String value, Iterator it) {
+	private Set<String> getAllEquivalents(String value, Iterator<DBEntry> it) {
 		Set<String> result = null;
 		while (it.hasNext()) {
-			DBEntry element = (DBEntry) it.next();
+			DBEntry element = it.next();
 			if (element.getValue().equals(value)) {
-				Set allMatchingDBEntries = element.getAllEquivalents();
+				Set<DBEntry> allMatchingDBEntries = element.getAllEquivalents();
 				result = new HashSet<String>();
-				Iterator dbIt = allMatchingDBEntries.iterator();
+				Iterator<DBEntry> dbIt = allMatchingDBEntries.iterator();
 				while (dbIt.hasNext()) {
-					DBEntry matchingEntry = (DBEntry) dbIt.next();
+					DBEntry matchingEntry = dbIt.next();
 					result.add(matchingEntry.getValue());
 				}
 			}
@@ -158,9 +158,9 @@
 	}
 
 	static class DBEntry {
-		private List<DBEntry> equivalents = new LinkedList();
+		private final List<DBEntry> equivalents = new LinkedList<DBEntry>();
 
-		private String value;
+		private final String value;
 
 		DBEntry(String value) {
 			this.value = value;
@@ -174,8 +174,8 @@
 			return this.value;
 		}
 
-		Set getAllEquivalents() {
-			return new HashSet(this.equivalents);
+		Set<DBEntry> getAllEquivalents() {
+			return new HashSet<DBEntry>(this.equivalents);
 		}
 	}
 }



Mime
View raw message