-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Code Refactors #1017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code Refactors #1017
Changes from 4 commits
c13b57c
1de42aa
5dc1031
2c6082a
6dd878d
39e8ead
ac65ee0
0cdc5e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ public class Cookie { | |
| /** | ||
| * Constructs a new Cookie object. | ||
| */ | ||
| public Cookie() { | ||
| private Cookie() { | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -189,21 +189,30 @@ public static String toString(JSONObject jo) throws JSONException { | |
| * @return The unescaped string. | ||
| */ | ||
| public static String unescape(String string) { | ||
| int i = 0; | ||
|
||
| int length = string.length(); | ||
| StringBuilder sb = new StringBuilder(length); | ||
| for (int i = 0; i < length; ++i) { | ||
|
|
||
| while (i < length) { | ||
| char c = string.charAt(i); | ||
| if (c == '+') { | ||
| c = ' '; | ||
| sb.append(' '); | ||
| i++; | ||
| } else if (c == '%' && i + 2 < length) { | ||
| int d = JSONTokener.dehexchar(string.charAt(i + 1)); | ||
| int e = JSONTokener.dehexchar(string.charAt(i + 2)); | ||
|
|
||
| if (d >= 0 && e >= 0) { | ||
| c = (char)(d * 16 + e); | ||
| i += 2; | ||
| sb.append((char)(d * 16 + e)); | ||
| i += 3; | ||
| } else { | ||
| sb.append(c); | ||
| i++; | ||
| } | ||
| } else { | ||
| sb.append(c); | ||
| i++; | ||
| } | ||
| sb.append(c); | ||
| } | ||
| return sb.toString(); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.