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 da...@apache.org on 2008/05/22 20:34:07 UTC

svn commit: r659195 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/IdUtil.java

Author: dag
Date: Thu May 22 11:34:06 2008
New Revision: 659195

URL: http://svn.apache.org/viewvc?rev=659195&view=rev
Log:
DERBY-3673 Add checks that a new role isn't already a user authorization id

Patch derby-3673-4. Removes some redundant code.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/IdUtil.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=659195&r1=659194&r2=659195&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 Thu May 22 11:34:06 2008
@@ -266,17 +266,7 @@
 		if (!needsQuote) {
 			result = authid.toLowerCase();
 		} else {
-			StringBuffer b = new StringBuffer();
-			b.append("\"");
-			for (int i=0; i < authid.length(); i++) {
-				char c = authid.charAt(i);
-				if (c == '"') {
-					b.append('"'); // " must be escaped as two quotes ("")
-				}
-				b.append(c);
-			}
-			b.append("\"");
-			result = b.toString();
+			result = normalToDelimited(authid);
 		}
 
 		return result;