mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-06 10:45:23 +08:00
Replace JSONObject constructor string arrays with var args
This commit is contained in:
@@ -194,7 +194,7 @@ public class JSONObject {
|
|||||||
* @param names
|
* @param names
|
||||||
* An array of strings.
|
* An array of strings.
|
||||||
*/
|
*/
|
||||||
public JSONObject(JSONObject jo, String[] names) {
|
public JSONObject(JSONObject jo, String ... names) {
|
||||||
this(names.length);
|
this(names.length);
|
||||||
for (int i = 0; i < names.length; i += 1) {
|
for (int i = 0; i < names.length; i += 1) {
|
||||||
try {
|
try {
|
||||||
@@ -378,7 +378,7 @@ public class JSONObject {
|
|||||||
* An array of strings, the names of the fields to be obtained
|
* An array of strings, the names of the fields to be obtained
|
||||||
* from the object.
|
* from the object.
|
||||||
*/
|
*/
|
||||||
public JSONObject(Object object, String names[]) {
|
public JSONObject(Object object, String ... names) {
|
||||||
this(names.length);
|
this(names.length);
|
||||||
Class<?> c = object.getClass();
|
Class<?> c = object.getClass();
|
||||||
for (int i = 0; i < names.length; i += 1) {
|
for (int i = 0; i < names.length; i += 1) {
|
||||||
|
Reference in New Issue
Block a user