[ofbiz-framework] branch trunk updated: Improved: Replace explicit type argument with diamond operator(OFBIZ-11828)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Improved: Replace explicit type argument with diamond operator(OFBIZ-11828)

Pawan Verma-2
This is an automated email from the ASF dual-hosted git repository.

pawan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new e19b12e  Improved: Replace explicit type argument with diamond operator(OFBIZ-11828)
e19b12e is described below

commit e19b12eae99c47c2e21f84c3bfb1c3775df4a8eb
Author: Pawan Verma <[hidden email]>
AuthorDate: Sun Jun 28 01:04:25 2020 +0530

    Improved: Replace explicit type argument with diamond operator(OFBIZ-11828)
   
    Since Java 1.7, when defining generic types it is unnecessary to redefine those types in the constructor when it is already done in the declared type.
---
 .../ofbiz/accounting/payment/PaymentGatewayServices.java   |  2 +-
 .../thirdparty/cybersource/IcsPaymentServices.java         | 10 +++++-----
 .../thirdparty/orbital/OrbitalPaymentServices.java         |  8 ++++----
 .../ofbiz/accounting/thirdparty/paypal/PayPalServices.java | 14 +++++++-------
 .../ofbiz/accounting/thirdparty/verisign/PayflowPro.java   | 14 +++++++-------
 .../manufacturing/jobshopmgt/ProductionRunServices.java    |  4 ++--
 .../ofbiz/marketing/tracking/TrackingCodeEvents.java       |  2 +-
 .../org/apache/ofbiz/order/shoppingcart/ShoppingCart.java  |  2 +-
 .../org/apache/ofbiz/product/catalog/CatalogWorker.java    |  2 +-
 .../org/apache/ofbiz/shipment/shipment/ShipmentWorker.java |  2 +-
 .../org/apache/ofbiz/base/util/collections/MapContext.java |  2 +-
 .../apache/ofbiz/common/scripting/ScriptHelperImpl.java    |  2 +-
 .../java/org/apache/ofbiz/entity/GenericDelegator.java     |  2 +-
 .../apache/ofbiz/entity/transaction/TransactionUtil.java   |  4 ++--
 .../java/org/apache/ofbiz/entity/util/EntityQuery.java     |  2 +-
 .../ofbiz/entityext/data/EntityDataLoadContainer.java      |  2 +-
 .../src/main/java/org/apache/ofbiz/security/CsrfUtil.java  |  2 +-
 .../test/java/org/apache/ofbiz/security/CsrfUtilTests.java |  2 +-
 framework/webtools/template/entity/tablesMySql.jsp         |  2 +-
 .../ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java     |  2 +-
 20 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java
index 9ac5e16..69168ca 100644
--- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java
+++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java
@@ -3009,7 +3009,7 @@ public class PaymentGatewayServices {
         }
 
         // prepare the order payment preference (facade)
-        GenericValue orderPaymentPref = delegator.makeValue("OrderPaymentPreference", new HashMap<String, Object>());
+        GenericValue orderPaymentPref = delegator.makeValue("OrderPaymentPreference", new HashMap<>());
         orderPaymentPref.set("orderPaymentPreferenceId", "_NA_");
         orderPaymentPref.set("orderId", "_NA_");
         orderPaymentPref.set("presentFlag", "N");
diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java
index 591ba8c..660d5b4 100644
--- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java
+++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java
@@ -304,7 +304,7 @@ public class IcsPaymentServices {
         // make the request map
         String capture = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "autoBill", configString, "payment.cybersource.autoBill", "false");
         String orderId = (String) context.get("orderId");
-        Map<String, Object> request = new HashMap<String, Object>();
+        Map<String, Object> request = new HashMap<>();
         request.put("ccAuthService_run", "true");              // run auth service
         request.put("ccCaptureService_run", capture);          // run capture service (i.e. sale)
         request.put("merchantReferenceCode", orderId);         // set the order ref number
