changeset 978:aa4ee1301885

Rename a method in ClasspathMatcher 2014-04-02 Omair Majid <omajid@redhat.com> * netx/net/sourceforge/jnlp/util/ClasspathMatcher.java (quote): Rename to .. (convertWildcardToRegEx): New method. Adjust all callers.
author Omair Majid <omajid@redhat.com>
date Wed, 02 Apr 2014 15:52:42 -0400
parents fce39c02c702
children 65cb5965ec77
files ChangeLog netx/net/sourceforge/jnlp/util/ClasspathMatcher.java
diffstat 2 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Apr 02 15:48:00 2014 -0400
+++ b/ChangeLog	Wed Apr 02 15:52:42 2014 -0400
@@ -1,3 +1,9 @@
+2014-04-02  Omair Majid  <omajid@redhat.com>
+
+	* netx/net/sourceforge/jnlp/util/ClasspathMatcher.java
+	(quote): Rename to ..
+	(convertWildcardToRegEx): New method. Adjust all callers.
+
 2014-04-02  Jiri Vanek  <jvanek@redhat.com>
 
 	* NEWS: Added 1.6 section
--- a/netx/net/sourceforge/jnlp/util/ClasspathMatcher.java	Wed Apr 02 15:48:00 2014 -0400
+++ b/netx/net/sourceforge/jnlp/util/ClasspathMatcher.java	Wed Apr 02 15:52:42 2014 -0400
@@ -152,7 +152,7 @@
                 //this is handling case, when *.abc.xy
                 //should match also abc.xy except whatever.abc.xz
                 //but NOT whatewerabc.xy
-                pre = "(" + quote(domain.substring(2)) + ")|(";
+                pre = "(" + convertWildcardToRegEx(domain.substring(2)) + ")|(";
                 post = ")";
             }
             return Pattern.compile(pre + ClasspathMatcher.sourceToRegExString(domain) + post);
@@ -320,17 +320,10 @@
         if (s.equals("*")) {
             return ".*";
         }
-        return quote(s);
+        return convertWildcardToRegEx(s);
     }
     
-    private static String quote(String s) {
-        /*
-         * coment for lazybones:
-         *  Pattern.quote - all characters in citation are threated as are without any special meaning
-         *   Citation is based on \Q and \E marks wwith escapped inner \Q and \E
-         * ^ is start of th e line
-         * $ is end of the line
-         */
+    private static String convertWildcardToRegEx(String s) {
         if (s.startsWith("*") && s.endsWith("*")) {
             return "^.*" + Pattern.quote(s.substring(1, s.length() - 1)) + ".*$";
         } else if (s.endsWith("*")) {