db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r540791 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/types/ impl/sql/catalog/ impl/sql/compile/
Date Tue, 22 May 2007 23:34:40 GMT
Author: djd
Date: Tue May 22 16:34:39 2007
New Revision: 540791

URL: http://svn.apache.org/viewvc?view=rev&rev=540791
Log:
Remove some unused methods in DataValueFactory that fetched new DataValueDescriptors without
passing
in a holder object.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericConstantNode.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactory.java?view=diff&rev=540791&r1=540790&r2=540791
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactory.java Tue
May 22 16:34:39 2007
@@ -41,21 +41,19 @@
 {
         /**
          * Get a SQL int with the given value.  A null argument means get
-         * a SQL null value.  The second form uses the previous value (if non-null)
+         * a SQL null value.  Uses the previous value (if non-null)
          * to hold the return value.
          *
          */
-        NumberDataValue         getDataValue(Integer value);
         NumberDataValue         getDataValue(Integer value, NumberDataValue previous)
                                                         throws StandardException;
 
         /**
          * Get a SQL int with a char value.  A null argument means get
-         * a SQL null value.  The second form uses the previous value (if non-null)
+         * a SQL null value.  Uses the previous value (if non-null)
          * to hold the return value.
          *
          */
-        public NumberDataValue getDataValue(char value);
         public NumberDataValue getDataValue(char value, NumberDataValue previous)
                                                         throws StandardException;
 
@@ -124,12 +122,11 @@
 
         /**
          * Get a SQL Long Bit Varying with the given value.  A null argument means
-         * get a SQL null value.  The second form uses the previous value (if
+         * get a SQL null value.  Uses the previous value (if
          * non-null) to hold the return value.
          *
          * @exception StandardException         Thrown on error
          */
-        BitDataValue            getLongVarbitDataValue(byte[] value) throws StandardException;
         BitDataValue            getLongVarbitDataValue(byte[] value,
                                                                                         
       BitDataValue previous)
                                                         throws StandardException;
@@ -138,12 +135,11 @@
 
         /**
          * Get a SQL Blob with the given value.  A null argument means
-         * get a SQL null value.  The second form uses the previous value (if
+         * get a SQL null value.  Uses the previous value (if
          * non-null) to hold the return value.
          *
          * @exception StandardException         Thrown on error
          */
-        BitDataValue            getBlobDataValue(byte[] value) throws StandardException;
         BitDataValue            getBlobDataValue(byte[] value,
                                                                                         
       BitDataValue previous)
                                                         throws StandardException;
@@ -183,7 +179,6 @@
          * (if non-null) to hold the return value.
          *
          */
-        StringDataValue         getClobDataValue(String value);
         StringDataValue         getClobDataValue(String value, StringDataValue previous)
throws StandardException;
 
         /**
@@ -227,11 +222,10 @@
 
         /**
          * Get a RefDataValue with the given value.  A null argument means get
-         * a SQL null value.  The second form uses the previous value (if non-null)
+         * a SQL null value.  Uses the previous value (if non-null)
          * to hold the return value.
          *
          */
-        RefDataValue            getDataValue(RowLocation value);
         RefDataValue            getDataValue(RowLocation value, RefDataValue previous);
 
         /**
@@ -253,40 +247,34 @@
                                                         throws StandardException;
 
         /**
-         * Get a SQL real with the given value.  The second form
-         * re-uses the previous value, if non-null, as the data holder to return.
+         * Get a SQL real with the given value.  Uses the previous value, if non-null, as
the data holder to return.
          *
          * @exception StandardException         Thrown on error
          */
-        NumberDataValue         getDataValue(float value) throws StandardException;
         NumberDataValue         getDataValue(float value, NumberDataValue previous)
                                                         throws StandardException;
 
         /**
-         * Get a SQL double precision with the given value.  The second form
-         * re-uses the previous value, if non-null, as the data holder to return.
+         * Get a SQL double precision with the given value.  Uses the previous value, if
non-null, as the data holder to return.
          *
          * @exception StandardException         Thrown on error
          */
-        NumberDataValue         getDataValue(double value) throws StandardException;
         NumberDataValue         getDataValue(double value, NumberDataValue previous)
                                                         throws StandardException;
 
         /**
-         * Get a SQL SMALLINT with the given value.  The second form re-uses the
+         * Get a SQL SMALLINT with the given value.  Uses the
          * previous value, if non-null, as the data holder to return.
          *
          */
-        NumberDataValue         getDataValue(short value);
-        NumberDataValue         getDataValue(short value, NumberDataValue previous)
+         NumberDataValue         getDataValue(short value, NumberDataValue previous)
                                                         throws StandardException;
 
         /**
-         * Get a SQL TINYINT with the given value.  The second form re-uses the
+         * Get a SQL TINYINT with the given value. Uses the
          * previous value, if non-null, as the data holder to return.
          *
          */
-        NumberDataValue         getDataValue(byte value);
         NumberDataValue         getDataValue(byte value, NumberDataValue previous)
                                                         throws StandardException;
 
@@ -341,25 +329,24 @@
                                                         throws StandardException;
 
         /**
-         * Get a SQL bit with the given value.  The second form re-uses the
+         * Get a SQL bit with the given value.  Uses the
          * previous value, if non-null, as the data holder to return.
          *
          * @exception StandardException         Thrown on error
          */
-        BitDataValue            getVarbitDataValue(byte[] value) throws StandardException;
         BitDataValue            getVarbitDataValue(byte[] value, BitDataValue previous)
                                                         throws StandardException;
 
         /**
-         * Get a new SQLChar object to represent a SQL CHAR with the given value.
-         * A null argument means get a SQL NULL value.
+         * Get a new SQLChar object to represent a SQL CHAR (UCS_BASIC)
+         * with the given value. A null argument means get a SQL NULL value.
          *
          */
         StringDataValue         getCharDataValue(String value);
         
         /**
-         * Get a SQLChar object to represent a SQL CHAR with the given value.
-         * A null argument means get a SQL NULL value.
+         * Get a SQLChar object to represent a SQL CHAR  (UCS_BASIC
+         * with the given value. A null argument means get a SQL NULL value.
          * If previous is not null (Java reference) then it will be set
          * to the value passed in and returned, otherwise a new SQLChar
          * will be created and set to the value.
@@ -465,10 +452,9 @@
         public DateTimeDataValue getTimestampValue( String timestampStr, boolean isJdbcEscape)
throws StandardException;
 
         /**
-         * Get a null XML value. The second form re-uses the previous value,
+         * Get a null XML value. Uses the previous value,
          * if non-null, as the data holder to return.
          */
-        XMLDataValue getXMLDataValue();
         XMLDataValue getXMLDataValue(XMLDataValue previous)
 			throws StandardException;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java?view=diff&rev=540791&r1=540790&r2=540791
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataValueFactoryImpl.java
Tue May 22 16:34:39 2007
@@ -146,18 +146,13 @@
         {
                 if (previous == null)
                 {
-                        return getDataValue(value);
+                        return new SQLInteger(value);
                 }
 
                 previous.setValue(value);
                 return previous;
         }
 
-        public NumberDataValue getDataValue(char value)
-        {
-                return new SQLInteger(value);
-        }
-
         public NumberDataValue getDataValue(char value, NumberDataValue previous)
                                                         throws StandardException
         {
@@ -167,11 +162,6 @@
                 return previous;
         }
 
-        public NumberDataValue getDataValue(short value)
-        {
-                return new SQLSmallint(value);
-        }
-
         public NumberDataValue getDataValue(short value, NumberDataValue previous)
                         throws StandardException
         {
@@ -199,11 +189,6 @@
                 return previous;
         }
 
-        public NumberDataValue getDataValue(byte value)
-        {
-                return new SQLTinyint(value);
-        }
-
         public NumberDataValue getDataValue(byte value, NumberDataValue previous)
                                 throws StandardException
         {
@@ -263,12 +248,6 @@
                 return previous;
         }
 
-        public NumberDataValue getDataValue(float value)
-                throws StandardException
-        {
-                return new SQLReal(value);
-        }
-
         public NumberDataValue getDataValue(float value, NumberDataValue previous)
                         throws StandardException
         {
@@ -297,11 +276,6 @@
                 return previous;
         }
 
-        public NumberDataValue getDataValue(double value) throws StandardException
-        {
-                return new SQLDouble(value);
-        }
-
         public NumberDataValue getDataValue(double value, NumberDataValue previous)
                         throws StandardException
         {
@@ -414,11 +388,6 @@
                 return previous;
         }
 
-        public BitDataValue getVarbitDataValue(byte[] value)
-        {
-                return new SQLVarbit(value);
-        }
-
         public BitDataValue getVarbitDataValue(byte[] value, BitDataValue previous)
                         throws StandardException
         {
@@ -431,11 +400,6 @@
 
         // LONGVARBIT
 
-        public BitDataValue getLongVarbitDataValue(byte[] value) throws StandardException
-        {
-                return new SQLLongVarbit(value);
-        }
-
         public BitDataValue getLongVarbitDataValue(byte[] value, BitDataValue previous)
                         throws StandardException
         {
@@ -446,10 +410,6 @@
         }
 
         // BLOB
-        public BitDataValue getBlobDataValue(byte[] value) throws StandardException
-        {
-                return new SQLBlob(value);
-        }
 
         public BitDataValue getBlobDataValue(byte[] value, BitDataValue previous)
                         throws StandardException
@@ -496,11 +456,6 @@
                 return new SQLLongvarchar(value);
         }
 
-        public StringDataValue getClobDataValue(String value)
-        {
-                return new SQLClob(value);
-        }
-
         public StringDataValue getLongvarcharDataValue(String value,
                                                                                         
               StringDataValue previous)
                                                                                         
               throws StandardException
@@ -667,11 +622,6 @@
                 return previous;
         }
 