@@ -325,7 +325,7 @@ public class IcsPaymentServices {
         }
         String merchantDesc = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "merchantDescr", configString, "payment.cybersource.merchantDescr", null);
         String merchantCont = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "merchantContact", configString, "payment.cybersource.merchantContact", null);
-        Map<String, Object> request = new HashMap<String, Object>();
+        Map<String, Object> request = new HashMap<>();
         request.put("ccCaptureService_run", "true");
         request.put("ccCaptureService_authRequestID", authTransaction.getString("referenceNum"));
         request.put("item_0_unitPrice", getAmountString(context, "captureAmount"));
@@ -343,7 +343,7 @@ public class IcsPaymentServices {
     }
 
     private static Map<String, Object> buildReleaseRequest(Map<String, ? extends Object> context, GenericValue authTransaction) {
-        Map<String, Object> request = new HashMap<String, Object>();
+        Map<String, Object> request = new HashMap<>();
         GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference");
         String currency = (String) context.get("currency");
         request.put("ccAuthReversalService_run", "true");
@@ -364,7 +364,7 @@ public class IcsPaymentServices {
         String currency = (String) context.get("currency");
         String merchantDesc = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "merchantDescr", configString, "payment.cybersource.merchantDescr", null);
         String merchantCont = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "merchantContact", configString, "payment.cybersource.merchantContact", null);
-        Map<String, Object> request = new HashMap<String, Object>();
+        Map<String, Object> request = new HashMap<>();
         request.put("ccCreditService_run", "true");
         request.put("ccCreditService_captureRequestID", authTransaction.getString("referenceNum"));
         request.put("item_0_unitPrice", getAmountString(context, "refundAmount"));
