jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1174284 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java
Date Thu, 22 Sep 2011 17:57:17 GMT
Author: reschke
Date: Thu Sep 22 17:57:17 2011
New Revision: 1174284

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

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java?rev=1174284&r1=1174283&r2=1174284&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java
Thu Sep 22 17:57:17 2011
@@ -56,6 +56,7 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.Map;
 
 /**
  * Abstract base class for database persistence managers. This class
@@ -106,7 +107,7 @@ public abstract class DatabasePersistenc
     protected static final int SLEEP_BEFORE_RECONNECT = 10000;
 
     // the map of prepared statements (key: sql stmt, value: prepared stmt)
-    private HashMap preparedStatements = new HashMap();
+    private Map<String, PreparedStatement> preparedStatements = new HashMap<String,
PreparedStatement>();
 
     // SQL statements for NodeState management
     protected String nodeStateInsertSQL;
@@ -269,8 +270,8 @@ public abstract class DatabasePersistenc
 
         try {
             // close shared prepared statements
-            for (Iterator it = preparedStatements.values().iterator(); it.hasNext();) {
-                closeStatement((PreparedStatement) it.next());
+            for (PreparedStatement ps : preparedStatements.values()) {
+                closeStatement(ps);
             }
             preparedStatements.clear();
 
@@ -828,8 +829,8 @@ public abstract class DatabasePersistenc
         // gracefully in order to avoid potential memory leaks
 
         // close shared prepared statements
-        for (Iterator it = preparedStatements.values().iterator(); it.hasNext();) {
-            PreparedStatement stmt = ((PreparedStatement) it.next());
+        for (Iterator<PreparedStatement> it = preparedStatements.values().iterator();
it.hasNext();) {
+            PreparedStatement stmt = it.next();
             if (stmt != null) {
                 try {
                     stmt.close();



Mime
View raw message