jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r366214 - in /incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query: sql/JCRSQLQueryBuilder.java xpath/XPathQueryBuilder.java
Date Thu, 05 Jan 2006 16:38:14 GMT
Author: mreutegg
Date: Thu Jan  5 08:38:08 2006
New Revision: 366214

URL: http://svn.apache.org/viewcvs?rev=366214&view=rev
Log:
Memory leak in query parsers.
See: http://thread.gmane.org/gmane.comp.apache.jackrabbit.devel/5026

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java?rev=366214&r1=366213&r2=366214&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
Thu Jan  5 08:38:08 2006
@@ -35,6 +35,7 @@
 import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.util.ISO8601;
 import org.apache.log4j.Logger;
+import org.apache.commons.collections.map.ReferenceMap;
 
 import javax.jcr.query.InvalidQueryException;
 import java.text.SimpleDateFormat;
@@ -46,7 +47,6 @@
 import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.Map;
-import java.util.WeakHashMap;
 import java.io.StringReader;
 
 /**
@@ -68,7 +68,7 @@
     /**
      * Map of reusable JCRSQL parser instances indexed by NamespaceResolver.
      */
-    private static Map parsers = new WeakHashMap();
+    private static Map parsers = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK);
 
 
     /**

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java?rev=366214&r1=366213&r2=366214&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
Thu Jan  5 08:38:08 2006
@@ -38,6 +38,7 @@
 import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.util.ISO8601;
 import org.apache.jackrabbit.util.ISO9075;
+import org.apache.commons.collections.map.ReferenceMap;
 
 import javax.jcr.query.InvalidQueryException;
 import java.io.StringReader;
@@ -45,7 +46,6 @@
 import java.util.Calendar;
 import java.util.List;
 import java.util.Map;
-import java.util.WeakHashMap;
 
 /**
  * Query builder that translates a XPath statement into a query tree structure.
@@ -195,7 +195,7 @@
     /**
      * Map of reusable XPath parser instances indexed by NamespaceResolver.
      */
-    private static Map parsers = new WeakHashMap();
+    private static Map parsers = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK);
 
     /**
      * The root <code>QueryNode</code>



Mime
View raw message