Skip to content

Commit

Permalink
Improved: Make private methods static when possible
Browse files Browse the repository at this point in the history
(OFBIZ-10966)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862248 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Jun 27, 2019
1 parent 8c3c6cd commit 1bb65ee
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -197,7 +197,7 @@ private long convertJsonAndWriteValues(String jsonString) throws IOException {
return this.numberRead;
}

private List<Map<String, Object>> iterateJsonEntityData(Object jsonData) {
private static List<Map<String, Object>> iterateJsonEntityData(Object jsonData) {
List<Map<String, Object>> genericMapList = new LinkedList<Map<String, Object>>();
if (jsonData instanceof JSONArray) {
JSONArray jsonArray = (JSONArray) jsonData;
Expand All @@ -219,7 +219,7 @@ private List<Map<String, Object>> iterateJsonEntityData(Object jsonData) {
return genericMapList;
}

private Map<String, Object> iterateJSONObject(JSONObject jsonObj) {
private static Map<String, Object> iterateJSONObject(JSONObject jsonObj) {
Map<String, Object> mapObj = new HashMap<String, Object>();
Iterator iterator = jsonObj.keySet().iterator();
while (iterator.hasNext()) {
Expand All @@ -241,7 +241,7 @@ private long create(JSONObject jsonObject) throws IOException {
String key = iterator.next().toString();
Object value = jsonObject.get(key);
if (UtilValidate.isNotEmpty(value)) {
List<Map<String, Object>> genericMapList = this.iterateJsonEntityData(value);
List<Map<String, Object>> genericMapList = iterateJsonEntityData(value);
for (Map<String, Object> keyValPair : genericMapList) {
try {
ModelEntity modelEntity = this.delegator.getModelEntity(key);
Expand Down Expand Up @@ -287,7 +287,7 @@ private long createUpdate(JSONObject jsonObject) throws IOException {
String key = iterator.next().toString();
Object value = jsonObject.get(key);
if (UtilValidate.isNotEmpty(value)) {
List<Map<String, Object>> genericMapList = this.iterateJsonEntityData(value);
List<Map<String, Object>> genericMapList = iterateJsonEntityData(value);
for (Map<String, Object> keyValPair : genericMapList) {
try {
GenericValue currentValue = delegator.makeValue(key);
Expand Down Expand Up @@ -372,7 +372,7 @@ private long createReplace(JSONObject jsonObject) throws IOException {
String key = iterator.next().toString();
Object value = jsonObject.get(key);
if (UtilValidate.isNotEmpty(value)) {
List<Map<String, Object>> genericMapList = this.iterateJsonEntityData(value);
List<Map<String, Object>> genericMapList = iterateJsonEntityData(value);
for (Map<String, Object> keyValPair : genericMapList) {
try {
GenericValue currentValue = this.delegator.makeValue(key);
Expand Down Expand Up @@ -478,7 +478,7 @@ private long delete(JSONObject jsonObject) throws IOException {
String key = iterator.next().toString();
Object value = jsonObject.get(key);
if (UtilValidate.isNotEmpty(value)) {
List<Map<String, Object>> genericMapList = this.iterateJsonEntityData(value);
List<Map<String, Object>> genericMapList = iterateJsonEntityData(value);
for (Map<String, Object> keyValPair : genericMapList) {
try {
ModelEntity modelEntity = this.delegator.getModelEntity(key);
Expand Down

0 comments on commit 1bb65ee

Please sign in to comment.