JAL-3438 spotless for 2.11.2.0
[jalview.git] / src / org / json / HTTPTokener.java
index 55f48ff..0db5eed 100644 (file)
@@ -25,53 +25,66 @@ SOFTWARE.
 */
 
 /**
- * The HTTPTokener extends the JSONTokener to provide additional methods
- * for the parsing of HTTP headers.
+ * The HTTPTokener extends the JSONTokener to provide additional methods for the
+ * parsing of HTTP headers.
+ * 
  * @author JSON.org
  * @version 2015-12-09
  */
-public class HTTPTokener extends JSONTokener {
-
-    /**
-     * Construct an HTTPTokener from a string.
-     * @param string A source string.
-     */
-    public HTTPTokener(String string) {
-        super(string);
-    }
+public class HTTPTokener extends JSONTokener
+{
 
+  /**
+   * Construct an HTTPTokener from a string.
+   * 
+   * @param string
+   *          A source string.
+   */
+  public HTTPTokener(String string)
+  {
+    super(string);
+  }
 
-    /**
-     * Get the next token or string. This is used in parsing HTTP headers.
-     * @throws JSONException
-     * @return A String.
-     */
-    public String nextToken() throws JSONException {
-        char c;
-        char q;
-        StringBuilder sb = new StringBuilder();
-        do {
-            c = next();
-        } while (Character.isWhitespace(c));
-        if (c == '"' || c == '\'') {
-            q = c;
-            for (;;) {
-                c = next();
-                if (c < ' ') {
-                    throw syntaxError("Unterminated string.");
-                }
-                if (c == q) {
-                    return sb.toString();
-                }
-                sb.append(c);
-            }
+  /**
+   * Get the next token or string. This is used in parsing HTTP headers.
+   * 
+   * @throws JSONException
+   * @return A String.
+   */
+  public String nextToken() throws JSONException
+  {
+    char c;
+    char q;
+    StringBuilder sb = new StringBuilder();
+    do
+    {
+      c = next();
+    } while (Character.isWhitespace(c));
+    if (c == '"' || c == '\'')
+    {
+      q = c;
+      for (;;)
+      {
+        c = next();
+        if (c < ' ')
+        {
+          throw syntaxError("Unterminated string.");
         }
-        for (;;) {
-            if (c == 0 || Character.isWhitespace(c)) {
-                return sb.toString();
-            }
-            sb.append(c);
-            c = next();
+        if (c == q)
+        {
+          return sb.toString();
         }
+        sb.append(c);
+      }
+    }
+    for (;;)
+    {
+      if (c == 0 || Character.isWhitespace(c))
+      {
+        return sb.toString();
+      }
+      sb.append(c);
+      c = next();
     }
+  }
 }