karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [karaf-decanter] branch master updated: [KARAF-6240] Use a default regex value instead of throwing IllegalStateException in the regex parser
Date Thu, 18 Apr 2019 13:03:19 GMT
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf-decanter.git


The following commit(s) were added to refs/heads/master by this push:
     new b14a66f  [KARAF-6240] Use a default regex value instead of throwing IllegalStateException
in the regex parser
     new c6968f7  Merge pull request #80 from jbonofre/KARAF-6240
b14a66f is described below

commit b14a66fff9db04f0effc4b54d3070953d787a330
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
AuthorDate: Thu Apr 18 14:41:42 2019 +0200

    [KARAF-6240] Use a default regex value instead of throwing IllegalStateException in the
regex parser
---
 .../java/org/apache/karaf/decanter/parser/regex/RegexParser.java    | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/parser/regex/src/main/java/org/apache/karaf/decanter/parser/regex/RegexParser.java
b/parser/regex/src/main/java/org/apache/karaf/decanter/parser/regex/RegexParser.java
index e8f5cea..3f8b5a3 100644
--- a/parser/regex/src/main/java/org/apache/karaf/decanter/parser/regex/RegexParser.java
+++ b/parser/regex/src/main/java/org/apache/karaf/decanter/parser/regex/RegexParser.java
@@ -47,10 +47,8 @@ public class RegexParser implements Parser {
     }
 
     public void activate(Dictionary<String, Object> config) {
-        if (config.get("regex") == null) {
-            throw new IllegalStateException("regex property is required");
-        }
-        this.pattern = Pattern.compile((String) config.get("regex"));
+        String regex = (config.get("regex") != null) ? (String) config.get("regex") : "(.*)";
+        this.pattern = Pattern.compile(regex);
         this.keys = (config.get("keys") != null) ? (String) config.get("keys") : null;
     }
 


Mime
View raw message