db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r988107 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDate.java
Date Mon, 23 Aug 2010 12:55:26 GMT
Author: kahatlen
Date: Mon Aug 23 12:55:26 2010
New Revision: 988107

URL: http://svn.apache.org/viewvc?rev=988107&view=rev
Log:
DERBY-3173: Removed cached String objects from SQLDate

Patch contributed by Eranda Sooriyabandara <070468D@gmail.com>.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDate.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDate.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDate.java?rev=988107&r1=988106&r2=988107&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDate.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDate.java Mon Aug 23 12:55:26
2010
@@ -86,14 +86,11 @@ public final class SQLDate extends DataT
 
 	private int	encodedDate;	//year << 16 + month << 8 + day
 
-	// The cached value.toString()
-	private String	valueString;
-
     private static final int BASE_MEMORY_USAGE = ClassSize.estimateBaseFromCatalog( SQLDate.class);
 
     public int estimateMemoryUsage()
     {
-        return BASE_MEMORY_USAGE + ClassSize.estimateMemoryUsage( valueString);
+        return BASE_MEMORY_USAGE;
     } // end of estimateMemoryUsage
 
     int getEncodedDate()
@@ -111,23 +108,10 @@ public final class SQLDate extends DataT
 		//format is [yyy]y-mm-dd e.g. 1-01-01, 9999-99-99
 		if (!isNull())
 		{
-			if (valueString == null)
-			{
-				valueString = encodedDateToString(encodedDate);
-			}
-			return valueString;
+			return encodedDateToString(encodedDate);
 		}
 		else
 		{
-			if (SanityManager.DEBUG)
-			{
-				if (valueString != null)
-				{
-					SanityManager.THROWASSERT(
-						"valueString expected to be null, not " +
-						valueString);
-				}
-			}
 			return null;
 		}
 	}
@@ -229,15 +213,11 @@ public final class SQLDate extends DataT
 	{
 		encodedDate = in.readInt();
 
-		// reset cached string values
-		valueString = null;
 	}
 	public void readExternalFromArray(ArrayInputStream in) throws IOException
 	{
 		encodedDate = in.readInt();
 
-		// reset cached string values
-		valueString = null;
 	}
 
 	/*
@@ -268,8 +248,6 @@ public final class SQLDate extends DataT
 		// clear encodedDate
 		encodedDate = 0;
 
-		// clear cached valueString
-		valueString = null;
 	}
 
 	/*



Mime
View raw message