@@ -381,7 +381,7 @@ public class IcsPaymentServices {
 
     private static Map<String, Object> buildCreditRequest(Map<String, ? extends Object> context) {
         String refCode = (String) context.get("referenceCode");
-        Map<String, Object> request = new HashMap<String, Object>();
+        Map<String, Object> request = new HashMap<>();
         request.put("ccCreditService_run", "true");            // run credit service
         request.put("merchantReferenceCode", refCode);         // set the ref number could be order id
         appendFullBillingInfo(request, context);               // add in all address info
diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java
index 15c44e7..cbe4fff 100644
--- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java
+++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java
@@ -252,7 +252,7 @@ public class OrbitalPaymentServices {
         //TODO: Will move this to property file and then will read it from there.
         String configFile = "/applications/accounting/config/linehandler.properties";
         String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId");
-        Map<String, Object> buildConfiguratorContext = new HashMap<String, Object>();
+        Map<String, Object> buildConfiguratorContext = new HashMap<>();
         try {
             buildConfiguratorContext.put("OrbitalConnectionUsername", getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "username"));
             buildConfiguratorContext.put("OrbitalConnectionPassword", getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "connectionPassword"));
@@ -487,7 +487,7 @@ public class OrbitalPaymentServices {
     }
 
     private static Map<String, Object> processCard(RequestIF request) {
-        Map<String, Object> processCardResult = new HashMap<String, Object>();
+        Map<String, Object> processCardResult = new HashMap<>();
         try {
             response = tp.process(request);
             if (response.isApproved()) {
@@ -597,7 +597,7 @@ public class OrbitalPaymentServices {
     }
 
     private static void printTransResult(ResponseIF response) {
-        Map<String, Object> generatedResponse = new HashMap<String, Object>();
+        Map<String, Object> generatedResponse = new HashMap<>();
         generatedResponse.put("isGood",  response.isGood());
         generatedResponse.put("isError", response.isError());
         generatedResponse.put("isQuickResponse",  response.isQuickResponse());
@@ -641,7 +641,7 @@ public class OrbitalPaymentServices {
     }
 
     private static Map<String, Object> validateRequest(Map<String, Object> params, Map props, RequestIF request) {
-        Map<String, Object> result = new HashMap<String, Object>();
+        Map<String, Object> result = new HashMap<>();
         result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
         return result;
     }
diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/paypal/PayPalServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
index 51f3ac6..5380382 100644
--- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
+++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
@@ -90,7 +90,7 @@ public class PayPalServices {
     // The weak key is a simple wrapper for the checkout token String and is stored as a cart attribute. The value
     // is a weak reference to the ShoppingCart itself.  Entries will be removed as carts are removed from the
     // session (i.e. on cart clear or successful checkout) or when the session is destroyed
-    private static Map<TokenWrapper, WeakReference<ShoppingCart>> tokenCartMap = new WeakHashMap<TokenWrapper, WeakReference<ShoppingCart>>();
+    private static Map<TokenWrapper, WeakReference<ShoppingCart>> tokenCartMap = new WeakHashMap<>();
 
     public static Map<String, Object> setExpressCheckout(DispatchContext dctx, Map<String, ? extends Object> context) {
         ShoppingCart cart = (ShoppingCart) context.get("cart");
@@ -166,7 +166,7 @@ public class PayPalServices {
         cart.setAttribute("payPalCheckoutToken", token);
         TokenWrapper tokenWrapper = new TokenWrapper(token);
         cart.setAttribute("payPalCheckoutTokenObj", tokenWrapper);
-        PayPalServices.tokenCartMap.put(tokenWrapper, new WeakReference<ShoppingCart>(cart));
+        PayPalServices.tokenCartMap.put(tokenWrapper, new WeakReference<>(cart));
         return ServiceUtil.returnSuccess();
     }
 
@@ -191,7 +191,7 @@ public class PayPalServices {
         // Since most if not all of the shipping estimate codes requires a persisted contactMechId we'll create one and
         // then delete once we're done, now is not the time to worry about updating everything
         String contactMechId = null;
-        Map<String, Object> inMap = new HashMap<String, Object>();
+        Map<String, Object> inMap = new HashMap<>();
         inMap.put("address1", paramMap.get("SHIPTOSTREET"));
         inMap.put("address2", paramMap.get("SHIPTOSTREET2"));
         inMap.put("city", paramMap.get("SHIPTOCITY"));
@@ -413,7 +413,7 @@ public class PayPalServices {
             }
         }
 
-        Map<String, Object> inMap = new HashMap<String, Object>();
+        Map<String, Object> inMap = new HashMap<>();
         Map<String, Object> outMap = null;
         // Create the person if necessary
         boolean newParty = false;
@@ -520,7 +520,7 @@ public class PayPalServices {
         boolean needsShippingPurpose = true;
         // if the cart for some reason already has a billing address, we'll leave it be
         boolean needsBillingPurpose = (cart.getContactMech("BILLING_LOCATION") == null);
-        Map<String, Object> postalMap = new HashMap<String, Object>();
+        Map<String, Object> postalMap = new HashMap<>();
         postalMap.put("toName", decoder.get("SHIPTONAME"));
         postalMap.put("address1", decoder.get("SHIPTOSTREET"));
         postalMap.put("address2", decoder.get("SHIPTOSTREET2"));
@@ -728,7 +728,7 @@ public class PayPalServices {
             return ServiceUtil.returnError(UtilMisc.toList(errorMessages.values()));
         }
 
-        Map<String, Object> inMap = new HashMap<String, Object>();
+        Map<String, Object> inMap = new HashMap<>();
         inMap.put("userLogin", userLogin);
         inMap.put("paymentMethodId", payPalPaymentMethod.get("paymentMethodId"));
         inMap.put("transactionId", decoder.get("TRANSACTIONID"));
@@ -1032,7 +1032,7 @@ public class PayPalServices {
 
     private static String parseStateProvinceGeoId(String payPalShipToState, String countryGeoId, Delegator delegator) {
         String lookupField = "geoName";
-        List<EntityCondition> conditionList = new LinkedList<EntityCondition>();
+        List<EntityCondition> conditionList = new LinkedList<>();
         conditionList.add(EntityCondition.makeCondition("geoAssocTypeId", "REGIONS"));
         if ("USA".equals(countryGeoId) || "CAN".equals(countryGeoId)) {
             // PayPal returns two letter code for US and Canadian States/Provinces
diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/verisign/PayflowPro.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/verisign/PayflowPro.java
index ac789f8..b6154a3 100644
--- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/verisign/PayflowPro.java
+++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/verisign/PayflowPro.java
@@ -90,7 +90,7 @@ public class PayflowPro {
             isPayPal = true;
         }
 
-        Map<String, String> data = new HashMap<String, String>();
+        Map<String, String> data = new HashMap<>();
 
         boolean isReAuth = false;
         if (isPayPal) {
@@ -433,7 +433,7 @@ public class PayflowPro {
                     "AccountingPayPalShoppingCartIsEmpty", locale));
         }
 
-        Map<String, String> data = new HashMap<String, String>();
+        Map<String, String> data = new HashMap<>();
 
         data.put("TRXTYPE", "O");
         data.put("TENDER", "P");
@@ -543,7 +543,7 @@ public class PayflowPro {
         String paymentGatewayConfigId = payPalPaymentSetting.getString("paymentGatewayConfigId");
         String configString = "payment.properties";
 
-        Map<String, String> data = new HashMap<String, String>();
+        Map<String, String> data = new HashMap<>();
         data.put("TRXTYPE", "O");
         data.put("TENDER", "P");
         data.put("ACTION", "G");
@@ -576,7 +576,7 @@ public class PayflowPro {
                     "AccountingPayPalCommunicationError", locale));
         }
 
-        Map<String, Object> inMap = new HashMap<String, Object>();
+        Map<String, Object> inMap = new HashMap<>();
         inMap.put("userLogin", cart.getUserLogin());
         inMap.put("partyId", cart.getOrderPartyId());
         inMap.put("contactMechId", cart.getShippingContactMechId());
@@ -622,7 +622,7 @@ public class PayflowPro {
         }
         BigDecimal processAmount = paymentPref.getBigDecimal("maxAmount");
 
-        Map<String, String> data = new HashMap<String, String>();
+        Map<String, String> data = new HashMap<>();
         data.put("TRXTYPE", "O");
         data.put("TENDER", "P");
         data.put("PAYERID", payPalPaymentMethod.getString("payerId"));
@@ -650,7 +650,7 @@ public class PayflowPro {
 
         Map<String, String> responseMap = parseResponse(resp);
 
-        Map<String, Object> inMap = new HashMap<String, Object>();
+        Map<String, Object> inMap = new HashMap<>();
         inMap.put("userLogin", userLogin);
         inMap.put("paymentMethodId", payPalPaymentMethod.get("paymentMethodId"));
         inMap.put("transactionId", responseMap.get("PNREF"));
@@ -670,7 +670,7 @@ public class PayflowPro {
 
     private static Map<String, String> parseResponse(String resp) {
         Debug.logInfo("Verisign response string: " + resp, MODULE);
-        Map<String, String> parameters = new HashMap<String, String>();
+        Map<String, String> parameters = new HashMap<>();
         List<String> params = StringUtil.split(resp, "&");
         for (String str : params) {
             if (str.length() > 0) {
diff --git a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
index d4387a7..d4118dd 100644
--- a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
+++ b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
@@ -3474,7 +3474,7 @@ public class ProductionRunServices {
                     estimatedShipDate = now;
                 }
                 if (!products.containsKey(productId)) {
-                    products.put(productId, new TreeMap<Timestamp, Object>());
+                    products.put(productId, new TreeMap<>());
                 }
                 TreeMap<Timestamp, Object> productMap = products.get(productId);
                 if (!productMap.containsKey(estimatedShipDate)) {
@@ -3517,7 +3517,7 @@ public class ProductionRunServices {
                     estimatedShipDate = now;
                 }
                 if (!products.containsKey(productId)) {
-                    products.put(productId, new TreeMap<Timestamp, Object>());
+                    products.put(productId, new TreeMap<>());
                 }
                 TreeMap<Timestamp, Object> productMap = products.get(productId);
                 if (!productMap.containsKey(estimatedShipDate)) {
diff --git a/applications/marketing/src/main/java/org/apache/ofbiz/marketing/tracking/TrackingCodeEvents.java b/applications/marketing/src/main/java/org/apache/ofbiz/marketing/tracking/TrackingCodeEvents.java
index f935381..0e22d2e 100644
--- a/applications/marketing/src/main/java/org/apache/ofbiz/marketing/tracking/TrackingCodeEvents.java
+++ b/applications/marketing/src/main/java/org/apache/ofbiz/marketing/tracking/TrackingCodeEvents.java
@@ -307,7 +307,7 @@ public class TrackingCodeEvents {
         String prodCatalogId = trackingCode.getString("prodCatalogId");
         if (UtilValidate.isNotEmpty(prodCatalogId)) {
             session.setAttribute("CURRENT_CATALOG_ID", prodCatalogId);
-            CategoryWorker.setTrail(request, new LinkedList<String>());
+            CategoryWorker.setTrail(request, new LinkedList<>());
         }
 
         // if forward/redirect is needed, do a response.sendRedirect and return null to tell the control servlet to not do any other requests/views
diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
index a9bcb48..61e2f97 100644
--- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
+++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
@@ -4345,7 +4345,7 @@ public class ShoppingCart implements Iterable<ShoppingCartItem>, Serializable {
                 Map<ShoppingCartItem, Map<Integer, BigDecimal>> supplierCartItems = UtilGenerics.cast(dropShipItems.get(supplierPartyId));
 
                 if (! supplierCartItems.containsKey(cartItem)) {
-                    supplierCartItems.put(cartItem, new HashMap<Integer, BigDecimal>());
+                    supplierCartItems.put(cartItem, new HashMap<>());
                 }
                 Map<Integer, BigDecimal> cartItemGroupQuantities = UtilGenerics.cast(supplierCartItems.get(cartItem));
 
diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/catalog/CatalogWorker.java b/applications/product/src/main/java/org/apache/ofbiz/product/catalog/CatalogWorker.java
index 7c9b491..407b9b3 100644
--- a/applications/product/src/main/java/org/apache/ofbiz/product/catalog/CatalogWorker.java
+++ b/applications/product/src/main/java/org/apache/ofbiz/product/catalog/CatalogWorker.java
@@ -176,7 +176,7 @@ public final class CatalogWorker {
         if (!fromSession) {
             if (Debug.verboseOn()) Debug.logVerbose("[CatalogWorker.getCurrentCatalogId] Setting new catalog name: " + prodCatalogId, MODULE);
             session.setAttribute("CURRENT_CATALOG_ID", prodCatalogId);
-            CategoryWorker.setTrail(request, new LinkedList<String>());
+            CategoryWorker.setTrail(request, new LinkedList<>());
         }
         return prodCatalogId;
     }
diff --git a/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentWorker.java b/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentWorker.java
index d9537c6..3bc5bbe 100644
--- a/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentWorker.java
+++ b/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentWorker.java
@@ -134,7 +134,7 @@ public final class ShipmentWorker {
                         } else if (totalWeight.compareTo(BigDecimal.ZERO) > 0) {
                             // create the first package
                             if (packages.size() == 0) {
-                                packages.add(new HashMap<String, BigDecimal>());
+                                packages.add(new HashMap<>());
                             }
 
                             // package loop
diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MapContext.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MapContext.java
index ab25f36..0545493 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MapContext.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/MapContext.java
@@ -53,7 +53,7 @@ public class MapContext<K, V> implements Map<K, V>, LocalizedMap<V> {
 
     /** Puts a new Map on the top of the stack */
     public void push() {
-        contexts.addFirst(new HashMap<K, V>());
+        contexts.addFirst(new HashMap<>());
     }
 
     /** Puts an existing Map on the top of the stack (top meaning will override lower layers on the stack) */
diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/scripting/ScriptHelperImpl.java b/framework/common/src/main/java/org/apache/ofbiz/common/scripting/ScriptHelperImpl.java
index 05364e3..e5729dc 100644
--- a/framework/common/src/main/java/org/apache/ofbiz/common/scripting/ScriptHelperImpl.java
+++ b/framework/common/src/main/java/org/apache/ofbiz/common/scripting/ScriptHelperImpl.java
@@ -49,7 +49,7 @@ import org.apache.ofbiz.service.ServiceUtil;
 public final class ScriptHelperImpl implements ScriptHelper {
 
     private static final String MODULE = ScriptHelperImpl.class.getName();
-    private static final Map<String, ? extends Object> EMPTY_ARGS = Collections.unmodifiableMap(new HashMap<String, Object>());
+    private static final Map<String, ? extends Object> EMPTY_ARGS = Collections.unmodifiableMap(new HashMap<>());
 
     private static GenericValue runFindByPrimaryKey(ModelEntity modelEntity, ContextHelper ctxHelper, boolean useCache, boolean autoFieldMap,
             Map<String, ? extends Object> fieldMap, List<String> selectFieldList) throws ScriptException {
diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java
index 5077f96..ad57813 100644
--- a/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java
+++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java
@@ -2198,7 +2198,7 @@ public class GenericDelegator implements Delegator {
      */
     @Override
     public <T> void setEntityEcaHandler(EntityEcaHandler<T> entityEcaHandler) {
-        this.entityEcaHandler.set(new ConstantFuture<EntityEcaHandler<?>>(entityEcaHandler));
+        this.entityEcaHandler.set(new ConstantFuture<>(entityEcaHandler));
         this.warnNoEcaHandler = false;
     }
 
diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/TransactionUtil.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/TransactionUtil.java
index 44949ed..86145a2 100644
--- a/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/TransactionUtil.java
+++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/transaction/TransactionUtil.java
@@ -75,8 +75,8 @@ public final class TransactionUtil implements Status {
     private static final boolean debugResources = readDebugResources();
     public static final Map<Xid, DebugXaResource> debugResMap = Collections.<Xid, DebugXaResource>synchronizedMap(new HashMap<Xid, DebugXaResource>());
     // in order to improve performance allThreadsTransactionBeginStack and allThreadsTransactionBeginStackSave are only maintained when logging level INFO is on
-    private static Map<Long, Exception> allThreadsTransactionBeginStack = Collections.<Long, Exception>synchronizedMap(new HashMap<Long, Exception>());
-    private static Map<Long, List<Exception>> allThreadsTransactionBeginStackSave = Collections.<Long, List<Exception>>synchronizedMap(new HashMap<Long, List<Exception>>());
+    private static Map<Long, Exception> allThreadsTransactionBeginStack = Collections.<Long, Exception>synchronizedMap(new HashMap<>());
+    private static Map<Long, List<Exception>> allThreadsTransactionBeginStackSave = Collections.<Long, List<Exception>>synchronizedMap(new HashMap<>());
 
     private TransactionUtil () {}
     public static <V> V doNewTransaction(Callable<V> callable, String ifErrorMessage, int timeout, boolean printException) throws GenericEntityException {
diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java
index fa1943c..450e03c 100644
--- a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java
+++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java
@@ -557,7 +557,7 @@ public class EntityQuery {
         cache(false);
         try (EntityListIterator genericValueEli = queryIterator()) {
             if (this.distinct) {
-                Set<T> distinctSet = new LinkedHashSet<T>();
+                Set<T> distinctSet = new LinkedHashSet<>();
                 GenericValue value = null;
                 while ((value = genericValueEli.next()) != null) {
                     T fieldValue = UtilGenerics.<T>cast(value.get(fieldName));
diff --git a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java
index e21c9e6..4bafbc6 100644
--- a/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java
+++ b/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java
@@ -557,7 +557,7 @@ public class EntityDataLoadContainer implements Container {
                         .filter(file -> file.getName().toLowerCase(Locale.getDefault()).endsWith(".xml"))
                         .map(file -> UtilURL.fromFilename(file.getPath()))
                         .collect(Collectors.toList()))
-                .orElse(new ArrayList<URL>());
+                .orElse(new ArrayList<>());
     }
 
     private static void logDataLoadingPlan(List<URL> urlList, String delegatorName) {
diff --git a/framework/security/src/main/java/org/apache/ofbiz/security/CsrfUtil.java b/framework/security/src/main/java/org/apache/ofbiz/security/CsrfUtil.java
index 846013b..3e59ffb 100644
--- a/framework/security/src/main/java/org/apache/ofbiz/security/CsrfUtil.java
+++ b/framework/security/src/main/java/org/apache/ofbiz/security/CsrfUtil.java
@@ -90,7 +90,7 @@ public final class CsrfUtil {
         if (UtilValidate.isNotEmpty(partyId)) {
             Map<String, Map<String, String>> partyTokenMap = csrfTokenCache.get(partyId);
             if (partyTokenMap == null) {
-                partyTokenMap = new HashMap<String, Map<String, String>>();
+                partyTokenMap = new HashMap<>();
                 csrfTokenCache.put(partyId, partyTokenMap);
             }
 
diff --git a/framework/security/src/test/java/org/apache/ofbiz/security/CsrfUtilTests.java b/framework/security/src/test/java/org/apache/ofbiz/security/CsrfUtilTests.java
index 3f3e15f..736597a 100644
--- a/framework/security/src/test/java/org/apache/ofbiz/security/CsrfUtilTests.java
+++ b/framework/security/src/test/java/org/apache/ofbiz/security/CsrfUtilTests.java
@@ -49,7 +49,7 @@ public class CsrfUtilTests {
         when(request.getSession()).thenReturn(session);
 
         // prepare the token map to be retrieved from session
-        Map<String, String> tokenMap = new LinkedHashMap<String, String>();
+        Map<String, String> tokenMap = new LinkedHashMap<>();
         tokenMap.put("uri_1", "abcd");
         when(session.getAttribute("CSRF-Token")).thenReturn(tokenMap);
 
diff --git a/framework/webtools/template/entity/tablesMySql.jsp b/framework/webtools/template/entity/tablesMySql.jsp
index cdf5bbd..b75bf47 100644
--- a/framework/webtools/template/entity/tablesMySql.jsp
+++ b/framework/webtools/template/entity/tablesMySql.jsp
@@ -20,7 +20,7 @@ under the License.
 if(security.hasPermission("ENTITY_MAINT", session)) {
   ModelReader reader = delegator.getModelReader();
   Collection<String> ec = reader.getEntityNames();
-  TreeSet<String> entities = new TreeSet<String>(ec);
+  TreeSet<String> entities = new TreeSet<>(ec);
   Iterator<String> classNamesIterator = entities.iterator();
   while(classNamesIterator != null && classNamesIterator.hasNext()) { ModelEntity entity = reader.getModelEntity((String)classNamesIterator.next());%>
 CREATE TABLE <%=entity.getPlainTableName()%> (<%for (String fieldName : entity.getAllFieldNames()){ModelField field=entity.getField(fieldName); ModelFieldType type = delegator.getEntityFieldType(entity, field.getType());%><%if(field.getIsPk()){%>
diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java
index 21adeb5..05a2001 100644
--- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java
+++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/MultiBlockHtmlTemplateUtil.java
@@ -373,7 +373,7 @@ public final class MultiBlockHtmlTemplateUtil {
         Set<String> scriptLinks = UtilGenerics.cast(request.getAttribute(SCRIPT_LINKS_FOR_FOOT));
         if (scriptLinks == null) {
             // use of LinkedHashSet to maintain insertion order
-            scriptLinks = new LinkedHashSet<String>();
+            scriptLinks = new LinkedHashSet<>();
             request.setAttribute(SCRIPT_LINKS_FOR_FOOT, scriptLinks);
         }
         scriptLinks.add(filePath);