mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-02 11:05:28 -04: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:
commit
4b49bc94ce
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user