1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

Merge pull request #494 from spaffrath/replace_string_arrays_with_var_args

Replace JSONObject constructor string arrays with var args
This commit is contained in:
Sean Leary 2019-11-06 09:31:23 -06:00 committed by GitHub
commit 4b49bc94ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -194,7 +194,7 @@ public class JSONObject {
* @param names
* An array of strings.
*/
public JSONObject(JSONObject jo, String[] names) {
public JSONObject(JSONObject jo, String ... names) {
this(names.length);
for (int i = 0; i < names.length; i += 1) {
try {
@ -378,7 +378,7 @@ public class JSONObject {
* An array of strings, the names of the fields to be obtained
* from the object.
*/
public JSONObject(Object object, String names[]) {
public JSONObject(Object object, String ... names) {
this(names.length);
Class<?> c = object.getClass();
for (int i = 0; i < names.length; i += 1) {