Skip to content
Permalink
Browse files

Improved: Add missing generics

(OFBIZ-10966)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862250 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Jun 27, 2019
1 parent 698af7c commit 59599e3cb2c175fc2e370e170c441b5f7bad379c
@@ -101,7 +101,7 @@ public void setPlaceholderValues(Map<String, Object> placeholderValues) {

public List<Object> getMessageList() {
if (this.checkDataOnly && this.messageList == null) {
this.messageList = new LinkedList();
this.messageList = new LinkedList<>();
}

return this.messageList;
@@ -154,7 +154,7 @@ private long convertJsonAndWriteValues(String jsonString) throws IOException {

for (int jsonIndex = 0; jsonIndex < length; ++jsonIndex) {
JSONObject jsonObject = jsonArray.getJSONObject(jsonIndex);
Iterator iterator = jsonObject.keySet().iterator();
Iterator<?> iterator = jsonObject.keySet().iterator();

while (iterator.hasNext()) {
String key = iterator.next().toString();
@@ -189,7 +189,7 @@ private long convertJsonAndWriteValues(String jsonString) throws IOException {
}

private static List<Map<String, Object>> iterateJsonEntityData(Object jsonData) {
List<Map<String, Object>> genericMapList = new LinkedList<Map<String, Object>>();
List<Map<String, Object>> genericMapList = new LinkedList<>();
if (jsonData instanceof JSONArray) {
JSONArray jsonArray = (JSONArray) jsonData;
int length = jsonArray.length();
@@ -211,8 +211,8 @@ private long convertJsonAndWriteValues(String jsonString) throws IOException {
}

private static Map<String, Object> iterateJSONObject(JSONObject jsonObj) {
Map<String, Object> mapObj = new HashMap<String, Object>();
Iterator iterator = jsonObj.keySet().iterator();
Map<String, Object> mapObj = new HashMap<>();
Iterator<?> iterator = jsonObj.keySet().iterator();
while (iterator.hasNext()) {
String keyStr = (String) iterator.next();
Object keyvalue = jsonObj.get(keyStr);
@@ -227,7 +227,7 @@ private long convertJsonAndWriteValues(String jsonString) throws IOException {
}

private long createUpdate(JSONObject jsonObject) throws IOException {
Iterator iterator = jsonObject.keySet().iterator();
Iterator<?> iterator = jsonObject.keySet().iterator();
while (iterator.hasNext()) {
String key = iterator.next().toString();
Object value = jsonObject.get(key);
@@ -28,6 +28,7 @@
import javax.servlet.http.HttpSession;

import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.UtilGenerics;
import org.apache.ofbiz.entity.Delegator;
import org.apache.ofbiz.entity.GenericEntityException;
import org.apache.ofbiz.entity.GenericValue;
@@ -49,7 +50,7 @@ public static String downloadJsonData(HttpServletRequest request, HttpServletRes
Security security = (Security) request.getAttribute("security");
boolean isFirst = true;
if (security.hasPermission("ENTITY_MAINT", session)) {
TreeSet passedEntityNames = (TreeSet) session.getAttribute("jsonrawdump_entitylist");
TreeSet<String> passedEntityNames = UtilGenerics.cast(session.getAttribute("jsonrawdump_entitylist"));
session.removeAttribute("jsonrawdump_entitylist");
EntityExpr entityDateCond = (EntityExpr) session.getAttribute("entityDateCond");
session.removeAttribute("entityDateCond");
@@ -68,9 +69,9 @@ public static String downloadJsonData(HttpServletRequest request, HttpServletRes
try {
beganTransaction = TransactionUtil.begin();

Iterator i = passedEntityNames.iterator();
Iterator<String> i = passedEntityNames.iterator();
while (i.hasNext()) {
String curEntityName = (String) i.next();
String curEntityName = i.next();

ModelEntity me = reader.getModelEntity(curEntityName);
EntityListIterator values = null;

0 comments on commit 59599e3

Please sign in to comment.
You can’t perform that action at this time.