db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1407432 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/types/ impl/store/access/ impl/store/access/btree/ impl/store/access/btree/index/ impl/store/access/heap/
Date Fri, 09 Nov 2012 12:25:34 GMT
Author: kahatlen
Date: Fri Nov  9 12:25:31 2012
New Revision: 1407432

URL: http://svn.apache.org/viewvc?rev=1407432&view=rev
Log:
DERBY-2920: Share code between readExternal() and readExternalFromArray()

Provide a default readExternalFromArray() method that simply forwards
calls to readExternal() in the DataType class. Remove the method from
sub-classes where the readExternal() and readExternalFromArray() methods
are identical.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/BinaryDecimal.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataType.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBoolean.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDate.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDecimal.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDouble.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLInteger.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongint.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLReal.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLRef.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLSmallint.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTime.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTimestamp.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTinyint.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/UserType.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/StorableFormatId.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2I.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/BinaryDecimal.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/BinaryDecimal.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/BinaryDecimal.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/BinaryDecimal.java Fri Nov
 9 12:25:31 2012
@@ -30,7 +30,6 @@ import java.sql.Types;
 
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.services.io.ArrayInputStream;
 import org.apache.derby.iapi.services.io.StoredFormatIds;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
@@ -639,27 +638,6 @@ return divide(dividend, divisor, result,
 		in.readFully(data2c);
 
 	}
-	public void readExternalFromArray(ArrayInputStream in) throws IOException 
-	{
-		sqlScale = in.readUnsignedByte();
-		int size = in.readUnsignedByte();
-
-		/*
-		** Allocate a new array if the data to read
-		** is larger than the existing array, or if
-		** we don't have an array yet.
-
-        Need to use readFully below and NOT just read because read does not
-        guarantee getting size bytes back, whereas readFully does (unless EOF).
-        */
-		if ((data2c == null) || size != data2c.length)
-		{
-			data2c = new byte[size];
-		}
-		in.readFully(data2c);
-	}
-
-
 
 	public final int getLength()
 	{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataType.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataType.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataType.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataType.java Fri Nov  9 12:25:31
2012
@@ -23,10 +23,11 @@ package org.apache.derby.iapi.types;
 
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.services.i18n.MessageService;
+import org.apache.derby.iapi.services.io.ArrayInputStream;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
 import java.io.InputStream;
+import java.io.IOException;
 import java.sql.Blob;
 import java.sql.Clob;
 import java.sql.Date;
@@ -260,6 +261,20 @@ public abstract class DataType
         return this;
     }
 
+    /**
+     * Read the DataValueDescriptor from the stream. The default implementation
+     * calls {@code readExternal()}, which accesses the {@code ArrayInputStream}
+     * as a generic stream. If sub-classes can implement it more efficiently
+     * by accessing the array, they should override this method.
+     *
+     * @see DataValueDescriptor#readExternalFromArray
+     * @see java.io.Externalizable#readExternal
+     */
+    public void readExternalFromArray(ArrayInputStream in)
+            throws IOException, ClassNotFoundException {
+        readExternal(in);
+    }
+
 	/*
 	 * Column interface
 	 */

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java Fri Nov  9
12:25:31 2012
@@ -27,8 +27,6 @@ import org.apache.derby.iapi.reference.C
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.reference.MessageId;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
 import org.apache.derby.iapi.error.StandardException;
 
 import org.apache.derby.iapi.services.context.ContextService;
@@ -431,26 +429,6 @@ abstract class SQLBinary
 			readFromStream((InputStream) in);
 		}
 	}
