cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1397685 - /cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
Date Fri, 12 Oct 2012 18:53:41 GMT
Author: dkulp
Date: Fri Oct 12 18:53:41 2012
New Revision: 1397685

URL: http://svn.apache.org/viewvc?rev=1397685&view=rev
Log:
[CXF-4391] Trap invalid patterns and ignore them

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java?rev=1397685&r1=1397684&r2=1397685&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java Fri
Oct 12 18:53:41 2012
@@ -31,6 +31,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
 
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.common.logging.LogUtils;
@@ -90,14 +91,18 @@ public class ConfigurerImpl extends Bean
                                 //old wildcard
                                 n = "." + n.replaceAll("\\.", "\\."); 
                             }
-                            Matcher matcher = Pattern.compile(n).matcher("");
-                            List<MatcherHolder> m = wildCardBeanDefinitions.get(className);
-                            if (m == null) {
-                                m = new ArrayList<MatcherHolder>();
-                                wildCardBeanDefinitions.put(className, m);
+                            try {
+                                Matcher matcher = Pattern.compile(n).matcher("");
+                                List<MatcherHolder> m = wildCardBeanDefinitions.get(className);
+                                if (m == null) {
+                                    m = new ArrayList<MatcherHolder>();
+                                    wildCardBeanDefinitions.put(className, m);
+                                }
+                                MatcherHolder holder = new MatcherHolder(orig, matcher);
+                                m.add(holder);
+                            } catch (PatternSyntaxException npe) { 
+                                //not a valid patter, we'll ignore
                             }
-                            MatcherHolder holder = new MatcherHolder(orig, matcher);
-                            m.add(holder);
                         } else {
                             LogUtils.log(LOG, Level.WARNING, "WILDCARD_BEAN_ID_WITH_NO_CLASS_MSG",
n); 
                         }



Mime
View raw message