-        public RefDataValue getDataValue(RowLocation value)
-        {
-                return new SQLRef(value);
-        }
-
         public RefDataValue getDataValue(RowLocation value, RefDataValue previous)
         {
                 if (previous == null)
@@ -789,7 +739,7 @@
         {
                 if (dataValue == null)
                 {
-                        return getVarbitDataValue((byte[]) null);
+                        return new SQLVarbit();
                 }
                 else
                 {
@@ -803,7 +753,7 @@
         {
                 if (dataValue == null)
                 {
-                        return getLongVarbitDataValue((byte[]) null);
+                        return new SQLLongVarbit();
                 }
                 else
                 {
@@ -817,7 +767,7 @@
         {
                 if (dataValue == null)
                 {
-                        return getBlobDataValue((byte[]) null);
+                        return new SQLBlob();
                 }
                 else
                 {
@@ -870,7 +820,7 @@
         {
                 if (dataValue == null)
                 {
-                        return getClobDataValue((String) null);
+                        return new SQLClob();
                 }
                 else
                 {
@@ -948,7 +898,7 @@
         {
                 if (dataValue == null)
                 {
-                        return getDataValue((RowLocation) null);
+                        return new SQLRef();
                 }
                 else
                 {
@@ -1044,18 +994,6 @@
         return new SQLTimestamp( timestampStr, isJdbcEscape, getLocaleFinder());
     } // end of getTimestampValue( String timestampStr)
 
-
-    /**
-     * getXMLDataValue:
-     * Get a SQL null value with XML type.
-     * @return An XMLDataValue instance corresponding to a
-     *  a NULL value.
-     */
-    public XMLDataValue getXMLDataValue()
-    {
-        return new XML();
-    }
-
     /**
      * getXMLDataValue:
      * Get a null XML  value.  If a non-null XMLDataValue is
@@ -1089,7 +1027,7 @@
     public XMLDataValue getNullXML(XMLDataValue dataValue)
     {
         if (dataValue == null)
-            return getXMLDataValue();
+            return new XML();
         else {
             dataValue.setToNull();
             return dataValue;

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?view=diff&rev=540791&r1=540790&r2=540791
==============================================================================
--- 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 Tue May 22
16:34:39 2007
@@ -151,7 +151,7 @@
 	int streamValueLength;
 
 	/**
-		no-arg constructor, required by Formattable.
+		Create a binary value set to NULL
 	*/
 	SQLBinary()
 	{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java?view=diff&rev=540791&r1=540790&r2=540791
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
Tue May 22 16:34:39 2007
@@ -244,7 +244,7 @@
 		row.setColumn(SYSCOLUMNS_COLUMNNAME, new SQLVarchar(colName));
 
 		/* 3rd column is COLUMNNUMBER (int) */
-		row.setColumn(SYSCOLUMNS_COLUMNNUMBER, dvf.getDataValue(colID));
+		row.setColumn(SYSCOLUMNS_COLUMNNUMBER, new SQLInteger(colID));
 
 		/* 4th column is COLUMNDATATYPE */
 		row.setColumn(SYSCOLUMNS_COLUMNDATATYPE,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericConstantNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericConstantNode.java?view=diff&rev=540791&r1=540790&r2=540791
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericConstantNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NumericConstantNode.java
Tue May 22 16:34:39 2007
@@ -32,6 +32,7 @@
 import org.apache.derby.iapi.services.compiler.MethodBuilder;
 import org.apache.derby.iapi.services.info.JVMInfo;
 
+import org.apache.derby.iapi.types.SQLInteger;
 import org.apache.derby.iapi.types.TypeId;
 import org.apache.derby.iapi.types.DataTypeUtilities;
 import org.apache.derby.iapi.types.NumberDataValue;
@@ -95,7 +96,7 @@
 			{
 				maxwidth = TypeId.INT_MAXWIDTH;
 				typeid = Types.INTEGER;
-				setValue(getDataValueFactory().getDataValue((Integer) arg1));
+				setValue(new SQLInteger((Integer) arg1));
 			}
 			break;
 



Mime
View raw message