Merge remote-tracking branch 'origin/merge/JAL-845_JAL-1640' into
[jalview.git] / src / jalview / ws / rest / RestServiceDescription.java
index 6f304a9..601ebd3 100644 (file)
@@ -87,7 +87,8 @@ public class RestServiceDescription
     boolean diff = (gapCharacter != other.gapCharacter);
     diff |= vseparable != other.vseparable;
     diff |= hseparable != other.hseparable;
-    diff |= !(urlSuffix.equals(other.urlSuffix));
+    diff |= !(urlSuffix == null && other.urlSuffix == null || (urlSuffix != null
+            && other.urlSuffix != null && urlSuffix.equals(other.urlSuffix)));
     // TODO - robust diff that includes constants and reordering of URL
     // diff |= !(postUrl.equals(other.postUrl));
     // diff |= !inputParams.equals(other.inputParams);
@@ -369,7 +370,9 @@ public class RestServiceDescription
   {
     int seplen = separator.length();
     if (list == null || list.equals("") || list.equals(separator))
+    {
       return null;
+    }
     java.util.ArrayList<String> jv = new ArrayList<String>();
     int cp = 0, pos, escape;
     boolean wasescaped = false, wasquoted = false;
@@ -384,7 +387,6 @@ public class RestServiceDescription
         jv.set(jv.size() - 1,
                 lstitem = lstitem + separator
                         + list.substring(cp, pos + escape));
-
       }
       else
       {
@@ -392,15 +394,9 @@ public class RestServiceDescription
       }
       cp = pos + seplen;
       wasescaped = escape == -1;
-      if (!wasescaped)
-      {
-        // last separator may be in an unmatched quote
-        if (java.util.regex.Pattern.matches("('[^']*')*[^']*'", lstitem))
-        {
-          wasquoted = true;
-        }
-      }
-
+      // last separator may be in an unmatched quote
+      wasquoted = (java.util.regex.Pattern.matches(".*='[^']*(?!')",
+              lstitem));
     }
     if (cp < list.length())
     {