Convert javolution FastMap, FastSet and FastList by standard java.util.*
Related to OFBIZ-5781 Convert Javolution collections into Java collections Thanks to Deepak Dixit and Adrian Crum for their help. By defautl converted : * FastMap by HashMap * FastList by LinkedList * FastSet by HashSet git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1672752 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -34,7 +34,10 @@ import java.net.URL;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
@@ -44,10 +47,6 @@ import java.util.TreeSet;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import javolution.util.FastList;
|
||||
import javolution.util.FastMap;
|
||||
import javolution.util.FastSet;
|
||||
|
||||
import org.ofbiz.base.location.FlexibleLocation;
|
||||
import org.ofbiz.base.util.Debug;
|
||||
import org.ofbiz.base.util.GeneralException;
|
||||
@@ -109,7 +108,7 @@ public class WebToolsServices {
|
||||
GenericValue userLogin = (GenericValue) context.get("userLogin");
|
||||
LocalDispatcher dispatcher = dctx.getDispatcher();
|
||||
Locale locale = (Locale) context.get("locale");
|
||||
List<String> messages = FastList.newInstance();
|
||||
List<String> messages = new LinkedList<String>();
|
||||
|
||||
String filename = (String)context.get("filename");
|
||||
String fmfilename = (String)context.get("fmfilename");
|
||||
@@ -157,7 +156,7 @@ public class WebToolsServices {
|
||||
try {
|
||||
Configuration conf = org.ofbiz.base.util.template.FreeMarkerWorker.getDefaultOfbizConfig();
|
||||
template = new Template("FMImportFilter", templateReader, conf);
|
||||
Map<String, Object> fmcontext = FastMap.newInstance();
|
||||
Map<String, Object> fmcontext = new HashMap<String, Object>();
|
||||
|
||||
InputSource ins = url != null ? new InputSource(url.openStream()) : new InputSource(new StringReader(fulltext));
|
||||
NodeModel nodeModel;
|
||||
@@ -221,7 +220,7 @@ public class WebToolsServices {
|
||||
GenericValue userLogin = (GenericValue) context.get("userLogin");
|
||||
LocalDispatcher dispatcher = dctx.getDispatcher();
|
||||
Locale locale = (Locale) context.get("locale");
|
||||
List<String> messages = FastList.newInstance();
|
||||
List<String> messages = new LinkedList<String>();
|
||||
|
||||
String path = (String) context.get("path");
|
||||
String mostlyInserts = (String) context.get("mostlyInserts");
|
||||
@@ -246,7 +245,7 @@ public class WebToolsServices {
|
||||
|
||||
if (baseDir.isDirectory() && baseDir.canRead()) {
|
||||
File[] fileArray = baseDir.listFiles();
|
||||
FastList<File> files = FastList.newInstance();
|
||||
List<File> files = new LinkedList<File>();
|
||||
for (File file: fileArray) {
|
||||
if (file.getName().toUpperCase().endsWith("XML")) {
|
||||
files.add(file);
|
||||
@@ -256,11 +255,11 @@ public class WebToolsServices {
|
||||
int passes=0;
|
||||
int initialListSize = files.size();
|
||||
int lastUnprocessedFilesCount = 0;
|
||||
FastList<File> unprocessedFiles = FastList.newInstance();
|
||||
List<File> unprocessedFiles = new LinkedList<File>();
|
||||
while (files.size()>0 &&
|
||||
files.size() != lastUnprocessedFilesCount) {
|
||||
lastUnprocessedFilesCount = files.size();
|
||||
unprocessedFiles = FastList.newInstance();
|
||||
unprocessedFiles = new LinkedList<File>();
|
||||
for (File f: files) {
|
||||
Map<String, Object> parseEntityXmlFileArgs = UtilMisc.toMap("mostlyInserts", mostlyInserts,
|
||||
"createDummyFks", createDummyFks,
|
||||
@@ -330,13 +329,13 @@ public class WebToolsServices {
|
||||
Integer txTimeoutInt = (Integer) context.get("txTimeout");
|
||||
int txTimeout = txTimeoutInt != null ? txTimeoutInt.intValue() : -1;
|
||||
|
||||
List<Object> messages = FastList.newInstance();
|
||||
List<Object> messages = new LinkedList<Object>();
|
||||
|
||||
// parse the pass in list of readers to use
|
||||
List<String> readerNames = null;
|
||||
if (UtilValidate.isNotEmpty(readers) && !"none".equalsIgnoreCase(readers)) {
|
||||
if (readers.indexOf(",") == -1) {
|
||||
readerNames = FastList.newInstance();
|
||||
readerNames = new LinkedList<String>();
|
||||
readerNames.add(readers);
|
||||
} else {
|
||||
readerNames = StringUtil.split(readers, ",");
|
||||
@@ -366,7 +365,7 @@ public class WebToolsServices {
|
||||
|
||||
// need a list if it is empty
|
||||
if (urlList == null) {
|
||||
urlList = FastList.newInstance();
|
||||
urlList = new LinkedList<URL>();
|
||||
}
|
||||
|
||||
// process the list of files
|
||||
@@ -374,8 +373,8 @@ public class WebToolsServices {
|
||||
changedFormat.setMinimumIntegerDigits(5);
|
||||
changedFormat.setGroupingUsed(false);
|
||||
|
||||
List<Object> errorMessages = FastList.newInstance();
|
||||
List<String> infoMessages = FastList.newInstance();
|
||||
List<Object> errorMessages = new LinkedList<Object>();
|
||||
List<String> infoMessages = new LinkedList<String>();
|
||||
int totalRowsChanged = 0;
|
||||
if (UtilValidate.isNotEmpty(urlList)) {
|
||||
messages.add("=-=-=-=-=-=-= Doing a data " + (checkDataOnly ? "check" : "load") + " with the following files:");
|
||||
@@ -477,7 +476,7 @@ public class WebToolsServices {
|
||||
txTimeout = Integer.valueOf(7200);
|
||||
}
|
||||
|
||||
List<String> results = FastList.newInstance();
|
||||
List<String> results = new LinkedList<String>();
|
||||
|
||||
if (UtilValidate.isNotEmpty(outpath)) {
|
||||
File outdir = new File(outpath);
|
||||
@@ -509,7 +508,7 @@ public class WebToolsServices {
|
||||
boolean beganTx = TransactionUtil.begin();
|
||||
// some databases don't support cursors, or other problems may happen, so if there is an error here log it and move on to get as much as possible
|
||||
try {
|
||||
List<EntityCondition> conds = FastList.newInstance();
|
||||
List<EntityCondition> conds = new LinkedList<EntityCondition>();
|
||||
if (UtilValidate.isNotEmpty(fromDate)) {
|
||||
conds.add(EntityCondition.makeCondition("createdStamp", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate));
|
||||
}
|
||||
@@ -624,7 +623,7 @@ public class WebToolsServices {
|
||||
Map<String, Object> resultMap = ServiceUtil.returnSuccess();
|
||||
|
||||
ModelReader reader = delegator.getModelReader();
|
||||
Map<String, TreeSet<String>> entitiesByPackage = FastMap.newInstance();
|
||||
Map<String, TreeSet<String>> entitiesByPackage = new HashMap<String, TreeSet<String>>();
|
||||
TreeSet<String> packageNames = new TreeSet<String>();
|
||||
TreeSet<String> tableNames = new TreeSet<String>();
|
||||
|
||||
@@ -651,14 +650,14 @@ public class WebToolsServices {
|
||||
}
|
||||
|
||||
String search = (String) context.get("search");
|
||||
List<Map<String, Object>> packagesList = FastList.newInstance();
|
||||
List<Map<String, Object>> packagesList = new LinkedList<Map<String,Object>>();
|
||||
try {
|
||||
for (String pName : packageNames) {
|
||||
Map<String, Object> packageMap = FastMap.newInstance();
|
||||
Map<String, Object> packageMap = new HashMap<String, Object>();
|
||||
TreeSet<String> entities = entitiesByPackage.get(pName);
|
||||
List<Map<String, Object>> entitiesList = FastList.newInstance();
|
||||
List<Map<String, Object>> entitiesList = new LinkedList<Map<String,Object>>();
|
||||
for (String entityName: entities) {
|
||||
Map<String, Object> entityMap = FastMap.newInstance();
|
||||
Map<String, Object> entityMap = new HashMap<String, Object>();
|
||||
String helperName = delegator.getEntityHelperName(entityName);
|
||||
String groupName = delegator.getEntityGroupName(entityName);
|
||||
if (search == null || entityName.toLowerCase().indexOf(search.toLowerCase()) != -1) {
|
||||
@@ -682,9 +681,9 @@ public class WebToolsServices {
|
||||
}
|
||||
|
||||
// fields list
|
||||
List<Map<String, Object>> javaNameList = FastList.newInstance();
|
||||
List<Map<String, Object>> javaNameList = new LinkedList<Map<String,Object>>();
|
||||
for (Iterator<ModelField> f = entity.getFieldsIterator(); f.hasNext();) {
|
||||
Map<String, Object> javaNameMap = FastMap.newInstance();
|
||||
Map<String, Object> javaNameMap = new HashMap<String, Object>();
|
||||
ModelField field = f.next();
|
||||
ModelFieldType type = delegator.getEntityFieldType(entity, field.getType());
|
||||
javaNameMap.put("isPk", field.getIsPk());
|
||||
@@ -718,14 +717,14 @@ public class WebToolsServices {
|
||||
}
|
||||
|
||||
// relations list
|
||||
List<Map<String, Object>> relationsList = FastList.newInstance();
|
||||
List<Map<String, Object>> relationsList = new LinkedList<Map<String,Object>>();
|
||||
for (int r = 0; r < entity.getRelationsSize(); r++) {
|
||||
Map<String, Object> relationMap = FastMap.newInstance();
|
||||
Map<String, Object> relationMap = new HashMap<String, Object>();
|
||||
ModelRelation relation = entity.getRelation(r);
|
||||
List<Map<String, Object>> keysList = FastList.newInstance();
|
||||
List<Map<String, Object>> keysList = new LinkedList<Map<String,Object>>();
|
||||
int row = 1;
|
||||
for (ModelKeyMap keyMap : relation.getKeyMaps()) {
|
||||
Map<String, Object> keysMap = FastMap.newInstance();
|
||||
Map<String, Object> keysMap = new HashMap<String, Object>();
|
||||
String fieldName = null;
|
||||
String relFieldName = null;
|
||||
if (keyMap.getFieldName().equals(keyMap.getRelFieldName())) {
|
||||
@@ -751,16 +750,16 @@ public class WebToolsServices {
|
||||
}
|
||||
|
||||
// index list
|
||||
List<Map<String, Object>> indexList = FastList.newInstance();
|
||||
List<Map<String, Object>> indexList = new LinkedList<Map<String,Object>>();
|
||||
for (int r = 0; r < entity.getIndexesSize(); r++) {
|
||||
List<String> fieldNameList = FastList.newInstance();
|
||||
List<String> fieldNameList = new LinkedList<String>();
|
||||
|
||||
ModelIndex index = entity.getIndex(r);
|
||||
for (Iterator<ModelIndex.Field> fieldIterator = index.getFields().iterator(); fieldIterator.hasNext();) {
|
||||
fieldNameList.add(fieldIterator.next().getFieldName());
|
||||
}
|
||||
|
||||
Map<String, Object> indexMap = FastMap.newInstance();
|
||||
Map<String, Object> indexMap = new HashMap<String, Object>();
|
||||
indexMap.put("name", index.getName());
|
||||
indexMap.put("description", index.getDescription());
|
||||
indexMap.put("fieldNameList", fieldNameList);
|
||||
@@ -823,7 +822,7 @@ public class WebToolsServices {
|
||||
|
||||
Set<String> entityNames = new TreeSet<String>();
|
||||
if (UtilValidate.isNotEmpty(entityPackageNameOrig)) {
|
||||
Set<String> entityPackageNameSet = FastSet.newInstance();
|
||||
Set<String> entityPackageNameSet = new HashSet<String>();
|
||||
entityPackageNameSet.addAll(StringUtil.split(entityPackageNameOrig, ","));
|
||||
|
||||
Debug.logInfo("Exporting with entityPackageNameSet: " + entityPackageNameSet, module);
|
||||
@@ -851,12 +850,12 @@ public class WebToolsServices {
|
||||
}
|
||||
|
||||
// write the index.eomodeld file
|
||||
Map<String, Object> topLevelMap = FastMap.newInstance();
|
||||
Map<String, Object> topLevelMap = new HashMap<String, Object>();
|
||||
topLevelMap.put("EOModelVersion", "\"2.1\"");
|
||||
List<Map<String, Object>> entitiesMapList = FastList.newInstance();
|
||||
List<Map<String, Object>> entitiesMapList = new LinkedList<Map<String,Object>>();
|
||||
topLevelMap.put("entities", entitiesMapList);
|
||||
for (String entityName: entityNames) {
|
||||
Map<String, Object> entitiesMap = FastMap.newInstance();
|
||||
Map<String, Object> entitiesMap = new HashMap<String, Object>();
|
||||
entitiesMapList.add(entitiesMap);
|
||||
entitiesMap.put("className", "EOGenericRecord");
|
||||
entitiesMap.put("name", entityName);
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -33,8 +34,6 @@ import java.util.concurrent.Future;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import javolution.util.FastSet;
|
||||
|
||||
import org.ofbiz.base.component.ComponentConfig;
|
||||
import org.ofbiz.base.concurrent.ExecutionPool;
|
||||
import org.ofbiz.base.util.Debug;
|
||||
@@ -329,7 +328,7 @@ public class ArtifactInfoFactory {
|
||||
}
|
||||
|
||||
public Set<ArtifactInfoBase> getAllArtifactInfosByNamePartial(String artifactNamePartial, String type) {
|
||||
Set<ArtifactInfoBase> aiBaseSet = FastSet.newInstance();
|
||||
Set<ArtifactInfoBase> aiBaseSet = new HashSet<ArtifactInfoBase>();
|
||||
|
||||
if (UtilValidate.isEmpty(artifactNamePartial)) {
|
||||
return aiBaseSet;
|
||||
|
||||
@@ -20,12 +20,11 @@ package org.ofbiz.webtools.artifactinfo;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import javolution.util.FastSet;
|
||||
|
||||
import org.ofbiz.base.location.FlexibleLocation;
|
||||
import org.ofbiz.base.util.GeneralException;
|
||||
import org.ofbiz.entity.GenericEntityException;
|
||||
@@ -112,13 +111,13 @@ public class EntityArtifactInfo extends ArtifactInfoBase {
|
||||
|
||||
/** Get the Services called by Entity ECA */
|
||||
public Set<ServiceArtifactInfo> getServicesCalledByEntityEca() {
|
||||
Set<ServiceArtifactInfo> serviceSet = FastSet.newInstance();
|
||||
Set<ServiceArtifactInfo> serviceSet = new HashSet<ServiceArtifactInfo>();
|
||||
// TODO: implement this
|
||||
return serviceSet;
|
||||
}
|
||||
|
||||
public Set<EntityEcaRule> getEntityEcaRules() {
|
||||
Set<EntityEcaRule> eecaSet = FastSet.newInstance();
|
||||
Set<EntityEcaRule> eecaSet = new HashSet<EntityEcaRule>();
|
||||
// TODO: implement this
|
||||
return eecaSet;
|
||||
}
|
||||
|
||||
+2
-3
@@ -21,13 +21,12 @@ package org.ofbiz.webtools.artifactinfo;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import javolution.util.FastSet;
|
||||
|
||||
import org.ofbiz.base.location.FlexibleLocation;
|
||||
import org.ofbiz.base.util.Debug;
|
||||
import org.ofbiz.base.util.GeneralException;
|
||||
@@ -216,7 +215,7 @@ public class ScreenWidgetArtifactInfo extends ArtifactInfoBase {
|
||||
|
||||
public Set<ScreenWidgetArtifactInfo> getScreensIncludedInScreen() {
|
||||
// TODO: implement this
|
||||
return FastSet.newInstance();
|
||||
return new HashSet<ScreenWidgetArtifactInfo>();
|
||||
}
|
||||
|
||||
public Set<ScreenWidgetArtifactInfo> getScreensIncludingThisScreen() {
|
||||
|
||||
@@ -23,15 +23,14 @@ import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import javolution.util.FastList;
|
||||
import javolution.util.FastMap;
|
||||
import javolution.util.FastSet;
|
||||
|
||||
import org.ofbiz.base.location.FlexibleLocation;
|
||||
import org.ofbiz.base.util.Debug;
|
||||
import org.ofbiz.base.util.FileUtil;
|
||||
@@ -178,7 +177,7 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
|
||||
populateServicesFromNameSet(allServiceNameSet);
|
||||
}
|
||||
} else if ("group".equals(this.modelService.engineName)) {
|
||||
Set<String> allServiceNameSet = FastSet.newInstance();
|
||||
Set<String> allServiceNameSet = new HashSet<String>();
|
||||
GroupModel groupModel = modelService.internalGroup;
|
||||
if (groupModel == null) {
|
||||
groupModel = ServiceGroupReader.getGroupModel(this.modelService.location);
|
||||
@@ -279,7 +278,7 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
|
||||
|
||||
public Set<ServiceArtifactInfo> getServicesCalledByServiceEcas() {
|
||||
// TODO: implement this sometime, not really necessary
|
||||
return FastSet.newInstance();
|
||||
return new HashSet<ServiceArtifactInfo>();
|
||||
}
|
||||
|
||||
public Set<ServiceEcaArtifactInfo> getServiceEcaRulesTriggeredByService() {
|
||||
@@ -288,7 +287,7 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
|
||||
|
||||
public Set<ServiceArtifactInfo> getServicesCallingServiceByEcas() {
|
||||
// TODO: implement this sometime, not really necessary
|
||||
return FastSet.newInstance();
|
||||
return new HashSet<ServiceArtifactInfo>();
|
||||
}
|
||||
|
||||
public Set<ServiceEcaArtifactInfo> getServiceEcaRulesCallingService() {
|
||||
@@ -316,9 +315,9 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
|
||||
|
||||
Debug.logInfo("Writing Service Call Graph EO Model for service [" + this.modelService.name + "] to [" + eomodeldFullPath + "]", module);
|
||||
|
||||
Set<String> allDiagramEntitiesWithPrefixes = FastSet.newInstance();
|
||||
List<ServiceArtifactInfo> allServiceList = FastList.newInstance();
|
||||
List<ServiceEcaArtifactInfo> allServiceEcaList = FastList.newInstance();
|
||||
Set<String> allDiagramEntitiesWithPrefixes = new HashSet<String>();
|
||||
List<ServiceArtifactInfo> allServiceList = new LinkedList<ServiceArtifactInfo>();
|
||||
List<ServiceEcaArtifactInfo> allServiceEcaList = new LinkedList<ServiceEcaArtifactInfo>();
|
||||
|
||||
// make sure that any prefix that might have been set on this is cleared
|
||||
this.setDisplayPrefix("");
|
||||
@@ -345,7 +344,7 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
|
||||
allServiceList.add(calledService);
|
||||
}
|
||||
|
||||
Map<String, Integer> displaySuffixNumByEcaName = FastMap.newInstance();
|
||||
Map<String, Integer> displaySuffixNumByEcaName = new HashMap<String, Integer>();
|
||||
|
||||
// all SECAs and triggering services that call this service as an action
|
||||
Set<ServiceEcaArtifactInfo> callingServiceEcaSet = this.getServiceEcaRulesCallingService();
|
||||
@@ -386,12 +385,12 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
|
||||
}
|
||||
|
||||
// write index.eomodeld file
|
||||
Map<String, Object> indexEoModelMap = FastMap.newInstance();
|
||||
Map<String, Object> indexEoModelMap = new HashMap<String, Object>();
|
||||
indexEoModelMap.put("EOModelVersion", "\"2.1\"");
|
||||
List<Map<String, Object>> entitiesMapList = FastList.newInstance();
|
||||
List<Map<String, Object>> entitiesMapList = new LinkedList<Map<String,Object>>();
|
||||
indexEoModelMap.put("entities", entitiesMapList);
|
||||
for (String entityName: allDiagramEntitiesWithPrefixes) {
|
||||
Map<String, Object> entitiesMap = FastMap.newInstance();
|
||||
Map<String, Object> entitiesMap = new HashMap<String, Object>();
|
||||
entitiesMapList.add(entitiesMap);
|
||||
entitiesMap.put("className", "EOGenericRecord");
|
||||
entitiesMap.put("name", entityName);
|
||||
@@ -446,17 +445,17 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
|
||||
}
|
||||
|
||||
public Map<String, Object> createEoModelMap(Set<ServiceArtifactInfo> callingServiceSet, Set<ServiceArtifactInfo> calledServiceSet, Set<ServiceEcaArtifactInfo> callingServiceEcaSet, Set<ServiceEcaArtifactInfo> calledServiceEcaSet, boolean useMoreDetailedNames) {
|
||||
if (callingServiceSet == null) callingServiceSet = FastSet.newInstance();
|
||||
if (calledServiceSet == null) calledServiceSet = FastSet.newInstance();
|
||||
if (callingServiceEcaSet == null) callingServiceEcaSet = FastSet.newInstance();
|
||||
if (calledServiceEcaSet == null) calledServiceEcaSet = FastSet.newInstance();
|
||||
Map<String, Object> topLevelMap = FastMap.newInstance();
|
||||
if (callingServiceSet == null) callingServiceSet = new HashSet<ServiceArtifactInfo>();
|
||||
if (calledServiceSet == null) calledServiceSet = new HashSet<ServiceArtifactInfo>();
|
||||
if (callingServiceEcaSet == null) callingServiceEcaSet = new HashSet<ServiceEcaArtifactInfo>();
|
||||
if (calledServiceEcaSet == null) calledServiceEcaSet = new HashSet<ServiceEcaArtifactInfo>();
|
||||
Map<String, Object> topLevelMap = new HashMap<String, Object>();
|
||||
|
||||
topLevelMap.put("name", this.getDisplayPrefixedName());
|
||||
topLevelMap.put("className", "EOGenericRecord");
|
||||
|
||||
// for classProperties add attribute names AND relationship names to get a nice, complete chart
|
||||
List<String> classPropertiesList = FastList.newInstance();
|
||||
List<String> classPropertiesList = new LinkedList<String>();
|
||||
topLevelMap.put("classProperties", classPropertiesList);
|
||||
for (ModelParam param: this.modelService.getModelParamList()) {
|
||||
// skip the internal parameters, very redundant in the diagrams
|
||||
@@ -482,10 +481,10 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
|
||||
}
|
||||
|
||||
// attributes
|
||||
List<Map<String, Object>> attributesList = FastList.newInstance();
|
||||
List<Map<String, Object>> attributesList = new LinkedList<Map<String,Object>>();
|
||||
topLevelMap.put("attributes", attributesList);
|
||||
for (ModelParam param: this.modelService.getModelParamList()) {
|
||||
Map<String, Object> attributeMap = FastMap.newInstance();
|
||||
Map<String, Object> attributeMap = new HashMap<String, Object>();
|
||||
attributesList.add(attributeMap);
|
||||
|
||||
if (useMoreDetailedNames) {
|
||||
@@ -498,10 +497,10 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
|
||||
}
|
||||
|
||||
// relationships
|
||||
List<Map<String, Object>> relationshipsMapList = FastList.newInstance();
|
||||
List<Map<String, Object>> relationshipsMapList = new LinkedList<Map<String,Object>>();
|
||||
|
||||
for (ServiceArtifactInfo sai: callingServiceSet) {
|
||||
Map<String, Object> relationshipMap = FastMap.newInstance();
|
||||
Map<String, Object> relationshipMap = new HashMap<String, Object>();
|
||||
relationshipsMapList.add(relationshipMap);
|
||||
|
||||
relationshipMap.put("name", sai.getDisplayPrefixedName());
|
||||
@@ -516,7 +515,7 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
|
||||
//joinsMap.put("destinationAttribute", keyMap.getRelFieldName());
|
||||
}
|
||||
for (ServiceArtifactInfo sai: calledServiceSet) {
|
||||
Map<String, Object> relationshipMap = FastMap.newInstance();
|
||||
Map<String, Object> relationshipMap = new HashMap<String, Object>();
|
||||
relationshipsMapList.add(relationshipMap);
|
||||
|
||||
relationshipMap.put("name", sai.getDisplayPrefixedName());
|
||||
@@ -532,7 +531,7 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
|
||||
}
|
||||
|
||||
for (ServiceEcaArtifactInfo seai: callingServiceEcaSet) {
|
||||
Map<String, Object> relationshipMap = FastMap.newInstance();
|
||||
Map<String, Object> relationshipMap = new HashMap<String, Object>();
|
||||
relationshipsMapList.add(relationshipMap);
|
||||
|
||||
relationshipMap.put("name", seai.getDisplayPrefixedName());
|
||||
@@ -541,7 +540,7 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
|
||||
relationshipMap.put("isMandatory", "Y");
|
||||
}
|
||||
for (ServiceEcaArtifactInfo seai: calledServiceEcaSet) {
|
||||
Map<String, Object> relationshipMap = FastMap.newInstance();
|
||||
Map<String, Object> relationshipMap = new HashMap<String, Object>();
|
||||
relationshipsMapList.add(relationshipMap);
|
||||
|
||||
relationshipMap.put("name", seai.getDisplayPrefixedName());
|
||||
|
||||
+12
-13
@@ -20,15 +20,14 @@ package org.ofbiz.webtools.artifactinfo;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import javolution.util.FastList;
|
||||
import javolution.util.FastMap;
|
||||
import javolution.util.FastSet;
|
||||
|
||||
import org.ofbiz.base.location.FlexibleLocation;
|
||||
import org.ofbiz.base.util.GeneralException;
|
||||
import org.ofbiz.base.util.UtilMisc;
|
||||
@@ -114,15 +113,15 @@ public class ServiceEcaArtifactInfo extends ArtifactInfoBase {
|
||||
}
|
||||
|
||||
public Map<String, Object> createEoModelMap(Set<ServiceArtifactInfo> triggeringServiceSet, Set<ServiceArtifactInfo> triggeredServiceSet, boolean useMoreDetailedNames) {
|
||||
if (triggeringServiceSet == null) triggeringServiceSet = FastSet.newInstance();
|
||||
if (triggeredServiceSet == null) triggeredServiceSet = FastSet.newInstance();
|
||||
Map<String, Object> topLevelMap = FastMap.newInstance();
|
||||
if (triggeringServiceSet == null) triggeringServiceSet = new HashSet<ServiceArtifactInfo>();
|
||||
if (triggeredServiceSet == null) triggeredServiceSet = new HashSet<ServiceArtifactInfo>();
|
||||
Map<String, Object> topLevelMap = new HashMap<String, Object>();
|
||||
|
||||
topLevelMap.put("name", this.getDisplayPrefixedName());
|
||||
topLevelMap.put("className", "EOGenericRecord");
|
||||
|
||||
// for classProperties add attribute names AND relationship names to get a nice, complete chart
|
||||
List<String> classPropertiesList = FastList.newInstance();
|
||||
List<String> classPropertiesList = new LinkedList<String>();
|
||||
topLevelMap.put("classProperties", classPropertiesList);
|
||||
// conditions
|
||||
for (ServiceEcaCondition ecaCondition: this.serviceEcaRule.getEcaConditionList()) {
|
||||
@@ -139,10 +138,10 @@ public class ServiceEcaArtifactInfo extends ArtifactInfoBase {
|
||||
|
||||
/* going to try this without any attributes...
|
||||
// attributes
|
||||
List<Map<String, Object>> attributesList = FastList.newInstance();
|
||||
List<Map<String, Object>> attributesList = new LinkedList();
|
||||
topLevelMap.put("attributes", attributesList);
|
||||
for (ModelParam param: this.modelService.getModelParamList()) {
|
||||
Map<String, Object> attributeMap = FastMap.newInstance();
|
||||
Map<String, Object> attributeMap = new HashMap();
|
||||
attributesList.add(attributeMap);
|
||||
|
||||
if (useMoreDetailedNames) {
|
||||
@@ -156,10 +155,10 @@ public class ServiceEcaArtifactInfo extends ArtifactInfoBase {
|
||||
*/
|
||||
|
||||
// relationships
|
||||
List<Map<String, Object>> relationshipsMapList = FastList.newInstance();
|
||||
List<Map<String, Object>> relationshipsMapList = new LinkedList<Map<String,Object>>();
|
||||
|
||||
for (ServiceArtifactInfo sai: triggeringServiceSet) {
|
||||
Map<String, Object> relationshipMap = FastMap.newInstance();
|
||||
Map<String, Object> relationshipMap = new HashMap<String, Object>();
|
||||
relationshipsMapList.add(relationshipMap);
|
||||
|
||||
relationshipMap.put("name", sai.getDisplayPrefixedName());
|
||||
@@ -168,7 +167,7 @@ public class ServiceEcaArtifactInfo extends ArtifactInfoBase {
|
||||
relationshipMap.put("isMandatory", "Y");
|
||||
}
|
||||
for (ServiceArtifactInfo sai: triggeredServiceSet) {
|
||||
Map<String, Object> relationshipMap = FastMap.newInstance();
|
||||
Map<String, Object> relationshipMap = new HashMap<String, Object>();
|
||||
relationshipsMapList.add(relationshipMap);
|
||||
|
||||
relationshipMap.put("name", sai.getDisplayPrefixedName());
|
||||
|
||||
@@ -18,10 +18,9 @@
|
||||
*/
|
||||
package org.ofbiz.webtools.labelmanager;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import org.ofbiz.base.util.Debug;
|
||||
import org.ofbiz.base.util.UtilValidate;
|
||||
|
||||
@@ -32,7 +31,7 @@ public class LabelInfo {
|
||||
protected String labelKey = "";
|
||||
protected String labelKeyComment = "";
|
||||
protected String fileName = "";
|
||||
protected Map<String, LabelValue> labelValues = FastMap.newInstance();
|
||||
protected Map<String, LabelValue> labelValues = new LinkedHashMap<String, LabelValue>();
|
||||
|
||||
public LabelInfo(String labelKey, String labelKeyComment, String fileName, String localeStr, String labelValue, String labelComment) {
|
||||
this.labelKey = labelKey;
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -30,8 +31,6 @@ import java.util.TreeSet;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import javolution.util.FastList;
|
||||
|
||||
import org.ofbiz.base.component.ComponentConfig;
|
||||
import org.ofbiz.base.component.ComponentConfig.ClasspathInfo;
|
||||
import org.ofbiz.base.util.Debug;
|
||||
@@ -57,7 +56,7 @@ public class LabelManagerFactory {
|
||||
|
||||
protected Map<String, LabelInfo> labels = new TreeMap<String, LabelInfo>();
|
||||
protected Set<String> localesFound = new TreeSet<String>();
|
||||
protected List<LabelInfo> duplicatedLocalesLabelsList = FastList.newInstance();
|
||||
protected List<LabelInfo> duplicatedLocalesLabelsList = new LinkedList<LabelInfo>();
|
||||
|
||||
public static synchronized LabelManagerFactory getInstance() throws IOException {
|
||||
if (componentNamesFound == null) {
|
||||
|
||||
@@ -22,7 +22,9 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -30,9 +32,6 @@ import java.util.TreeMap;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import javolution.util.FastList;
|
||||
import javolution.util.FastSet;
|
||||
|
||||
import org.ofbiz.base.component.ComponentConfig;
|
||||
import org.ofbiz.base.util.Debug;
|
||||
import org.ofbiz.base.util.FileUtil;
|
||||
@@ -65,8 +64,8 @@ public class LabelReferences {
|
||||
protected Delegator delegator;
|
||||
protected DispatchContext dispatchContext;
|
||||
protected Map<String, LabelInfo> labels;
|
||||
protected Set<String> labelSet = FastSet.newInstance();
|
||||
protected Set<String> rootFolders = FastSet.newInstance();
|
||||
protected Set<String> labelSet = new HashSet<String>();
|
||||
protected Set<String> rootFolders = new HashSet<String>();
|
||||
|
||||
public LabelReferences(Delegator delegator, LabelManagerFactory factory) {
|
||||
this.delegator = delegator;
|
||||
@@ -113,7 +112,7 @@ public class LabelReferences {
|
||||
// get labels from simple method files
|
||||
getLabelsFromSimpleMethodFiles();
|
||||
// get labels from widgets files
|
||||
List<File> fileList = FastList.newInstance();
|
||||
List<File> fileList = new LinkedList<File>();
|
||||
for (String rootFolder : this.rootFolders) {
|
||||
fileList.addAll(FileUtil.findXmlFiles(rootFolder + "webapp", null, null, null));
|
||||
fileList.addAll(FileUtil.findXmlFiles(rootFolder + "widget", null, null, null));
|
||||
@@ -259,7 +258,7 @@ public class LabelReferences {
|
||||
}
|
||||
|
||||
private void getLabelsFromFormWidgets(String inFile, File file) throws MalformedURLException, SAXException, ParserConfigurationException, IOException, GenericServiceException {
|
||||
Set<String> fieldNames = FastSet.newInstance();
|
||||
Set<String> fieldNames = new HashSet<String>();
|
||||
findUiLabelMapInFile(inFile, file.getPath());
|
||||
Document formDocument = UtilXml.readXmlDocument(file.toURI().toURL());
|
||||
Element rootElem = formDocument.getDocumentElement();
|
||||
|
||||
Reference in New Issue
Block a user