Improved: Remove redundant specification of type arguments
(OFBIZ-10937) Since Java 1.7, when defining generic types it is unnecessary to redefine those types in the constructor when it is done in the declared type. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857906 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -31,7 +31,7 @@ public final class JsLanguageFilesMapping {
|
||||
|
||||
public static class datejs {
|
||||
|
||||
private static Map<String, String> localeFiles = new HashMap<String, String>();
|
||||
private static Map<String, String> localeFiles = new HashMap<>();
|
||||
private static String defaultDateJs = "/common/js/jquery/plugins/datejs/date-en-US.js";
|
||||
|
||||
static {
|
||||
@@ -206,7 +206,7 @@ public final class JsLanguageFilesMapping {
|
||||
}
|
||||
|
||||
public static class jquery {
|
||||
private static Map<String, String> localeFiles = new HashMap<String, String>();
|
||||
private static Map<String, String> localeFiles = new HashMap<>();
|
||||
private static String defaultDateJs = "/common/js/jquery/ui/i18n/jquery.ui.datepicker-en.js";
|
||||
|
||||
static {
|
||||
@@ -381,7 +381,7 @@ public final class JsLanguageFilesMapping {
|
||||
}
|
||||
|
||||
public static class validation {
|
||||
private static Map<String, String> localeFiles = new HashMap<String, String>();
|
||||
private static Map<String, String> localeFiles = new HashMap<>();
|
||||
private static String defaultValidation = "/common/js/jquery/plugins/validate/localization/messages_en.js";
|
||||
|
||||
static {
|
||||
@@ -555,7 +555,7 @@ public final class JsLanguageFilesMapping {
|
||||
}
|
||||
|
||||
public static class dateTime {
|
||||
private static Map<String, String> localeFiles = new HashMap<String, String>();
|
||||
private static Map<String, String> localeFiles = new HashMap<>();
|
||||
private static String defaultDateTime = "/common/js/jquery/ui/i18n/jquery.ui.datepicker-en.js";
|
||||
|
||||
static {
|
||||
@@ -729,7 +729,7 @@ public final class JsLanguageFilesMapping {
|
||||
}
|
||||
|
||||
public static class select2 {
|
||||
private static Map<String, String> localeFiles = new HashMap<String, String>();
|
||||
private static Map<String, String> localeFiles = new HashMap<>();
|
||||
private static String defaultSelect2 = "/common/js/jquery/plugins/select2/js/i18n/en.js";
|
||||
|
||||
static {
|
||||
|
||||
@@ -519,7 +519,7 @@ public class EmailServices {
|
||||
|
||||
// check if attachment screen location passed in
|
||||
if (UtilValidate.isNotEmpty(xslfoAttachScreenLocationList)) {
|
||||
List<Map<String, ? extends Object>> bodyParts = new LinkedList<Map<String, ? extends Object>>();
|
||||
List<Map<String, ? extends Object>> bodyParts = new LinkedList<>();
|
||||
if (bodyText != null) {
|
||||
bodyText = FlexibleStringExpander.expandString(bodyText, screenContext, locale);
|
||||
bodyParts.add(UtilMisc.<String, Object>toMap("content", bodyText, "type", UtilValidate.isNotEmpty(contentType) ? contentType : "text/html"));
|
||||
|
||||
@@ -53,13 +53,13 @@ public final class GeoWorker {
|
||||
|
||||
public static List<GenericValue> expandGeoGroup(GenericValue geo) {
|
||||
if (geo == null) {
|
||||
return new LinkedList<GenericValue>();
|
||||
return new LinkedList<>();
|
||||
}
|
||||
if (!"GROUP".equals(geo.getString("geoTypeId"))) {
|
||||
return UtilMisc.toList(geo);
|
||||
}
|
||||
|
||||
List<GenericValue> geoList = new LinkedList<GenericValue>();
|
||||
List<GenericValue> geoList = new LinkedList<>();
|
||||
List<GenericValue> thisGeoAssoc = null;
|
||||
try {
|
||||
thisGeoAssoc = geo.getRelated("AssocGeoAssoc", UtilMisc.toMap("geoAssocTypeId", "GROUP_MEMBER"), null, false);
|
||||
@@ -84,7 +84,7 @@ public final class GeoWorker {
|
||||
if (UtilValidate.isEmpty(geoIdByTypeMapOrig)) {
|
||||
return geoIdByTypeMapOrig;
|
||||
}
|
||||
Map<String, String> geoIdByTypeMapTemp = new LinkedHashMap<String, String>();
|
||||
Map<String, String> geoIdByTypeMapTemp = new LinkedHashMap<>();
|
||||
for (Map.Entry<String, String> geoIdByTypeEntry: geoIdByTypeMapOrig.entrySet()) {
|
||||
List<GenericValue> geoAssocList = EntityQuery.use(delegator)
|
||||
.from("GeoAssoc")
|
||||
@@ -97,7 +97,7 @@ public final class GeoWorker {
|
||||
}
|
||||
}
|
||||
geoIdByTypeMapTemp = expandGeoRegionDeep(geoIdByTypeMapTemp, delegator);
|
||||
Map<String, String> geoIdByTypeMapNew = new LinkedHashMap<String, String>();
|
||||
Map<String, String> geoIdByTypeMapNew = new LinkedHashMap<>();
|
||||
// add the temp Map first, then the original over top of it, ie give the original priority over the sub/expanded values
|
||||
geoIdByTypeMapNew.putAll(geoIdByTypeMapTemp);
|
||||
geoIdByTypeMapNew.putAll(geoIdByTypeMapOrig);
|
||||
|
||||
@@ -115,13 +115,13 @@ public final class ContextHelper {
|
||||
if (isService()) {
|
||||
errorMessages = UtilGenerics.checkList(getResults().get(ModelService.ERROR_MESSAGE_LIST));
|
||||
if (errorMessages == null) {
|
||||
errorMessages = new LinkedList<String>();
|
||||
errorMessages = new LinkedList<>();
|
||||
getResults().put(ModelService.ERROR_MESSAGE_LIST, errorMessages);
|
||||
}
|
||||
} else {
|
||||
errorMessages = UtilGenerics.checkList(getResults().get("_error_message_list_"));
|
||||
if (errorMessages == null) {
|
||||
errorMessages = new LinkedList<String>();
|
||||
errorMessages = new LinkedList<>();
|
||||
getResults().put("_error_message_list_", errorMessages);
|
||||
}
|
||||
}
|
||||
@@ -147,7 +147,7 @@ public final class ContextHelper {
|
||||
public Map<String, Object> getParameters() {
|
||||
Map<String, Object> parameters = UtilGenerics.checkMap(this.context.getAttribute(ScriptUtil.PARAMETERS_KEY));
|
||||
if (parameters == null) {
|
||||
parameters = new LinkedHashMap<String, Object>();
|
||||
parameters = new LinkedHashMap<>();
|
||||
this.context.setAttribute(ScriptUtil.PARAMETERS_KEY, parameters, ScriptContext.ENGINE_SCOPE);
|
||||
}
|
||||
return parameters;
|
||||
@@ -168,7 +168,7 @@ public final class ContextHelper {
|
||||
public Map<String, Object> getResults() {
|
||||
Map<String, Object> results = UtilGenerics.checkMap(this.context.getAttribute(ScriptUtil.RESULT_KEY));
|
||||
if (results == null) {
|
||||
results = new LinkedHashMap<String, Object>();
|
||||
results = new LinkedHashMap<>();
|
||||
this.context.setAttribute(ScriptUtil.RESULT_KEY, results, ScriptContext.ENGINE_SCOPE);
|
||||
}
|
||||
return results;
|
||||
|
||||
+4
-4
@@ -53,7 +53,7 @@ public final class ScriptHelperImpl implements ScriptHelper {
|
||||
|
||||
private static GenericValue runFindByPrimaryKey(ModelEntity modelEntity, ContextHelper ctxHelper, boolean useCache, boolean autoFieldMap,
|
||||
Map<String, ? extends Object> fieldMap, List<String> selectFieldList) throws ScriptException {
|
||||
Map<String, Object> entityContext = new HashMap<String, Object>();
|
||||
Map<String, Object> entityContext = new HashMap<>();
|
||||
Delegator delegator = ctxHelper.getDelegator();
|
||||
Map<String, Object> context = ctxHelper.getBindings();
|
||||
if (autoFieldMap) {
|
||||
@@ -75,7 +75,7 @@ public final class ScriptHelperImpl implements ScriptHelper {
|
||||
entityContext.remove("timeZone");
|
||||
Set<String> fieldsToSelect = null;
|
||||
if (selectFieldList != null) {
|
||||
fieldsToSelect = new HashSet<String>(selectFieldList);
|
||||
fieldsToSelect = new HashSet<>(selectFieldList);
|
||||
}
|
||||
if (fieldsToSelect != null && useCache) {
|
||||
String errMsg = "Error running script " + ctxHelper.getScriptName() + ": Problem invoking the findOne method: Cannot specify selectFieldList argument when useCache is set to true ";
|
||||
@@ -116,7 +116,7 @@ public final class ScriptHelperImpl implements ScriptHelper {
|
||||
|
||||
public Map<String, ? extends Object> createServiceMap(String serviceName, Map<String, ? extends Object> inputMap) throws ScriptException {
|
||||
Assert.notNull("serviceName", serviceName, "inputMap", inputMap);
|
||||
Map<String, Object> toMap = new HashMap<String, Object>();
|
||||
Map<String, Object> toMap = new HashMap<>();
|
||||
ModelService modelService = null;
|
||||
try {
|
||||
modelService = ctxHelper.getDispatcher().getDispatchContext().getModelService(serviceName);
|
||||
@@ -226,7 +226,7 @@ public final class ScriptHelperImpl implements ScriptHelper {
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<String, Object> inMap = new HashMap<String, Object>(inputMap);
|
||||
Map<String, Object> inMap = new HashMap<>(inputMap);
|
||||
if (includeUserLogin && !inMap.containsKey("userLogin")) {
|
||||
GenericValue userLogin = ctxHelper.getUserLogin();
|
||||
if (userLogin != null) {
|
||||
|
||||
@@ -52,7 +52,7 @@ public class StatusServices {
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "CommonStatusMandatory", locale));
|
||||
}
|
||||
|
||||
List<GenericValue> statusItems = new LinkedList<GenericValue>();
|
||||
List<GenericValue> statusItems = new LinkedList<>();
|
||||
for (String statusTypeId: statusTypes) {
|
||||
try {
|
||||
List<GenericValue> myStatusItems = EntityQuery.use(delegator)
|
||||
@@ -66,7 +66,7 @@ public class StatusServices {
|
||||
Debug.logError(e, module);
|
||||
}
|
||||
}
|
||||
Map<String, Object> ret = new LinkedHashMap<String, Object>();
|
||||
Map<String, Object> ret = new LinkedHashMap<>();
|
||||
ret.put("statusItems",statusItems);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public final class StatusWorker {
|
||||
|
||||
public static void getStatusItems(PageContext pageContext, String attributeName, String statusTypeIdOne, String statusTypeIdTwo) {
|
||||
Delegator delegator = (Delegator) pageContext.getRequest().getAttribute("delegator");
|
||||
List<GenericValue> statusItems = new LinkedList<GenericValue>();
|
||||
List<GenericValue> statusItems = new LinkedList<>();
|
||||
|
||||
try {
|
||||
List<GenericValue> calItems = EntityQuery.use(delegator)
|
||||
|
||||
@@ -68,7 +68,7 @@ public class TelecomServices {
|
||||
|
||||
|
||||
try {
|
||||
Map<String, Object> createCommEventCtx = new HashMap<String, Object>();
|
||||
Map<String, Object> createCommEventCtx = new HashMap<>();
|
||||
createCommEventCtx = ctx.makeValidContext("createCommunicationEvent", ModelService.IN_PARAM, context);
|
||||
createCommEventCtx.put("content", message);
|
||||
createCommEventCtx.put("communicationEventTypeId", "PHONE_COMMUNICATION");
|
||||
@@ -82,7 +82,7 @@ public class TelecomServices {
|
||||
}
|
||||
String communicationEventId = (String) createCommEventResult.get("communicationEventId");
|
||||
|
||||
Map<String, Object> conditions = new HashMap<String, Object>();
|
||||
Map<String, Object> conditions = new HashMap<>();
|
||||
conditions.put("productStoreId", productStoreId);
|
||||
conditions.put("telecomMsgTypeEnumId", telecomMsgTypeEnumId);
|
||||
conditions.put("telecomMethodTypeId", telecomMethodTypeId);
|
||||
@@ -90,7 +90,7 @@ public class TelecomServices {
|
||||
if (productStoreTelecomSetting != null) {
|
||||
GenericValue customMethod = productStoreTelecomSetting.getRelatedOne("CustomMethod", false);
|
||||
if (UtilValidate.isNotEmpty(customMethod.getString("customMethodName"))) {
|
||||
Map<String, Object> serviceCtx = new HashMap<String, Object>();
|
||||
Map<String, Object> serviceCtx = new HashMap<>();
|
||||
serviceCtx.put("numbers", numbers);
|
||||
serviceCtx.put("message", message);
|
||||
if (telecomGatewayConfigId != null) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class PerformFindTests extends OFBizTestCase {
|
||||
}
|
||||
|
||||
private List<GenericValue> getCompleteList(Map<String, Object> context) {
|
||||
List<GenericValue> foundElements = new LinkedList<GenericValue>();
|
||||
List<GenericValue> foundElements = new LinkedList<>();
|
||||
try (EntityListIterator listIt = (EntityListIterator) context.get("listIt")) {
|
||||
if (listIt != null) {
|
||||
foundElements = listIt.getCompleteList();
|
||||
@@ -115,7 +115,7 @@ public class PerformFindTests extends OFBizTestCase {
|
||||
GenericValue userLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", "system").cache().queryOne();
|
||||
prepareData();
|
||||
|
||||
Map<String, Object> inputFields = new HashMap<String, Object>();
|
||||
Map<String, Object> inputFields = new HashMap<>();
|
||||
//first test without condition
|
||||
Map<String, Object> performFindMap = UtilMisc.toMap("userLogin", userLogin, "entityName", "Testing", "inputFields", inputFields);
|
||||
Map<String, Object> result = dispatcher.runSync("performFind", performFindMap);
|
||||
|
||||
Reference in New Issue
Block a user