Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java Sun Apr 21 12:49:52 2019 @@ -61,8 +61,8 @@ import org.apache.ofbiz.security.Securit public final class ContentManagementWorker { public static final String module = ContentManagementWorker.class.getName(); - private static Map<String, GenericValue> cachedWebSitePublishPoints = new HashMap<String, GenericValue>(); - private static Map<String, Map<String, Object>> cachedStaticValues = new HashMap<String, Map<String,Object>>(); + private static Map<String, GenericValue> cachedWebSitePublishPoints = new HashMap<>(); + private static Map<String, Map<String, Object>> cachedStaticValues = new HashMap<>(); private ContentManagementWorker() {} @@ -83,7 +83,7 @@ public final class ContentManagementWork Map<String, LifoSet<Object>> lookupCaches = UtilGenerics.checkMap(session.getAttribute("lookupCaches")); if (lookupCaches == null) { - lookupCaches = new HashMap<String, LifoSet<Object>>(); + lookupCaches = new HashMap<>(); session.setAttribute("lookupCaches", lookupCaches); } String entityName = pk.getEntityName(); @@ -102,7 +102,7 @@ public final class ContentManagementWork String cacheEntityName = entityName; LifoSet<Object> lkupCache = lookupCaches.get(cacheEntityName); if (lkupCache == null) { - lkupCache = new LifoSet<Object>(); + lkupCache = new LifoSet<>(); lookupCaches.put(cacheEntityName, lkupCache); } lkupCache.add(pk.getPrimaryKey()); @@ -113,7 +113,7 @@ public final class ContentManagementWork String cacheEntityName = entityName; LifoSet<Object> lkupCache = lookupCaches.get(cacheEntityName); if (lkupCache == null) { - lkupCache = new LifoSet<Object>(); + lkupCache = new LifoSet<>(); lookupCaches.put(cacheEntityName, lkupCache); } @@ -156,7 +156,7 @@ public final class ContentManagementWork HttpSession session = request.getSession(); Map<String, GenericEntity> currentEntityMap = UtilGenerics.checkMap(session.getAttribute("currentEntityMap")); if (currentEntityMap == null) { - currentEntityMap = new HashMap<String, GenericEntity>(); + currentEntityMap = new HashMap<>(); session.setAttribute("currentEntityMap", currentEntityMap); } currentEntityMap.put(entityName, ent); @@ -185,7 +185,7 @@ public final class ContentManagementWork HttpSession session = request.getSession(); Map<String, GenericPK> currentEntityMap = UtilGenerics.checkMap(session.getAttribute("currentEntityMap")); if (currentEntityMap == null) { - currentEntityMap = new HashMap<String, GenericPK>(); + currentEntityMap = new HashMap<>(); session.setAttribute("currentEntityMap", currentEntityMap); } Map<String, Object> paramMap = UtilHttp.getParameterMap(request); @@ -278,7 +278,7 @@ public final class ContentManagementWork } public static List<String []> getPermittedPublishPoints(Delegator delegator, List<GenericValue> allPublishPoints, GenericValue userLogin, Security security, String permittedAction, String permittedOperations, String passedRoles) throws GeneralException { - List<String []> permittedPublishPointList = new LinkedList<String[]>(); + List<String []> permittedPublishPointList = new LinkedList<>(); // Check that user has permission to admin sites for (GenericValue webSitePP : allPublishPoints) { @@ -293,7 +293,7 @@ public final class ContentManagementWork } List<String> passedPurposes = UtilMisc.toList("ARTICLE"); List<String> roles = StringUtil.split(passedRoles, "|"); - List<String> targetOperationList = new LinkedList<String>(); + List<String> targetOperationList = new LinkedList<>(); if (UtilValidate.isEmpty(permittedOperations)) { targetOperationList.add("CONTENT" + entityAction); } else { @@ -325,7 +325,7 @@ public final class ContentManagementWork } catch (GenericEntityException e) { throw new GeneralException(e.getMessage()); } - List<GenericValue> allPublishPoints = new LinkedList<GenericValue>(); + List<GenericValue> allPublishPoints = new LinkedList<>(); GenericValue webSitePublishPoint = null; for (GenericValue contentAssoc : relatedPubPts) { String pub = (String)contentAssoc.get("contentId"); @@ -337,7 +337,7 @@ public final class ContentManagementWork public static Map<String, GenericValue> getPublishPointMap(Delegator delegator, String pubPtId) throws GeneralException { List<GenericValue> publishPointList = getAllPublishPoints(delegator, pubPtId); - Map<String, GenericValue> publishPointMap = new HashMap<String, GenericValue>(); + Map<String, GenericValue> publishPointMap = new HashMap<>(); for (GenericValue webSitePublishPoint : publishPointList) { String pub = (String)webSitePublishPoint.get("contentId"); publishPointMap.put(pub, webSitePublishPoint); @@ -356,7 +356,7 @@ public final class ContentManagementWork } public static Map<String, GenericValue> getPublishPointMap(Delegator delegator, List<GenericValue> publishPointList) { - Map<String, GenericValue> publishPointMap = new HashMap<String, GenericValue>(); + Map<String, GenericValue> publishPointMap = new HashMap<>(); for (GenericValue webSitePublishPoint : publishPointList) { String pub = (String)webSitePublishPoint.get("contentId"); publishPointMap.put(pub, webSitePublishPoint); @@ -372,12 +372,12 @@ public final class ContentManagementWork throw new GeneralException(e.getMessage()); } - List<Map<String, Object>> staticValueList = new LinkedList<Map<String,Object>>(); + List<Map<String, Object>> staticValueList = new LinkedList<>(); for (GenericValue content : assocValueList) { String contentId = (String)content.get("contentId"); String contentName = (String)content.get("contentName"); String description = (String)content.get("description"); - Map<String, Object> map = new HashMap<String, Object>(); + Map<String, Object> map = new HashMap<>(); map.put("contentId", contentId); map.put("contentName", contentName); map.put("description", description); @@ -460,7 +460,7 @@ public final class ContentManagementWork if (!ignoreCache) { Map<String, Object> subStaticValueMap = cachedStaticValues.get(parentPlaceholderId); if (subStaticValueMap == null) { - subStaticValueMap = new HashMap<String, Object>(); + subStaticValueMap = new HashMap<>(); cachedStaticValues.put(parentPlaceholderId, subStaticValueMap); } } @@ -473,12 +473,12 @@ public final class ContentManagementWork // and another map (publishPointMapAll) that points to one of the top-level points. List<GenericValue> allPublishPointList = getAllPublishPoints(delegator, rootPubId); List<String []> publishPointList = getPermittedPublishPoints(delegator, allPublishPointList, userLogin, security , permittedAction, permittedOperations, passedRoles); - Map<String, Object> publishPointMap = new HashMap<String, Object>(); - Map<String, Object> publishPointMapAll = new HashMap<String, Object>(); + Map<String, Object> publishPointMap = new HashMap<>(); + Map<String, Object> publishPointMapAll = new HashMap<>(); for (String [] arr : publishPointList) { String contentId = arr[0]; String description = arr[1]; - List<Object []> subPointList = new LinkedList<Object[]>(); + List<Object []> subPointList = new LinkedList<>(); Object [] subArr = {contentId, subPointList, description, null}; publishPointMap.put(contentId, subArr); publishPointMapAll.put(contentId, contentId); @@ -521,7 +521,7 @@ public final class ContentManagementWork } } - List<Object []> publishedLinkList = new LinkedList<Object[]>(); + List<Object []> publishedLinkList = new LinkedList<>(); for (Entry<String, Object> entry : publishPointMap.entrySet()) { String contentId = entry.getKey(); Object [] subPointArr = (Object [])publishPointMap.get(contentId); @@ -552,7 +552,7 @@ public final class ContentManagementWork } public static List<String []> getPermittedDepartmentPoints(Delegator delegator, List<GenericValue> allDepartmentPoints, GenericValue userLogin, Security security, String permittedAction, String permittedOperations, String passedRoles) throws GeneralException { - List<String []> permittedDepartmentPointList = new LinkedList<String[]>(); + List<String []> permittedDepartmentPointList = new LinkedList<>(); // Check that user has permission to admin sites for (GenericValue content : allDepartmentPoints) { @@ -565,7 +565,7 @@ public final class ContentManagementWork entityAction = "_ADMIN"; List<String> passedPurposes = UtilMisc.<String>toList("ARTICLE"); List<String> roles = StringUtil.split(passedRoles, "|"); - List<String> targetOperationList = new LinkedList<String>(); + List<String> targetOperationList = new LinkedList<>(); if (UtilValidate.isEmpty(permittedOperations)) { targetOperationList.add("CONTENT" + entityAction); } else { @@ -598,7 +598,7 @@ public final class ContentManagementWork } catch (GenericEntityException e) { throw new GeneralException(e.getMessage()); } - List<GenericValue> allDepartmentPoints = new LinkedList<GenericValue>(); + List<GenericValue> allDepartmentPoints = new LinkedList<>(); GenericValue departmentContent = null; for (GenericValue contentAssoc : relatedPubPts) { String pub = (String)contentAssoc.get("contentId"); @@ -623,7 +623,7 @@ public final class ContentManagementWork if (thisContent == null) throw new RuntimeException("No entity found for id=" + contentId); - List<EntityCondition> conditionMain = new ArrayList<EntityCondition>(); + List<EntityCondition> conditionMain = new ArrayList<>(); conditionMain.add(EntityCondition.makeCondition("contentIdTo", contentId)); if (typeList.size() > 0) { conditionMain.add(EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.IN, typeList)); Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java Sun Apr 21 12:49:52 2019 @@ -70,7 +70,7 @@ In order to make this service active add Locale locale = (Locale) context.get("locale"); GenericValue userLogin = (GenericValue) context.get("userLogin"); String file = (String) context.get("file"); - Map<String, Object> result = new HashMap<String, Object>(); + Map<String, Object> result = new HashMap<>(); String errMsg = "", sucMsg= ""; GenericValue Entity = null; if (UtilValidate.isNotEmpty(file)) { @@ -104,7 +104,7 @@ In order to make this service active add Entity.set("createdTxStamp", UtilDateTime.nowTimestamp()); delegator.create(Entity); - Map<String, Object> contentAssoc = new HashMap<String, Object>(); + Map<String, Object> contentAssoc = new HashMap<>(); contentAssoc.put("contentId", "HOME_DOCUMENT"); contentAssoc.put("contentAssocTypeId", "TREE_CHILD"); contentAssoc.put("contentIdTo", "ROOT"); @@ -187,7 +187,7 @@ In order to make this service active add .queryList(); if (contentAssocs.size() == 0) { - contentAssoc = new HashMap<String, Object>(); + contentAssoc = new HashMap<>(); contentAssoc.put("contentId", contentId); contentAssoc.put("contentAssocTypeId", "TREE_CHILD"); contentAssoc.put("contentIdTo", rootContent); @@ -233,7 +233,7 @@ In order to make this service active add Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); GenericValue userLogin = (GenericValue) context.get("userLogin"); - Map<String, Object> result = new HashMap<String, Object>(); + Map<String, Object> result = new HashMap<>(); String subContents = null, check = ",", oldChar = "\"", newChar = "", contentNameInprogress = "", contentName = "", contentId = null; GenericValue Entity = null; String errMsg = "", sucMsg= ""; @@ -265,7 +265,7 @@ In order to make this service active add } if (contentNameMatch == false) { //create DataResource - Map<String,Object> data = new HashMap<String, Object>(); + Map<String,Object> data = new HashMap<>(); data.put("userLogin", userLogin); result = dispatcher.runSync("createDataResource", data); if (ServiceUtil.isError(result)) { @@ -289,7 +289,7 @@ In order to make this service active add delegator.create(Entity); //Relation Content - Map<String,Object> contentAssoc = new HashMap<String, Object>(); + Map<String,Object> contentAssoc = new HashMap<>(); contentAssoc.put("contentId", contentId); contentAssoc.put("contentAssocTypeId", "SUB_CONTENT"); contentAssoc.put("contentIdTo", rootContent); @@ -330,7 +330,7 @@ In order to make this service active add } if (contentNameMatch == false) { //create DataResource - Map<String,Object> data = new HashMap<String, Object>(); + Map<String,Object> data = new HashMap<>(); data.put("userLogin", userLogin); result = dispatcher.runSync("createDataResource", data); if (ServiceUtil.isError(result)) { @@ -354,7 +354,7 @@ In order to make this service active add delegator.create(Entity); //create ContentAssoc - Map<String,Object> contentAssoc = new HashMap<String, Object>(); + Map<String,Object> contentAssoc = new HashMap<>(); contentAssoc.put("contentId", contentId); contentAssoc.put("contentAssocTypeId", "SUB_CONTENT"); contentAssoc.put("contentIdTo", rootContent); Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/blog/BlogRssServices.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/blog/BlogRssServices.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/blog/BlogRssServices.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/blog/BlogRssServices.java Sun Apr 21 12:49:52 2019 @@ -99,7 +99,7 @@ public class BlogRssServices { } public static List<SyndEntry> generateEntryList(LocalDispatcher dispatcher, Delegator delegator, String contentId, String entryLink, Locale locale, GenericValue userLogin) { - List<SyndEntry> entries = new LinkedList<SyndEntry>(); + List<SyndEntry> entries = new LinkedList<>(); List<GenericValue> contentRecs = null; try { @@ -116,7 +116,7 @@ public class BlogRssServices { for (GenericValue v : contentRecs) { String sub = null; try { - Map<String, Object> dummy = new HashMap<String, Object>(); + Map<String, Object> dummy = new HashMap<>(); sub = ContentWorker.renderSubContentAsText(dispatcher, v.getString("contentId"), mapKey, dummy, locale, mimeTypeId, true); } catch (GeneralException e) { Debug.logError(e, module); Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/ContentJsonEvents.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/ContentJsonEvents.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/ContentJsonEvents.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/ContentJsonEvents.java Sun Apr 21 12:49:52 2019 @@ -61,7 +61,7 @@ public class ContentJsonEvents { ); List<GenericValue> assocs = delegator.findList("ContentAssoc", condition, null, null, null, false); - List<Map<String, Object>> nodes = new LinkedList<Map<String, Object>>(); + List<Map<String, Object>> nodes = new LinkedList<>(); for (GenericValue assoc : assocs) { nodes.add(getTreeNode(assoc)); } Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocEvents.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocEvents.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocEvents.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocEvents.java Sun Apr 21 12:49:52 2019 @@ -114,7 +114,7 @@ public class CompDocEvents { request.setAttribute(obj.toString(), val); } // Update ContentRevision and ContentRevisonItem - Map<String, Object> contentRevisionMap = new HashMap<String, Object>(); + Map<String, Object> contentRevisionMap = new HashMap<>(); contentRevisionMap.put("itemContentId", contentId); contentRevisionMap.put("contentId", contentId); contentRevisionMap.put("userLogin", userLogin); @@ -158,7 +158,7 @@ public class CompDocEvents { String rootDir = servletContext.getRealPath("/"); String https = (String) servletContext.getAttribute("https"); - Map<String, Object> mapIn = new HashMap<String, Object>(); + Map<String, Object> mapIn = new HashMap<>(); mapIn.put("contentId", contentId); mapIn.put("locale", locale); mapIn.put("rootDir", rootDir); @@ -207,7 +207,7 @@ public class CompDocEvents { String rootDir = servletContext.getRealPath("/"); String https = (String) servletContext.getAttribute("https"); - Map<String, Object> mapIn = new HashMap<String, Object>(); + Map<String, Object> mapIn = new HashMap<>(); mapIn.put("contentId", contentId); mapIn.put("locale", locale); mapIn.put("rootDir", rootDir); Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java Sun Apr 21 12:49:52 2019 @@ -73,7 +73,7 @@ public class CompDocServices { */ public static Map<String, Object> persistRootCompDoc(DispatchContext dctx, Map<String, ? extends Object> context) { - Map<String, Object> result = new HashMap<String, Object>(); + Map<String, Object> result = new HashMap<>(); Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); Locale locale = (Locale)context.get("locale"); @@ -107,7 +107,7 @@ public class CompDocServices { contentId = (String) persistContentResult.get("contentId"); result.putAll(persistContentResult); - Map<String, Object> contentRevisionMap = new HashMap<String, Object>(); + Map<String, Object> contentRevisionMap = new HashMap<>(); contentRevisionMap.put("itemContentId", contentId); contentRevisionMap.put("contentId", contentId); contentRevisionMap.put("userLogin", userLogin); @@ -139,7 +139,7 @@ public class CompDocServices { String contentRevisionSeqId = (String) context.get("contentRevisionSeqId"); try { - List<EntityCondition> exprList = new LinkedList<EntityCondition>(); + List<EntityCondition> exprList = new LinkedList<>(); exprList.add(EntityCondition.makeCondition("contentIdTo", EntityOperator.EQUALS, contentId)); exprList.add(EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.EQUALS, "COMPDOC_PART")); exprList.add(EntityCondition.makeCondition("rootRevisionContentId", EntityOperator.EQUALS, contentId)); Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentKeywordIndex.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentKeywordIndex.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentKeywordIndex.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentKeywordIndex.java Sun Apr 21 12:49:52 2019 @@ -66,8 +66,8 @@ public class ContentKeywordIndex { boolean removeStems = KeywordSearchUtil.getRemoveStems(); Set<String> stemSet = KeywordSearchUtil.getStemSet(); - Map<String, Long> keywords = new TreeMap<String, Long>(); - List<String> strings = new LinkedList<String>(); + Map<String, Long> keywords = new TreeMap<>(); + List<String> strings = new LinkedList<>(); int pidWeight = 1; keywords.put(content.getString("contentId").toLowerCase(Locale.getDefault()), (long) pidWeight); @@ -186,7 +186,7 @@ public class ContentKeywordIndex { } } - List<GenericValue> toBeStored = new LinkedList<GenericValue>(); + List<GenericValue> toBeStored = new LinkedList<>(); int keywordMaxLength = EntityUtilProperties.getPropertyAsInteger("contentsearch", "content.keyword.max.length", 0); for (Map.Entry<String, Long> entry: keywords.entrySet()) { if (entry.getKey().length() <= keywordMaxLength) { Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentMapFacade.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentMapFacade.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentMapFacade.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentMapFacade.java Sun Apr 21 12:49:52 2019 @@ -51,7 +51,7 @@ public class ContentMapFacade implements public static final String module = ContentMapFacade.class.getName(); - private static final Set<String> mapKeySet = new HashSet<String>(); + private static final Set<String> mapKeySet = new HashSet<>(); static { mapKeySet.add("fields"); mapKeySet.add("link"); @@ -277,10 +277,10 @@ public class ContentMapFacade implements return dataResource; } else if ("subcontent_all".equalsIgnoreCase(name)) { // subcontent list of ordered subcontent - List<ContentMapFacade> subContent = new LinkedList<ContentMapFacade>(); + List<ContentMapFacade> subContent = new LinkedList<>(); List<GenericValue> subs = null; try { - Map<String, Object> expressions = new HashMap<String, Object>(); + Map<String, Object> expressions = new HashMap<>(); expressions.put("contentIdStart", contentId); if(!this.mapKeyFilter.equals("")) { expressions.put("caMapKey", this.mapKeyFilter); @@ -327,7 +327,7 @@ public class ContentMapFacade implements return "=========> " + errorMsg + " <========="; } // TODO: change to use the MapStack instead of a cloned Map - Map<String, Object> renderCtx = new HashMap<String, Object>(); + Map<String, Object> renderCtx = new HashMap<>(); renderCtx.putAll(context); if (this.decoratedContent != null) { renderCtx.put("decoratedContent", decoratedContent); @@ -452,7 +452,7 @@ public class ContentMapFacade implements // key is the mapKey GenericValue sub = null; try { - Map<String, Object> expressions = new HashMap<String, Object>(); + Map<String, Object> expressions = new HashMap<>(); expressions.put("contentIdStart", contentId); expressions.put("caMapKey", name); if(!this.statusFilter.equals("")) { Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java Sun Apr 21 12:49:52 2019 @@ -114,7 +114,7 @@ public class ContentPermissionServices { displayPassCond = true; } Debug.logInfo("displayPassCond(0):" + displayPassCond, ""); - Map<String, Object> results = new HashMap<String, Object>(); + Map<String, Object> results = new HashMap<>(); GenericValue userLogin = (GenericValue) context.get("userLogin"); String partyId = (String) context.get("partyId"); if (UtilValidate.isEmpty(partyId)) { @@ -145,7 +145,7 @@ public class ContentPermissionServices { if (UtilValidate.isNotEmpty(contentPurposeString)) { List<String> purposesFromString = StringUtil.split(contentPurposeString, "|"); if (passedPurposes == null) { - passedPurposes = new LinkedList<String>(); + passedPurposes = new LinkedList<>(); } passedPurposes.addAll(purposesFromString); } @@ -159,7 +159,7 @@ public class ContentPermissionServices { if (UtilValidate.isNotEmpty(targetOperationString)) { List<String> operationsFromString = StringUtil.split(targetOperationString, "|"); if (targetOperations == null) { - targetOperations = new LinkedList<String>(); + targetOperations = new LinkedList<>(); } targetOperations.addAll(operationsFromString); } @@ -168,7 +168,7 @@ public class ContentPermissionServices { EntityPermissionChecker.StdRelatedRoleGetter roleGetter = new EntityPermissionChecker.StdRelatedRoleGetter("Content", "roleTypeId", "contentId", "partyId", "ownerContentId", "ContentRole"); List<String> passedRoles = UtilGenerics.checkList(context.get("roleTypeList")); - if (passedRoles == null) passedRoles = new LinkedList<String>(); + if (passedRoles == null) passedRoles = new LinkedList<>(); String roleTypeString = (String) context.get("roleTypeString"); if (UtilValidate.isNotEmpty(roleTypeString)) { List<String> rolesFromString = StringUtil.split(roleTypeString, "|"); @@ -184,7 +184,7 @@ public class ContentPermissionServices { StringBuilder errBuf = new StringBuilder(); String permissionStatus = null; - List<Object> entityIds = new LinkedList<Object>(); + List<Object> entityIds = new LinkedList<>(); if (passed) { results.put("permissionStatus", "granted"); permissionStatus = "granted"; @@ -250,7 +250,7 @@ public class ContentPermissionServices { } public static Map<String, Object> checkAssocPermission(DispatchContext dctx, Map<String, ? extends Object> context) { - Map<String, Object> results = new HashMap<String, Object>(); + Map<String, Object> results = new HashMap<>(); // Security security = dctx.getSecurity(); Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); @@ -277,12 +277,12 @@ public class ContentPermissionServices { "ContentContentToOrFromIsNull", UtilMisc.toMap("contentTo", contentTo, "contentFrom", contentFrom), locale)); } - Map<String, Object> permResults = new HashMap<String, Object>(); + Map<String, Object> permResults = new HashMap<>(); // Use the purposes from the from entity for both cases. List<String> relatedPurposes = EntityPermissionChecker.getRelatedPurposes(contentFrom, null); List<String> relatedPurposesTo = EntityPermissionChecker.getRelatedPurposes(contentTo, relatedPurposes); - Map<String, Object> serviceInMap = new HashMap<String, Object>(); + Map<String, Object> serviceInMap = new HashMap<>(); serviceInMap.put("userLogin", userLogin); serviceInMap.put("targetOperationList", UtilMisc.toList("CONTENT_LINK_TO")); serviceInMap.put("contentPurposeList", relatedPurposesTo); Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearch.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearch.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearch.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearch.java Sun Apr 21 12:49:52 2019 @@ -113,17 +113,17 @@ public class ContentSearch { public static class ContentSearchContext { public int index = 1; - public List<EntityCondition> entityConditionList = new LinkedList<EntityCondition>(); - public List<String> orderByList = new LinkedList<String>(); + public List<EntityCondition> entityConditionList = new LinkedList<>(); + public List<String> orderByList = new LinkedList<>(); public Set<String> fieldsToSelect = UtilMisc.toSet("contentId"); public DynamicViewEntity dynamicViewEntity = new DynamicViewEntity(); public boolean contentIdGroupBy = false; public boolean includedKeywordSearch = false; public Timestamp nowTimestamp = UtilDateTime.nowTimestamp(); - public List<Set<String>> keywordFixedOrSetAndList = new LinkedList<Set<String>>(); - public Set<String> orKeywordFixedSet = new HashSet<String>(); - public Set<String> andKeywordFixedSet = new HashSet<String>(); - public List<GenericValue> contentSearchConstraintList = new LinkedList<GenericValue>(); + public List<Set<String>> keywordFixedOrSetAndList = new LinkedList<>(); + public Set<String> orKeywordFixedSet = new HashSet<>(); + public Set<String> andKeywordFixedSet = new HashSet<>(); + public List<GenericValue> contentSearchConstraintList = new LinkedList<>(); public ResultSortOrder resultSortOrder = null; public Integer resultOffset = null; public Integer maxResults = null; @@ -250,7 +250,7 @@ public class ContentSearch { dynamicViewEntity.addMemberEntity(entityAlias, "ContentKeyword"); dynamicViewEntity.addAlias(entityAlias, prefix + "Keyword", "keyword", null, null, null, null); dynamicViewEntity.addViewLink("CNT", entityAlias, Boolean.FALSE, ModelKeyMap.makeKeyMapList("contentId")); - List<EntityExpr> keywordOrList = new LinkedList<EntityExpr>(); + List<EntityExpr> keywordOrList = new LinkedList<>(); for (String keyword: keywordFixedOrSet) { keywordOrList.add(EntityCondition.makeCondition(prefix + "Keyword", EntityOperator.LIKE, keyword)); } @@ -305,7 +305,7 @@ public class ContentSearch { } public ArrayList<String> makeContentIdList(EntityListIterator eli) { - ArrayList<String> contentIds = new ArrayList<String>(maxResults == null ? 100 : maxResults); + ArrayList<String> contentIds = new ArrayList<>(maxResults == null ? 100 : maxResults); if (eli == null) { Debug.logWarning("The eli is null, returning zero results", module); return contentIds; @@ -349,7 +349,7 @@ public class ContentSearch { int numRetreived = 1; int duplicatesFound = 0; - Set<String> contentIdSet = new HashSet<String>(); + Set<String> contentIdSet = new HashSet<>(); contentIds.add(searchResult.getString("contentId")); contentIdSet.add(searchResult.getString("contentId")); @@ -456,7 +456,7 @@ public class ContentSearch { @Override public void addConstraint(ContentSearchContext contentSearchContext) { - Set<String> contentIdSet = new HashSet<String>(); + Set<String> contentIdSet = new HashSet<>(); if (includeSubContents) { // find all sub-categories recursively, make a Set of contentId ContentSearch.getAllSubContentIds(contentId, contentIdSet, contentSearchContext.getDelegator(), contentSearchContext.nowTimestamp); @@ -483,7 +483,7 @@ public class ContentSearch { contentSearchContext.dynamicViewEntity.addAlias(entityAlias, prefix + "ThruDate", "thruDate", null, null, null, null); contentSearchContext.dynamicViewEntity.addViewLink("CNT", entityAlias, Boolean.TRUE, ModelKeyMap.makeKeyMapList("contentId")); - List<EntityExpr> assocConditionFromTo = new LinkedList<EntityExpr>(); + List<EntityExpr> assocConditionFromTo = new LinkedList<>(); assocConditionFromTo.add(EntityCondition.makeCondition(prefix + "ContentIdTo", EntityOperator.IN, contentIdSet)); if (UtilValidate.isNotEmpty(contentAssocTypeId)) { assocConditionFromTo.add(EntityCondition.makeCondition(prefix + "ContentAssocTypeId", EntityOperator.EQUALS, contentAssocTypeId)); @@ -504,7 +504,7 @@ public class ContentSearch { contentSearchContext.dynamicViewEntity.addAlias(entityAlias, prefix + "ThruDate", "thruDate", null, null, null, null); contentSearchContext.dynamicViewEntity.addViewLink("CNT", entityAlias, Boolean.TRUE, ModelKeyMap.makeKeyMapList("contentId","contentIdTo")); - List<EntityExpr> assocConditionToFrom = new LinkedList<EntityExpr>(); + List<EntityExpr> assocConditionToFrom = new LinkedList<>(); assocConditionToFrom.add(EntityCondition.makeCondition(prefix + "ContentIdFrom", EntityOperator.IN, contentIdSet)); if (UtilValidate.isNotEmpty(contentAssocTypeId)) { assocConditionToFrom.add(EntityCondition.makeCondition(prefix + "ContentAssocTypeId", EntityOperator.EQUALS, contentAssocTypeId)); @@ -626,11 +626,11 @@ public class ContentSearch { public Set<String> makeFullKeywordSet(Delegator delegator) { Set<String> keywordSet = KeywordSearchUtil.makeKeywordSet(this.keywordsString, null, true); - Set<String> fullKeywordSet = new TreeSet<String>(); + Set<String> fullKeywordSet = new TreeSet<>(); // expand the keyword list according to the thesaurus and create a new set of keywords for (String keyword: keywordSet) { - Set<String> expandedSet = new TreeSet<String>(); + Set<String> expandedSet = new TreeSet<>(); boolean replaceEntered = KeywordSearchUtil.expandKeywordForSearch(keyword, expandedSet, delegator); fullKeywordSet.addAll(expandedSet); if (!replaceEntered) { @@ -655,13 +655,13 @@ public class ContentSearch { // expand the keyword list according to the thesaurus and create a new set of keywords for (String keyword: keywordSet) { - Set<String> expandedSet = new TreeSet<String>(); + Set<String> expandedSet = new TreeSet<>(); boolean replaceEntered = KeywordSearchUtil.expandKeywordForSearch(keyword, expandedSet, contentSearchContext.getDelegator()); if (!replaceEntered) { expandedSet.add(keyword); } Set<String> fixedSet = KeywordSearchUtil.fixKeywordsForSearch(expandedSet, anyPrefix, anySuffix, removeStems, isAnd); - Set<String> fixedKeywordSet = new HashSet<String>(); + Set<String> fixedKeywordSet = new HashSet<>(); fixedKeywordSet.addAll(fixedSet); contentSearchContext.keywordFixedOrSetAndList.add(fixedKeywordSet); } Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchEvents.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchEvents.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchEvents.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchEvents.java Sun Apr 21 12:49:52 2019 @@ -98,7 +98,7 @@ public class ContentSearchEvents { String searchSortOrderString = ContentSearchSession.searchGetSortOrderString(false, request); // ========== populate the result Map - Map<String, Object> result = new HashMap<String, Object>(); + Map<String, Object> result = new HashMap<>(); result.put("contentIds", contentIds); result.put("viewIndex", viewIndex); Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java Sun Apr 21 12:49:52 2019 @@ -68,7 +68,7 @@ public class ContentSearchSession { public static void addConstraint(ContentSearchConstraint contentSearchConstraint, HttpSession session) { ContentSearchOptions contentSearchOptions = getContentSearchOptions(session); if (contentSearchOptions.constraintList == null) { - contentSearchOptions.constraintList = new LinkedList<ContentSearch.ContentSearchConstraint>(); + contentSearchOptions.constraintList = new LinkedList<>(); } if (!contentSearchOptions.constraintList.contains(contentSearchConstraint)) { contentSearchOptions.constraintList.add(contentSearchConstraint); @@ -131,7 +131,7 @@ public class ContentSearchSession { public List<String> searchGetConstraintStrings(boolean detailed, Delegator delegator, Locale locale) { List<ContentSearchConstraint> contentSearchConstraintList = this.getConstraintList(); - List<String> constraintStrings = new LinkedList<String>(); + List<String> constraintStrings = new LinkedList<>(); if (contentSearchConstraintList == null) { return constraintStrings; } @@ -267,7 +267,7 @@ public class ContentSearchSession { public static List<ContentSearchOptions> getSearchOptionsHistoryList(HttpSession session) { List<ContentSearchOptions> optionsHistoryList = UtilGenerics.checkList(session.getAttribute("_CONTENT_SEARCH_OPTIONS_HISTORY_")); if (optionsHistoryList == null) { - optionsHistoryList = new LinkedList<ContentSearchSession.ContentSearchOptions>(); + optionsHistoryList = new LinkedList<>(); session.setAttribute("_CONTENT_SEARCH_OPTIONS_HISTORY_", optionsHistoryList); } return optionsHistoryList; Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java Sun Apr 21 12:49:52 2019 @@ -64,7 +64,7 @@ public class ContentServices { */ public static Map<String, Object> findRelatedContent(DispatchContext dctx, Map<String, ? extends Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); - Map<String, Object> results = new HashMap<String, Object>(); + Map<String, Object> results = new HashMap<>(); GenericValue currentContent = (GenericValue) context.get("currentContent"); String fromDate = (String) context.get("fromDate"); @@ -93,12 +93,12 @@ public class ContentServices { return results; } - Map<String, Object> serviceInMap = new HashMap<String, Object>(); + Map<String, Object> serviceInMap = new HashMap<>(); serviceInMap.put("userLogin", context.get("userLogin")); serviceInMap.put("targetOperationList", targetOperations); serviceInMap.put("entityOperation", context.get("entityOperation")); - List<GenericValue> permittedList = new LinkedList<GenericValue>(); + List<GenericValue> permittedList = new LinkedList<>(); Map<String, Object> permResults = null; for (GenericValue content : contentList) { serviceInMap.put("currentContent", content); @@ -126,8 +126,8 @@ public class ContentServices { * This is a generic service for traversing a Content tree, typical of a blog response tree. It calls the ContentWorker.traverse method. */ public static Map<String, Object> findContentParents(DispatchContext dctx, Map<String, ? extends Object> context) { - Map<String, Object> results = new HashMap<String, Object>(); - List<Object> parentList = new LinkedList<Object>(); + Map<String, Object> results = new HashMap<>(); + List<Object> parentList = new LinkedList<>(); results.put("parentList", parentList); LocalDispatcher dispatcher = dctx.getDispatcher(); String contentId = (String)context.get("contentId"); @@ -136,7 +136,7 @@ public class ContentServices { if (UtilValidate.isEmpty(direction)) { direction="To"; } - Map<String, Object> traversMap = new HashMap<String, Object>(); + Map<String, Object> traversMap = new HashMap<>(); traversMap.put("contentId", contentId); traversMap.put("direction", direction); traversMap.put("contentAssocTypeId", contentAssocTypeId); @@ -168,7 +168,7 @@ public class ContentServices { */ public static Map<String, Object> traverseContent(DispatchContext dctx, Map<String, ? extends Object> context) { Delegator delegator = dctx.getDelegator(); - Map<String, Object> results = new HashMap<String, Object>(); + Map<String, Object> results = new HashMap<>(); Locale locale = (Locale) context.get("locale"); String contentId = (String) context.get("contentId"); @@ -203,7 +203,7 @@ public class ContentServices { thruDate = UtilDateTime.toTimestamp(thruDateStr); } - Map<String, Object> whenMap = new HashMap<String, Object>(); + Map<String, Object> whenMap = new HashMap<>(); whenMap.put("followWhen", context.get("followWhen")); whenMap.put("pickWhen", context.get("pickWhen")); whenMap.put("returnBeforePickWhen", context.get("returnBeforePickWhen")); @@ -214,8 +214,8 @@ public class ContentServices { startContentAssocTypeId = "PUBLISH"; } - Map<String, Object> nodeMap = new HashMap<String, Object>(); - List<GenericValue> pickList = new LinkedList<GenericValue>(); + Map<String, Object> nodeMap = new HashMap<>(); + List<GenericValue> pickList = new LinkedList<>(); ContentWorker.traverse(delegator, content, fromDate, thruDate, whenMap, 0, nodeMap, startContentAssocTypeId, pickList, direction); results.put("nodeMap", nodeMap); @@ -249,7 +249,7 @@ public class ContentServices { Map<String, Object> context = UtilMisc.makeMapWritable(rcontext); Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); - Map<String, Object> result = new HashMap<String, Object>(); + Map<String, Object> result = new HashMap<>(); Locale locale = (Locale) context.get("locale"); context.put("entityOperation", "_UPDATE"); List<String> targetOperationList = ContentWorker.prepTargetOperationList(context, "_UPDATE"); @@ -283,7 +283,7 @@ public class ContentServices { contentAssoc.put("thruDate", UtilDateTime.nowTimestamp()); String permissionStatus = null; - Map<String, Object> serviceInMap = new HashMap<String, Object>(); + Map<String, Object> serviceInMap = new HashMap<>(); serviceInMap.put("userLogin", context.get("userLogin")); serviceInMap.put("targetOperationList", targetOperationList); serviceInMap.put("contentPurposeList", contentPurposeList); @@ -331,7 +331,7 @@ public class ContentServices { Locale locale = (Locale) context.get("locale"); Timestamp nowTimestamp = UtilDateTime.nowTimestamp(); String sequenceNum = null; - Map<String, Object> results = new HashMap<String, Object>(); + Map<String, Object> results = new HashMap<>(); try { GenericValue activeAssoc = null; @@ -343,7 +343,7 @@ public class ContentServices { sequenceNum = (String) activeAssoc.get("sequenceNum"); } - List<EntityCondition> exprList = new LinkedList<EntityCondition>(); + List<EntityCondition> exprList = new LinkedList<>(); exprList.add(EntityCondition.makeCondition("mapKey", EntityOperator.EQUALS, mapKey)); if (sequenceNum != null) { exprList.add(EntityCondition.makeCondition("sequenceNum", EntityOperator.EQUALS, sequenceNum)); @@ -382,7 +382,7 @@ public class ContentServices { * matching content. */ public static Map<String, Object> renderSubContentAsText(DispatchContext dctx, Map<String, ? extends Object> context) { - Map<String, Object> results = new HashMap<String, Object>(); + Map<String, Object> results = new HashMap<>(); LocalDispatcher dispatcher = dctx.getDispatcher(); Map<String,Object> templateContext = UtilGenerics.checkMap(context.get("templateContext")); @@ -408,7 +408,7 @@ public class ContentServices { Writer outWriter = new StringWriter(); if (templateContext == null) { - templateContext = new HashMap<String, Object>(); + templateContext = new HashMap<>(); } try { @@ -432,7 +432,7 @@ public class ContentServices { * matching content. */ public static Map<String, Object> renderContentAsText(DispatchContext dctx, Map<String, ? extends Object> context) { - Map<String,Object> results = new HashMap<String, Object>(); + Map<String,Object> results = new HashMap<>(); LocalDispatcher dispatcher = dctx.getDispatcher(); Writer out = (Writer) context.get("outWriter"); @@ -451,7 +451,7 @@ public class ContentServices { } if (templateContext == null) { - templateContext = new HashMap<String, Object>(); + templateContext = new HashMap<>(); } Writer outWriter = new StringWriter(); @@ -475,7 +475,7 @@ public class ContentServices { } public static Map<String, Object> linkContentToPubPt(DispatchContext dctx, Map<String, ? extends Object> context) { - Map<String, Object> results = new HashMap<String, Object>(); + Map<String, Object> results = new HashMap<>(); Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); @@ -489,7 +489,7 @@ public class ContentServices { if (Debug.infoOn()) Debug.logInfo("in publishContent, statusId:" + statusId, module); if (Debug.infoOn()) Debug.logInfo("in publishContent, userLogin:" + userLogin, module); - Map<String, Object> mapIn = new HashMap<String, Object>(); + Map<String, Object> mapIn = new HashMap<>(); mapIn.put("contentId", contentId); mapIn.put("contentIdTo", contentIdTo); mapIn.put("contentAssocTypeId", contentAssocTypeId); @@ -513,7 +513,7 @@ public class ContentServices { content.put("statusId", statusId); content.store(); - mapIn = new HashMap<String, Object>(); + mapIn = new HashMap<>(); mapIn.put("contentId", contentId); mapIn.put("contentIdTo", contentIdTo); mapIn.put("contentAssocTypeId", contentAssocTypeId); @@ -543,7 +543,7 @@ public class ContentServices { } public static Map<String, Object> publishContent(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{ - Map<String, Object> result = new HashMap<String, Object>(); + Map<String, Object> result = new HashMap<>(); GenericValue content = (GenericValue)context.get("content"); try { @@ -557,10 +557,10 @@ public class ContentServices { } public static Map<String, Object> getPrefixedMembers(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{ - Map<String, Object> result = new HashMap<String, Object>(); + Map<String, Object> result = new HashMap<>(); Map<String, Object> mapIn = UtilGenerics.checkMap(context.get("mapIn")); String prefix = (String)context.get("prefix"); - Map<String, Object> mapOut = new HashMap<String, Object>(); + Map<String, Object> mapOut = new HashMap<>(); result.put("mapOut", mapOut); if (mapIn != null) { Set<Map.Entry<String, Object>> entrySet = mapIn.entrySet(); @@ -576,8 +576,8 @@ public class ContentServices { } public static Map<String, Object> splitString(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{ - Map<String, Object> result = new HashMap<String, Object>(); - List<String> outputList = new LinkedList<String>(); + Map<String, Object> result = new HashMap<>(); + List<String> outputList = new LinkedList<>(); String delimiter = UtilFormatOut.checkEmpty((String)context.get("delimiter"), "|"); String inputString = (String)context.get("inputString"); if (UtilValidate.isNotEmpty(inputString)) { @@ -588,7 +588,7 @@ public class ContentServices { } public static Map<String, Object> joinString(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{ - Map<String, Object> result = new HashMap<String, Object>(); + Map<String, Object> result = new HashMap<>(); String outputString = null; String delimiter = UtilFormatOut.checkEmpty((String)context.get("delimiter"), "|"); List<String> inputList = UtilGenerics.checkList(context.get("inputList")); @@ -600,8 +600,8 @@ public class ContentServices { } public static Map<String, Object> urlEncodeArgs(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{ - Map<String, Object> result = new HashMap<String, Object>(); - Map<String, Object> mapFiltered = new HashMap<String, Object>(); + Map<String, Object> result = new HashMap<>(); + Map<String, Object> mapFiltered = new HashMap<>(); Map<String, Object> mapIn = UtilGenerics.checkMap(context.get("mapIn")); if (mapIn != null) { Set<Map.Entry<String, Object>> entrySet = mapIn.entrySet(); Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java Sun Apr 21 12:49:52 2019 @@ -79,7 +79,7 @@ public class ContentServicesComplex { } public static Map<String, Object> getAssocAndContentAndDataResourceMethod(Delegator delegator, String contentId, String mapKey, String direction, Timestamp fromDate, Timestamp thruDate, String fromDateStr, String thruDateStr, List<String> assocTypes, List<String> contentTypes) { - List<EntityCondition> exprList = new LinkedList<EntityCondition>(); + List<EntityCondition> exprList = new LinkedList<>(); EntityExpr joinExpr = null; String viewName = null; if (mapKey != null) { @@ -113,7 +113,7 @@ public class ContentServicesComplex { exprList.add(fromExpr); } if (thruDate != null) { - List<EntityExpr> thruList = new LinkedList<EntityExpr>(); + List<EntityExpr> thruList = new LinkedList<>(); EntityExpr thruExpr = EntityCondition.makeCondition("caThruDate", EntityOperator.LESS_THAN, thruDate); thruList.add(thruExpr); @@ -122,7 +122,7 @@ public class ContentServicesComplex { EntityConditionList<EntityExpr> thruExprList = EntityCondition.makeCondition(thruList, EntityOperator.OR); exprList.add(thruExprList); } else if (fromDate != null) { - List<EntityExpr> thruList = new LinkedList<EntityExpr>(); + List<EntityExpr> thruList = new LinkedList<>(); EntityExpr thruExpr = EntityCondition.makeCondition("caThruDate", EntityOperator.GREATER_THAN, fromDate); thruList.add(thruExpr); @@ -142,7 +142,7 @@ public class ContentServicesComplex { GenericValue a = relatedAssocs.get(i); if (Debug.verboseOn()) Debug.logVerbose(" contentId:" + a.get("contentId") + " To:" + a.get("caContentIdTo") + " fromDate:" + a.get("caFromDate") + " thruDate:" + a.get("caThruDate") + " AssocTypeId:" + a.get("caContentAssocTypeId"), null); } - Map<String, Object> results = new HashMap<String, Object>(); + Map<String, Object> results = new HashMap<>(); results.put("entityList", relatedAssocs); return results; } @@ -162,7 +162,7 @@ public class ContentServicesComplex { if (UtilValidate.isNotEmpty(assocTypesString)) { List<String> lst = StringUtil.split(assocTypesString, "|"); if (assocTypes == null) { - assocTypes = new LinkedList<String>(); + assocTypes = new LinkedList<>(); } assocTypes.addAll(lst); } @@ -171,7 +171,7 @@ public class ContentServicesComplex { if (UtilValidate.isNotEmpty(contentTypesString)) { List<String> lst = StringUtil.split(contentTypesString, "|"); if (contentTypes == null) { - contentTypes = new LinkedList<String>(); + contentTypes = new LinkedList<>(); } contentTypes.addAll(lst); } @@ -210,7 +210,7 @@ public class ContentServicesComplex { } else { viewName = "ContentAssocDataResourceViewTo"; } - List<EntityCondition> conditionList = new ArrayList<EntityCondition>(); + List<EntityCondition> conditionList = new ArrayList<>(); conditionList.add(joinExpr); if (UtilValidate.isNotEmpty(mapKey)) { String mapKeyValue = "is null".equalsIgnoreCase(mapKey) ? null : mapKey; @@ -241,7 +241,7 @@ public class ContentServicesComplex { GenericValue contentAssocDataResourceView = null; GenericValue content = null; GenericValue dataResource = null; - List<GenericValue> contentAssocDataResourceList = new LinkedList<GenericValue>(); + List<GenericValue> contentAssocDataResourceList = new LinkedList<>(); Locale locale = Locale.getDefault(); // TODO: this needs to be passed in try{ for (GenericValue contentAssocView : contentAssocsTypeFiltered) { @@ -259,12 +259,12 @@ public class ContentServicesComplex { contentAssocDataResourceView = delegator.makeValue(viewName); contentAssocDataResourceView.setAllFields(content, true, null, null); } - SimpleMapProcessor.runSimpleMapProcessor("component://content/minilang/ContentManagementMapProcessors.xml", "contentAssocOut", contentAssoc, contentAssocDataResourceView, new LinkedList<Object>(), locale); + SimpleMapProcessor.runSimpleMapProcessor("component://content/minilang/ContentManagementMapProcessors.xml", "contentAssocOut", contentAssoc, contentAssocDataResourceView, new LinkedList<>(), locale); String dataResourceId = content.getString("dataResourceId"); if (UtilValidate.isNotEmpty(dataResourceId)) dataResource = content.getRelatedOne("DataResource", true); if (dataResource != null) { - SimpleMapProcessor.runSimpleMapProcessor("component://content/minilang/ContentManagementMapProcessors.xml", "dataResourceOut", dataResource, contentAssocDataResourceView, new LinkedList<Object>(), locale); + SimpleMapProcessor.runSimpleMapProcessor("component://content/minilang/ContentManagementMapProcessors.xml", "dataResourceOut", dataResource, contentAssocDataResourceView, new LinkedList<>(), locale); } contentAssocDataResourceList.add(contentAssocDataResourceView); } @@ -277,7 +277,7 @@ public class ContentServicesComplex { List<String> orderByList = StringUtil.split(orderBy, "|"); contentAssocDataResourceList = EntityUtil.orderBy(contentAssocDataResourceList, orderByList); } - Map<String, Object> results = new HashMap<String, Object>(); + Map<String, Object> results = new HashMap<>(); results.put("entityList", contentAssocDataResourceList); if (UtilValidate.isNotEmpty(contentAssocDataResourceList)) { results.put("view", contentAssocDataResourceList.get(0)); Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java Sun Apr 21 12:49:52 2019 @@ -200,7 +200,7 @@ public class ContentWorker implements or ModelService service = dctx.getModelService(serviceName); if (service != null) { //put all requestParameters into templateContext to use them as IN service parameters - Map<String,Object> tempTemplateContext = new HashMap<String, Object>(); + Map<String,Object> tempTemplateContext = new HashMap<>(); tempTemplateContext.putAll(UtilGenerics.<String,Object>checkMap(templateContext.get("requestParameters"))); tempTemplateContext.putAll(templateContext); Map<String,Object> serviceCtx = service.makeValid(tempTemplateContext, ModelService.IN_PARAM); @@ -223,7 +223,7 @@ public class ContentWorker implements or String contentId = content.getString("contentId"); if (templateContext == null) { - templateContext = new HashMap<String, Object>(); + templateContext = new HashMap<>(); } // create the content facade @@ -480,27 +480,27 @@ public class ContentWorker implements or contentId = (String) content.get("contentId"); contentTypeId = (String) content.get("contentTypeId"); List<GenericValue> topicList = content.getRelated("ToContentAssoc", UtilMisc.toMap("contentAssocTypeId", "TOPIC"), null, false); - List<String> topics = new LinkedList<String>(); + List<String> topics = new LinkedList<>(); for (int i = 0; i < topicList.size(); i++) { GenericValue assoc = topicList.get(i); topics.add(assoc.getString("contentId")); } List<GenericValue> keywordList = content.getRelated("ToContentAssoc", UtilMisc.toMap("contentAssocTypeId", "KEYWORD"), null, false); - List<String> keywords = new LinkedList<String>(); + List<String> keywords = new LinkedList<>(); for (int i = 0; i < keywordList.size(); i++) { GenericValue assoc = keywordList.get(i); keywords.add(assoc.getString("contentId")); } List<GenericValue> purposeValueList = content.getRelated("ContentPurpose", null, null, true); - List<String> purposes = new LinkedList<String>(); + List<String> purposes = new LinkedList<>(); for (int i = 0; i < purposeValueList.size(); i++) { GenericValue purposeValue = purposeValueList.get(i); purposes.add(purposeValue.getString("contentPurposeTypeId")); } - List<String> contentTypeAncestry = new LinkedList<String>(); + List<String> contentTypeAncestry = new LinkedList<>(); getContentTypeAncestry(delegator, contentTypeId, contentTypeAncestry); - Map<String, Object> context = new HashMap<String, Object>(); + Map<String, Object> context = new HashMap<>(); context.put("content", content); context.put("contentAssocTypeId", contentAssocTypeId); context.put("purposes", purposes); @@ -511,13 +511,13 @@ public class ContentWorker implements or boolean isReturnBefore = checkWhen(context, (String) whenMap.get("returnBeforePickWhen"), false); Map<String, Object> thisNode = null; if (isPick || !isReturnBefore) { - thisNode = new HashMap<String, Object>(); + thisNode = new HashMap<>(); thisNode.put("contentId", contentId); thisNode.put("contentTypeId", contentTypeId); thisNode.put("contentAssocTypeId", contentAssocTypeId); List<Map<String, Object>> kids = UtilGenerics.checkList(masterNode.get("kids")); if (kids == null) { - kids = new LinkedList<Map<String,Object>>(); + kids = new LinkedList<>(); masterNode.put("kids", kids); } kids.add(thisNode); @@ -528,9 +528,9 @@ public class ContentWorker implements or } boolean isReturnAfter = checkWhen(context, (String) whenMap.get("returnAfterPickWhen"), false); if (!isReturnAfter) { - List<String> assocTypes = new LinkedList<String>(); + List<String> assocTypes = new LinkedList<>(); List<GenericValue> relatedAssocs = getContentAssocsWithId(delegator, contentId, fromDate, thruDate, direction, assocTypes); - Map<String, Object> assocContext = new HashMap<String, Object>(); + Map<String, Object> assocContext = new HashMap<>(); assocContext.put("related", relatedAssocs); for (GenericValue assocValue : relatedAssocs) { contentAssocTypeId = (String) assocValue.get("contentAssocTypeId"); @@ -649,7 +649,7 @@ public class ContentWorker implements or } public static List<Object> getPurposes(GenericValue content) { - List<Object> purposes = new LinkedList<Object>(); + List<Object> purposes = new LinkedList<>(); try { List<GenericValue> purposeValueList = content.getRelated("ContentPurpose", null, null, true); for (int i = 0; i < purposeValueList.size(); i++) { @@ -663,7 +663,7 @@ public class ContentWorker implements or } public static List<Object> getSections(GenericValue content) { - List<Object> sections = new LinkedList<Object>(); + List<Object> sections = new LinkedList<>(); try { List<GenericValue> sectionValueList = content.getRelated("FromContentAssoc", null, null, true); for (int i = 0; i < sectionValueList.size(); i++) { @@ -680,7 +680,7 @@ public class ContentWorker implements or } public static List<Object> getTopics(GenericValue content) { - List<Object> topics = new LinkedList<Object>(); + List<Object> topics = new LinkedList<>(); try { List<GenericValue> topicValueList = content.getRelated("FromContentAssoc", null, null, true); for (int i = 0; i < topicValueList.size(); i++) { @@ -703,7 +703,7 @@ public class ContentWorker implements or String mapKey = (String) ctx.get("mapKey"); String parentContentId = (String) parentContent.get("contentId"); Map<String, Object> whenMap = UtilGenerics.checkMap(ctx.get("whenMap")); - List<Map<String, Object>> kids = new LinkedList<Map<String,Object>>(); + List<Map<String, Object>> kids = new LinkedList<>(); currentNode.put("kids", kids); String direction = (String) ctx.get("direction"); if (UtilValidate.isEmpty(direction)) { @@ -780,7 +780,7 @@ public class ContentWorker implements or Debug.logInfo("assocList:" + assocList.size() + " contentId:" + currentContent.getString("contentId"), ""); } - List<GenericValue> contentList = new LinkedList<GenericValue>(); + List<GenericValue> contentList = new LinkedList<>(); String contentIdName = "contentId"; if (linkDir != null && "TO".equalsIgnoreCase(linkDir)) { contentIdName = contentIdName.concat("To"); @@ -807,7 +807,7 @@ public class ContentWorker implements or } public static List<GenericValue> getAssociatedContentView(GenericValue currentContent, String linkDir, List<String> assocTypes, List<String> contentTypes, String fromDate, String thruDate) throws GenericEntityException { - List<EntityExpr> exprListAnd = new LinkedList<EntityExpr>(); + List<EntityExpr> exprListAnd = new LinkedList<>(); String origContentId = (String) currentContent.get("contentId"); String contentIdName = "contentId"; @@ -857,7 +857,7 @@ public class ContentWorker implements or } public static List<GenericValue> getContentAssocsWithId(Delegator delegator, String contentId, Timestamp fromDate, Timestamp thruDate, String direction, List<String> assocTypes) throws GenericEntityException { - List<EntityCondition> exprList = new LinkedList<EntityCondition>(); + List<EntityCondition> exprList = new LinkedList<>(); EntityExpr joinExpr = null; if (direction != null && "From".equalsIgnoreCase(direction)) { joinExpr = EntityCondition.makeCondition("contentIdTo", EntityOperator.EQUALS, contentId); @@ -873,7 +873,7 @@ public class ContentWorker implements or exprList.add(fromExpr); } if (thruDate != null) { - List<EntityExpr> thruList = new LinkedList<EntityExpr>(); + List<EntityExpr> thruList = new LinkedList<>(); EntityExpr thruExpr = EntityCondition.makeCondition("thruDate", EntityOperator.LESS_THAN, thruDate); thruList.add(thruExpr); @@ -882,7 +882,7 @@ public class ContentWorker implements or EntityConditionList<EntityExpr> thruExprList = EntityCondition.makeCondition(thruList, EntityOperator.OR); exprList.add(thruExprList); } else if (fromDate != null) { - List<EntityExpr> thruList = new LinkedList<EntityExpr>(); + List<EntityExpr> thruList = new LinkedList<>(); EntityExpr thruExpr = EntityCondition.makeCondition("thruDate", EntityOperator.GREATER_THAN, fromDate); thruList.add(thruExpr); @@ -978,8 +978,8 @@ public class ContentWorker implements or } public static List<Map<String, Object>> getContentAncestryNodeTrail(Delegator delegator, String contentId, String contentAssocTypeId, String direction) throws GenericEntityException { - List<GenericValue> contentAncestorList = new LinkedList<GenericValue>(); - List<Map<String, Object>> nodeTrail = new LinkedList<Map<String,Object>>(); + List<GenericValue> contentAncestorList = new LinkedList<>(); + List<Map<String, Object>> nodeTrail = new LinkedList<>(); getContentAncestry(delegator, contentId, contentAssocTypeId, direction, contentAncestorList); for (GenericValue value : contentAncestorList) { Map<String, Object> thisNode = ContentWorker.makeNode(value); @@ -989,7 +989,7 @@ public class ContentWorker implements or } public static String getContentAncestryNodeTrailCsv(Delegator delegator, String contentId, String contentAssocTypeId, String direction) throws GenericEntityException { - List<GenericValue> contentAncestorList = new LinkedList<GenericValue>(); + List<GenericValue> contentAncestorList = new LinkedList<>(); getContentAncestry(delegator, contentId, contentAssocTypeId, direction, contentAncestorList); String csv = StringUtil.join(contentAncestorList, ","); return csv; @@ -1041,13 +1041,13 @@ public class ContentWorker implements or } public static Map<String, Object> callContentPermissionCheckResult(Delegator delegator, LocalDispatcher dispatcher, Map<String, Object> context) { - Map<String, Object> permResults = new HashMap<String, Object>(); + Map<String, Object> permResults = new HashMap<>(); String skipPermissionCheck = (String) context.get("skipPermissionCheck"); if (UtilValidate.isEmpty(skipPermissionCheck) || (!"true".equalsIgnoreCase(skipPermissionCheck) && !"granted".equalsIgnoreCase(skipPermissionCheck))) { GenericValue userLogin = (GenericValue) context.get("userLogin"); - Map<String, Object> serviceInMap = new HashMap<String, Object>(); + Map<String, Object> serviceInMap = new HashMap<>(); serviceInMap.put("userLogin", userLogin); serviceInMap.put("targetOperationList", context.get("targetOperationList")); serviceInMap.put("contentPurposeList", context.get("contentPurposeList")); @@ -1151,7 +1151,7 @@ public class ContentWorker implements or if (UtilValidate.isNotEmpty(trail)) { passedGlobalNodeTrail = UtilGenerics.checkList(UtilMisc.makeListWritable(trail)); } else { - passedGlobalNodeTrail = new LinkedList<Map<String,Object>>(); + passedGlobalNodeTrail = new LinkedList<>(); } int sz = passedGlobalNodeTrail.size(); if (sz > 0) { @@ -1209,7 +1209,7 @@ public class ContentWorker implements or } public static Map<String, Object> buildPickContext(Delegator delegator, String contentAssocTypeId, String assocContentId, String direction, GenericValue thisContent) throws GenericEntityException { - Map<String, Object> ctx = new HashMap<String, Object>(); + Map<String, Object> ctx = new HashMap<>(); ctx.put("contentAssocTypeId", contentAssocTypeId); ctx.put("contentId", assocContentId); // This needs to be the opposite @@ -1223,7 +1223,7 @@ public class ContentWorker implements or ctx.put("content", thisContent); List<Object> purposes = getPurposes(thisContent); ctx.put("purposes", purposes); - List<String> contentTypeAncestry = new LinkedList<String>(); + List<String> contentTypeAncestry = new LinkedList<>(); String contentTypeId = thisContent.getString("contentTypeId"); getContentTypeAncestry(delegator, contentTypeId, contentTypeAncestry); ctx.put("typeAncestry", contentTypeAncestry); @@ -1235,7 +1235,7 @@ public class ContentWorker implements or } public static void checkConditions(Delegator delegator, Map<String, Object> trailNode, Map<String, Object> contentAssoc, Map<String, Object> whenMap) { - Map<String, Object> context = new HashMap<String, Object>(); + Map<String, Object> context = new HashMap<>(); GenericValue content = (GenericValue)trailNode.get("value"); if (content != null) { context.put("content", content); @@ -1246,7 +1246,7 @@ public class ContentWorker implements or List<Object> topics = getTopics(content); context.put("topics", topics); String contentTypeId = (String)content.get("contentTypeId"); - List<String> contentTypeAncestry = new LinkedList<String>(); + List<String> contentTypeAncestry = new LinkedList<>(); try { getContentTypeAncestry(delegator, contentTypeId, contentTypeAncestry); } catch (GenericEntityException e) { @@ -1257,7 +1257,7 @@ public class ContentWorker implements or contentAssoc = delegator.makeValue("ContentAssoc"); try { // TODO: locale needs to be gotten correctly - SimpleMapProcessor.runSimpleMapProcessor("component://content/minilang/ContentManagementMapProcessors.xml", "contentAssocIn", content, contentAssoc, new LinkedList<Object>(), Locale.getDefault()); + SimpleMapProcessor.runSimpleMapProcessor("component://content/minilang/ContentManagementMapProcessors.xml", "contentAssocIn", content, contentAssoc, new LinkedList<>(), Locale.getDefault()); context.put("contentAssocTypeId", contentAssoc.get("contentAssocTypeId")); context.put("contentAssocPredicateId", contentAssoc.get("contentAssocPredicateId")); context.put("mapKey", contentAssoc.get("mapKey")); @@ -1298,12 +1298,12 @@ public class ContentWorker implements or if (UtilValidate.isNotEmpty(targetOperationString)) { List<String> opsFromString = StringUtil.split(targetOperationString, "|"); if (UtilValidate.isEmpty(targetOperationList)) { - targetOperationList = new LinkedList<String>(); + targetOperationList = new LinkedList<>(); } targetOperationList.addAll(opsFromString); } if (UtilValidate.isEmpty(targetOperationList)) { - targetOperationList = new LinkedList<String>(); + targetOperationList = new LinkedList<>(); if (UtilValidate.isEmpty(md)) { md ="_CREATE"; } @@ -1330,12 +1330,12 @@ public class ContentWorker implements or if (UtilValidate.isNotEmpty(contentPurposeString)) { List<String> purposesFromString = StringUtil.split(contentPurposeString, "|"); if (UtilValidate.isEmpty(contentPurposeList)) { - contentPurposeList = new LinkedList<String>(); + contentPurposeList = new LinkedList<>(); } contentPurposeList.addAll(purposesFromString); } if (UtilValidate.isEmpty(contentPurposeList)) { - contentPurposeList = new LinkedList<String>(); + contentPurposeList = new LinkedList<>(); } if (Debug.infoOn()) { Debug.logInfo("in prepContentPurposeList, contentPurposeList(0):" + contentPurposeList, ""); @@ -1357,7 +1357,7 @@ public class ContentWorker implements or } public static List<GenericValue> getContentAssocViewList(Delegator delegator, String contentIdTo, String contentId, String contentAssocTypeId, String statusId, String privilegeEnumId) throws GenericEntityException { - List<EntityExpr> exprListAnd = new LinkedList<EntityExpr>(); + List<EntityExpr> exprListAnd = new LinkedList<>(); if (UtilValidate.isNotEmpty(contentIdTo)) { EntityExpr expr = EntityCondition.makeCondition("caContentIdTo", EntityOperator.EQUALS, contentIdTo); @@ -1406,7 +1406,7 @@ public class ContentWorker implements or return thisNode; } - thisNode = new HashMap<String, Object>(); + thisNode = new HashMap<>(); thisNode.put("value", thisContent); String contentId = (String)thisContent.get("contentId"); thisNode.put("contentId", contentId); @@ -1442,7 +1442,7 @@ public class ContentWorker implements or } public static List<List<String>> csvToList(String csv, Delegator delegator) { - List<List<String>> outList = new LinkedList<List<String>>(); + List<List<String>> outList = new LinkedList<>(); List<String> contentIdList = StringUtil.split(csv, ","); GenericValue content = null; String contentName = null; @@ -1451,7 +1451,7 @@ public class ContentWorker implements or content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).cache().queryOne(); } catch (GenericEntityException e) { Debug.logError(e.getMessage(), module); - return new LinkedList<List<String>>(); + return new LinkedList<>(); } contentName = (String)content.get("contentName"); outList.add(UtilMisc.toList(contentId, contentName)); @@ -1460,7 +1460,7 @@ public class ContentWorker implements or } public static List<GenericValue> csvToContentList(String csv, Delegator delegator) { - List<GenericValue> trail = new LinkedList<GenericValue>(); + List<GenericValue> trail = new LinkedList<>(); if (csv == null) { return trail; } @@ -1471,7 +1471,7 @@ public class ContentWorker implements or content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).cache().queryOne(); } catch (GenericEntityException e) { Debug.logError(e.getMessage(), module); - return new LinkedList<GenericValue>(); + return new LinkedList<>(); } trail.add(content); } @@ -1479,7 +1479,7 @@ public class ContentWorker implements or } public static List<Map<String, Object>> csvToTrail(String csv, Delegator delegator) { - List<Map<String, Object>> trail = new LinkedList<Map<String,Object>>(); + List<Map<String, Object>> trail = new LinkedList<>(); if (csv == null) { return trail; } Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/PermissionRecorder.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/PermissionRecorder.java?rev=1857906&r1=1857905&r2=1857906&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/PermissionRecorder.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/PermissionRecorder.java Sun Apr 21 12:49:52 2019 @@ -39,7 +39,7 @@ public class PermissionRecorder { protected boolean isOn = false; protected GenericValue userLogin; - protected List<Map<String, Object>> permCheckResults = new LinkedList<Map<String,Object>>(); + protected List<Map<String, Object>> permCheckResults = new LinkedList<>(); protected boolean entityPermCheckResult = false; protected String currentContentId = ""; protected Map<String, Object> currentContentMap; @@ -124,7 +124,7 @@ public class PermissionRecorder { public void setCurrentContentId(String id) { if (!currentContentId.equals(id)) { - currentContentMap = new HashMap<String, Object>(); + currentContentMap = new HashMap<>(); permCheckResults.add(currentContentMap); currentContentMap.put("contentId", id); currentContentMap.put("checkResults", new LinkedList<>()); @@ -155,7 +155,7 @@ public class PermissionRecorder { } public void startMatchGroup(List<String> targetOperations, List<String> purposes, List<String> roles, List<String> targStatusList, String targPrivilegeEnumId, String contentId) { - currentContentMap = new HashMap<String, Object>(); + currentContentMap = new HashMap<>(); permCheckResults.add(currentContentMap); String s = null; if (targetOperations != null) { @@ -174,7 +174,7 @@ public class PermissionRecorder { s = targStatusList.toString(); currentContentMap.put("statusId", s); } - List<Map<String, Object>> checkResultList = new LinkedList<Map<String,Object>>(); + List<Map<String, Object>> checkResultList = new LinkedList<>(); currentContentMap.put("privilegeEnumId", privilegeEnumId); currentContentMap.put("contentId", contentId); currentContentMap.put("checkResultList", checkResultList); |
Free forum by Nabble | Edit this page |