-	public final void readExternalFromArray(ArrayInputStream in) throws IOException
-	{
-		// need to clear stream first, in case this object is reused, and
-		// stream is set by previous use.  Track 3794.
-		stream = null;
-		streamValueLength = -1;
-        _blobValue = null;
-
-		int len = SQLBinary.readBinaryLength(in);
-
-		if (len != 0)
-		{
-			dataValue = new byte[len];
-			in.readFully(dataValue);
-		}
-		else
-		{
-			readFromStream(in);
-		}
-	}
 
     /**
      * Read the encoded length of the value from the on-disk format.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBoolean.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBoolean.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBoolean.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBoolean.java Fri Nov  9
12:25:31 2012
@@ -21,9 +21,6 @@
 
 package org.apache.derby.iapi.types;
 
-
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
 import org.apache.derby.iapi.services.io.Storable;
@@ -32,11 +29,6 @@ import org.apache.derby.iapi.services.io
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.types.DataValueDescriptor;
-import org.apache.derby.iapi.types.TypeId;
-import org.apache.derby.iapi.types.BooleanDataValue;
-
-
 import org.apache.derby.iapi.services.cache.ClassSize;
 import org.apache.derby.iapi.util.StringUtil;
 
@@ -224,15 +216,6 @@ public final class SQLBoolean
 		value = in.readBoolean();
 		isnull = false;
 	}
-	public void readExternalFromArray(ArrayInputStream in) throws IOException {
-
-		if (SanityManager.DEBUG)
-			SanityManager.ASSERT( ! immutable,
-						"Attempt to set the value of an immutable SQLBoolean");
-
-		value = in.readBoolean();
-		isnull = false;
-	}
 
 	/**
 	 * @see Storable#restoreToNull

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=1407432&r1=1407431&r2=1407432&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 Fri Nov  9 12:25:31
2012
@@ -23,8 +23,6 @@ package org.apache.derby.iapi.types;
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
 import org.apache.derby.iapi.error.StandardException;
 
 import org.apache.derby.iapi.db.DatabaseContext;
@@ -201,12 +199,6 @@ public final class SQLDate extends DataT
 	public void readExternal(ObjectInput in) throws IOException
 	{
 		encodedDate = in.readInt();
-
-	}
-	public void readExternalFromArray(ArrayInputStream in) throws IOException
-	{
-		encodedDate = in.readInt();
-
 	}
 
 	/*

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDecimal.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDecimal.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDecimal.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDecimal.java Fri Nov  9
12:25:31 2012
@@ -23,8 +23,6 @@ package org.apache.derby.iapi.types;
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
 import org.apache.derby.iapi.services.io.StoredFormatIds;
@@ -33,11 +31,9 @@ import org.apache.derby.iapi.services.io
 import org.apache.derby.iapi.error.StandardException;
 
 import org.apache.derby.iapi.services.cache.ClassSize;
-import org.apache.derby.iapi.services.info.JVMInfo;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.lang.Math;
 import java.lang.reflect.Method;
 import java.lang.reflect.InvocationTargetException;
 import java.io.ObjectOutput;
@@ -502,29 +498,6 @@ public final class SQLDecimal extends Nu
 		in.readFully(rawData);
 
 	}
-	public void readExternalFromArray(ArrayInputStream in) throws IOException 
-	{
-		// clear the previous value to ensure that the
-		// rawData value will be used
-		value = null;
-
-		rawScale = in.readUnsignedByte();
-		int size = in.readUnsignedByte();
-
-		/*
-		** Allocate a new array if the data to read
-		** is larger than the existing array, or if
-		** we don't have an array yet.
-
-        Need to use readFully below and NOT just read because read does not
-        guarantee getting size bytes back, whereas readFully does (unless EOF).
-        */
-		if ((rawData == null) || size != rawData.length)
-		{
-			rawData = new byte[size];
-		}
-		in.readFully(rawData);
-	}
 
 	/**
 	 * @see Storable#restoreToNull

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDouble.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDouble.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDouble.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDouble.java Fri Nov  9
12:25:31 2012
@@ -23,8 +23,6 @@ package org.apache.derby.iapi.types;
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
 import org.apache.derby.iapi.services.io.StoredFormatIds;
 import org.apache.derby.iapi.services.io.Storable;
 
@@ -32,16 +30,8 @@ import org.apache.derby.iapi.services.sa
 
 import org.apache.derby.iapi.error.StandardException;
 
-import org.apache.derby.iapi.types.BooleanDataValue;
-import org.apache.derby.iapi.types.DataValueDescriptor;
-import org.apache.derby.iapi.types.NumberDataValue;
-import org.apache.derby.iapi.types.TypeId;
-
 import org.apache.derby.iapi.services.cache.ClassSize;
 
-import org.apache.derby.iapi.types.NumberDataType;
-import org.apache.derby.iapi.types.SQLBoolean;
-
 import java.io.ObjectOutput;
 import java.io.ObjectInput;
 import java.io.IOException;
@@ -240,13 +230,6 @@ public final class SQLDouble extends Num
 		isnull = false;
 	}
 
-	/** @see java.io.Externalizable#readExternal */
-	public void readExternalFromArray(ArrayInputStream in) throws IOException {
-
-		value = in.readDouble();
-		isnull = false;
-	}
-
 	/**
 	 * @see Storable#restoreToNull
 	 *

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLInteger.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLInteger.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLInteger.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLInteger.java Fri Nov  9
12:25:31 2012
@@ -21,12 +21,6 @@
 
 package org.apache.derby.iapi.types;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
-import org.apache.derby.iapi.types.DataValueDescriptor;
-import org.apache.derby.iapi.types.TypeId;
-import org.apache.derby.iapi.types.NumberDataValue;
-import org.apache.derby.iapi.types.BooleanDataValue;
 import org.apache.derby.iapi.reference.SQLState;
 
 import org.apache.derby.iapi.services.io.StoredFormatIds;
@@ -37,9 +31,6 @@ import org.apache.derby.iapi.services.sa
 
 import org.apache.derby.iapi.services.cache.ClassSize;
 
-import org.apache.derby.iapi.types.NumberDataType;
-import org.apache.derby.iapi.types.SQLBoolean;
-
 import java.io.ObjectOutput;
 import java.io.ObjectInput;
 import java.io.IOException;
@@ -177,12 +168,6 @@ public final class SQLInteger
 		value = in.readInt();
 		isnull = false;
 	}
-	public final void readExternalFromArray(ArrayInputStream in) 
-        throws IOException {
-
-		value = in.readInt();
-		isnull = false;
-	}
 
 	/**
 	 * @see Storable#restoreToNull

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongint.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongint.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongint.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLLongint.java Fri Nov  9
12:25:31 2012
@@ -21,12 +21,6 @@
 
 package org.apache.derby.iapi.types;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
-import org.apache.derby.iapi.types.DataValueDescriptor;
-import org.apache.derby.iapi.types.TypeId;
-import org.apache.derby.iapi.types.NumberDataValue;
-import org.apache.derby.iapi.types.BooleanDataValue;
 import org.apache.derby.iapi.reference.SQLState;
 
 import org.apache.derby.iapi.services.io.StoredFormatIds;
@@ -37,9 +31,6 @@ import org.apache.derby.iapi.services.sa
 
 import org.apache.derby.iapi.services.cache.ClassSize;
 
-import org.apache.derby.iapi.types.NumberDataType;
-import org.apache.derby.iapi.types.SQLBoolean;
-
 import java.io.ObjectOutput;
 import java.io.ObjectInput;
 import java.io.IOException;
@@ -198,11 +189,6 @@ public final class SQLLongint
 		value = in.readLong();
 		isnull = false;
 	}
-	public void readExternalFromArray(ArrayInputStream in) throws IOException {
-
-		value = in.readLong();
-		isnull = false;
-	}
 
 	/**
 	 * @see Storable#restoreToNull

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLReal.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLReal.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLReal.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLReal.java Fri Nov  9 12:25:31
2012
@@ -23,22 +23,12 @@ package org.apache.derby.iapi.types;
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
-import org.apache.derby.iapi.types.BooleanDataValue;
-import org.apache.derby.iapi.types.DataValueDescriptor;
-import org.apache.derby.iapi.types.NumberDataValue;
-import org.apache.derby.iapi.types.StringDataValue;
-import org.apache.derby.iapi.types.TypeId;
-
 import org.apache.derby.iapi.services.io.Storable;
 import org.apache.derby.iapi.services.io.StoredFormatIds;
 
 import org.apache.derby.iapi.error.StandardException;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
-import org.apache.derby.iapi.types.NumberDataType;
-import org.apache.derby.iapi.types.SQLBoolean;
 
 import org.apache.derby.iapi.services.cache.ClassSize;
 
@@ -242,12 +232,6 @@ public final class SQLReal
         value = in.readFloat();
         isnull = false;
 	}
-	public void readExternalFromArray(ArrayInputStream in) throws IOException {
-        // setValue(in.readFloat()); // can throw StandardException which we can't pass on
-        // assume we wrote the value, so we can read it without problem, for now.
-        value = in.readFloat();
-        isnull = false;
-	}
 
 	/**
 	 * @see Storable#restoreToNull

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLRef.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLRef.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLRef.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLRef.java Fri Nov  9 12:25:31
2012
@@ -21,28 +21,14 @@
 
 package org.apache.derby.iapi.types;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
 import org.apache.derby.iapi.error.StandardException;
 
-import org.apache.derby.iapi.types.DataTypeDescriptor;
-import org.apache.derby.iapi.types.DataValueDescriptor;
-import org.apache.derby.iapi.types.TypeId;
-import org.apache.derby.iapi.reference.SQLState;
-
-import org.apache.derby.iapi.types.DataValueDescriptor;
-
-import org.apache.derby.iapi.types.RowLocation;
-import org.apache.derby.iapi.types.Orderable;
-
 import org.apache.derby.iapi.services.io.StoredFormatIds;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
 import org.apache.derby.catalog.TypeDescriptor;
 
-import org.apache.derby.iapi.types.DataType;
-import org.apache.derby.iapi.types.RefDataValue;
 import org.apache.derby.iapi.services.cache.ClassSize;
 
 import java.io.ObjectOutput;
@@ -147,10 +133,6 @@ public class SQLRef extends DataType imp
 	{
 		value = (RowLocation) in.readObject();
 	}
-	public void readExternalFromArray(ArrayInputStream in) throws IOException, ClassNotFoundException
-	{
-		value = (RowLocation) in.readObject();
-	}
 
 	/**
 	 * @see org.apache.derby.iapi.services.io.Storable#restoreToNull

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLSmallint.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLSmallint.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLSmallint.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLSmallint.java Fri Nov 
9 12:25:31 2012
@@ -23,13 +23,6 @@ package org.apache.derby.iapi.types;
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
-import org.apache.derby.iapi.types.DataValueDescriptor;
-import org.apache.derby.iapi.types.TypeId;
-import org.apache.derby.iapi.types.NumberDataValue;
-import org.apache.derby.iapi.types.BooleanDataValue;
-
 import org.apache.derby.iapi.services.io.StoredFormatIds;
 import org.apache.derby.iapi.services.io.Storable;
 
@@ -38,9 +31,6 @@ import org.apache.derby.iapi.services.sa
 
 import org.apache.derby.iapi.services.cache.ClassSize;
 
-import org.apache.derby.iapi.types.NumberDataType;
-import org.apache.derby.iapi.types.SQLBoolean;
-
 import java.io.ObjectOutput;
 import java.io.ObjectInput;
 import java.io.IOException;
@@ -210,11 +200,6 @@ public final class SQLSmallint
 	}
 
 	/** @see java.io.Externalizable#readExternal */
