mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-22 17:35:22 +00:00
Merge pull request #42487 from woosung1223
* pr/42487: Refactor BasicJsonParser to use enhanced switch Closes gh-42487
This commit is contained in:
+6
-14
@@ -137,20 +137,12 @@ public class BasicJsonParser extends AbstractJsonParser {
|
||||
inEscape = false;
|
||||
continue;
|
||||
}
|
||||
if (current == '{') {
|
||||
inObject++;
|
||||
}
|
||||
if (current == '}') {
|
||||
inObject--;
|
||||
}
|
||||
if (current == '[') {
|
||||
inList++;
|
||||
}
|
||||
if (current == ']') {
|
||||
inList--;
|
||||
}
|
||||
if (current == '"') {
|
||||
inValue = !inValue;
|
||||
switch (current) {
|
||||
case '{' -> inObject++;
|
||||
case '}' -> inObject--;
|
||||
case '[' -> inList++;
|
||||
case ']' -> inList--;
|
||||
case '"' -> inValue = !inValue;
|
||||
}
|
||||
if (current == ',' && inObject == 0 && inList == 0 && !inValue) {
|
||||
list.add(build.toString());
|
||||
|
||||
Reference in New Issue
Block a user