Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/org/json/CDL.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public class CDL {

/**
* Constructs a new CDL object.
* @deprecated (Utility class cannot be instantiated)
*/
@Deprecated
public CDL() {
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/json/Cookie.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public class Cookie {

/**
* Constructs a new Cookie object.
* @deprecated (Utility class cannot be instantiated)
*/
@Deprecated()
public Cookie() {
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/json/CookieList.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public class CookieList {

/**
* Constructs a new CookieList object.
* @deprecated (Utility class cannot be instantiated)
*/
@Deprecated
public CookieList() {
}

Expand Down
21 changes: 18 additions & 3 deletions src/main/java/org/json/JSONML.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ public class JSONML {

/**
* Constructs a new JSONML object.
* @deprecated (Utility class cannot be instantiated)
*/
@Deprecated
public JSONML() {
}


/**
* Parse XML values and store them in a JSONArray.
* @param x The XMLTokener containing the source string.
Expand Down Expand Up @@ -239,9 +242,21 @@ private static Object parse(
}
} else {
if (ja != null) {
ja.put(token instanceof String
? (config.isKeepStrings() ? XML.unescape((String)token) : XML.stringToValue((String)token))
: token);
Object value;

if (token instanceof String) {
String strToken = (String) token;
if (config.isKeepStrings()) {
value = XML.unescape(strToken);
} else {
value = XML.stringToValue(strToken);
}
} else {
value = token;
}

ja.put(value);

}
}
}
Expand Down