db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r590730 - in /db/derby/code/trunk/java/engine/org/apache/derby/iapi/util: IdUtil.java StringUtil.java
Date Wed, 31 Oct 2007 16:12:11 GMT
Author: djd
Date: Wed Oct 31 09:12:10 2007
New Revision: 590730

URL: http://svn.apache.org/viewvc?rev=590730&view=rev
Log:
DERBY-3147 Remove last traces of lower-cased identifiers from IdUtil and StringUtil.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/IdUtil.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/StringUtil.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/IdUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/IdUtil.java?rev=590730&r1=590729&r2=590730&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/IdUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/IdUtil.java Wed Oct 31 09:12:10
2007
@@ -205,7 +205,7 @@
 			if (c == '"')
 				return parseQId(r,normalize);
 			else
-				return parseUnQId(r,normalize, true);
+				return parseUnQId(r,normalize);
 		}
 
 		catch (IOException ioe){
@@ -220,13 +220,12 @@
      * 
      * @param r Regular identifier to parse.
      * @param normalize If true return the identifer converted to a single case, otherwise
return the identifier as entered.
-     * @param normalizeToUpper
      * @return the value of the identifer or a delimited identifier
      * @throws IOException Error accessing value
      * @throws StandardException Error parsing identifier.
  
      */
-	private static String parseUnQId(StringReader r, boolean normalize, boolean normalizeToUpper)
+	private static String parseUnQId(StringReader r, boolean normalize)
 		 throws IOException,StandardException
 	{
 		StringBuffer b = new StringBuffer();
@@ -242,11 +241,13 @@
 				break;
 		}
 		if (c != -1) r.reset();
+        
+        String id = b.toString();
 
 		if (normalize)
-			return normalizeToUpper ? StringUtil.SQLToUpperCase(b.toString()) : StringUtil.SQLToLowerCase(b.toString());
+			return StringUtil.SQLToUpperCase(id);
 		else
-			return b.toString();
+			return id;
 	}
 
 
@@ -305,6 +306,11 @@
 			return normalToDelimited(b.toString()); //Put the quotes back.
 	}
 
+    /**
+     * Verify the read is empty (no more characters in its stream).
+     * @param r
+     * @throws StandardException
+     */
 	private static void verifyEmpty(java.io.Reader r)
 		 throws StandardException
 	{
@@ -407,7 +413,7 @@
 		if (p==null) return null;
 		StringReader r = new StringReader(p);
 		String[] result = parseIdList(r, true);
-		verifyListEmpty(r);
+		verifyEmpty(r);
 		return result;
 	}
 	
@@ -597,21 +603,6 @@
 			sb.append(externalIds[ix]);
 		}
 		return sb.toString();
-	}
-
-	private static void verifyListEmpty(StringReader r)
-		 throws StandardException
-	{
-		try {
-			if (r.read() != -1)
-				throw StandardException.newException(SQLState.ID_LIST_PARSE_ERROR);
-		}
-
-		catch (IOException ioe){
-			throw StandardException.newException(SQLState.ID_LIST_PARSE_ERROR,ioe);
-		}
-		
-
 	}
 
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/StringUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/StringUtil.java?rev=590730&r1=590729&r2=590730&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/StringUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/StringUtil.java Wed Oct 31
09:12:10 2007
@@ -343,19 +343,6 @@
 			return s.toUpperCase(Locale.ENGLISH);
 	}
 
-
-	/** Convert string to lowercase
-	 *  Return java.util.Locale.ENGLISH lowercasing
-	 * @param s string to lowercase
-	 * @return lowercased string
-	 */
-	public static String SQLToLowerCase(String s)
-	{
-		return s.toLowerCase(Locale.ENGLISH);
-
-	}
-
-
 	/** Compares two strings 
 	 * Strings will be uppercased in english and compared
 	 * equivalent to s1.equalsIgnoreCase(s2)



Mime
View raw message