You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2008/05/06 20:04:41 UTC

svn commit: r653862 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java

Author: aadamchik
Date: Tue May  6 11:04:41 2008
New Revision: 653862

URL: http://svn.apache.org/viewvc?rev=653862&view=rev
Log:
CAY-514  implement a "MATCH ALL VALUES" expression

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java?rev=653862&r1=653861&r2=653862&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/ExpressionFactory.java Tue May  6 11:04:41 2008
@@ -24,7 +24,6 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
-import java.util.Random;
 
 import org.apache.cayenne.exp.parser.ASTAdd;
 import org.apache.cayenne.exp.parser.ASTAnd;
@@ -74,12 +73,10 @@
     public static final char SPLIT_SEPARATOR = '|';
 
     private static Class<?>[] typeLookup;
-    private static final Random random;
+    private static volatile int autoAliasId;
 
     static {
 
-        random = new Random(System.currentTimeMillis());
-
         // make sure all types are small integers, then we can use
         // them as indexes in lookup array
         int[] allTypes = new int[] {
@@ -303,7 +300,7 @@
 
             String beforeSplit = split > 0 ? path.substring(0, split) + "." : "";
             String afterSplit = splitEnd > 0 ? "." + path.substring(splitEnd + 1) : "";
-            String aliasBase = "split" + random.nextInt(Integer.MAX_VALUE) + "_";
+            String aliasBase = "split" + autoAliasId++ + "_";
             String splitChunk = splitEnd > 0 ? path.substring(split + 1, splitEnd) : path
                     .substring(split + 1);