[KYUUBI #6727] replace immutable empty list and map in BatchRequest initialization
# 🔍 Description ## Issue References 🔗 This pull request fixes # ## Describe Your Solution 🔧 - replace immutable empty list and map with mutable one for BatchRequest initialization, for easier BatchRequest construction for rest-client use ## Types of changes 🔖 - [ ] Bugfix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan 🧪 #### Behavior Without This Pull Request ⚰️ #### Behavior With This Pull Request 🎉 #### Related Unit Tests --- # Checklist 📝 - [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) **Be nice. Be informative.** Closes #6727 from bowenliang123/batchapi-emptylist. Closes #6727 9d6a04c8a [Bowen Liang] update Authored-by: Bowen Liang <liangbowen@gf.com.cn> Signed-off-by: Bowen Liang <liangbowen@gf.com.cn>
This commit is contained in:
parent
acd80f004a
commit
70e0302c02
@ -17,10 +17,7 @@
|
||||
|
||||
package org.apache.kyuubi.client.api.v1.dto;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
@ -29,9 +26,9 @@ public class BatchRequest {
|
||||
private String resource;
|
||||
private String className;
|
||||
private String name;
|
||||
private Map<String, String> conf = Collections.emptyMap();
|
||||
private List<String> args = Collections.emptyList();
|
||||
private Map<String, String> extraResourcesMap = Collections.emptyMap();
|
||||
private Map<String, String> conf = new HashMap<>(0);
|
||||
private List<String> args = new ArrayList<>(0);
|
||||
private Map<String, String> extraResourcesMap = new HashMap<>(0);
|
||||
|
||||
public BatchRequest() {}
|
||||
|
||||
@ -91,7 +88,7 @@ public class BatchRequest {
|
||||
|
||||
public Map<String, String> getConf() {
|
||||
if (null == conf) {
|
||||
return Collections.emptyMap();
|
||||
return new HashMap<>(0);
|
||||
}
|
||||
return conf;
|
||||
}
|
||||
@ -102,7 +99,7 @@ public class BatchRequest {
|
||||
|
||||
public List<String> getArgs() {
|
||||
if (null == args) {
|
||||
return Collections.emptyList();
|
||||
return new ArrayList<>(0);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user