You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2005/11/01 23:29:01 UTC

svn commit: r330136 - /db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java

Author: djd
Date: Tue Nov  1 14:28:59 2005
New Revision: 330136

URL: http://svn.apache.org/viewcvs?rev=330136&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.

Merge of 330133 from trunk.

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

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java?rev=330136&r1=330135&r2=330136&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java Tue Nov  1 14:28:59 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;