-	public void readExternalFromArray(ArrayInputStream in) throws IOException {
-
-		value = in.readShort();
-		isnull = false;
-	}
 	public void readExternal(ObjectInput in) throws IOException {
 
 		value = in.readShort();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTime.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTime.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTime.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTime.java Fri Nov  9 12:25:31
2012
@@ -23,8 +23,6 @@ package org.apache.derby.iapi.types;
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
 import org.apache.derby.iapi.services.context.ContextService;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
@@ -207,11 +205,6 @@ public final class SQLTime extends DataT
 		encodedTime = in.readInt();
 		encodedTimeFraction = in.readInt();
 	}
-	public void readExternalFromArray(ArrayInputStream in) throws IOException
-	{
-		encodedTime = in.readInt();
-		encodedTimeFraction = in.readInt();
-	}
 
 	/*
 	 * DataValueDescriptor interface

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTimestamp.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTimestamp.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTimestamp.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTimestamp.java Fri Nov
 9 12:25:31 2012
@@ -23,8 +23,6 @@ package org.apache.derby.iapi.types;
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.db.DatabaseContext;
 
@@ -227,12 +225,6 @@ public final class SQLTimestamp extends 
 		encodedTime = in.readInt();
 		nanos = in.readInt();
 	}
-	public void readExternalFromArray(ArrayInputStream in) throws IOException
-	{
-		encodedDate = in.readInt();
-		encodedTime = in.readInt();
-		nanos = in.readInt();
-	}
 
 	/*
 	 * DataValueDescriptor interface

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTinyint.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTinyint.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTinyint.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTinyint.java Fri Nov  9
12:25:31 2012
@@ -23,24 +23,14 @@ package org.apache.derby.iapi.types;
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.services.io.StoredFormatIds;
 import org.apache.derby.iapi.services.io.Storable;
 
 import org.apache.derby.iapi.error.StandardException;
 
-import org.apache.derby.iapi.types.BooleanDataValue;
-import org.apache.derby.iapi.types.DataValueDescriptor;
-import org.apache.derby.iapi.types.NumberDataValue;
-import org.apache.derby.iapi.types.TypeId;
-
 import org.apache.derby.iapi.services.cache.ClassSize;
 
-import org.apache.derby.iapi.types.NumberDataType;
-import org.apache.derby.iapi.types.SQLBoolean;
-
 import java.io.ObjectOutput;
 import java.io.ObjectInput;
 import java.io.IOException;
@@ -257,12 +247,6 @@ public final class SQLTinyint
 		value = in.readByte();
 		isnull = false;
 	}
-	public void readExternalFromArray(ArrayInputStream in) throws IOException {
-
-		value = in.readByte();
-		isnull = false;
-	}
-
 
 	/**
 	 * @see Storable#restoreToNull

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/UserType.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/UserType.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/UserType.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/UserType.java Fri Nov  9 12:25:31
2012
@@ -25,20 +25,12 @@ import org.apache.derby.catalog.TypeDesc
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
 import org.apache.derby.iapi.services.loader.ClassInspector;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.services.io.StoredFormatIds;
 
 import org.apache.derby.iapi.error.StandardException;
 
-import org.apache.derby.iapi.types.DataValueDescriptor;
-import org.apache.derby.iapi.types.TypeId;
-
-import org.apache.derby.iapi.types.BooleanDataValue;
-import org.apache.derby.iapi.types.UserDataValue;
-
 import org.apache.derby.iapi.services.cache.ClassSize;
 
 import java.sql.Date;
@@ -304,12 +296,6 @@ public class UserType extends DataType
 		/* RESOLVE: Sanity check for right class */
 		value = in.readObject();
 	}
