db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r330133 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java
Date Tue, 01 Nov 2005 22:12:57 GMT
Author: djd
Date: Tue Nov  1 14:12:53 2005
New Revision: 330133

URL: http://svn.apache.org/viewcvs?rev=330133&view=rev
Log:
DERBY-656 Use the size estimates from the catalog to avoid security
issues in BackingStoreHashtable. This matches the other uses of the
class size utilities, eg. for the DataValueDescriptors.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java?rev=330133&r1=330132&r2=330133&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java
Tue Nov  1 14:12:53 2005
@@ -121,17 +121,10 @@
     private long max_inmemory_size;
     private boolean keepAfterCommit;
 
-    private static int vectorSize; // The estimated number of bytes used by Vector(0)
-    static {
-        try
-        {
-            vectorSize = ClassSize.estimateBase( java.util.Vector.class);
-        }
-        catch( SecurityException se)
-        {
-            vectorSize = 4*ClassSize.refSize;
-        }
-    };
+    /**
+     * The estimated number of bytes used by Vector(0)
+     */  
+    private final static int vectorSize = ClassSize.estimateBaseFromCatalog(java.util.Vector.class);
     
     private DiskHashtable diskHashtable;
 



Mime
View raw message