[jboss-cvs] JBoss Messaging SVN: r3667 - trunk/src/main/org/jboss/messaging/util.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Feb 6 05:39:16 EST 2008


Author: ataylor
Date: 2008-02-06 05:39:16 -0500 (Wed, 06 Feb 2008)
New Revision: 3667

Modified:
   trunk/src/main/org/jboss/messaging/util/Match.java
Log:
regex fix

Modified: trunk/src/main/org/jboss/messaging/util/Match.java
===================================================================
--- trunk/src/main/org/jboss/messaging/util/Match.java	2008-02-05 23:37:47 UTC (rev 3666)
+++ trunk/src/main/org/jboss/messaging/util/Match.java	2008-02-06 10:39:16 UTC (rev 3667)
@@ -21,7 +21,6 @@
    */
 package org.jboss.messaging.util;
 
-import org.jboss.messaging.core.Mergeable;
 
 import java.util.regex.Pattern;
 
@@ -32,7 +31,7 @@
 {
 
    public static String WORD_WILDCARD = "^";
-   private static String WORD_WILDCARD_REPLACEMENT = "[*[^.]]";
+   private static String WORD_WILDCARD_REPLACEMENT = "[^.]+";
    public static String WILDCARD = "*";
    private static String WILDCARD_REPLACEMENT = ".+";
    private static final String DOT = ".";
@@ -55,9 +54,9 @@
       }
       else
       {
-         actMatch = actMatch.replace(WORD_WILDCARD, WORD_WILDCARD_REPLACEMENT);
          actMatch = actMatch.replace(DOT, DOT_REPLACEMENT);
          actMatch = actMatch.replace(WILDCARD,  WILDCARD_REPLACEMENT);
+         actMatch = actMatch.replace(WORD_WILDCARD, WORD_WILDCARD_REPLACEMENT);
       }
       pattern = Pattern.compile(actMatch);
 
@@ -97,9 +96,8 @@
 
       Match that = (Match) o;
 
-      if (match != null ? !match.equals(that.match) : that.match != null) return false;
+      return !(match != null ? !match.equals(that.match) : that.match != null);
 
-      return true;
    }
 
    public int hashCode()
@@ -109,8 +107,8 @@
 
    /**
     * utility method to verify consistency of match
-    * @param match
-    * @throws IllegalArgumentException
+    * @param match the match to validate
+    * @throws IllegalArgumentException if a match isnt valid
     */
    public static void verify(String match) throws IllegalArgumentException
    {




More information about the jboss-cvs-commits mailing list