-	public void readExternalFromArray(ArrayInputStream in) 
-        throws IOException, ClassNotFoundException
-	{
-		/* RESOLVE: Sanity check for right class */
-		value = in.readObject();
-	}
 
 	/*
 	 * DataValueDescriptor interface

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/StorableFormatId.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/StorableFormatId.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/StorableFormatId.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/StorableFormatId.java
Fri Nov  9 12:25:31 2012
@@ -23,7 +23,6 @@ package org.apache.derby.impl.store.acce
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
 import org.apache.derby.iapi.services.io.FormatIdUtil;
 import org.apache.derby.iapi.services.io.StoredFormatIds;
 
@@ -108,11 +107,6 @@ public class StorableFormatId extends Da
     {
         format_id = FormatIdUtil.readFormatIdInteger(in);
     }
-	public void readExternalFromArray(ArrayInputStream in) throws IOException
-    {
-        format_id = FormatIdUtil.readFormatIdInteger(in);
-    }
-
 
     public void restoreToNull()
     {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java Fri
Nov  9 12:25:31 2012
@@ -23,7 +23,6 @@ package org.apache.derby.impl.store.acce
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
 import org.apache.derby.iapi.services.io.FormatableBitSet;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
@@ -685,27 +684,6 @@ public abstract class BTree extends Gene
 
 		id = new ContainerKey(segmentid, containerid);
 	}
-
-	public void readExternalFromArray(ArrayInputStream in) 
-        throws IOException, ClassNotFoundException
-	{
-        // read in the conglomerate format id.
-        conglom_format_id = FormatIdUtil.readFormatIdInteger(in);
-
-		// XXX (nat) need to improve error handling
-		long containerid         = in.readLong();
-		int segmentid			= in.readInt();
-		nKeyFields          = in.readInt();
-		nUniqueColumns      = in.readInt();
-		allowDuplicates     = in.readBoolean();
-		maintainParentLinks = in.readBoolean();
-
-        // read in the array of format id's
-        format_ids = ConglomerateUtil.readFormatIdArray(this.nKeyFields, in);
-
-		id = new ContainerKey(segmentid, containerid);
-	}
-
 	
 	/**
 	Store the stored representation of the column value in the stream.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2I.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2I.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2I.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2I.java
Fri Nov  9 12:25:31 2012
@@ -28,8 +28,6 @@ import java.util.Properties;
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
-
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.error.StandardException;
 
@@ -1137,7 +1135,7 @@ public class B2I extends BTree
      *
      * @see java.io.Externalizable#readExternal
      **/
-	private final void localReadExternal(ObjectInput in)
+    public void readExternal(ObjectInput in)
 		throws IOException, ClassNotFoundException
 	{
 		super.readExternal(in);
@@ -1200,15 +1198,4 @@ public class B2I extends BTree
             setUniqueWithDuplicateNulls(in.readBoolean());
         }
 	}
-
-	public void readExternal(ObjectInput in)
-		throws IOException, ClassNotFoundException
-	{
-        localReadExternal(in);
-    }
-	public void readExternalFromArray(ArrayInputStream in)
-		throws IOException, ClassNotFoundException
-	{
-        localReadExternal(in);
-    }
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java?rev=1407432&r1=1407431&r2=1407432&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/heap/Heap.java Fri
Nov  9 12:25:31 2012
@@ -29,7 +29,6 @@ import java.util.Properties;
 
 import org.apache.derby.iapi.reference.SQLState;
 
-import org.apache.derby.iapi.services.io.ArrayInputStream;
 import org.apache.derby.iapi.services.io.FormatableBitSet;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
@@ -1188,7 +1187,7 @@ public class Heap 
      *
      * @see java.io.Externalizable#readExternal
      **/
-	private final void localReadExternal(ObjectInput in)
+    public void readExternal(ObjectInput in)
 		throws IOException, ClassNotFoundException
 	{
 
@@ -1238,16 +1237,4 @@ public class Heap 
             }
         }
     }
-
-	public void readExternal(ObjectInput in)
-		throws IOException, ClassNotFoundException
-	{
-        localReadExternal(in);
-    }
-
-	public void readExternalFromArray(ArrayInputStream in)
-		throws IOException, ClassNotFoundException
-	{
-        localReadExternal(in);
-    }
 }



Mime
View raw message