Synched branch with trunk.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/branches/json-integration-refactoring@1635897 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/applications/order/src/org/ofbiz/order/order/OrderServices.java b/applications/order/src/org/ofbiz/order/order/OrderServices.java
index 6e82af6..cc922d9 100644
--- a/applications/order/src/org/ofbiz/order/order/OrderServices.java
+++ b/applications/order/src/org/ofbiz/order/order/OrderServices.java
@@ -281,10 +281,15 @@
normalizedItemQuantities.put(currentProductId, currentQuantity.add(orderItem.getBigDecimal("quantity")));
}
- Map<String, Object> countContext = new HashMap<String, Object>();
- countContext.put("productId", currentProductId);
- countContext.put("quantity", orderItem.getBigDecimal("quantity"));
- countProductQuantityOrdered(ctx, countContext);
+ try {
+ // count product ordered quantities
+ // run this synchronously so it will run in the same transaction
+ dispatcher.runSync("countProductQuantityOrdered", UtilMisc.<String, Object>toMap("productId", currentProductId, "quantity", orderItem.getBigDecimal("quantity"), "userLogin", userLogin));
+ } catch (GenericServiceException e1) {
+ Debug.logError(e1, "Error calling countProductQuantityOrdered service", module);
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
+ "OrderErrorCallingCountProductQuantityOrderedService",locale) + e1.toString());
+ }
}
}
diff --git a/framework/base/src/org/ofbiz/base/concurrent/ExecutionPool.java b/framework/base/src/org/ofbiz/base/concurrent/ExecutionPool.java
index 15e7599..04359a7 100644
--- a/framework/base/src/org/ofbiz/base/concurrent/ExecutionPool.java
+++ b/framework/base/src/org/ofbiz/base/concurrent/ExecutionPool.java
@@ -19,14 +19,15 @@
package org.ofbiz.base.concurrent;
import java.util.Collection;
+import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.DelayQueue;
import java.util.concurrent.Delayed;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
import java.util.concurrent.ForkJoinPool;
+import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.SynchronousQueue;
@@ -34,8 +35,6 @@
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
-import javolution.util.FastList;
-
import org.ofbiz.base.lang.SourceMonitored;
import org.ofbiz.base.util.Debug;
@@ -78,7 +77,7 @@
}
public static <F> List<F> getAllFutures(Collection<Future<F>> futureList) {
- List<F> result = FastList.newInstance();
+ List<F> result = new LinkedList<F>();
for (Future<F> future: futureList) {
try {
result.add(future.get());
diff --git a/framework/base/src/org/ofbiz/base/config/JNDIConfigUtil.java b/framework/base/src/org/ofbiz/base/config/JNDIConfigUtil.java
index 1789004..828167d 100644
--- a/framework/base/src/org/ofbiz/base/config/JNDIConfigUtil.java
+++ b/framework/base/src/org/ofbiz/base/config/JNDIConfigUtil.java
@@ -18,7 +18,7 @@
*******************************************************************************/
package org.ofbiz.base.config;
-import javolution.util.FastMap;
+import java.util.concurrent.ConcurrentHashMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilXml;
@@ -32,7 +32,7 @@
public static final String module = JNDIConfigUtil.class.getName();
public static final String JNDI_CONFIG_XML_FILENAME = "jndiservers.xml";
- private static final FastMap<String, JndiServerInfo> jndiServerInfos = FastMap.newInstance();
+ private static final ConcurrentHashMap<String, JndiServerInfo> jndiServerInfos = new ConcurrentHashMap<String, JndiServerInfo>();
private static Element getXmlRootElement() throws GenericConfigException {
try {
diff --git a/framework/base/src/org/ofbiz/base/util/BshUtil.java b/framework/base/src/org/ofbiz/base/util/BshUtil.java
index e06a835..5efcdab 100644
--- a/framework/base/src/org/ofbiz/base/util/BshUtil.java
+++ b/framework/base/src/org/ofbiz/base/util/BshUtil.java
@@ -25,8 +25,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;
-
-import javolution.util.FastMap;
+import java.util.concurrent.ConcurrentHashMap;
import org.ofbiz.base.location.FlexibleLocation;
import org.ofbiz.base.util.cache.UtilCache;
@@ -45,7 +44,7 @@
public static final String module = BshUtil.class.getName();
- protected static FastMap<ClassLoader, BshClassManager> masterClassManagers = FastMap.newInstance();
+ protected static ConcurrentHashMap<ClassLoader, BshClassManager> masterClassManagers = new ConcurrentHashMap<ClassLoader, BshClassManager>();
private static final UtilCache<String, Interpreter.ParsedScript> parsedScripts = UtilCache.createUtilCache("script.BshLocationParsedCache", 0, 0, false);
/**
diff --git a/framework/base/src/org/ofbiz/base/util/FileUtil.java b/framework/base/src/org/ofbiz/base/util/FileUtil.java
index 6776dee..f47b84e 100644
--- a/framework/base/src/org/ofbiz/base/util/FileUtil.java
+++ b/framework/base/src/org/ofbiz/base/util/FileUtil.java
@@ -32,12 +32,11 @@
import java.io.Reader;
import java.io.Writer;
import java.net.MalformedURLException;
+import java.util.HashSet;
+import java.util.LinkedList;
import java.util.List;
import java.util.Set;
-import javolution.util.FastList;
-import javolution.util.FastSet;
-
import org.apache.commons.io.FileUtils;
import org.ofbiz.base.location.ComponentLocationResolver;
@@ -245,8 +244,8 @@
basePath = System.getProperty("ofbiz.home");
}
- Set<String> stringsToFindInPath = FastSet.newInstance();
- Set<String> stringsToFindInFile = FastSet.newInstance();
+ Set<String> stringsToFindInPath = new HashSet<String>();
+ Set<String> stringsToFindInFile = new HashSet<String>();
if (partialPath != null) {
stringsToFindInPath.add(partialPath);
@@ -255,7 +254,7 @@
stringsToFindInFile.add(stringToFind);
}
- List<File> fileList = FastList.newInstance();
+ List<File> fileList = new LinkedList<File>();
FileUtil.searchFiles(fileList, new File(basePath), new SearchTextFilesFilter(fileExt, stringsToFindInPath, stringsToFindInFile), true);
return fileList;
@@ -266,22 +265,22 @@
basePath = System.getProperty("ofbiz.home");
}
- Set<String> stringsToFindInPath = FastSet.newInstance();
- Set<String> stringsToFindInFile = FastSet.newInstance();
+ Set<String> stringsToFindInPath = new HashSet<String>();
+ Set<String> stringsToFindInFile = new HashSet<String>();
if (partialPath != null) stringsToFindInPath.add(partialPath);
if (rootElementName != null) stringsToFindInFile.add("<" + rootElementName + " ");
if (xsdOrDtdName != null) stringsToFindInFile.add(xsdOrDtdName);
- List<File> fileList = FastList.newInstance();
+ List<File> fileList = new LinkedList<File>();
FileUtil.searchFiles(fileList, new File(basePath), new SearchTextFilesFilter("xml", stringsToFindInPath, stringsToFindInFile), true);
return fileList;
}
public static class SearchTextFilesFilter implements FilenameFilter {
String fileExtension;
- Set<String> stringsToFindInFile = FastSet.newInstance();
- Set<String> stringsToFindInPath = FastSet.newInstance();
+ Set<String> stringsToFindInFile = new HashSet<String>();
+ Set<String> stringsToFindInPath = new HashSet<String>();
public SearchTextFilesFilter(String fileExtension, Set<String> stringsToFindInPath, Set<String> stringsToFindInFile) {
this.fileExtension = fileExtension;
diff --git a/framework/base/src/org/ofbiz/base/util/GroovyUtil.java b/framework/base/src/org/ofbiz/base/util/GroovyUtil.java
index e007b82..cc6b3c3 100644
--- a/framework/base/src/org/ofbiz/base/util/GroovyUtil.java
+++ b/framework/base/src/org/ofbiz/base/util/GroovyUtil.java
@@ -26,12 +26,11 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.HashMap;
import java.util.Map;
import javax.script.ScriptContext;
-import javolution.util.FastMap;
-
import org.codehaus.groovy.control.CompilationFailedException;
import org.codehaus.groovy.runtime.InvokerHelper;
import org.ofbiz.base.location.FlexibleLocation;
@@ -95,7 +94,7 @@
* @return A <code>Binding</code> instance
*/
public static Binding getBinding(Map<String, Object> context) {
- Map<String, Object> vars = FastMap.newInstance();
+ Map<String, Object> vars = new HashMap<String, Object>();
if (context != null) {
vars.putAll(context);
vars.put("context", context);
diff --git a/framework/base/src/org/ofbiz/base/util/HttpRequestFileUpload.java b/framework/base/src/org/ofbiz/base/util/HttpRequestFileUpload.java
index 44fd32d..ebe5d6e 100644
--- a/framework/base/src/org/ofbiz/base/util/HttpRequestFileUpload.java
+++ b/framework/base/src/org/ofbiz/base/util/HttpRequestFileUpload.java
@@ -24,13 +24,12 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Date;
+import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
-import javolution.util.FastMap;
-
/**
* HttpRequestFileUpload - Receive a file upload through an HttpServletRequest
*
@@ -140,7 +139,7 @@
String boundary = new String(line, 0, boundaryLength); // -2 discards the newline character
System.out.println("boundary=[" + boundary + "] length is " + boundaryLength);
- fields = FastMap.newInstance();
+ fields = new HashMap<String, String>();
while (requestLength > 0/* i != -1*/) {
String newLine = "";
diff --git a/framework/base/src/org/ofbiz/base/util/KeyStoreUtil.java b/framework/base/src/org/ofbiz/base/util/KeyStoreUtil.java
index 9d87509..a69aa06 100755
--- a/framework/base/src/org/ofbiz/base/util/KeyStoreUtil.java
+++ b/framework/base/src/org/ofbiz/base/util/KeyStoreUtil.java
@@ -46,10 +46,9 @@
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.Collection;
+import java.util.HashMap;
import java.util.Map;
-import javolution.util.FastMap;
-
import org.apache.commons.codec.binary.Base64;
import org.ofbiz.base.component.ComponentConfig;
import org.ofbiz.base.config.GenericConfigException;
@@ -143,7 +142,7 @@
}
public static Map<String, String> getX500Map(Principal x500) {
- Map<String, String> x500Map = FastMap.newInstance();
+ Map<String, String> x500Map = new HashMap<String, String>();
String name = x500.getName().replaceAll("\\\\,", "&com;");
String[] x500Opts = name.split("\\,");
diff --git a/framework/base/src/org/ofbiz/base/util/MultiTrustManager.java b/framework/base/src/org/ofbiz/base/util/MultiTrustManager.java
index 729766c..f0c7d9a 100644
--- a/framework/base/src/org/ofbiz/base/util/MultiTrustManager.java
+++ b/framework/base/src/org/ofbiz/base/util/MultiTrustManager.java
@@ -25,12 +25,11 @@
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Enumeration;
+import java.util.LinkedList;
import java.util.List;
import javax.net.ssl.X509TrustManager;
-import javolution.util.FastList;
-
/**
* MultiTrustManager
*/
@@ -46,7 +45,7 @@
}
public MultiTrustManager() {
- keystores = FastList.newInstance();
+ keystores = new LinkedList<KeyStore>();
}
public void add(KeyStore ks) {
@@ -78,7 +77,7 @@
}
public X509Certificate[] getAcceptedIssuers() {
- List<X509Certificate> issuers = FastList.newInstance();
+ List<X509Certificate> issuers = new LinkedList<X509Certificate>();
for (KeyStore store: keystores) {
try {
Enumeration<String> e = store.aliases();
diff --git a/framework/base/src/org/ofbiz/base/util/SSLUtil.java b/framework/base/src/org/ofbiz/base/util/SSLUtil.java
index b783336..d27cb88 100644
--- a/framework/base/src/org/ofbiz/base/util/SSLUtil.java
+++ b/framework/base/src/org/ofbiz/base/util/SSLUtil.java
@@ -18,23 +18,21 @@
*******************************************************************************/
package org.ofbiz.base.util;
-import org.ofbiz.base.config.GenericConfigException;
-import org.ofbiz.base.component.ComponentConfig;
-
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
-import java.security.SecureRandom;
import java.security.Principal;
-import java.security.cert.X509Certificate;
+import java.security.SecureRandom;
import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
import java.util.Arrays;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLServerSocketFactory;
@@ -44,7 +42,8 @@
import javax.net.ssl.X509KeyManager;
import javax.net.ssl.X509TrustManager;
-import javolution.util.FastList;
+import org.ofbiz.base.component.ComponentConfig;
+import org.ofbiz.base.config.GenericConfigException;
/**
* KeyStoreUtil - Utilities for setting up SSL connections with specific client certificates
@@ -92,7 +91,7 @@
}
public static KeyManager[] getKeyManagers(String alias) throws IOException, GeneralSecurityException, GenericConfigException {
- List<KeyManager> keyMgrs = FastList.newInstance();
+ List<KeyManager> keyMgrs = new LinkedList<KeyManager>();
for (ComponentConfig.KeystoreInfo ksi: ComponentConfig.getAllKeystoreInfos()) {
if (ksi.isCertStore()) {
KeyStore ks = ksi.getKeyStore();
diff --git a/framework/base/src/org/ofbiz/base/util/StringUtil.java b/framework/base/src/org/ofbiz/base/util/StringUtil.java
index b7b12c9..e34c4e5 100644
--- a/framework/base/src/org/ofbiz/base/util/StringUtil.java
+++ b/framework/base/src/org/ofbiz/base/util/StringUtil.java
@@ -23,19 +23,16 @@
import java.net.URLEncoder;
import java.util.Arrays;
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.Map;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
-import javolution.context.ObjectFactory;
-import javolution.lang.Reusable;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-import javolution.util.FastSet;
-
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.ofbiz.base.lang.Appender;
@@ -56,6 +53,7 @@
public static final StringUtil INSTANCE = new StringUtil();
public static final String module = StringUtil.class.getName();
+ // FIXME: Not thread safe
protected static final Map<String, Pattern> substitutionPatternMap;
/** OWASP ESAPI canonicalize strict flag; setting false so we only get warnings about double encoding, etc; can be set to true for exceptions and more security */
@@ -67,7 +65,7 @@
List<Codec> codecList = Arrays.asList(new HTMLEntityCodec(), new PercentCodec());
defaultWebEncoder = new DefaultEncoder(codecList);
defaultWebValidator = new DefaultValidator();
- substitutionPatternMap = FastMap.newInstance();
+ substitutionPatternMap = new HashMap<String, Pattern>();
substitutionPatternMap.put("&&", Pattern.compile("@and", Pattern.LITERAL));
substitutionPatternMap.put("||", Pattern.compile("@or", Pattern.LITERAL));
substitutionPatternMap.put("<=", Pattern.compile("@lteq", Pattern.LITERAL));
@@ -203,7 +201,7 @@
else st = new StringTokenizer(str);
if (st != null && st.hasMoreTokens()) {
- splitList = FastList.newInstance();
+ splitList = new LinkedList<String>();
while (st.hasMoreTokens())
splitList.add(st.nextToken());
@@ -229,7 +227,7 @@
if (st != null && st.length > 0) {
- splitList = FastList.newInstance();
+ splitList = new LinkedList<String>();
for (int i=0; i < st.length; i++) splitList.add(st[i]);
}
@@ -243,7 +241,7 @@
public static List<String> quoteStrList(List<String> list) {
List<String> tmpList = list;
- list = FastList.newInstance();
+ list = new LinkedList<String>();
for (String str: tmpList) {
str = "'" + str + "'";
list.add(str);
@@ -274,7 +272,7 @@
*/
public static Map<String, String> strToMap(String str, String delim, boolean trim, String pairsSeparator) {
if (str == null) return null;
- Map<String, String> decodedMap = FastMap.newInstance();
+ Map<String, String> decodedMap = new HashMap<String, String>();
List<String> elements = split(str, delim);
pairsSeparator = pairsSeparator == null ? "=" : pairsSeparator;
@@ -384,7 +382,7 @@
* @return new Map
*/
public static Map<String, String> toMap(String s) {
- Map<String, String> newMap = FastMap.newInstance();
+ Map<String, String> newMap = new HashMap<String, String>();
if (s.startsWith("{") && s.endsWith("}")) {
s = s.substring(1, s.length() - 1);
String[] entries = s.split("\\,\\s");
@@ -408,7 +406,7 @@
* @return new List
*/
public static List<String> toList(String s) {
- List<String> newList = FastList.newInstance();
+ List<String> newList = new LinkedList<String>();
if (s.startsWith("[") && s.endsWith("]")) {
s = s.substring(1, s.length() - 1);
String[] entries = s.split("\\,\\s");
@@ -429,7 +427,7 @@
* @return new List
*/
public static Set<String> toSet(String s) {
- Set<String> newSet = FastSet.newInstance();
+ Set<String> newSet = new HashSet<String>();
if (s.startsWith("[") && s.endsWith("]")) {
s = s.substring(1, s.length() - 1);
String[] entries = s.split("\\,\\s");
@@ -454,7 +452,7 @@
if (keys == null || values == null || keys.size() != values.size()) {
throw new IllegalArgumentException("Keys and Values cannot be null and must be the same size");
}
- Map<K, V> newMap = FastMap.newInstance();
+ Map<K, V> newMap = new HashMap<K, V>();
for (int i = 0; i < keys.size(); i++) {
newMap.put(keys.get(i), values.get(i));
}
@@ -791,19 +789,12 @@
/**
* A simple Map wrapper class that will do HTML encoding. To be used for passing a Map to something that will expand Strings with it as a context, etc.
- * To reduce memory allocation impact this object is recyclable and minimal in that it only keeps a reference to the original Map.
*/
- public static class HtmlEncodingMapWrapper<K> implements Map<K, Object>, Reusable {
- protected static final ObjectFactory<HtmlEncodingMapWrapper<?>> mapStackFactory = new ObjectFactory<HtmlEncodingMapWrapper<?>>() {
- @Override
- protected HtmlEncodingMapWrapper<?> create() {
- return new HtmlEncodingMapWrapper<Object>();
- }
- };
+ public static class HtmlEncodingMapWrapper<K> implements Map<K, Object> {
public static <K> HtmlEncodingMapWrapper<K> getHtmlEncodingMapWrapper(Map<K, Object> mapToWrap, SimpleEncoder encoder) {
if (mapToWrap == null) return null;
- HtmlEncodingMapWrapper<K> mapWrapper = (HtmlEncodingMapWrapper<K>) UtilGenerics.<K, Object>checkMap(mapStackFactory.object());
+ HtmlEncodingMapWrapper<K> mapWrapper = new HtmlEncodingMapWrapper<K>();
mapWrapper.setup(mapToWrap, encoder);
return mapWrapper;
}
diff --git a/framework/base/src/org/ofbiz/base/util/UtilGenerics.java b/framework/base/src/org/ofbiz/base/util/UtilGenerics.java
index 72595ee..cc10b92 100644
--- a/framework/base/src/org/ofbiz/base/util/UtilGenerics.java
+++ b/framework/base/src/org/ofbiz/base/util/UtilGenerics.java
@@ -19,13 +19,12 @@
package org.ofbiz.base.util;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Stack;
-import javolution.util.FastMap;
-
public class UtilGenerics {
public static final String module = UtilMisc.class.getName();
@@ -141,7 +140,7 @@
if (data.length % 2 == 1) {
throw new IllegalArgumentException("You must pass an even sized array to the toMap method");
}
- Map<K, V> map = FastMap.newInstance();
+ Map<K, V> map = new LinkedHashMap<K, V>();
for (int i = 0; i < data.length;) {
Object key = data[i];
if (key != null && !(keyType.isInstance(key))) throw new IllegalArgumentException("Key(" + i + ") is not a " + keyType.getName() + ", was(" + key.getClass().getName() + ")");
@@ -162,7 +161,7 @@
if (data.length % 2 == 1) {
throw new IllegalArgumentException("You must pass an even sized array to the toMap method");
}
- Map<K, Object> map = FastMap.newInstance();
+ Map<K, Object> map = new LinkedHashMap<K, Object>();
for (int i = 0; i < data.length;) {
Object key = data[i];
if (key != null && !(keyType.isInstance(key))) throw new IllegalArgumentException("Key(" + i + ") is not a " + keyType.getName() + ", was(" + key.getClass().getName() + ")");
diff --git a/framework/base/src/org/ofbiz/base/util/UtilHttp.java b/framework/base/src/org/ofbiz/base/util/UtilHttp.java
index 9f20d22..9f545a8 100644
--- a/framework/base/src/org/ofbiz/base/util/UtilHttp.java
+++ b/framework/base/src/org/ofbiz/base/util/UtilHttp.java
@@ -35,6 +35,7 @@
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -47,9 +48,6 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.apache.commons.lang.RandomStringUtils;
import org.apache.oro.text.regex.MalformedPatternException;
import org.apache.oro.text.regex.Pattern;
@@ -88,7 +86,7 @@
* @return The resulting Map
*/
public static Map<String, Object> getCombinedMap(HttpServletRequest request, Set<? extends String> namesToSkip) {
- FastMap<String, Object> combinedMap = FastMap.newInstance();
+ Map<String, Object> combinedMap = new HashMap<String, Object>();
combinedMap.putAll(getParameterMap(request)); // parameters override nothing
combinedMap.putAll(getServletContextMap(request, namesToSkip)); // bottom level application attributes
combinedMap.putAll(getSessionMap(request, namesToSkip)); // session overrides application
@@ -162,7 +160,7 @@
}
public static Map<String, Object> getQueryStringOnlyParameterMap(String queryString) {
- Map<String, Object> paramMap = FastMap.newInstance();
+ Map<String, Object> paramMap = new HashMap<String, Object>();
if (UtilValidate.isNotEmpty(queryString)) {
StringTokenizer queryTokens = new StringTokenizer(queryString, "&");
while (queryTokens.hasMoreTokens()) {
@@ -189,7 +187,7 @@
public static Map<String, Object> getPathInfoOnlyParameterMap(String pathInfoStr, Set<? extends String> nameSet, Boolean onlyIncludeOrSkip) {
boolean onlyIncludeOrSkipPrim = onlyIncludeOrSkip == null ? true : onlyIncludeOrSkip.booleanValue();
- Map<String, Object> paramMap = FastMap.newInstance();
+ Map<String, Object> paramMap = new HashMap<String, Object>();
// now add in all path info parameters /~name1=value1/~name2=value2/
// note that if a parameter with a given name already exists it will be put into a list with all values
@@ -218,7 +216,7 @@
paramList.add(value);
} else {
String paramString = (String) curValue;
- paramList = FastList.newInstance();
+ paramList = new LinkedList<String>();
paramList.add(paramString);
paramList.add(value);
}
@@ -249,7 +247,7 @@
if (paramEntry.getValue() instanceof String) {
paramEntry.setValue(canonicalizeParameter((String) paramEntry.getValue()));
} else if (paramEntry.getValue() instanceof Collection<?>) {
- List<String> newList = FastList.newInstance();
+ List<String> newList = new LinkedList<String>();
for (String listEntry: UtilGenerics.<String>checkCollection(paramEntry.getValue())) {
newList.add(canonicalizeParameter(listEntry));
}
@@ -275,7 +273,7 @@
* @return The resulting Map
*/
public static Map<String, Object> getJSONAttributeMap(HttpServletRequest request) {
- Map<String, Object> returnMap = FastMap.newInstance();
+ Map<String, Object> returnMap = new HashMap<String, Object>();
Map<String, Object> attrMap = getAttributeMap(request);
for (Map.Entry<String, Object> entry : attrMap.entrySet()) {
String key = entry.getKey();
@@ -305,7 +303,7 @@
* @return The resulting Map
*/
public static Map<String, Object> getAttributeMap(HttpServletRequest request, Set<? extends String> namesToSkip) {
- Map<String, Object> attributeMap = FastMap.newInstance();
+ Map<String, Object> attributeMap = new HashMap<String, Object>();
// look at all request attributes
Enumeration<String> requestAttrNames = UtilGenerics.cast(request.getAttributeNames());
@@ -339,7 +337,7 @@
* @return The resulting Map
*/
public static Map<String, Object> getSessionMap(HttpServletRequest request, Set<? extends String> namesToSkip) {
- Map<String, Object> sessionMap = FastMap.newInstance();
+ Map<String, Object> sessionMap = new HashMap<String, Object>();
HttpSession session = request.getSession();
// look at all the session attributes
@@ -374,7 +372,7 @@
* @return The resulting Map
*/
public static Map<String, Object> getServletContextMap(HttpServletRequest request, Set<? extends String> namesToSkip) {
- Map<String, Object> servletCtxMap = FastMap.newInstance();
+ Map<String, Object> servletCtxMap = new HashMap<String, Object>();
// look at all servlet context attributes
ServletContext servletContext = (ServletContext) request.getAttribute("servletContext");
@@ -1126,7 +1124,7 @@
* index of the row.
*/
public static Collection<Map<String, Object>> parseMultiFormData(Map<String, Object> parameters) {
- FastMap<Integer, Map<String, Object>> rows = FastMap.newInstance(); // stores the rows keyed by row number
+ Map<Integer, Map<String, Object>> rows = new HashMap<Integer, Map<String, Object>>(); // stores the rows keyed by row number
// first loop through all the keys and create a hashmap for each ${ROW_SUBMIT_PREFIX}${N} = Y
for (String key: parameters.keySet()) {
@@ -1138,7 +1136,7 @@
// decode the value of N and create a new map for it
Integer n = Integer.decode(key.substring(ROW_SUBMIT_PREFIX_LENGTH, key.length()));
- Map<String, Object> m = FastMap.newInstance();
+ Map<String, Object> m = new HashMap<String, Object>();
m.put("row", n); // special "row" = N tuple
rows.put(n, m); // key it to N
}
@@ -1170,7 +1168,7 @@
* multi form parameters (usually named according to the ${param}_o_N notation).
*/
public static <V> Map<String, V> removeMultiFormParameters(Map<String, V> parameters) {
- FastMap<String, V> filteredParameters = new FastMap<String, V>();
+ Map<String, V> filteredParameters = new HashMap<String, V>();
for (Map.Entry<String, V> entry : parameters.entrySet()) {
String key = entry.getKey();
if (key != null && (key.indexOf(MULTI_ROW_DELIMITER) != -1 || key.indexOf("_useRowSubmit") != -1 || key.indexOf("_rowCount") != -1)) {
@@ -1220,7 +1218,7 @@
if (UtilValidate.isEmpty(compositeType)) return null;
// collect the composite fields into a map
- Map<String, String> data = FastMap.newInstance();
+ Map<String, String> data = new HashMap<String, String>();
for (Enumeration<String> names = UtilGenerics.cast(request.getParameterNames()); names.hasMoreElements();) {
String name = names.nextElement();
if (!name.startsWith(prefix + COMPOSITE_DELIMITER)) continue;
@@ -1375,7 +1373,7 @@
HttpSession session = request.getSession();
Map<String, Map<String, Object>> paramMapStore = UtilGenerics.checkMap(session.getAttribute("_PARAM_MAP_STORE_"));
if (paramMapStore == null) {
- paramMapStore = FastMap.newInstance();
+ paramMapStore = new HashMap<String, Map<String, Object>>();
session.setAttribute("_PARAM_MAP_STORE_", paramMapStore);
}
Map<String, Object> parameters = getParameterMap(request);
diff --git a/framework/base/src/org/ofbiz/base/util/UtilJavaParse.java b/framework/base/src/org/ofbiz/base/util/UtilJavaParse.java
index ff20996..ba7b5a4 100644
--- a/framework/base/src/org/ofbiz/base/util/UtilJavaParse.java
+++ b/framework/base/src/org/ofbiz/base/util/UtilJavaParse.java
@@ -20,10 +20,9 @@
import java.io.File;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Set;
-import javolution.util.FastSet;
-
import org.ofbiz.base.component.ComponentConfig;
@@ -117,7 +116,8 @@
return nextClose;
}
- public static Set<String> serviceMethodNames = FastSet.newInstance();
+ // FIXME: Not thread safe
+ public static Set<String> serviceMethodNames = new HashSet<String>();
static {
serviceMethodNames.add("runSync");
serviceMethodNames.add("runSyncIgnore");
@@ -129,7 +129,7 @@
serviceMethodNames.add("addCommitService");
}
public static Set<String> findServiceCallsInBlock(int blockStart, int blockEnd, String javaFile) {
- Set<String> serviceNameSet = FastSet.newInstance();
+ Set<String> serviceNameSet = new HashSet<String>();
int dispatcherIndex = javaFile.indexOf("dispatcher.", blockStart+1);
while (dispatcherIndex > 0 && dispatcherIndex < blockEnd) {
@@ -154,7 +154,8 @@
return serviceNameSet;
}
- public static Set<String> entityMethodNames = FastSet.newInstance();
+ // FIXME: Not thread safe
+ public static Set<String> entityMethodNames = new HashSet<String>();
static {
entityMethodNames.add("getModelEntity");
entityMethodNames.add("getEntityGroupName");
@@ -197,7 +198,7 @@
entityMethodNames.add("findCountByCondition");
}
public static Set<String> findEntityUseInBlock(int blockStart, int blockEnd, String javaFile) {
- Set<String> entityNameSet = FastSet.newInstance();
+ Set<String> entityNameSet = new HashSet<String>();
int delegatorIndex = javaFile.indexOf("delegator.", blockStart+1);
while (delegatorIndex > 0 && delegatorIndex < blockEnd) {
diff --git a/framework/base/src/org/ofbiz/base/util/UtilProperties.java b/framework/base/src/org/ofbiz/base/util/UtilProperties.java
index e94d7bf..9a95146 100644
--- a/framework/base/src/org/ofbiz/base/util/UtilProperties.java
+++ b/framework/base/src/org/ofbiz/base/util/UtilProperties.java
@@ -29,9 +29,12 @@
import java.math.BigInteger;
import java.net.URL;
import java.text.MessageFormat;
+import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.HashSet;
import java.util.InvalidPropertiesFormatException;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -40,9 +43,6 @@
import java.util.ResourceBundle;
import java.util.Set;
-import javolution.util.FastList;
-import javolution.util.FastSet;
-
import org.ofbiz.base.location.FlexibleLocation;
import org.ofbiz.base.util.cache.UtilCache;
import org.ofbiz.base.util.collections.ResourceBundleMapWrapper;
@@ -78,7 +78,7 @@
protected static Locale fallbackLocale = null;
protected static Set<Locale> defaultCandidateLocales = null;
- protected static Set<String> propertiesNotFound = FastSet.newInstance();
+ protected static Set<String> propertiesNotFound = new HashSet<String>();
/** Compares the specified property to the compareString, returns true if they are the same, false otherwise
* @param resource The name of the resource - if the properties file is 'webevent.properties', the resource name is 'webevent'
@@ -658,7 +658,7 @@
return getMessage(resource, name, UtilGenerics.toMap(String.class, context), locale);
}
- protected static Set<String> resourceNotFoundMessagesShown = FastSet.newInstance();
+ protected static Set<String> resourceNotFoundMessagesShown = new HashSet<String>();
/** Returns the specified resource/properties file as a ResourceBundle
* @param resource The name of the resource - can be a file, class, or URL
* @param locale The locale that the given resource will correspond to
@@ -777,7 +777,7 @@
* @return A list of candidate locales.
*/
public static List<Locale> localeToCandidateList(Locale locale) {
- List<Locale> localeList = FastList.newInstance();
+ List<Locale> localeList = new LinkedList<Locale>();
localeList.add(locale);
String localeString = locale.toString();
int pos = localeString.lastIndexOf("_", localeString.length());
@@ -798,7 +798,7 @@
if (defaultCandidateLocales == null) {
synchronized (UtilProperties.class) {
if (defaultCandidateLocales == null) {
- defaultCandidateLocales = FastSet.newInstance();
+ defaultCandidateLocales = new HashSet<Locale>();
defaultCandidateLocales.addAll(localeToCandidateList(Locale.getDefault()));
defaultCandidateLocales.addAll(localeToCandidateList(getFallbackLocale()));
defaultCandidateLocales.add(Locale.ROOT);
@@ -822,11 +822,10 @@
if (Locale.ROOT.equals(locale)) {
return UtilMisc.toList(locale);
}
- Set<Locale> localeSet = FastSet.newInstance();
+ Set<Locale> localeSet = new HashSet<Locale>();
localeSet.addAll(localeToCandidateList(locale));
localeSet.addAll(getDefaultCandidateLocales());
- List<Locale> localeList = FastList.newInstance();
- localeList.addAll(localeSet);
+ List<Locale> localeList = new ArrayList<Locale>(localeSet);
return localeList;
}
@@ -1036,11 +1035,11 @@
if (bundle == null) {
synchronized (bundleCache) {
double startTime = System.currentTimeMillis();
- FastList<Locale> candidateLocales = (FastList<Locale>) getCandidateLocales(locale);
+ List<Locale> candidateLocales = (List<Locale>) getCandidateLocales(locale);
UtilResourceBundle parentBundle = null;
int numProperties = 0;
while (candidateLocales.size() > 0) {
- Locale candidateLocale = candidateLocales.removeLast();
+ Locale candidateLocale = candidateLocales.remove(candidateLocales.size() -1);
// ResourceBundles are connected together as a singly-linked list
String lookupName = createResourceName(resource, candidateLocale, true);
UtilResourceBundle lookupBundle = bundleCache.get(lookupName);
diff --git a/framework/base/src/org/ofbiz/base/util/UtilTimer.java b/framework/base/src/org/ofbiz/base/util/UtilTimer.java
index d92b839..515d694 100644
--- a/framework/base/src/org/ofbiz/base/util/UtilTimer.java
+++ b/framework/base/src/org/ofbiz/base/util/UtilTimer.java
@@ -18,7 +18,7 @@
*******************************************************************************/
package org.ofbiz.base.util;
-import javolution.util.FastMap;
+import java.util.concurrent.ConcurrentHashMap;
/**
* Timer handling utility
@@ -30,10 +30,7 @@
public class UtilTimer {
public static final String module = UtilTimer.class.getName();
- protected static FastMap<String, UtilTimer> staticTimers = FastMap.newInstance();
- static {
- staticTimers.setShared(true);
- }
+ protected static ConcurrentHashMap<String, UtilTimer> staticTimers = new ConcurrentHashMap<String, UtilTimer>();
protected String timerName = null;
protected String lastMessage = null;
diff --git a/framework/base/src/org/ofbiz/base/util/UtilXml.java b/framework/base/src/org/ofbiz/base/util/UtilXml.java
index 458c6a7..3d36f84 100644
--- a/framework/base/src/org/ofbiz/base/util/UtilXml.java
+++ b/framework/base/src/org/ofbiz/base/util/UtilXml.java
@@ -29,6 +29,7 @@
import java.io.Reader;
import java.io.Writer;
import java.net.URL;
+import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.regex.Matcher;
@@ -45,8 +46,6 @@
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
-import javolution.util.FastList;
-
import org.apache.xerces.parsers.DOMParser;
import org.apache.xerces.xni.Augmentations;
import org.apache.xerces.xni.NamespaceContext;
@@ -666,7 +665,7 @@
public static List<? extends Element> childElementList(Element element) {
if (element == null) return null;
- List<Element> elements = FastList.newInstance();
+ List<Element> elements = new LinkedList<Element>();
Node node = element.getFirstChild();
if (node != null) {
@@ -686,7 +685,7 @@
public static List<? extends Element> childElementList(Element element, String childElementName) {
if (element == null) return null;
- List<Element> elements = FastList.newInstance();
+ List<Element> elements = new LinkedList<Element>();
Node node = element.getFirstChild();
if (node != null) {
@@ -708,7 +707,7 @@
public static List<? extends Element> childElementList(Element element, Set<String> childElementNames) {
if (element == null) return null;
- List<Element> elements = FastList.newInstance();
+ List<Element> elements = new LinkedList<Element>();
if (childElementNames == null) return elements;
Node node = element.getFirstChild();
@@ -733,7 +732,7 @@
/** Return a List of Element objects that are children of the given DocumentFragment */
public static List<? extends Element> childElementList(DocumentFragment fragment) {
if (fragment == null) return null;
- List<Element> elements = FastList.newInstance();
+ List<Element> elements = new LinkedList<Element>();
Node node = fragment.getFirstChild();
if (node != null) {
do {
@@ -751,7 +750,7 @@
public static List<? extends Node> childNodeList(Node node) {
if (node == null) return null;
- List<Node> nodes = FastList.newInstance();
+ List<Node> nodes = new LinkedList<Node>();
do {
if (node.getNodeType() == Node.ELEMENT_NODE || node.getNodeType() == Node.COMMENT_NODE) {
diff --git a/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java b/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java
index fc1557d..67c9d03 100644
--- a/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java
+++ b/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java
@@ -23,8 +23,10 @@
import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.MissingResourceException;
@@ -37,8 +39,6 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
-import javolution.util.FastList;
-import javolution.util.FastMap;
import jdbm.helper.FastIterator;
import jdbm.htree.HTree;
@@ -475,7 +475,7 @@
public Collection<V> values() {
if (fileTable != null) {
- List<V> values = FastList.newInstance();
+ List<V> values = new LinkedList<V>();
try {
synchronized (this) {
FastIterator<V> iter = fileTable.values();
@@ -490,7 +490,7 @@
}
return values;
} else {
- List<V> valuesList = FastList.newInstance();
+ List<V> valuesList = new LinkedList<V>();
for (CacheLine<V> line: memoryTable.values()) {
valuesList.add(line.getValue());
}
@@ -896,7 +896,7 @@
}
private Map<String, Object> createLineInfo(int keyNum, K key, CacheLine<V> line) {
- Map<String, Object> lineInfo = FastMap.newInstance();
+ Map<String, Object> lineInfo = new HashMap<String, Object>();
lineInfo.put("elementKey", key);
if (line.getLoadTimeNanos() > 0) {
@@ -908,7 +908,7 @@
}
private Map<String, Object> createLineInfo(int keyNum, K key, V value) {
- Map<String, Object> lineInfo = FastMap.newInstance();
+ Map<String, Object> lineInfo = new HashMap<String, Object>();
lineInfo.put("elementKey", key);
lineInfo.put("lineSize", findSizeInBytes(value));
lineInfo.put("keyNum", keyNum);
@@ -916,7 +916,7 @@
}
public Collection<? extends Map<String, Object>> getLineInfos() {
- List<Map<String, Object>> lineInfos = FastList.newInstance();
+ List<Map<String, Object>> lineInfos = new LinkedList<Map<String, Object>>();
int keyIndex = 0;
for (K key: getCacheLineKeys()) {
Object nulledKey = fromKey(key);
diff --git a/framework/base/src/org/ofbiz/base/util/collections/GenericMapCollection.java b/framework/base/src/org/ofbiz/base/util/collections/GenericMapCollection.java
index c310466..ffaf865 100644
--- a/framework/base/src/org/ofbiz/base/util/collections/GenericMapCollection.java
+++ b/framework/base/src/org/ofbiz/base/util/collections/GenericMapCollection.java
@@ -20,11 +20,10 @@
import java.util.Collection;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import javolution.util.FastList;
-
public abstract class GenericMapCollection<K, V, M extends Map<K, V>, I> implements Collection<I> {
protected final M source;
@@ -87,7 +86,7 @@
}
public Object[] toArray() {
- List<I> list = FastList.newInstance();
+ List<I> list = new LinkedList<I>();
Iterator<I> it = iterator(false);
while (it.hasNext()) {
list.add(it.next());
@@ -96,7 +95,7 @@
}
public <T> T[] toArray(T[] array) {
- List<Object> list = FastList.newInstance();
+ List<Object> list = new LinkedList<Object>();
Iterator<I> it = iterator(false);
while (it.hasNext()) {
list.add(it.next());
diff --git a/framework/base/src/org/ofbiz/base/util/collections/MapContext.java b/framework/base/src/org/ofbiz/base/util/collections/MapContext.java
index 4f3dcd7..14269af 100644
--- a/framework/base/src/org/ofbiz/base/util/collections/MapContext.java
+++ b/framework/base/src/org/ofbiz/base/util/collections/MapContext.java
@@ -20,17 +20,14 @@
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
-import javolution.context.ObjectFactory;
-import javolution.lang.Reusable;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-import javolution.util.FastSet;
-
import org.ofbiz.base.util.UtilGenerics;
@@ -38,19 +35,12 @@
* Map Stack
*
*/
-public class MapContext<K, V> implements Map<K, V>, Reusable, LocalizedMap<V> {
+public class MapContext<K, V> implements Map<K, V>, LocalizedMap<V> {
public static final String module = MapContext.class.getName();
- protected static final ObjectFactory<MapContext<?, ?>> mapStackFactory = new ObjectFactory<MapContext<?, ?>>() {
- @Override
- protected MapContext<?, ?> create() {
- return new MapContext<Object, Object>();
- }
- };
-
public static final <K, V> MapContext<K, V> getMapContext() {
- return (MapContext<K, V>) UtilGenerics.<K, V>checkMap(mapStackFactory.object());
+ return new MapContext<K, V>();
}
public static <K, V> MapContext<K, V> createMapContext() {
@@ -82,15 +72,15 @@
super();
}
- protected List<Map<K, V>> stackList = FastList.newInstance();
+ protected List<Map<K, V>> stackList = new LinkedList<Map<K, V>>();
public void reset() {
- stackList = FastList.newInstance();
+ stackList = new LinkedList<Map<K, V>>();
}
/** Puts a new Map on the top of the stack */
public void push() {
- Map<K, V> newMap = FastMap.newInstance();
+ Map<K, V> newMap = new HashMap<K, V>();
this.stackList.add(0,newMap);
}
@@ -184,7 +174,7 @@
*/
public boolean containsValue(Object value) {
// walk the stackList and the entries for each Map and if nothing is in for the current key, consider it an option, otherwise ignore
- Set<K> resultKeySet = FastSet.newInstance();
+ Set<K> resultKeySet = new HashSet<K>();
for (Map<K, V> curMap: this.stackList) {
for (Map.Entry<K, V> curEntry: curMap.entrySet()) {
if (!resultKeySet.contains(curEntry.getKey())) {
@@ -277,7 +267,7 @@
*/
public Set<K> keySet() {
// walk the stackList and aggregate all keys
- Set<K> resultSet = FastSet.newInstance();
+ Set<K> resultSet = new HashSet<K>();
for (Map<K, V> curMap: this.stackList) {
resultSet.addAll(curMap.keySet());
}
@@ -289,8 +279,8 @@
*/
public Collection<V> values() {
// walk the stackList and the entries for each Map and if nothing is in for the current key, put it in
- Set<K> resultKeySet = FastSet.newInstance();
- List<V> resultValues = FastList.newInstance();
+ Set<K> resultKeySet = new HashSet<K>();
+ List<V> resultValues = new LinkedList<V>();
for (Map<K, V> curMap: this.stackList) {
for (Map.Entry<K, V> curEntry: curMap.entrySet()) {
if (!resultKeySet.contains(curEntry.getKey())) {
@@ -307,8 +297,8 @@
*/
public Set<Map.Entry<K, V>> entrySet() {
// walk the stackList and the entries for each Map and if nothing is in for the current key, put it in
- Set<K> resultKeySet = FastSet.newInstance();
- Set<Map.Entry<K, V>> resultEntrySet = FastSet.newInstance();
+ Set<K> resultKeySet = new HashSet<K>();
+ Set<Map.Entry<K, V>> resultEntrySet = new HashSet<Map.Entry<K, V>>();
for (Map<K, V> curMap: this.stackList) {
for (Map.Entry<K, V> curEntry: curMap.entrySet()) {
if (!resultKeySet.contains(curEntry.getKey())) {
diff --git a/framework/base/src/org/ofbiz/base/util/collections/MapStack.java b/framework/base/src/org/ofbiz/base/util/collections/MapStack.java
index 2274af4..fabc4d4 100644
--- a/framework/base/src/org/ofbiz/base/util/collections/MapStack.java
+++ b/framework/base/src/org/ofbiz/base/util/collections/MapStack.java
@@ -21,11 +21,7 @@
import java.util.Locale;
import java.util.Map;
-import javolution.context.ObjectFactory;
-
import org.ofbiz.base.util.Debug;
-import org.ofbiz.base.util.UtilGenerics;
-
/**
* Map Stack
@@ -35,19 +31,8 @@
public static final String module = MapStack.class.getName();
- protected static final ObjectFactory<MapStack<?>> mapStackFactory = new ObjectFactory<MapStack<?>>() {
- @Override
- protected MapStack<?> create() {
- return new MapStack<Object>();
- }
- };
-
- protected static final <K> MapStack<K> getMapStack() {
- return (MapStack<K>) UtilGenerics.<K, Object>checkMap(mapStackFactory.object());
- }
-
public static <K> MapStack<K> create() {
- MapStack<K> newValue = MapStack.getMapStack();
+ MapStack<K> newValue = new MapStack<K>();
// initialize with a single entry
newValue.push();
return newValue;
@@ -55,7 +40,7 @@
@SuppressWarnings("unchecked")
public static <K> MapStack<K> create(Map<K, Object> baseMap) {
- MapStack<K> newValue = MapStack.getMapStack();
+ MapStack<K> newValue = new MapStack<K>();
if (baseMap instanceof MapStack) {
newValue.stackList.addAll(((MapStack) baseMap).stackList);
} else {
@@ -66,7 +51,7 @@
/** Does a shallow copy of the internal stack of the passed MapStack; enables simultaneous stacks that share common parent Maps */
public static <K> MapStack<K> create(MapStack<K> source) {
- MapStack<K> newValue = MapStack.getMapStack();
+ MapStack<K> newValue = new MapStack<K>();
newValue.stackList.addAll(source.stackList);
return newValue;
}
diff --git a/framework/base/src/org/ofbiz/base/util/string/NodeELResolver.java b/framework/base/src/org/ofbiz/base/util/string/NodeELResolver.java
index 9f5c63b..d6c89c0 100644
--- a/framework/base/src/org/ofbiz/base/util/string/NodeELResolver.java
+++ b/framework/base/src/org/ofbiz/base/util/string/NodeELResolver.java
@@ -19,6 +19,7 @@
package org.ofbiz.base.util.string;
import java.beans.FeatureDescriptor;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -32,8 +33,6 @@
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
-import javolution.util.FastList;
-
import org.apache.xerces.dom.NodeImpl;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.cache.UtilCache;
@@ -103,7 +102,7 @@
} else if (nodeList.getLength() == 1) {
result = nodeList.item(0);
} else {
- List<Node> newList = FastList.newInstance();
+ List<Node> newList = new ArrayList<Node>(nodeList.getLength());
for (int i = 0; i < nodeList.getLength(); i++) {
newList.add(nodeList.item(i));
}
diff --git a/framework/base/src/org/ofbiz/base/util/string/UelFunctions.java b/framework/base/src/org/ofbiz/base/util/string/UelFunctions.java
index 9137f4a..af30add 100644
--- a/framework/base/src/org/ofbiz/base/util/string/UelFunctions.java
+++ b/framework/base/src/org/ofbiz/base/util/string/UelFunctions.java
@@ -28,6 +28,7 @@
import java.sql.Timestamp;
import java.text.DateFormat;
import java.util.Collection;
+import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
@@ -36,8 +37,6 @@
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamSource;
-import javolution.util.FastMap;
-
import org.cyberneko.html.parsers.DOMParser;
import org.ofbiz.base.location.FlexibleLocation;
import org.ofbiz.base.util.Debug;
@@ -165,7 +164,7 @@
}
protected static class Functions extends FunctionMapper {
- protected final Map<String, Method> functionMap = FastMap.newInstance();
+ protected final Map<String, Method> functionMap = new HashMap<String, Method>();
public Functions() {
try {
this.functionMap.put("date:second", UtilDateTime.class.getMethod("getSecond", Timestamp.class, TimeZone.class, Locale.class));
@@ -305,7 +304,7 @@
return dateFormat.format(stamp);
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
public static int getSize(Object obj) {
try {
Map map = (Map) obj;
diff --git a/framework/base/src/org/ofbiz/base/util/string/UelUtil.java b/framework/base/src/org/ofbiz/base/util/string/UelUtil.java
index 0ffa2ea..5e4917e 100644
--- a/framework/base/src/org/ofbiz/base/util/string/UelUtil.java
+++ b/framework/base/src/org/ofbiz/base/util/string/UelUtil.java
@@ -19,6 +19,8 @@
package org.ofbiz.base.util.string;
import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -38,9 +40,6 @@
import javax.el.ValueExpression;
import javax.el.VariableMapper;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilGenerics;
@@ -453,6 +452,7 @@
* @param property Property <code>Object</code> to be evaluated
* @return New <code>List</code> or <code>Map</code>
*/
+ @SuppressWarnings("rawtypes")
public static Object autoVivifyListOrMap(Object property) {
String str = property.toString();
boolean isList = ("add".equals(str) || str.startsWith("insert@"));
@@ -461,9 +461,9 @@
isList = (index != null);
}
if (isList) {
- return FastList.newInstance();
+ return new LinkedList();
} else {
- return FastMap.newInstance();
+ return new HashMap();
}
}
diff --git a/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java b/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java
index 4b3e2de..60022fd 100644
--- a/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java
+++ b/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java
@@ -31,7 +31,9 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration;
+import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -42,9 +44,6 @@
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.location.FlexibleLocation;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
@@ -474,7 +473,7 @@
public static void checkForLoop(String path, Map<String, Object> ctx) throws IOException {
List<String> templateList = UtilGenerics.checkList(ctx.get("templateList"));
if (templateList == null) {
- templateList = FastList.newInstance();
+ templateList = new LinkedList<String>();
} else {
if (templateList.contains(path)) {
throw new IOException(path + " has already been visited.");
@@ -485,7 +484,7 @@
}
public static Map<String, Object> createEnvironmentMap(Environment env) {
- Map<String, Object> templateRoot = FastMap.newInstance();
+ Map<String, Object> templateRoot = new HashMap<String, Object>();
Set<String> varNames = null;
try {
varNames = UtilGenerics.checkSet(env.getKnownVariableNames());
@@ -517,7 +516,7 @@
}
public static Map<String, Object> saveValues(Map<String, Object> context, String [] saveKeyNames) {
- Map<String, Object> saveMap = FastMap.newInstance();
+ Map<String, Object> saveMap = new HashMap<String, Object>();
for (String key: saveKeyNames) {
Object o = context.get(key);
if (o instanceof Map<?, ?>) {
diff --git a/framework/common/src/org/ofbiz/common/CommonEvents.java b/framework/common/src/org/ofbiz/common/CommonEvents.java
index c6027d8..72c7b44 100644
--- a/framework/common/src/org/ofbiz/common/CommonEvents.java
+++ b/framework/common/src/org/ofbiz/common/CommonEvents.java
@@ -30,6 +30,7 @@
import java.io.Writer;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -40,7 +41,6 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import javolution.util.FastMap;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.StringUtils;
@@ -167,7 +167,7 @@
String followerSessionId = request.getParameter("followerSid");
String followSessionId = request.getParameter("followSid");
Map<String, String> follow = appletSessions.get(followSessionId);
- if (follow == null) follow = FastMap.newInstance();
+ if (follow == null) follow = new LinkedHashMap<String, String>();
String followerListStr = follow.get("followers");
if (followerListStr == null) {
followerListStr = followerSessionId;
@@ -189,7 +189,7 @@
String followerSessionId = request.getParameter("followerSid");
String pageUrl = request.getParameter("pageUrl");
Map<String, String> follow = appletSessions.get(followerSessionId);
- if (follow == null) follow = FastMap.newInstance();
+ if (follow == null) follow = new LinkedHashMap<String, String>();
follow.put("followPage", pageUrl);
appletSessions.put(followerSessionId, follow);
}
diff --git a/framework/common/src/org/ofbiz/common/CommonServices.java b/framework/common/src/org/ofbiz/common/CommonServices.java
index 0e63acd..73f2a59 100644
--- a/framework/common/src/org/ofbiz/common/CommonServices.java
+++ b/framework/common/src/org/ofbiz/common/CommonServices.java
@@ -33,6 +33,8 @@
import java.nio.ByteBuffer;
import java.sql.Timestamp;
import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -41,9 +43,6 @@
import javax.mail.internet.MimeMessage;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.metrics.Metrics;
import org.ofbiz.base.metrics.MetricsFactory;
import org.ofbiz.base.util.Debug;
@@ -112,7 +111,7 @@
Delegator delegator = dctx.getDelegator();
Map<String, Object> response = ServiceUtil.returnSuccess();
- List<GenericValue> testingNodes = FastList.newInstance();
+ List<GenericValue> testingNodes = new LinkedList<GenericValue>();
for (int i = 0; i < 3; i ++) {
GenericValue testingNode = delegator.makeValue("TestingNode");
testingNode.put("testingNodeId", "TESTING_NODE" + i);
@@ -227,7 +226,7 @@
* This service does not have required parameters and does not validate
*/
public static Map<String, Object> echoService(DispatchContext dctx, Map<String, ?> context) {
- Map<String, Object> result = FastMap.newInstance();
+ Map<String, Object> result = new LinkedHashMap<String, Object>();
result.putAll(context);
result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
return result;
@@ -387,7 +386,7 @@
String fileName = (String) context.get("_uploadFile_fileName");
String contentType = (String) context.get("_uploadFile_contentType");
- Map<String, Object> createCtx = FastMap.newInstance();
+ Map<String, Object> createCtx = new LinkedHashMap<String, Object>();
createCtx.put("binData", array);
createCtx.put("dataResourceTypeId", "OFBIZ_FILE");
createCtx.put("dataResourceName", fileName);
@@ -409,7 +408,7 @@
GenericValue dataResource = (GenericValue) createResp.get("dataResource");
if (dataResource != null) {
- Map<String, Object> contentCtx = FastMap.newInstance();
+ Map<String, Object> contentCtx = new LinkedHashMap<String, Object>();
contentCtx.put("dataResourceId", dataResource.getString("dataResourceId"));
contentCtx.put("localeString", ((Locale) context.get("locale")).toString());
contentCtx.put("contentTypeId", "DOCUMENT");
@@ -523,10 +522,10 @@
}
public static Map<String, Object> getAllMetrics(DispatchContext dctx, Map<String, ?> context) {
- List<Map<String, Object>> metricsMapList = FastList.newInstance();
+ List<Map<String, Object>> metricsMapList = new LinkedList<Map<String, Object>>();
Collection<Metrics> metricsList = MetricsFactory.getMetrics();
for (Metrics metrics : metricsList) {
- Map<String, Object> metricsMap = FastMap.newInstance();
+ Map<String, Object> metricsMap = new LinkedHashMap<String, Object>();
metricsMap.put("name", metrics.getName());
metricsMap.put("serviceRate", metrics.getServiceRate());
metricsMap.put("threshold", metrics.getThreshold());
diff --git a/framework/common/src/org/ofbiz/common/CommonWorkers.java b/framework/common/src/org/ofbiz/common/CommonWorkers.java
index 774038b..2639073 100644
--- a/framework/common/src/org/ofbiz/common/CommonWorkers.java
+++ b/framework/common/src/org/ofbiz/common/CommonWorkers.java
@@ -18,9 +18,9 @@
*******************************************************************************/
package org.ofbiz.common;
+import java.util.LinkedList;
import java.util.List;
-
-import javolution.util.FastList;
+import java.util.Map;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
@@ -45,7 +45,7 @@
public final static String module = CommonWorkers.class.getName();
public static List<GenericValue> getCountryList(Delegator delegator) {
- List<GenericValue> geoList = FastList.newInstance();
+ List<GenericValue> geoList = new LinkedList<GenericValue>();
String defaultCountry = EntityUtilProperties.getPropertyValue("general.properties", "country.geo.id.default", delegator);
GenericValue defaultGeo = null;
if (UtilValidate.isNotEmpty(defaultCountry)) {
@@ -63,7 +63,7 @@
exprs.add(EntityCondition.makeCondition("geoId", EntityOperator.IN, countriesAvailable));
}
- List<GenericValue> countriesList = FastList.newInstance();
+ List<GenericValue> countriesList = new LinkedList<GenericValue>();
try {
countriesList = delegator.findList("Geo", EntityCondition.makeCondition(exprs), null, UtilMisc.toList("geoName"), null, true);
} catch (GenericEntityException e) {
@@ -90,7 +90,7 @@
}
public static List<GenericValue> getStateList(Delegator delegator) {
- List<GenericValue> geoList = FastList.newInstance();
+ List<GenericValue> geoList = new LinkedList<GenericValue>();
EntityCondition condition = EntityCondition.makeCondition(EntityOperator.OR, EntityCondition.makeCondition("geoTypeId", "STATE"), EntityCondition.makeCondition("geoTypeId", "PROVINCE"), EntityCondition.makeCondition("geoTypeId", "TERRITORY"),
EntityCondition.makeCondition("geoTypeId", "MUNICIPALITY"));
List<String> sortList = UtilMisc.toList("geoName");
@@ -120,7 +120,7 @@
}
List<String> sortList = UtilMisc.toList(listOrderBy);
- List<GenericValue> geoList = FastList.newInstance();
+ List<GenericValue> geoList = new LinkedList<GenericValue>();
try {
// Check if the country is a country group and get recursively the
// states
diff --git a/framework/common/src/org/ofbiz/common/FindServices.java b/framework/common/src/org/ofbiz/common/FindServices.java
index 8c24a19..71ca1e5 100644
--- a/framework/common/src/org/ofbiz/common/FindServices.java
+++ b/framework/common/src/org/ofbiz/common/FindServices.java
@@ -23,15 +23,14 @@
import java.sql.Timestamp;
import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-import javolution.util.FastSet;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.ObjectType;
import org.ofbiz.base.util.StringUtil;
@@ -70,7 +69,7 @@
public static Map<String, EntityComparisonOperator<?, ?>> entityOperators;
static {
- entityOperators = FastMap.newInstance();
+ entityOperators = new LinkedHashMap<String, EntityComparisonOperator<?, ?>>();
entityOperators.put("between", EntityOperator.BETWEEN);
entityOperators.put("equals", EntityOperator.EQUALS);
entityOperators.put("greaterThan", EntityOperator.GREATER_THAN);
@@ -110,7 +109,7 @@
// Note that "normalizedFields" will contain values other than those
// Contained in the associated entity.
// Those extra fields will be ignored in the second half of this method.
- Map<String, Map<String, Map<String, Object>>> normalizedFields = FastMap.newInstance();
+ Map<String, Map<String, Map<String, Object>>> normalizedFields = new LinkedHashMap<String, Map<String, Map<String, Object>>>();
//StringBuffer queryStringBuf = new StringBuffer();
for (String fieldNameRaw: inputFields.keySet()) { // The name as it appeas in the HTML form
String fieldNameRoot = null; // The entity field name. Everything to the left of the first "_" if
@@ -182,19 +181,19 @@
}
subMap = normalizedFields.get(fieldNameRoot);
if (subMap == null) {
- subMap = FastMap.newInstance();
+ subMap = new LinkedHashMap<String, Map<String, Object>>();
normalizedFields.put(fieldNameRoot, subMap);
}
subMap2 = subMap.get(fieldPair);
if (subMap2 == null) {
- subMap2 = FastMap.newInstance();
+ subMap2 = new LinkedHashMap<String, Object>();
subMap.put(fieldPair, subMap2);
}
subMap2.put(fieldMode, fieldValue);
List<Object[]> origList = origValueMap.get(fieldNameRoot);
if (origList == null) {
- origList = FastList.newInstance();
+ origList = new LinkedList<Object[]>();
origValueMap.put(fieldNameRoot, origList);
}
Object [] origValues = {fieldNameRaw, fieldValue};
@@ -214,13 +213,13 @@
* @return returns an EntityCondition list
*/
public static List<EntityCondition> createConditionList(Map<String, ? extends Object> parameters, List<ModelField> fieldList, Map<String, Object> queryStringMap, Delegator delegator, Map<String, ?> context) {
- Set<String> processed = FastSet.newInstance();
- Set<String> keys = FastSet.newInstance();
- Map<String, ModelField> fieldMap = FastMap.newInstance();
+ Set<String> processed = new LinkedHashSet<String>();
+ Set<String> keys = new LinkedHashSet<String>();
+ Map<String, ModelField> fieldMap = new LinkedHashMap<String, ModelField>();
for (ModelField modelField : fieldList) {
fieldMap.put(modelField.getName(), modelField);
}
- List<EntityCondition> result = FastList.newInstance();
+ List<EntityCondition> result = new LinkedList<EntityCondition>();
for (Map.Entry<String, ? extends Object> entry : parameters.entrySet()) {
String parameterName = entry.getKey();
if (processed.contains(parameterName)) {
@@ -365,7 +364,7 @@
Object fieldValue = null; // If it is a "value" field, it will be the value to be used in the query.
// If it is an "op" field, it will be "equals", "greaterThan", etc.
EntityCondition cond = null;
- List<EntityCondition> tmpList = FastList.newInstance();
+ List<EntityCondition> tmpList = new LinkedList<EntityCondition>();
String opString = null;
boolean ignoreCase = false;
List<ModelField> fields = modelEntity.getFieldsUnmodifiable();
@@ -548,7 +547,7 @@
}
Timestamp filterByDateValue = (Timestamp) context.get("filterByDateValue");
- Map<String, Object> queryStringMap = FastMap.newInstance();
+ Map<String, Object> queryStringMap = new LinkedHashMap<String, Object>();
Delegator delegator = dctx.getDelegator();
ModelEntity modelEntity = delegator.getModelEntity(entityName);
List<EntityCondition> tmpList = createConditionList(inputFields, modelEntity.getFieldsUnmodifiable(), queryStringMap, delegator, context);
@@ -665,7 +664,7 @@
// Contained in the associated entity.
// Those extra fields will be ignored in the second half of this method.
ModelEntity modelEntity = delegator.getModelEntity(entityName);
- Map<String, Object> normalizedFields = FastMap.newInstance();
+ Map<String, Object> normalizedFields = new LinkedHashMap<String, Object>();
//StringBuffer queryStringBuf = new StringBuffer();
for (String fieldNameRaw: inputFields.keySet()) { // The name as it appeas in the HTML form
String fieldNameRoot = null; // The entity field name. Everything to the left of the first "_" if
diff --git a/framework/common/src/org/ofbiz/common/FtpServices.java b/framework/common/src/org/ofbiz/common/FtpServices.java
index 22d33c3..e0b86eb 100644
--- a/framework/common/src/org/ofbiz/common/FtpServices.java
+++ b/framework/common/src/org/ofbiz/common/FtpServices.java
@@ -25,12 +25,11 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import javolution.util.FastList;
-
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;
@@ -60,7 +59,7 @@
Debug.logError(ioe, "[putFile] Problem opening local file", module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "CommonFtpFileCannotBeOpen", locale));
}
- List<String> errorList = FastList.newInstance();
+ List<String> errorList = new LinkedList<String>();
FTPClient ftp = new FTPClient();
try {
Integer defaultTimeout = (Integer) context.get("defaultTimeout");
@@ -145,7 +144,7 @@
Debug.logError(ioe, "[getFile] Problem opening local file", module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "CommonFtpFileCannotBeOpen", locale));
}
- List<String> errorList = FastList.newInstance();
+ List<String> errorList = new LinkedList<String>();
FTPClient ftp = new FTPClient();
try {
Integer defaultTimeout = (Integer) context.get("defaultTimeout");
diff --git a/framework/common/src/org/ofbiz/common/JsLanguageFileMappingCreator.java b/framework/common/src/org/ofbiz/common/JsLanguageFileMappingCreator.java
index 257052b..2167f00 100644
--- a/framework/common/src/org/ofbiz/common/JsLanguageFileMappingCreator.java
+++ b/framework/common/src/org/ofbiz/common/JsLanguageFileMappingCreator.java
@@ -23,12 +23,11 @@
import java.io.StringWriter;
import java.io.Writer;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import javolution.util.FastMap;
-
import org.apache.commons.io.FileUtils;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.FileUtil;
@@ -48,10 +47,10 @@
String encoding = (String) context.get("encoding"); // default value: UTF-8
List<Locale> localeList = UtilMisc.availableLocales();
- Map<String, Object> jQueryLocaleFile = FastMap.newInstance();
- Map<String, String> dateJsLocaleFile = FastMap.newInstance();
- Map<String, String> validationLocaleFile = FastMap.newInstance();
- Map<String, String> dateTimePickerLocaleFile = FastMap.newInstance();
+ Map<String, Object> jQueryLocaleFile = new LinkedHashMap<String, Object>();
+ Map<String, String> dateJsLocaleFile = new LinkedHashMap<String, String>();
+ Map<String, String> validationLocaleFile = new LinkedHashMap<String, String>();
+ Map<String, String> dateTimePickerLocaleFile = new LinkedHashMap<String, String>();
// setup some variables to locate the js files
String componentRoot = "component://images/webapp";
diff --git a/framework/common/src/org/ofbiz/common/JsLanguageFilesMapping.java b/framework/common/src/org/ofbiz/common/JsLanguageFilesMapping.java
index 90f01e2..fc5d650 100644
--- a/framework/common/src/org/ofbiz/common/JsLanguageFilesMapping.java
+++ b/framework/common/src/org/ofbiz/common/JsLanguageFilesMapping.java
@@ -20,10 +20,9 @@
package org.ofbiz.common;
+import java.util.LinkedHashMap;
import java.util.Map;
-import javolution.util.FastMap;
-
public final class JsLanguageFilesMapping {
@@ -32,7 +31,7 @@
public static class datejs {
- private static Map<String, String> localeFiles = FastMap.newInstance();
+ private static Map<String, String> localeFiles = new LinkedHashMap<String, String>();
private static String defaultDateJs = "/images/jquery/plugins/datejs/date-en-US.js";
static {
@@ -200,7 +199,7 @@
}
public static class jquery {
- private static Map<String, String> localeFiles = FastMap.newInstance();
+ private static Map<String, String> localeFiles = new LinkedHashMap<String, String>();
private static String defaultDateJs = "/images/jquery/ui/i18n/jquery.ui.datepicker-en.js";
static {
@@ -368,7 +367,7 @@
}
public static class validation {
- private static Map<String, String> localeFiles = FastMap.newInstance();
+ private static Map<String, String> localeFiles = new LinkedHashMap<String, String>();
private static String defaultValidation = "/images/webapp/images/jquery/plugins/validate/localization/messages_en.js";
static {
@@ -535,7 +534,7 @@
}
public static class dateTime {
- private static Map<String, String> localeFiles = FastMap.newInstance();
+ private static Map<String, String> localeFiles = new LinkedHashMap<String, String>();
private static String defaultDateTime = "/images/webapp/images/jquery/ui/i18n/jquery.ui.datepicker-en.js";
static {
diff --git a/framework/common/src/org/ofbiz/common/KeywordSearchUtil.java b/framework/common/src/org/ofbiz/common/KeywordSearchUtil.java
index c4529bb..df50c87 100644
--- a/framework/common/src/org/ofbiz/common/KeywordSearchUtil.java
+++ b/framework/common/src/org/ofbiz/common/KeywordSearchUtil.java
@@ -19,14 +19,13 @@
package org.ofbiz.common;
import java.util.HashSet;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
@@ -209,7 +208,7 @@
}
public static Set<String> fixKeywordsForSearch(Set<String> keywordSet, boolean anyPrefix, boolean anySuffix, boolean removeStems, boolean isAnd) {
- Map<String, Long> keywords = FastMap.newInstance();
+ Map<String, Long> keywords = new LinkedHashMap<String, Long>();
fixupKeywordSet(keywordSet, keywords, getStopWordBagAnd(), getStopWordBagOr(), removeStems, getStemSet(), true, anyPrefix, anySuffix, isAnd);
return keywords.keySet();
}
diff --git a/framework/common/src/org/ofbiz/common/email/EmailServices.java b/framework/common/src/org/ofbiz/common/email/EmailServices.java
index b4a2a34..b04ddb3 100644
--- a/framework/common/src/org/ofbiz/common/email/EmailServices.java
+++ b/framework/common/src/org/ofbiz/common/email/EmailServices.java
@@ -31,6 +31,8 @@
import java.net.URL;
import java.security.Security;
import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -50,9 +52,6 @@
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.stream.StreamSource;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.MimeConstants;
import org.ofbiz.base.util.Debug;
@@ -334,7 +333,7 @@
} catch (SendFailedException e) {
// message code prefix may be used by calling services to determine the cause of the failure
Debug.logError(e, "[ADDRERR] Address error when sending message to [" + sendTo + "] from [" + sendFrom + "] cc [" + sendCc + "] bcc [" + sendBcc + "] subject [" + subject + "]", module);
- List<SMTPAddressFailedException> failedAddresses = FastList.newInstance();
+ List<SMTPAddressFailedException> failedAddresses = new LinkedList<SMTPAddressFailedException>();
Exception nestedException = null;
while ((nestedException = e.getNextException()) != null && nestedException instanceof MessagingException) {
if (nestedException instanceof SMTPAddressFailedException) {
@@ -430,8 +429,8 @@
List<String> xslfoAttachScreenLocationListParam = UtilGenerics.checkList(serviceContext.remove("xslfoAttachScreenLocationList"));
List<String> attachmentNameListParam = UtilGenerics.checkList(serviceContext.remove("attachmentNameList"));
- List<String> xslfoAttachScreenLocationList = FastList.newInstance();
- List<String> attachmentNameList = FastList.newInstance();
+ List<String> xslfoAttachScreenLocationList = new LinkedList<String>();
+ List<String> attachmentNameList = new LinkedList<String>();
if (UtilValidate.isNotEmpty(xslfoAttachScreenLocationParam)) xslfoAttachScreenLocationList.add(xslfoAttachScreenLocationParam);
if (UtilValidate.isNotEmpty(attachmentNameParam)) attachmentNameList.add(attachmentNameParam);
if (UtilValidate.isNotEmpty(xslfoAttachScreenLocationListParam)) xslfoAttachScreenLocationList.addAll(xslfoAttachScreenLocationListParam);
@@ -488,7 +487,7 @@
// check if attachment screen location passed in
if (UtilValidate.isNotEmpty(xslfoAttachScreenLocationList)) {
- List<Map<String, ? extends Object>> bodyParts = FastList.newInstance();
+ List<Map<String, ? extends Object>> bodyParts = new LinkedList<Map<String, ? extends Object>>();
if (bodyText != null) {
bodyText = FlexibleStringExpander.expandString(bodyText, screenContext, locale);
bodyParts.add(UtilMisc.<String, Object>toMap("content", bodyText, "type", "text/html"));
@@ -636,7 +635,7 @@
public static void sendFailureNotification(DispatchContext dctx, Map<String, ? extends Object> context, MimeMessage message, List<SMTPAddressFailedException> failures) {
Locale locale = (Locale) context.get("locale");
- Map<String, Object> newContext = FastMap.newInstance();
+ Map<String, Object> newContext = new LinkedHashMap<String, Object>();
newContext.put("userLogin", context.get("userLogin"));
newContext.put("sendFailureNotification", false);
newContext.put("sendFrom", context.get("sendFrom"));
@@ -653,9 +652,9 @@
}
sb.append(UtilProperties.getMessage(resource, "CommonEmailDeliveryOriginalMessage", locale));
sb.append("/n/n");
- List<Map<String, Object>> bodyParts = FastList.newInstance();
+ List<Map<String, Object>> bodyParts = new LinkedList<Map<String, Object>>();
bodyParts.add(UtilMisc.<String, Object>toMap("content", sb.toString(), "type", "text/plain"));
- Map<String, Object> bodyPart = FastMap.newInstance();
+ Map<String, Object> bodyPart = new LinkedHashMap<String, Object>();
bodyPart.put("content", sb.toString());
bodyPart.put("type", "text/plain");
try {
diff --git a/framework/common/src/org/ofbiz/common/email/NotificationServices.java b/framework/common/src/org/ofbiz/common/email/NotificationServices.java
index d608d79..44fe28f 100644
--- a/framework/common/src/org/ofbiz/common/email/NotificationServices.java
+++ b/framework/common/src/org/ofbiz/common/email/NotificationServices.java
@@ -22,11 +22,10 @@
import java.io.StringWriter;
import java.io.Writer;
import java.net.URL;
+import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;
-import javolution.util.FastMap;
-
import org.ofbiz.base.component.ComponentConfig.WebappInfo;
import org.ofbiz.base.location.FlexibleLocation;
import org.ofbiz.base.util.Debug;
@@ -143,7 +142,7 @@
// make sure we have a valid body before sending
if (body != null) {
// retain only the required attributes for the sendMail service
- Map<String, Object> emailContext = FastMap.newInstance();
+ Map<String, Object> emailContext = new LinkedHashMap<String, Object>();
emailContext.put("sendTo", context.get("sendTo"));
emailContext.put("body", body);
emailContext.put("sendCc", context.get("sendCc"));
@@ -191,7 +190,7 @@
Locale locale = (Locale) context.get("locale");
Map<String, Object> result = null;
if (templateData == null) {
- templateData = FastMap.newInstance();
+ templateData = new LinkedHashMap<String, Object>();
}
try {
diff --git a/framework/common/src/org/ofbiz/common/geo/GeoWorker.java b/framework/common/src/org/ofbiz/common/geo/GeoWorker.java
index b5b7594..8c5fbeb 100644
--- a/framework/common/src/org/ofbiz/common/geo/GeoWorker.java
+++ b/framework/common/src/org/ofbiz/common/geo/GeoWorker.java
@@ -18,12 +18,11 @@
*******************************************************************************/
package org.ofbiz.common.geo;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilValidate;
@@ -52,7 +51,7 @@
public static List<GenericValue> expandGeoGroup(GenericValue geo) {
if (geo == null) {
- return FastList.newInstance();
+ return new LinkedList<GenericValue>();
}
if (!"GROUP".equals(geo.getString("geoTypeId"))) {
return UtilMisc.toList(geo);
@@ -60,7 +59,7 @@
//Debug.logInfo("Expanding geo : " + geo, module);
- List<GenericValue> geoList = FastList.newInstance();
+ List<GenericValue> geoList = new LinkedList<GenericValue>();
List<GenericValue> thisGeoAssoc = null;
try {
thisGeoAssoc = geo.getRelated("AssocGeoAssoc", UtilMisc.toMap("geoAssocTypeId", "GROUP_MEMBER"), null, false);
@@ -90,7 +89,7 @@
if (UtilValidate.isEmpty(geoIdByTypeMapOrig)) {
return geoIdByTypeMapOrig;
}
- Map<String, String> geoIdByTypeMapTemp = FastMap.newInstance();
+ Map<String, String> geoIdByTypeMapTemp = new LinkedHashMap<String, String>();
for (Map.Entry<String, String> geoIdByTypeEntry: geoIdByTypeMapOrig.entrySet()) {
List<GenericValue> geoAssocList = delegator.findByAnd("GeoAssoc", UtilMisc.toMap("geoIdTo", geoIdByTypeEntry.getValue(), "geoAssocTypeId", "REGIONS"), null, true);
for (GenericValue geoAssoc: geoAssocList) {
@@ -99,7 +98,7 @@
}
}
geoIdByTypeMapTemp = expandGeoRegionDeep(geoIdByTypeMapTemp, delegator);
- Map<String, String> geoIdByTypeMapNew = FastMap.newInstance();
+ Map<String, String> geoIdByTypeMapNew = new LinkedHashMap<String, String>();
// add the temp Map first, then the original over top of it, ie give the original priority over the sub/expanded values
geoIdByTypeMapNew.putAll(geoIdByTypeMapTemp);
geoIdByTypeMapNew.putAll(geoIdByTypeMapOrig);
diff --git a/framework/common/src/org/ofbiz/common/image/ImageTransform.java b/framework/common/src/org/ofbiz/common/image/ImageTransform.java
index 7d50f0e..57ba893 100644
--- a/framework/common/src/org/ofbiz/common/image/ImageTransform.java
+++ b/framework/common/src/org/ofbiz/common/image/ImageTransform.java
@@ -24,6 +24,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -32,14 +33,10 @@
import javax.swing.ImageIcon;
import javax.xml.parsers.ParserConfigurationException;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.UtilXml;
-
import org.xml.sax.SAXException;
-
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -73,7 +70,7 @@
/* VARIABLES */
BufferedImage bufImg;
- Map<String, Object> result = FastMap.newInstance();
+ Map<String, Object> result = new LinkedHashMap<String, Object>();
/* BUFFERED IMAGE */
try {
@@ -113,7 +110,7 @@
/* VARIABLES */
BufferedImage bufNewImg;
double defaultHeight, defaultWidth, scaleFactor;
- Map<String, Object> result = FastMap.newInstance();
+ Map<String, Object> result = new LinkedHashMap<String, Object>();
/* DIMENSIONS from ImageProperties */
// A missed dimension is authorized
@@ -220,8 +217,8 @@
/* VARIABLES */
Document document;
Element rootElt;
- Map<String, Map<String, String>> valueMap = FastMap.newInstance();
- Map<String, Object> result = FastMap.newInstance();
+ Map<String, Map<String, String>> valueMap = new LinkedHashMap<String, Map<String, String>>();
+ Map<String, Object> result = new LinkedHashMap<String, Object>();
/* PARSING */
try {
@@ -255,10 +252,10 @@
/* get NAME and VALUE */
List<? extends Element> children = UtilXml.childElementList(rootElt); // FIXME : despite upgrading to jdom 1.1, it seems that getChildren is pre 1.5 java code (ie getChildren does not retun List<Element> but only List)
for (Element currentElt : children) {
- Map<String, String> eltMap = FastMap.newInstance();
+ Map<String, String> eltMap = new LinkedHashMap<String, String>();
List<? extends Element> children2 = UtilXml.childElementList(currentElt);
if (children2.size() > 0) {
- Map<String, String> childMap = FastMap.newInstance();
+ Map<String, String> childMap = new LinkedHashMap<String, String>();
// loop over Children 1st level
for (Element currentChild : children2) {
childMap.put(currentChild.getAttribute("name"), currentChild.getAttribute("value"));
diff --git a/framework/common/src/org/ofbiz/common/login/LoginServices.java b/framework/common/src/org/ofbiz/common/login/LoginServices.java
index e53748e..2ea42b2 100644
--- a/framework/common/src/org/ofbiz/common/login/LoginServices.java
+++ b/framework/common/src/org/ofbiz/common/login/LoginServices.java
@@ -20,6 +20,8 @@
package org.ofbiz.common.login;
import java.sql.Timestamp;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -28,9 +30,6 @@
import javax.transaction.Transaction;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.crypto.HashCrypt;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
@@ -91,7 +90,7 @@
}
}
- Map<String, Object> result = FastMap.newInstance();
+ Map<String, Object> result = new LinkedHashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
boolean useEncryption = "true".equals(UtilProperties.getPropertyValue("security.properties", "password.encrypt"));
@@ -469,11 +468,11 @@
*@return Map with the result of the service, the output parameters
*/
public static Map<String, Object> createUserLogin(DispatchContext ctx, Map<String, ?> context) {
- Map<String, Object> result = FastMap.newInstance();
+ Map<String, Object> result = new LinkedHashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
Security security = ctx.getSecurity();
GenericValue loggedInUserLogin = (GenericValue) context.get("userLogin");
- List<String> errorMessageList = FastList.newInstance();
+ List<String> errorMessageList = new LinkedList<String>();
Locale locale = (Locale) context.get("locale");
boolean useEncryption = "true".equals(UtilProperties.getPropertyValue("security.properties", "password.encrypt"));
@@ -653,7 +652,7 @@
newPasswordVerify = newPasswordVerify.toLowerCase();
}
- List<String> errorMessageList = FastList.newInstance();
+ List<String> errorMessageList = new LinkedList<String>();
if (newPassword != null) {
checkNewPassword(userLoginToUpdate, currentPassword, newPassword, newPasswordVerify,
passwordHint, errorMessageList, adminUser, locale);
@@ -701,10 +700,10 @@
*@return Map with the result of the service, the output parameters
*/
public static Map<String, Object> updateUserLoginId(DispatchContext ctx, Map<String, ?> context) {
- Map<String, Object> result = FastMap.newInstance();
+ Map<String, Object> result = new LinkedHashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
GenericValue loggedInUserLogin = (GenericValue) context.get("userLogin");
- List<String> errorMessageList = FastList.newInstance();
+ List<String> errorMessageList = new LinkedList<String>();
Locale locale = (Locale) context.get("locale");
//boolean useEncryption = "true".equals(UtilProperties.getPropertyValue("security.properties", "password.encrypt"));
@@ -813,7 +812,7 @@
*@return Map with the result of the service, the output parameters
*/
public static Map<String, Object> updateUserLoginSecurity(DispatchContext ctx, Map<String, ?> context) {
- Map<String, Object> result = FastMap.newInstance();
+ Map<String, Object> result = new LinkedHashMap<String, Object>();
Delegator delegator = ctx.getDelegator();
Security security = ctx.getSecurity();
GenericValue loggedInUserLogin = (GenericValue) context.get("userLogin");
diff --git a/framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java b/framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java
index dde669f..ce5ccbf 100644
--- a/framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java
+++ b/framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java
@@ -18,11 +18,10 @@
*******************************************************************************/
package org.ofbiz.common.preferences;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.ObjectType;
import org.ofbiz.base.util.UtilMisc;
@@ -132,7 +131,7 @@
* @return user preference map
*/
public static Map<String, Object> createUserPrefMap(GenericValue rec) throws GeneralException {
- return addPrefToMap(rec, FastMap.<String, Object>newInstance());
+ return addPrefToMap(rec, new LinkedHashMap<String, Object>());
}
/**
@@ -142,7 +141,7 @@
* @return user preference map
*/
public static Map<String, Object> createUserPrefMap(List<GenericValue> recList) throws GeneralException {
- Map<String, Object> userPrefMap = FastMap.newInstance();
+ Map<String, Object> userPrefMap = new LinkedHashMap<String, Object>();
if (recList != null) {
for (GenericValue value: recList) {
addPrefToMap(value, userPrefMap);
diff --git a/framework/common/src/org/ofbiz/common/scripting/ContextHelper.java b/framework/common/src/org/ofbiz/common/scripting/ContextHelper.java
index 91af24e..e459857 100644
--- a/framework/common/src/org/ofbiz/common/scripting/ContextHelper.java
+++ b/framework/common/src/org/ofbiz/common/scripting/ContextHelper.java
@@ -19,6 +19,8 @@
package org.ofbiz.common.scripting;
import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
import java.util.Locale;
import java.util.List;
import java.util.Map;
@@ -29,9 +31,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Assert;
import org.ofbiz.base.util.ScriptUtil;
import org.ofbiz.base.util.UtilGenerics;
@@ -115,13 +114,13 @@
if (isService()) {
errorMessages = UtilGenerics.checkList(getResults().get(ModelService.ERROR_MESSAGE_LIST));
if (errorMessages == null) {
- errorMessages = FastList.newInstance();
+ errorMessages = new LinkedList<String>();
getResults().put(ModelService.ERROR_MESSAGE_LIST, errorMessages);
}
} else {
errorMessages = UtilGenerics.checkList(getResults().get("_error_message_list_"));
if (errorMessages == null) {
- errorMessages = FastList.newInstance();
+ errorMessages = new LinkedList<String>();
getResults().put("_error_message_list_", errorMessages);
}
}
@@ -143,7 +142,7 @@
public Map<String, Object> getParameters() {
Map<String, Object> parameters = UtilGenerics.checkMap(this.context.getAttribute(ScriptUtil.PARAMETERS_KEY));
if (parameters == null) {
- parameters = FastMap.newInstance();
+ parameters = new LinkedHashMap<String, Object>();
this.context.setAttribute(ScriptUtil.PARAMETERS_KEY, parameters, ScriptContext.ENGINE_SCOPE);
}
return parameters;
@@ -164,7 +163,7 @@
public Map<String, Object> getResults() {
Map<String, Object> results = UtilGenerics.checkMap(this.context.getAttribute(ScriptUtil.RESULT_KEY));
if (results == null) {
- results = FastMap.newInstance();
+ results = new LinkedHashMap<String, Object>();
this.context.setAttribute(ScriptUtil.RESULT_KEY, results, ScriptContext.ENGINE_SCOPE);
}
return results;
diff --git a/framework/common/src/org/ofbiz/common/status/StatusServices.java b/framework/common/src/org/ofbiz/common/status/StatusServices.java
index b83ce3a..857550c 100644
--- a/framework/common/src/org/ofbiz/common/status/StatusServices.java
+++ b/framework/common/src/org/ofbiz/common/status/StatusServices.java
@@ -18,18 +18,18 @@
*******************************************************************************/
package org.ofbiz.common.status;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.UtilValidate;
import static org.ofbiz.base.util.UtilGenerics.checkList;
+
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
@@ -53,7 +53,7 @@
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "CommonStatusMandatory", locale));
}
- List<GenericValue> statusItems = FastList.newInstance();
+ List<GenericValue> statusItems = new LinkedList<GenericValue>();
for (String statusTypeId: statusTypes) {
try {
List<GenericValue> myStatusItems = delegator.findByAnd("StatusItem", UtilMisc.toMap("statusTypeId", statusTypeId), UtilMisc.toList("sequenceId"), true);
@@ -62,7 +62,7 @@
Debug.logError(e, module);
}
}
- Map<String, Object> ret = FastMap.newInstance();
+ Map<String, Object> ret = new LinkedHashMap<String, Object>();
ret.put("statusItems",statusItems);
return ret;
}
diff --git a/framework/common/src/org/ofbiz/common/status/StatusWorker.java b/framework/common/src/org/ofbiz/common/status/StatusWorker.java
index 72cb69e..5709622 100644
--- a/framework/common/src/org/ofbiz/common/status/StatusWorker.java
+++ b/framework/common/src/org/ofbiz/common/status/StatusWorker.java
@@ -18,12 +18,11 @@
*******************************************************************************/
package org.ofbiz.common.status;
+import java.util.LinkedList;
import java.util.List;
import javax.servlet.jsp.PageContext;
-import javolution.util.FastList;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.entity.Delegator;
@@ -52,7 +51,7 @@
public static void getStatusItems(PageContext pageContext, String attributeName, String statusTypeIdOne, String statusTypeIdTwo) {
Delegator delegator = (Delegator) pageContext.getRequest().getAttribute("delegator");
- List<GenericValue> statusItems = FastList.newInstance();
+ List<GenericValue> statusItems = new LinkedList<GenericValue>();
try {
List<GenericValue> calItems = delegator.findByAnd("StatusItem", UtilMisc.toMap("statusTypeId", statusTypeIdOne), UtilMisc.toList("sequenceId"), true);
diff --git a/framework/common/src/org/ofbiz/common/uom/UomWorker.java b/framework/common/src/org/ofbiz/common/uom/UomWorker.java
index a94f3d0..38ec2ce 100644
--- a/framework/common/src/org/ofbiz/common/uom/UomWorker.java
+++ b/framework/common/src/org/ofbiz/common/uom/UomWorker.java
@@ -21,10 +21,9 @@
import java.math.BigDecimal;
import java.sql.Timestamp;
+import java.util.LinkedHashMap;
import java.util.Map;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.LocalDispatcher;
@@ -100,12 +99,12 @@
if (originalValue == null || uomId == null || uomIdTo == null) return null;
if (uomId.equals(uomIdTo)) return originalValue;
- Map<String, Object> svcInMap = FastMap.newInstance();
+ Map<String, Object> svcInMap = new LinkedHashMap<String, Object>();
svcInMap.put("originalValue", originalValue);
svcInMap.put("uomId", uomId);
svcInMap.put("uomIdTo", uomIdTo);
- Map<String, Object> svcOutMap = FastMap.newInstance();
+ Map<String, Object> svcOutMap = new LinkedHashMap<String, Object>();
try {
svcOutMap = dispatcher.runSync("convertUom", svcInMap);
} catch (GenericServiceException ex) {
diff --git a/framework/entity/src/org/ofbiz/entity/test/EntityQueryTestSuite.java b/framework/entity/src/org/ofbiz/entity/test/EntityQueryTestSuite.java
new file mode 100644
index 0000000..8760a9f
--- /dev/null
+++ b/framework/entity/src/org/ofbiz/entity/test/EntityQueryTestSuite.java
@@ -0,0 +1,404 @@
+package org.ofbiz.entity.test;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.ofbiz.base.util.UtilDateTime;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.condition.EntityCondition;
+import org.ofbiz.entity.condition.EntityOperator;
+import org.ofbiz.entity.testtools.EntityTestCase;
+import org.ofbiz.entity.transaction.TransactionUtil;
+import org.ofbiz.entity.util.EntityFindOptions;
+import org.ofbiz.entity.util.EntityListIterator;
+import org.ofbiz.entity.util.EntityQuery;
+import org.ofbiz.entity.util.EntityUtil;
+
+public class EntityQueryTestSuite extends EntityTestCase {
+
+ public EntityQueryTestSuite(String name) {
+ super(name);
+ }
+
+ /*
+ * queryCount(): This method returns number of records found for the particular query.
+ * assert: Compared count of number of records found by Entity Engine method with count of number of records found by EntityQuery method.
+ */
+ public void testQueryCount() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "record-1", "description", "Record One"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "record-2", "description", "Record Two"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "record-3", "description", "Record Three"));
+ delegator.storeAll(testingTypes);
+
+ List<GenericValue> totalRecordsByEntityEngine = delegator.findList("TestingType", null, null, null, null, false);
+ int numberOfRecordsByEntityQuery = (int) EntityQuery.use(delegator).from("TestingType").queryCount();
+
+ assertEquals("queryCount(): Total Number of Records matched", totalRecordsByEntityEngine.size(), numberOfRecordsByEntityQuery);
+ }
+
+ /*
+ * where(): This method is used for setting condition of which records to fetch from entity.
+ * assert 1: Compared size of the list returned by Entity Engine method and by EntityQuery method.
+ * assert 2: Compared 'testingTypeId' field of first record fetched by Entity Engine method and by EntityQuery method.
+ * assert 3: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method.
+ */
+ public void testWhere() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "where-1", "description", "find me"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "where-2", "description", "find me not"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "where-3", "description", "find me"));
+ delegator.storeAll(testingTypes);
+
+ List<GenericValue> listByEntityEngine = delegator.findList("TestingType", EntityCondition.makeCondition("description", EntityOperator.EQUALS, "find me"), null, UtilMisc.toList("description"), null, false);
+ List<GenericValue> listByEntityQuery = EntityQuery.use(delegator).from("TestingType").where("description", "find me").orderBy("description").queryList();
+
+ assertEquals("where(): Number of records fetched by Entity Engine and by EntityQuery matched", listByEntityEngine.size(), listByEntityQuery.size());
+ assertEquals("where(): Record matched = testingTypeId", listByEntityEngine.get(0).getString("testingTypeId"), listByEntityQuery.get(0).getString("testingTypeId"));
+ assertEquals("where(): Record matched = description", listByEntityEngine.get(0).getString("description"), listByEntityQuery.get(0).getString("description"));
+ }
+
+ /*
+ * queryList(): Returns all records from the given entity.
+ * assert 1: Compared size of the list returned by Entity Engine method and by EntityQuery method.
+ * assert 2: Compared 'testingTypeId' field of first record fetched by Entity Engine method and by EntityQuery method.
+ * assert 3: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method.
+ */
+ public void testQueryList() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryList-1", "description", "queryList record one"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryList-2", "description", "queryList record two"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryList-3", "description", "queryList record three"));
+ delegator.storeAll(testingTypes);
+
+ List<GenericValue> listByEntityEngine = delegator.findList("TestingType", null, null, UtilMisc.toList("description"), null, false);
+ List<GenericValue> listByEntityQuery = EntityQuery.use(delegator).from("TestingType").orderBy("description").queryList();
+
+ assertEquals("queryList(): Number of records fetched by Entity Engine and by EntityQuery matched", listByEntityEngine.size(), listByEntityQuery.size());
+ assertEquals("queryList(): Record matched = testingTypeId", listByEntityEngine.get(0).getString("testingTypeId"), listByEntityQuery.get(0).getString("testingTypeId"));
+ assertEquals("queryList(): Record matched = description", listByEntityEngine.get(0).getString("description"), listByEntityQuery.get(0).getString("description"));
+ }
+
+ /*
+ * queryFirst(): Returns first record from result of query.
+ * assert 1: Compared 'testingTypeId' field of record fetched by Entity Engine method and by EntityQuery method.
+ * assert 2: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method.
+ */
+ public void testQueryFirst() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryFirst-1", "description", "first record"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryFirst-2", "description", "second record"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryFirst-3", "description", "third record"));
+ delegator.storeAll(testingTypes);
+
+ GenericValue firstRecordByEntityEngine = EntityUtil.getFirst(delegator.findList("TestingType", null, null, null, null, false));
+ GenericValue firstRecordByEntityQuery = EntityQuery.use(delegator).from("TestingType").queryFirst();
+
+ assertEquals("queryFirst(): Record matched = testingTypeId", firstRecordByEntityEngine.getString("testingTypeId"), firstRecordByEntityQuery.getString("testingTypeId"));
+ assertEquals("queryFirst(): Record matched = description", firstRecordByEntityEngine.getString("description"), firstRecordByEntityQuery.getString("description"));
+ }
+
+ /*
+ * queryOne(): This method returns only one record based on the conditions given.
+ * assert 1: Compared 'testingTypeId' field of record fetched by Entity Engine method and by EntityQuery method.
+ * assert 2: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method.
+ */
+ public void testQueryOne() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryOne-1", "description", "query one"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryOne-2", "description", "query two"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryOne-3", "description", "query three"));
+ delegator.storeAll(testingTypes);
+
+ GenericValue findOneByEntityEngine = delegator.findOne("TestingType", false, UtilMisc.toMap("testingTypeId", "queryOne-2"));
+ GenericValue queryOneByEntityQuery = EntityQuery.use(delegator).from("TestingType").where("testingTypeId", "queryOne-2").queryOne();
+
+ assertEquals("queryOne(): Record matched = testingTypeId", findOneByEntityEngine.getString("testingTypeId"), queryOneByEntityQuery.getString("testingTypeId"));
+ assertEquals("queryOne(): Record matched = description", findOneByEntityEngine.getString("description"), queryOneByEntityQuery.getString("description"));
+ }
+
+ /*
+ * select(): This method is used to select particular fields only from the entity.
+ * assert 1: Compared value of first record of selected 'description' field by both EntityEngine method and EntityQuery method.
+ * assert 2: Compared 'testingTypeId' field for null which is fetched by EntityQuery method.
+ */
+ public void testSelect() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "select-1", "description", "description one"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "select-2", "description", "description two"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "select-3", "description", "description three"));
+ delegator.storeAll(testingTypes);
+
+ List<GenericValue> selectByEntityEngine = delegator.findList("TestingType", null, UtilMisc.toSet("description"), UtilMisc.toList("description"), null, false);
+ List<GenericValue> selectByEntityQuery = EntityQuery.use(delegator).select("description").from("TestingType").orderBy("description").queryList();
+
+ assertEquals("select(): Record matched = description", selectByEntityEngine.get(0).getString("description"), selectByEntityQuery.get(0).getString("description"));
+ assertNull(selectByEntityQuery.get(0).getString("testingTypeId"));
+ }
+
+ /*
+ * distinct(): This method is used to get distinct values of records from entity field. (Note: Distinct method is generally used with select method)
+ * assert 1: Compared size of the list returned by Entity Engine method and by EntityQuery method.
+ * assert 2: Compared value of first record of selected 'description' field by both EntityEngine method and EntityQuery method.
+ * assert 3: Compared 'testingTypeId' field for null which is fetched by EntityQuery method.
+ */
+ public void testDistinctAndSelect() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "distinct-1", "description", "Distinct Record"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "distinct-2", "description", "Distinct Record"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "distinct-3", "description", "Not a Distinct Record"));
+ delegator.storeAll(testingTypes);
+
+ EntityFindOptions findOptions = new EntityFindOptions();
+ findOptions.setDistinct(true);
+ List<GenericValue> distinctByEntityEngine = delegator.findList("TestingType", null, UtilMisc.toSet("description"), UtilMisc.toList("description"), findOptions, false);
+ List<GenericValue> distinctByEntityQuery = EntityQuery.use(delegator).select("description").from("TestingType").distinct().orderBy("description").queryList();
+
+ assertEquals("distinct(): Number of records found by EntityEngine method are matching with records found by EntityQuery distinct method", distinctByEntityEngine.size(), distinctByEntityQuery.size());
+ assertEquals("distinct(): Record matched = description", distinctByEntityEngine.get(0).getString("description"), distinctByEntityQuery.get(0).getString("description"));
+ assertNull(distinctByEntityQuery.get(0).getString("testingTypeId"));
+ }
+
+ /*
+ * orderBy(): This method sorts the records found according to the given field or combination of fields.
+ * assert 1: Compared number of records returned by Entity Engine method and by EntityQuery method.
+ * assert 2: Compared 'testingTypeId' field of first record fetched by Entity Engine method and by EntityQuery method.
+ * assert 3: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method.
+ */
+ public void testOrderBy() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "orderBy-1", "description", "B"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "orderBy-2", "description", "C"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "orderBy-3", "description", "A"));
+ delegator.storeAll(testingTypes);
+
+ List<GenericValue> orderedByEntityEngine = delegator.findList("TestingType", EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, "orderBy-%"), null, UtilMisc.toList("description"), null, false);
+ List<GenericValue> orderedByEntityQuery = EntityQuery.use(delegator).from("TestingType").where(EntityCondition.makeCondition("testingTypeId", EntityOperator.LIKE, "orderBy-%")).orderBy("description").queryList();
+
+ assertEquals("orderBy(): Number of records found by both the methods matched", orderedByEntityEngine.size(), orderedByEntityQuery.size());
+ assertEquals("orderBy(): Record matched = testingTypeId", orderedByEntityEngine.get(0).getString("testingTypeId"), orderedByEntityQuery.get(0).getString("testingTypeId"));
+ assertEquals("orderBy(): Record matched = description", orderedByEntityEngine.get(0).getString("description"), orderedByEntityQuery.get(0).getString("description"));
+ }
+
+ /*
+ * filteByDate(): This method return only values that are currently active using from/thruDate fields.
+ * assert 1: Compared number of records returned by Entity Engine method and by EntityQuery method.
+ * assert 2: Compared 'testingNodeId' field of first record fetched by Entity Engine method and by EntityQuery method.
+ * assert 3: Compared 'testingId' field of first record fetched by Entity Engine method and by EntityQuery method.
+ * assert 4: Compared 'fromDate' field of first record fetched by Entity Engine method and by EntityQuery method.
+ * assert 5: Compared 'thruDate' field of first record fetched by Entity Engine method and by EntityQuery method.
+ */
+ public void testFilterByDate() throws GenericEntityException {
+ delegator.create("TestingType", "testingTypeId", "filterByDate-1", "description", "Filter BY Date");
+
+ delegator.create("Testing", "testingId", "testing-1", "testingTypeId", "filterByDate-1");
+ delegator.create("Testing", "testingId", "testing-2", "testingTypeId", "filterByDate-1");
+ delegator.create("Testing", "testingId", "testing-3", "testingTypeId", "filterByDate-1");
+ delegator.create("Testing", "testingId", "testing-4", "testingTypeId", "filterByDate-1");
+
+ delegator.create("TestingNode", "testingNodeId", "testingNode-1");
+ delegator.create("TestingNode", "testingNodeId", "testingNode-2");
+ delegator.create("TestingNode", "testingNodeId", "testingNode-3");
+ delegator.create("TestingNode", "testingNodeId", "testingNode-4");
+
+ delegator.create("TestingNodeMember", "testingNodeId", "testingNode-1","testingId", "testing-1", "fromDate", UtilDateTime.nowTimestamp(), "thruDate", UtilDateTime.getNextDayStart(UtilDateTime.nowTimestamp()));
+ delegator.create("TestingNodeMember", "testingNodeId", "testingNode-2","testingId", "testing-2", "fromDate", UtilDateTime.nowTimestamp(), "thruDate", UtilDateTime.getNextDayStart(UtilDateTime.nowTimestamp()));
+ delegator.create("TestingNodeMember", "testingNodeId", "testingNode-3","testingId", "testing-3", "fromDate", UtilDateTime.getNextDayStart(UtilDateTime.nowTimestamp()), "thruDate", UtilDateTime.getWeekEnd(UtilDateTime.nowTimestamp()));
+ delegator.create("TestingNodeMember", "testingNodeId", "testingNode-4","testingId", "testing-4", "fromDate", UtilDateTime.getMonthStart(UtilDateTime.nowTimestamp()), "thruDate", UtilDateTime.getMonthStart(UtilDateTime.nowTimestamp()));
+
+ List<GenericValue> filteredByEntityUtil = EntityUtil.filterByDate(delegator.findList("TestingNodeMember", null, null, UtilMisc.toList("testingNodeId"), null, false));
+ List<GenericValue> filteredByEntityQuery = EntityQuery.use(delegator).from("TestingNodeMember").filterByDate().orderBy("testingNodeId").queryList();
+
+ assertEquals("filterByDate(): Number of records found by both the methods matched", filteredByEntityUtil.size(), filteredByEntityQuery.size());
+ assertEquals("filterByDate(): Record matched = testingNodeId", filteredByEntityUtil.get(0).getString("testingNodeId"), filteredByEntityQuery.get(0).getString("testingNodeId"));
+ assertEquals("filterByDate(): Record matched = testingId", filteredByEntityUtil.get(0).getString("testingId"), filteredByEntityQuery.get(0).getString("testingId"));
+ assertEquals("filterByDate(): Record matched = fromDate", filteredByEntityUtil.get(0).getString("fromDate"), filteredByEntityQuery.get(0).getString("fromDate"));
+ assertEquals("filterByDate(): Record matched = thruDate", filteredByEntityUtil.get(0).getString("thruDate"), filteredByEntityQuery.get(0).getString("thruDate"));
+ }
+
+ /*
+ * maxRows(): This method sets the maximum number of records to be fetched by the query.
+ * assert 1: Compared number of records returned by Entity Engine method and by EntityQuery method.
+ * assert 2: Compared 'testingTypeId' field of first record fetched by Entity Engine method and by EntityQuery method.
+ * assert 3: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method.
+ */
+ public void testMaxRows() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "maxRows-1", "description", "Max Row One"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "maxRows-2", "description", "Max Row Two"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "maxRows-3", "description", "Max Row Three"));
+ delegator.storeAll(testingTypes);
+
+ EntityFindOptions findOptions = new EntityFindOptions();
+ findOptions.setMaxRows(2);
+ List<GenericValue> maxRowsByEntityEngine = delegator.findList("TestingType", null, null, UtilMisc.toList("description"), findOptions, false);
+ List<GenericValue> maxRowsByEntityQuery = EntityQuery.use(delegator).from("TestingType").maxRows(2).orderBy("description").queryList();
+
+ assertEquals("maxRows(): Number of records found by both the methods matched", maxRowsByEntityEngine.size(), maxRowsByEntityQuery.size());
+ assertEquals("maxRows(): Record matched = testingTypeId", maxRowsByEntityEngine.get(0).getString("testingTypeId"), maxRowsByEntityQuery.get(0).getString("testingTypeId"));
+ assertEquals("maxRows(): Record matched = description", maxRowsByEntityEngine.get(0).getString("description"), maxRowsByEntityQuery.get(0).getString("description"));
+ }
+
+ /*
+ * fetchSize(): This method sets the fetch size for the records to be fetched from the entity.
+ * assert 1: Compared number of records returned by Entity Engine method and by EntityQuery method.
+ * assert 2: Compared 'testingTypeId' field of first record fetched by Entity Engine method and by EntityQuery method.
+ * assert 3: Compared 'description' field of first record fetched by Entity Engine method and by EntityQuery method.
+ */
+ public void testFetchSize() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "fetchSize-1", "description", "Fetch Size One"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "fetchSize-2", "description", "Fetch Size Two"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "fetchSize-3", "description", "Fetch Size Three"));
+ delegator.storeAll(testingTypes);
+
+ EntityFindOptions findOptions = new EntityFindOptions();
+ findOptions.setFetchSize(2);;
+ List<GenericValue> fetchSizeByEntityEngine = delegator.findList("TestingType", null, null, UtilMisc.toList("description"), findOptions, false);
+ List<GenericValue> fetchSizeByEntityQuery = EntityQuery.use(delegator).from("TestingType").fetchSize(2).orderBy("description").queryList();
+
+ assertEquals("fetchSize(): Number of records found by both the methods matched", fetchSizeByEntityEngine.size(), fetchSizeByEntityQuery.size());
+ assertEquals("fetchSize(): Record matched = testingTypeId", fetchSizeByEntityEngine.get(0).getString("testingTypeId"), fetchSizeByEntityQuery.get(0).getString("testingTypeId"));
+ assertEquals("fetchSize(): Record matched = description", fetchSizeByEntityEngine.get(0).getString("description"), fetchSizeByEntityQuery.get(0).getString("description"));
+ }
+
+ /*
+ * queryIterator(): This method is used to get iterator object over the entity.
+ * assert: Compared first record of both the iterator.
+ */
+ public void testQueryIterator() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryIterator-1", "description", "Value One"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryIterator-2", "description", "Value Two"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "queryIterator-3", "description", "Value Three"));
+ delegator.storeAll(testingTypes);
+
+ boolean transactionStarted = false;
+ try {
+ transactionStarted = TransactionUtil.begin();
+
+ EntityListIterator eliByEntityEngine = null;
+ EntityListIterator eliByEntityQuery = null;
+ eliByEntityEngine = delegator.find("TestingType", null, null, null, null, null);
+ eliByEntityQuery = EntityQuery.use(delegator).from("TestingType").queryIterator();
+
+ GenericValue recordByEntityEngine = eliByEntityEngine.next();
+ GenericValue recordByEntityQuery = eliByEntityQuery.next();
+
+ assertEquals("queryIterator(): Value of first record pointed by both iterators matched", recordByEntityEngine, recordByEntityQuery);
+ eliByEntityEngine.close();
+ eliByEntityQuery.close();
+
+ TransactionUtil.commit(transactionStarted);
+ } catch (Exception e) {
+ TransactionUtil.rollback(transactionStarted, "Transaction is Rolled Back", e);
+ }
+ }
+
+ /*
+ * cursorForwardOnly(): Indicate that the ResultSet object's cursor may move only forward
+ * assert: Compared first record found by both the iterator.
+ */
+ public void testCursorForwardOnly() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "cursorForwardOnly-1", "description", "cursorForwardOnly One"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "cursorForwardOnly-2", "description", "cursorForwardOnly Two"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "cursorForwardOnly-3", "description", "cursorForwardOnly Three"));
+ delegator.storeAll(testingTypes);
+
+ boolean transactionStarted = false;
+ try {
+ transactionStarted = TransactionUtil.begin();
+
+ EntityListIterator eliByEntityEngine = null;
+ EntityListIterator eliByEntityQuery = null;
+ EntityFindOptions findOptions = new EntityFindOptions();
+ findOptions.setResultSetType(EntityFindOptions.TYPE_FORWARD_ONLY);
+ eliByEntityEngine = delegator.find("TestingType", null, null, null, null, findOptions);
+ eliByEntityQuery = EntityQuery.use(delegator).from("TestingType").cursorForwardOnly().queryIterator();
+
+ GenericValue nextRecordByEntityEngine = eliByEntityEngine.next();
+ GenericValue nextRecordByEntityQuery = eliByEntityQuery.next();
+
+ assertEquals("cursorForwardOnly(): Value of first record pointed by both iterators matched", nextRecordByEntityEngine, nextRecordByEntityQuery);
+ eliByEntityEngine.close();
+ eliByEntityQuery.close();
+
+ TransactionUtil.commit(transactionStarted);
+ } catch (Exception e) {
+ TransactionUtil.rollback(transactionStarted, "Transaction is Rolled Back", e);
+ }
+ }
+
+ /*
+ * cursorScrollSensitive(): ResultSet object's cursor is scrollable but generally sensitive to changes to the data that underlies the ResultSet.
+ * assert: Compared first record found by both the iterators.
+ */
+ public void testCursorScrollSensitive() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "scrollSensitive-1", "description", "cursorScrollSensitive One"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "scrollSensitive-2", "description", "cursorScrollSensitive Two"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "scrollSensitive-3", "description", "cursorScrollSensitive Three"));
+ delegator.storeAll(testingTypes);
+
+ boolean transactionStarted = false;
+ try {
+ transactionStarted = TransactionUtil.begin();
+
+ EntityListIterator eliByEntityEngine = null;
+ EntityListIterator eliByEntityQuery = null;
+ EntityFindOptions findOptions = new EntityFindOptions();
+ findOptions.setResultSetType(EntityFindOptions.TYPE_SCROLL_SENSITIVE);
+ eliByEntityEngine = delegator.find("TestingType", null, null, null, null, findOptions);
+ eliByEntityQuery = EntityQuery.use(delegator).from("TestingType").cursorScrollSensitive().queryIterator();
+
+ GenericValue nextRecordByDelegator = eliByEntityEngine.next();
+ GenericValue nextRecordByEntityQuery = eliByEntityQuery.next();
+
+ assertEquals("cursorScrollSensitive(): Records by delegator method and by EntityQuery method matched", nextRecordByDelegator, nextRecordByEntityQuery);
+ eliByEntityEngine.close();
+ eliByEntityQuery.close();
+
+ TransactionUtil.commit(transactionStarted);
+ } catch (Exception e) {
+ TransactionUtil.rollback(transactionStarted, "Transaction is Rolled Back", e);
+ }
+ }
+
+ /*
+ * cursorScrollInSensitive(): ResultSet object's cursor is scrollable but generally not sensitive to changes to the data that underlies the ResultSet.
+ * assert: Compared first record found by both the iterators.
+ */
+ public void testCursorScrollInSensitive() throws GenericEntityException {
+ List<GenericValue> testingTypes = new LinkedList<GenericValue>();
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "scrollInSensitive-1", "description", "cursorScrollInSensitive One"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "scrollInSensitive-2", "description", "cursorScrollInSensitive Two"));
+ testingTypes.add(delegator.makeValue("TestingType", "testingTypeId", "scrollInSensitive-3", "description", "cursorScrollInSensitive Three"));
+ delegator.storeAll(testingTypes);
+
+ boolean transactionStarted = false;
+ try {
+ transactionStarted = TransactionUtil.begin();
+
+ EntityListIterator eliByEntityEngine = null;
+ EntityListIterator eliByEntityQuery = null;
+ EntityFindOptions findOptions = new EntityFindOptions();
+ findOptions.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE);
+ eliByEntityEngine = delegator.find("TestingType", null, null, null, null, findOptions);
+ eliByEntityQuery = EntityQuery.use(delegator).from("TestingType").cursorScrollInsensitive().queryIterator();
+
+ GenericValue nextRecordByDelegator = eliByEntityEngine.next();
+ GenericValue nextRecordByEntityQuery = eliByEntityQuery.next();
+
+ assertEquals("cursorScrollInSensitive(): Records by delegator method and by EntityQuery method matched", nextRecordByDelegator, nextRecordByEntityQuery);
+ eliByEntityEngine.close();
+ eliByEntityQuery.close();
+
+ TransactionUtil.commit(transactionStarted);
+ } catch (Exception e) {
+ TransactionUtil.rollback(transactionStarted, "Transaction is Rolled Back", e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/framework/entity/testdef/entitytests.xml b/framework/entity/testdef/entitytests.xml
index 28b923e..1b94630 100644
--- a/framework/entity/testdef/entitytests.xml
+++ b/framework/entity/testdef/entitytests.xml
@@ -23,6 +23,7 @@
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
<test-case case-name="entity-tests"><junit-test-suite class-name="org.ofbiz.entity.test.EntityTestSuite"/></test-case>
<test-case case-name="entity-crypto-tests"><junit-test-suite class-name="org.ofbiz.entity.test.EntityCryptoTestSuite"/></test-case>
+ <test-case case-name="entity-query-tests"><junit-test-suite class-name="org.ofbiz.entity.test.EntityQueryTestSuite"/></test-case>
<test-case case-name="entity-util-properties-tests">
<simple-method-test location="component://entity/script/org/ofbiz/entity/test/EntityUtilPropertiesTests.xml"/>
</test-case>
diff --git a/framework/service/src/org/ofbiz/service/ModelNotification.java b/framework/service/src/org/ofbiz/service/ModelNotification.java
index 0e7d3de..6e99b72 100644
--- a/framework/service/src/org/ofbiz/service/ModelNotification.java
+++ b/framework/service/src/org/ofbiz/service/ModelNotification.java
@@ -19,18 +19,17 @@
package org.ofbiz.service;
-import org.ofbiz.service.config.ServiceConfigUtil;
-import org.ofbiz.base.config.GenericConfigException;
-import org.ofbiz.base.util.StringUtil;
-import org.ofbiz.base.util.Debug;
-import org.ofbiz.base.util.UtilGenerics;
-import org.ofbiz.base.util.UtilValidate;
-
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javolution.util.FastMap;
+import org.ofbiz.base.config.GenericConfigException;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.StringUtil;
+import org.ofbiz.base.util.UtilGenerics;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.service.config.ServiceConfigUtil;
import org.ofbiz.service.config.model.NotificationGroup;
import org.ofbiz.service.config.model.Notify;
@@ -82,8 +81,8 @@
}
// template context
- Map<String, Object> notifyContext = FastMap.newInstance();
- Map<String, Object> bodyParams = FastMap.newInstance();
+ Map<String, Object> notifyContext = new HashMap<String, Object>();
+ Map<String, Object> bodyParams = new HashMap<String, Object>();
bodyParams.put("serviceContext", context);
bodyParams.put("serviceResult", result);
bodyParams.put("service", model);
diff --git a/framework/service/src/org/ofbiz/service/ModelService.java b/framework/service/src/org/ofbiz/service/ModelService.java
index 7925079..b3ec763 100644
--- a/framework/service/src/org/ofbiz/service/ModelService.java
+++ b/framework/service/src/org/ofbiz/service/ModelService.java
@@ -23,8 +23,11 @@
import java.lang.reflect.Method;
import java.util.AbstractMap;
import java.util.AbstractSet;
+import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -56,9 +59,6 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.metrics.Metrics;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
@@ -84,7 +84,7 @@
@SuppressWarnings("serial")
public class ModelService extends AbstractMap<String, Object> implements Serializable {
private static final Field[] MODEL_SERVICE_FIELDS;
- private static final Map<String, Field> MODEL_SERVICE_FIELD_MAP = FastMap.newInstance();
+ private static final Map<String, Field> MODEL_SERVICE_FIELD_MAP = new LinkedHashMap<String, Field>();
static {
MODEL_SERVICE_FIELDS = ModelService.class.getFields();
for (Field field: MODEL_SERVICE_FIELDS) {
@@ -189,19 +189,19 @@
public Set<ModelParam> overrideParameters = new LinkedHashSet<ModelParam>();
/** List of permission groups for service invocation */
- public List<ModelPermGroup> permissionGroups = FastList.newInstance();
+ public List<ModelPermGroup> permissionGroups = new LinkedList<ModelPermGroup>();
/** List of email-notifications for this service */
- public List<ModelNotification> notifications = FastList.newInstance();
+ public List<ModelNotification> notifications = new LinkedList<ModelNotification>();
/** Internal Service Group */
public GroupModel internalGroup = null;
/** Context Information, a Map of parameters used by the service, contains ModelParam objects */
- protected Map<String, ModelParam> contextInfo = FastMap.newInstance();
+ protected Map<String, ModelParam> contextInfo = new LinkedHashMap<String, ModelParam>();
/** Context Information, a List of parameters used by the service, contains ModelParam objects */
- protected List<ModelParam> contextParamList = FastList.newInstance();
+ protected List<ModelParam> contextParamList = new LinkedList<ModelParam>();
/** Flag to say if we have pulled in our addition parameters from our implemented service(s) */
protected boolean inheritedParameters = false;
@@ -490,8 +490,8 @@
* @param locale the actual locale to use
*/
public void validate(Map<String, Object> context, String mode, Locale locale) throws ServiceValidationException {
- Map<String, String> requiredInfo = FastMap.newInstance();
- Map<String, String> optionalInfo = FastMap.newInstance();
+ Map<String, String> requiredInfo = new HashMap<String, String>();
+ Map<String, String> optionalInfo = new HashMap<String, String>();
boolean verboseOn = Debug.verboseOn();
if (verboseOn) Debug.logVerbose("[ModelService.validate] : {" + this.name + "} : Validating context - " + context, module);
@@ -517,14 +517,14 @@
}
// get the test values
- Map<String, Object> requiredTest = FastMap.newInstance();
- Map<String, Object> optionalTest = FastMap.newInstance();
+ Map<String, Object> requiredTest = new HashMap<String, Object>();
+ Map<String, Object> optionalTest = new HashMap<String, Object>();
- if (context == null) context = FastMap.newInstance();
+ if (context == null) context = new HashMap<String, Object>();
requiredTest.putAll(context);
- List<String> requiredButNull = FastList.newInstance();
- List<String> keyList = FastList.newInstance();
+ List<String> requiredButNull = new LinkedList<String>();
+ List<String> keyList = new LinkedList<String>();
keyList.addAll(requiredTest.keySet());
for (String key: keyList) {
Object value = requiredTest.get(key);
@@ -539,7 +539,7 @@
// check for requiredButNull fields and return an error since null values are not allowed for required fields
if (requiredButNull.size() > 0) {
- List<String> missingMsg = FastList.newInstance();
+ List<String> missingMsg = new LinkedList<String>();
for (String missingKey: requiredButNull) {
String message = this.getParam(missingKey).getPrimaryFailMessage(locale);
if (message == null) {
@@ -578,7 +578,7 @@
// required and type validation complete, do allow-html validation
if ("IN".equals(mode)) {
- List<String> errorMessageList = FastList.newInstance();
+ List<String> errorMessageList = new LinkedList<String>();
for (ModelParam modelParam : this.contextInfo.values()) {
// the param is a String, allow-html is not any, and we are looking at an IN parameter during input parameter validation
if (context.get(modelParam.name) != null && ("String".equals(modelParam.type) || "java.lang.String".equals(modelParam.type))
@@ -615,7 +615,7 @@
Set<String> missing = new TreeSet<String>(keySet);
missing.removeAll(testSet);
- List<String> missingMsgs = FastList.newInstance();
+ List<String> missingMsgs = new LinkedList<String>();
for (String key: missing) {
String msg = model.getParam(key).getPrimaryFailMessage(locale);
if (msg == null) {
@@ -625,7 +625,7 @@
missingMsgs.add(msg);
}
- List<String> missingCopy = FastList.newInstance();
+ List<String> missingCopy = new LinkedList<String>();
missingCopy.addAll(missing);
throw new ServiceValidationException(missingMsgs, model, missingCopy, null, mode);
}
@@ -635,7 +635,7 @@
Set<String> extra = new TreeSet<String>(testSet);
extra.removeAll(keySet);
- List<String> extraMsgs = FastList.newInstance();
+ List<String> extraMsgs = new LinkedList<String>();
for (String key: extra) {
ModelParam param = model.getParam(key);
String msg = null;
@@ -648,13 +648,13 @@
extraMsgs.add(msg);
}
- List<String> extraCopy = FastList.newInstance();
+ List<String> extraCopy = new LinkedList<String>();
extraCopy.addAll(extra);
throw new ServiceValidationException(extraMsgs, model, null, extraCopy, mode);
}
// * Validate types next
- List<String> typeFailMsgs = FastList.newInstance();
+ List<String> typeFailMsgs = new LinkedList<String>();
for (String key: testSet) {
ModelParam param = model.getParam(key);
@@ -775,7 +775,7 @@
* @return List of parameter names
*/
public List<String> getParameterNames(String mode, boolean optional, boolean internal) {
- List<String> names = FastList.newInstance();
+ List<String> names = new LinkedList<String>();
if (!"IN".equals(mode) && !"OUT".equals(mode) && !"INOUT".equals(mode)) {
return names;
@@ -843,7 +843,7 @@
* @param locale Locale to use to do some type conversion
*/
public Map<String, Object> makeValid(Map<String, ? extends Object> source, String mode, boolean includeInternal, List<Object> errorMessages, TimeZone timeZone, Locale locale) {
- Map<String, Object> target = FastMap.newInstance();
+ Map<String, Object> target = new HashMap<String, Object>();
if (source == null) {
return target;
@@ -919,7 +919,7 @@
}
private Map<String, Object> makePrefixMap(Map<String, ? extends Object> source, ModelParam param) {
- Map<String, Object> paramMap = FastMap.newInstance();
+ Map<String, Object> paramMap = new HashMap<String, Object>();
for (Map.Entry<String, ? extends Object> entry: source.entrySet()) {
String key = entry.getKey();
if (key.startsWith(param.stringMapPrefix)) {
@@ -931,7 +931,7 @@
}
private List<Object> makeSuffixList(Map<String, ? extends Object> source, ModelParam param) {
- List<Object> paramList = FastList.newInstance();
+ List<Object> paramList = new LinkedList<Object>();
for (Map.Entry<String, ? extends Object> entry: source.entrySet()) {
String key = entry.getKey();
if (key.endsWith(param.stringListSuffix)) {
@@ -1046,7 +1046,7 @@
* @return A list of required IN parameters in the order which they were defined.
*/
public List<Object> getInParameterSequence(Map<String, ? extends Object> source) {
- List<Object> target = FastList.newInstance();
+ List<Object> target = new LinkedList<Object>();
if (source == null) {
return target;
}
@@ -1070,7 +1070,7 @@
* the service was created.
*/
public List<ModelParam> getModelParamList() {
- List<ModelParam> newList = FastList.newInstance();
+ List<ModelParam> newList = new LinkedList<ModelParam>();
newList.addAll(this.contextParamList);
return newList;
}
@@ -1080,7 +1080,7 @@
* the service was created.
*/
public List<ModelParam> getInModelParamList() {
- List<ModelParam> inList = FastList.newInstance();
+ List<ModelParam> inList = new LinkedList<ModelParam>();
for (ModelParam modelParam: this.contextParamList) {
// don't include OUT parameters in this list, only IN and INOUT
if ("OUT".equals(modelParam.mode)) continue;
diff --git a/framework/service/src/org/ofbiz/service/ModelServiceReader.java b/framework/service/src/org/ofbiz/service/ModelServiceReader.java
index ca63f6b..521569a 100644
--- a/framework/service/src/org/ofbiz/service/ModelServiceReader.java
+++ b/framework/service/src/org/ofbiz/service/ModelServiceReader.java
@@ -21,16 +21,15 @@
import java.io.IOException;
import java.io.Serializable;
import java.net.URL;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.xml.parsers.ParserConfigurationException;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.config.GenericConfigException;
import org.ofbiz.base.config.ResourceHandler;
import org.ofbiz.base.metrics.MetricsFactory;
@@ -44,6 +43,7 @@
import org.ofbiz.entity.model.ModelEntity;
import org.ofbiz.entity.model.ModelField;
import org.ofbiz.entity.model.ModelFieldType;
+import org.ofbiz.service.ModelParam.ModelParamValidator;
import org.ofbiz.service.group.GroupModel;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -107,7 +107,7 @@
}
}
- Map<String, ModelService> modelServices = FastMap.newInstance();
+ Map<String, ModelService> modelServices = new HashMap<String, ModelService>();
if (this.isFromURL) {// utilTimer.timerString("Before getDocumentElement in file " + readerURL);
} else {// utilTimer.timerString("Before getDocumentElement in " + handler);
}
@@ -273,7 +273,7 @@
service.nameSpace = getCDATADef(serviceElement, "namespace");
// construct the context
- service.contextInfo = FastMap.newInstance();
+ service.contextInfo = new HashMap<String, ModelParam>();
this.createNotification(serviceElement, service);
this.createPermission(serviceElement, service);
this.createPermGroups(serviceElement, service);
@@ -690,7 +690,7 @@
List<? extends Element> validateElements = UtilXml.childElementList(attribute, "type-validate");
if (UtilValidate.isNotEmpty(validateElements)) {
// always clear out old ones; never append
- param.validators = FastList.newInstance();
+ param.validators = new LinkedList<ModelParamValidator>();
Element validate = validateElements.get(0);
String methodName = validate.getAttribute("method").intern();
diff --git a/framework/service/src/org/ofbiz/service/ServiceUtil.java b/framework/service/src/org/ofbiz/service/ServiceUtil.java
index 7990b1f..3a046e2 100644
--- a/framework/service/src/org/ofbiz/service/ServiceUtil.java
+++ b/framework/service/src/org/ofbiz/service/ServiceUtil.java
@@ -20,6 +20,7 @@
import java.math.BigDecimal;
import java.sql.Timestamp;
+import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
@@ -29,9 +30,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.transaction.Transaction;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.config.GenericConfigException;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
@@ -119,7 +117,7 @@
}
public static Map<String, Object> returnProblem(String returnType, String errorMessage, List<? extends Object> errorMessageList, Map<String, ? extends Object> errorMessageMap, Map<String, ? extends Object> nestedResult) {
- Map<String, Object> result = FastMap.newInstance();
+ Map<String, Object> result = new HashMap<String, Object>();
result.put(ModelService.RESPONSE_MESSAGE, returnType);
if (errorMessage != null) {
result.put(ModelService.ERROR_MESSAGE, errorMessage);
@@ -130,7 +128,7 @@
errorList.addAll(errorMessageList);
}
- Map<String, Object> errorMap = FastMap.newInstance();
+ Map<String, Object> errorMap = new HashMap<String, Object>();
if (errorMessageMap != null) {
errorMap.putAll(errorMessageMap);
}
@@ -178,7 +176,7 @@
* and what type of message that is should be determined by the RESPONSE_MESSAGE (and there's another annoyance, it should be RESPONSE_CODE)
*/
public static Map<String, Object> returnMessage(String code, String message) {
- Map<String, Object> result = FastMap.newInstance();
+ Map<String, Object> result = new HashMap<String, Object>();
if (code != null) result.put(ModelService.RESPONSE_MESSAGE, code);
if (message != null) result.put(ModelService.SUCCESS_MESSAGE, message);
return result;
@@ -479,7 +477,7 @@
boolean beganTx3 = false;
GenericValue runtimeData = null;
EntityListIterator runTimeDataIt = null;
- List<GenericValue> runtimeDataToDelete = FastList.newInstance();
+ List<GenericValue> runtimeDataToDelete = new LinkedList<GenericValue>();
long jobsandBoxCount = 0;
try {
// begin this transaction
@@ -711,7 +709,7 @@
*/
public static Map<String, Object> setServiceFields(LocalDispatcher dispatcher, String serviceName, Map<String, Object> fromMap, GenericValue userLogin,
TimeZone timeZone, Locale locale) throws GeneralServiceException {
- Map<String, Object> outMap = FastMap.newInstance();
+ Map<String, Object> outMap = new HashMap<String, Object>();
ModelService modelService = null;
try {
diff --git a/framework/service/src/org/ofbiz/service/ServiceXaWrapper.java b/framework/service/src/org/ofbiz/service/ServiceXaWrapper.java
index ee93841..4eb589c 100644
--- a/framework/service/src/org/ofbiz/service/ServiceXaWrapper.java
+++ b/framework/service/src/org/ofbiz/service/ServiceXaWrapper.java
@@ -18,14 +18,14 @@
*******************************************************************************/
package org.ofbiz.service;
+import java.util.HashMap;
import java.util.Map;
+
import javax.transaction.Status;
import javax.transaction.Transaction;
import javax.transaction.xa.XAException;
import javax.transaction.xa.Xid;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.transaction.GenericTransactionException;
@@ -295,7 +295,7 @@
if (model.validate) {
thisContext = model.makeValid(context, ModelService.IN_PARAM);
} else {
- thisContext = FastMap.newInstance();
+ thisContext = new HashMap<String, Object>();
thisContext.putAll(context);
}
diff --git a/framework/service/src/org/ofbiz/service/calendar/ExpressionUiHelper.java b/framework/service/src/org/ofbiz/service/calendar/ExpressionUiHelper.java
index 0a0ebd5..f79e3a8 100644
--- a/framework/service/src/org/ofbiz/service/calendar/ExpressionUiHelper.java
+++ b/framework/service/src/org/ofbiz/service/calendar/ExpressionUiHelper.java
@@ -21,20 +21,20 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
-import com.ibm.icu.util.Calendar;
+import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
-import javolution.util.FastSet;
-
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.condition.EntityCondition;
+import com.ibm.icu.util.Calendar;
+
/** TemporalExpression UI artifacts worker. */
public class ExpressionUiHelper {
@@ -141,13 +141,13 @@
*/
public static Set<String> getCandidateIncludeIds(Delegator delegator, String tempExprId) throws GenericEntityException {
List<GenericValue> findList = delegator.findList("TemporalExpressionAssoc", EntityCondition.makeCondition("fromTempExprId", tempExprId), null, null, null, true);
- Set<String> excludedIds = FastSet.newInstance();
+ Set<String> excludedIds = new HashSet<String>();
for (GenericValue value : findList) {
excludedIds.add(value.getString("toTempExprId"));
}
excludedIds.add(tempExprId);
findList = delegator.findList("TemporalExpression", null, null, null, null, true);
- Set<String> candidateIds = FastSet.newInstance();
+ Set<String> candidateIds = new HashSet<String>();
for (GenericValue value : findList) {
candidateIds.add(value.getString("tempExprId"));
}
diff --git a/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java b/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java
index 80cf6b2..015e11b 100644
--- a/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java
+++ b/framework/service/src/org/ofbiz/service/eca/ServiceEcaAction.java
@@ -18,12 +18,11 @@
*******************************************************************************/
package org.ofbiz.service.eca;
+import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilValidate;
@@ -137,7 +136,7 @@
if (UtilValidate.isNotEmpty(resultMapName)) {
Map<String, Object> resultMap = UtilGenerics.checkMap(context.get(resultMapName));
if (resultMap == null) {
- resultMap = FastMap.newInstance();
+ resultMap = new HashMap<String, Object>();
}
resultMap.putAll(dctx.getModelService(this.serviceName).makeValid(actionResult, ModelService.OUT_PARAM, false, null));
context.put(resultMapName, resultMap);
diff --git a/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java b/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java
index ab0aa0e..106488c 100644
--- a/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java
+++ b/framework/service/src/org/ofbiz/service/eca/ServiceEcaRule.java
@@ -18,12 +18,12 @@
*******************************************************************************/
package org.ofbiz.service.eca;
+import java.util.ArrayList;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import javolution.util.FastList;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilValidate;
@@ -44,8 +44,8 @@
protected final String eventName;
protected final boolean runOnFailure;
protected final boolean runOnError;
- protected final List<ServiceEcaCondition> conditions = FastList.newInstance();
- protected final List<Object> actionsAndSets = FastList.newInstance();
+ protected final List<ServiceEcaCondition> conditions = new ArrayList<ServiceEcaCondition>();
+ protected final List<Object> actionsAndSets = new ArrayList<Object>();
protected boolean enabled = true;
protected final String definitionLocation;
@@ -103,7 +103,7 @@
}
public List<ServiceEcaAction> getEcaActionList() {
- List<ServiceEcaAction> actionList = FastList.newInstance();
+ List<ServiceEcaAction> actionList = new LinkedList<ServiceEcaAction>();
for (Object actionOrSet: this.actionsAndSets) {
if (actionOrSet instanceof ServiceEcaAction) {
actionList.add((ServiceEcaAction) actionOrSet);
@@ -113,7 +113,7 @@
}
public List<ServiceEcaCondition> getEcaConditionList() {
- List<ServiceEcaCondition> condList = FastList.newInstance();
+ List<ServiceEcaCondition> condList = new LinkedList<ServiceEcaCondition>();
condList.addAll(this.conditions);
return condList;
}
diff --git a/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java b/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java
index 3d3d1bf..8bef3f1 100644
--- a/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java
+++ b/framework/service/src/org/ofbiz/service/eca/ServiceEcaSetField.java
@@ -19,15 +19,15 @@
package org.ofbiz.service.eca;
-import org.w3c.dom.Element;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.string.FlexibleStringExpander;
import org.ofbiz.entity.model.ModelUtil;
-
-import java.util.Map;
-import javolution.util.FastMap;
+import org.w3c.dom.Element;
/**
* ServiceEcaSetField
@@ -72,7 +72,7 @@
if (UtilValidate.isNotEmpty(this.mapName) && context.containsKey(this.mapName)) {
valueMap = UtilGenerics.checkMap(context.get(mapName));
} else {
- valueMap = FastMap.newInstance();
+ valueMap = new HashMap<String, Object>();
}
// process the context changes
Object newValue = null;
diff --git a/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java b/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java
index 48830a8..0f6e7d3 100644
--- a/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java
+++ b/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java
@@ -19,16 +19,16 @@
package org.ofbiz.service.eca;
import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.component.ComponentConfig;
import org.ofbiz.base.concurrent.ExecutionPool;
import org.ofbiz.base.config.GenericConfigException;
@@ -51,7 +51,7 @@
public static final String module = ServiceEcaUtil.class.getName();
// using a cache is dangerous here because if someone clears it the ECAs won't run: public static UtilCache ecaCache = new UtilCache("service.ServiceECAs", 0, 0, false);
- public static Map<String, Map<String, List<ServiceEcaRule>>> ecaCache = FastMap.newInstance();
+ public static Map<String, Map<String, List<ServiceEcaRule>>> ecaCache = new ConcurrentHashMap<String, Map<String, List<ServiceEcaRule>>>();
public static void reloadConfig() {
ecaCache.clear();
@@ -64,7 +64,7 @@
return;
}
- List<Future<List<ServiceEcaRule>>> futures = FastList.newInstance();
+ List<Future<List<ServiceEcaRule>>> futures = new LinkedList<Future<List<ServiceEcaRule>>>();
List<ServiceEcas> serviceEcasList = null;
try {
serviceEcasList = ServiceConfigUtil.getServiceEngine().getServiceEcas();
@@ -102,7 +102,7 @@
}
private static List<ServiceEcaRule> getEcaDefinitions(ResourceHandler handler) {
- List<ServiceEcaRule> handlerRules = FastList.newInstance();
+ List<ServiceEcaRule> handlerRules = new LinkedList<ServiceEcaRule>();
Element rootElement = null;
try {
rootElement = handler.getDocument().getDocumentElement();
@@ -134,14 +134,14 @@
List<ServiceEcaRule> rules = null;
if (eventMap == null) {
- eventMap = FastMap.newInstance();
- rules = FastList.newInstance();
+ eventMap = new HashMap<String, List<ServiceEcaRule>>();
+ rules = new LinkedList<ServiceEcaRule>();
ecaCache.put(serviceName, eventMap);
eventMap.put(eventName, rules);
} else {
rules = eventMap.get(eventName);
if (rules == null) {
- rules = FastList.newInstance();
+ rules = new LinkedList<ServiceEcaRule>();
eventMap.put(eventName, rules);
}
}
@@ -160,7 +160,7 @@
if (event != null) {
return eventMap.get(event);
} else {
- List<ServiceEcaRule> rules = FastList.newInstance();
+ List<ServiceEcaRule> rules = new LinkedList<ServiceEcaRule>();
for (Collection<ServiceEcaRule> col: eventMap.values()) {
rules.addAll(col);
}
diff --git a/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java b/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java
index 2cee9b7..6323151 100644
--- a/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java
+++ b/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java
@@ -18,12 +18,11 @@
*/
package org.ofbiz.service.engine;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilDateTime;
@@ -69,7 +68,7 @@
// static java service methods should be: public Map<String, Object> methodName(DispatchContext dctx, Map<String, Object> context)
DispatchContext dctx = dispatcher.getLocalContext(localName);
Locale locale = (Locale) parameters.get("locale");
- Map<String, Object> localContext = FastMap.newInstance();
+ Map<String, Object> localContext = new HashMap<String, Object>();
localContext.put("parameters", parameters);
Map<String, Object> result = ServiceUtil.returnSuccess();
diff --git a/framework/service/src/org/ofbiz/service/engine/GenericEngineFactory.java b/framework/service/src/org/ofbiz/service/engine/GenericEngineFactory.java
index 9095bed..05136d2 100644
--- a/framework/service/src/org/ofbiz/service/engine/GenericEngineFactory.java
+++ b/framework/service/src/org/ofbiz/service/engine/GenericEngineFactory.java
@@ -19,15 +19,14 @@
package org.ofbiz.service.engine;
import java.lang.reflect.Constructor;
+import java.util.HashMap;
import java.util.Map;
-import javolution.util.FastMap;
-
import org.ofbiz.base.config.GenericConfigException;
+import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.ServiceDispatcher;
import org.ofbiz.service.config.ServiceConfigUtil;
-import org.ofbiz.base.util.UtilGenerics;
/**
* Generic Engine Factory
@@ -39,7 +38,7 @@
public GenericEngineFactory(ServiceDispatcher dispatcher) {
this.dispatcher = dispatcher;
- engines = FastMap.newInstance();
+ engines = new HashMap<String, GenericEngine>();
}
/**
diff --git a/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java b/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java
index d8ab8d0..ebe0f44 100644
--- a/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java
+++ b/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java
@@ -23,14 +23,13 @@
import groovy.lang.Script;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.script.ScriptContext;
-import javolution.util.FastMap;
-
import org.codehaus.groovy.control.CompilerConfiguration;
import org.codehaus.groovy.runtime.InvokerHelper;
import org.ofbiz.base.config.GenericConfigException;
@@ -103,10 +102,10 @@
if (UtilValidate.isEmpty(modelService.location)) {
throw new GenericServiceException("Cannot run Groovy service with empty location");
}
- Map<String, Object> params = FastMap.newInstance();
+ Map<String, Object> params = new HashMap<String, Object>();
params.putAll(context);
- Map<String, Object> gContext = FastMap.newInstance();
+ Map<String, Object> gContext = new HashMap<String, Object>();
gContext.putAll(context);
gContext.put(ScriptUtil.PARAMETERS_KEY, params);
diff --git a/framework/service/src/org/ofbiz/service/engine/HttpEngine.java b/framework/service/src/org/ofbiz/service/engine/HttpEngine.java
index 9aba520..8bdddd1 100644
--- a/framework/service/src/org/ofbiz/service/engine/HttpEngine.java
+++ b/framework/service/src/org/ofbiz/service/engine/HttpEngine.java
@@ -20,13 +20,12 @@
import java.io.IOException;
import java.io.PrintWriter;
+import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.HttpClient;
import org.ofbiz.base.util.HttpClientException;
@@ -66,7 +65,7 @@
throw new GenericServiceException("Cannot serialize context.", e);
}
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("serviceName", modelService.invoke);
if (xmlContext != null)
parameters.put("serviceContext", xmlContext);
@@ -115,7 +114,7 @@
String serviceMode = request.getParameter("serviceMode");
String xmlContext = request.getParameter("serviceContext");
- Map<String, Object> result = FastMap.newInstance();
+ Map<String, Object> result = new HashMap<String, Object>();
Map<String, Object> context = null;
if (serviceName == null)
diff --git a/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java b/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
index 6f3e4f3..550a0d6 100644
--- a/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
+++ b/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
@@ -19,6 +19,7 @@
package org.ofbiz.service.engine;
import java.io.StringReader;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -26,8 +27,6 @@
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
-import javolution.util.FastMap;
-
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
@@ -107,7 +106,7 @@
int i = 0;
- Map<String, Object> parameterMap = FastMap.newInstance();
+ Map<String, Object> parameterMap = new HashMap<String, Object>();
for (ModelParam p: inModelParamList) {
if (Debug.infoOn()) Debug.logInfo("[SOAPClientEngine.invoke} : Parameter: " + p.name + " (" + p.mode + ") - " + i, module);
diff --git a/framework/service/src/org/ofbiz/service/engine/ScriptEngine.java b/framework/service/src/org/ofbiz/service/engine/ScriptEngine.java
index 172c087..347a35d 100644
--- a/framework/service/src/org/ofbiz/service/engine/ScriptEngine.java
+++ b/framework/service/src/org/ofbiz/service/engine/ScriptEngine.java
@@ -21,6 +21,7 @@
import static org.ofbiz.base.util.UtilGenerics.cast;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@@ -28,8 +29,6 @@
import javax.script.ScriptContext;
import javax.script.ScriptException;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Assert;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.ScriptUtil;
@@ -74,7 +73,7 @@
@Override
public Map<String, Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceException {
Assert.notNull("localName", localName, "modelService.location", modelService.location, "context", context);
- Map<String, Object> params = FastMap.newInstance();
+ Map<String, Object> params = new HashMap<String, Object>();
params.putAll(context);
context.put(ScriptUtil.PARAMETERS_KEY, params);
DispatchContext dctx = dispatcher.getLocalContext(localName);
diff --git a/framework/service/src/org/ofbiz/service/engine/XMLRPCClientEngine.java b/framework/service/src/org/ofbiz/service/engine/XMLRPCClientEngine.java
index d08de04..a910cf2 100644
--- a/framework/service/src/org/ofbiz/service/engine/XMLRPCClientEngine.java
+++ b/framework/service/src/org/ofbiz/service/engine/XMLRPCClientEngine.java
@@ -20,11 +20,10 @@
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javolution.util.FastMap;
-
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
import org.ofbiz.base.config.GenericConfigException;
@@ -128,7 +127,7 @@
}
Map<String, Object> result = null;
- Map<String, Object> params = FastMap.newInstance();
+ Map<String, Object> params = new HashMap<String, Object>();
for (ModelParam modelParam: modelService.getModelParamList()) {
// don't include OUT parameters in this list, only IN and INOUT
if ("OUT".equals(modelParam.mode) || modelParam.internal) continue;
diff --git a/framework/service/src/org/ofbiz/service/group/GroupModel.java b/framework/service/src/org/ofbiz/service/group/GroupModel.java
index 5b36af5..12ce49f 100644
--- a/framework/service/src/org/ofbiz/service/group/GroupModel.java
+++ b/framework/service/src/org/ofbiz/service/group/GroupModel.java
@@ -20,9 +20,7 @@
import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
-
-import javolution.util.FastMap;
+import java.util.*;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
@@ -58,19 +56,21 @@
throw new IllegalArgumentException("Group Definition found with no name attribute! : " + group);
}
- for (Element service: UtilXml.childElementList(group, "invoke")) {
+ for (Element service : UtilXml.childElementList(group, "invoke")) {
services.add(new GroupServiceModel(service));
}
List<? extends Element> oldServiceTags = UtilXml.childElementList(group, "service");
if (oldServiceTags.size() > 0) {
- for (Element service: oldServiceTags) {
+ for (Element service : oldServiceTags) {
services.add(new GroupServiceModel(service));
}
- Debug.logWarning("Service Group Definition : [" + group.getAttribute("name") + "] found with OLD 'service' attribute, change to use 'invoke'", module);
+ Debug.logWarning("Service Group Definition : [" + group.getAttribute("name")
+ + "] found with OLD 'service' attribute, change to use 'invoke'", module);
}
- if (Debug.verboseOn()) Debug.logVerbose("Created Service Group Model --> " + this, module);
+ if (Debug.verboseOn())
+ Debug.logVerbose("Created Service Group Model --> " + this, module);
}
/**
@@ -109,6 +109,7 @@
public List<GroupServiceModel> getServices() {
return this.services;
}
+
public boolean isOptional() {
return optional;
}
@@ -121,7 +122,8 @@
* @return Map Result Map
* @throws GenericServiceException
*/
- public Map<String, Object> run(ServiceDispatcher dispatcher, String localName, Map<String, Object> context) throws GenericServiceException {
+ public Map<String, Object> run(ServiceDispatcher dispatcher, String localName, Map<String, Object> context)
+ throws GenericServiceException {
if (this.getSendMode().equals("all")) {
return runAll(dispatcher, localName, context);
} else if (this.getSendMode().equals("round-robin")) {
@@ -132,7 +134,7 @@
} else if (this.getSendMode().equals("first-available")) {
return runOne(dispatcher, localName, context);
} else if (this.getSendMode().equals("none")) {
- return FastMap.newInstance();
+ return new HashMap<String, Object>();
} else {
throw new GenericServiceException("This mode is not currently supported");
}
@@ -152,13 +154,16 @@
return str.toString();
}
- private Map<String, Object> runAll(ServiceDispatcher dispatcher, String localName, Map<String, Object> context) throws GenericServiceException {
+ private Map<String, Object> runAll(ServiceDispatcher dispatcher, String localName, Map<String, Object> context)
+ throws GenericServiceException {
Map<String, Object> runContext = UtilMisc.makeMapWritable(context);
- Map<String, Object> result = FastMap.newInstance();
- for (GroupServiceModel model: services) {
- if (Debug.verboseOn()) Debug.logVerbose("Using Context: " + runContext, module);
+ Map<String, Object> result = new HashMap<String, Object>();
+ for (GroupServiceModel model : services) {
+ if (Debug.verboseOn())
+ Debug.logVerbose("Using Context: " + runContext, module);
Map<String, Object> thisResult = model.invoke(dispatcher, localName, runContext);
- if (Debug.verboseOn()) Debug.logVerbose("Result: " + thisResult, module);
+ if (Debug.verboseOn())
+ Debug.logVerbose("Result: " + thisResult, module);
// make sure we didn't fail
if (ServiceUtil.isError(thisResult)) {
@@ -175,14 +180,16 @@
return result;
}
- private Map<String, Object> runIndex(ServiceDispatcher dispatcher, String localName, Map<String, Object> context, int index) throws GenericServiceException {
+ private Map<String, Object> runIndex(ServiceDispatcher dispatcher, String localName, Map<String, Object> context, int index)
+ throws GenericServiceException {
GroupServiceModel model = services.get(index);
return model.invoke(dispatcher, localName, context);
}
- private Map<String, Object> runOne(ServiceDispatcher dispatcher, String localName, Map<String, Object> context) throws GenericServiceException {
+ private Map<String, Object> runOne(ServiceDispatcher dispatcher, String localName, Map<String, Object> context)
+ throws GenericServiceException {
Map<String, Object> result = null;
- for (GroupServiceModel model: services) {
+ for (GroupServiceModel model : services) {
try {
result = model.invoke(dispatcher, localName, context);
} catch (GenericServiceException e) {
diff --git a/framework/service/src/org/ofbiz/service/group/GroupServiceModel.java b/framework/service/src/org/ofbiz/service/group/GroupServiceModel.java
index 282c11e..bae244e 100644
--- a/framework/service/src/org/ofbiz/service/group/GroupServiceModel.java
+++ b/framework/service/src/org/ofbiz/service/group/GroupServiceModel.java
@@ -18,16 +18,15 @@
*******************************************************************************/
package org.ofbiz.service.group;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javolution.util.FastMap;
-
+import org.ofbiz.base.util.Debug;
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.ModelService;
import org.ofbiz.service.ServiceDispatcher;
-import org.ofbiz.base.util.Debug;
import org.w3c.dom.Element;
/**
@@ -117,7 +116,7 @@
return dispatcher.runSync(localName, model, thisContext);
} else {
dispatcher.runAsync(localName, model, thisContext, false);
- return FastMap.newInstance();
+ return new HashMap<String, Object>();
}
} else {
return dispatcher.runSync(localName, model, thisContext);
diff --git a/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java b/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java
index dfda2fc..30de016 100644
--- a/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java
+++ b/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java
@@ -20,8 +20,7 @@
import java.util.List;
import java.util.Map;
-
-import javolution.util.FastMap;
+import java.util.concurrent.ConcurrentHashMap;
import org.ofbiz.base.component.ComponentConfig;
import org.ofbiz.base.config.GenericConfigException;
@@ -41,7 +40,7 @@
public static final String module = ServiceGroupReader.class.getName();
// using a cache is dangerous here because if someone clears it the groups won't work at all: public static UtilCache groupsCache = new UtilCache("service.ServiceGroups", 0, 0, false);
- public static Map<String, GroupModel> groupsCache = FastMap.newInstance();
+ public static Map<String, GroupModel> groupsCache = new ConcurrentHashMap<String, GroupModel>();
public static void readConfig() {
List<ServiceGroups> serviceGroupsList = null;
diff --git a/framework/service/src/org/ofbiz/service/jms/JmsListenerFactory.java b/framework/service/src/org/ofbiz/service/jms/JmsListenerFactory.java
index e30d120..4871658 100644
--- a/framework/service/src/org/ofbiz/service/jms/JmsListenerFactory.java
+++ b/framework/service/src/org/ofbiz/service/jms/JmsListenerFactory.java
@@ -21,10 +21,9 @@
import java.lang.reflect.Constructor;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicReference;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilMisc;
@@ -45,8 +44,8 @@
public static final String TOPIC_LISTENER_CLASS = "org.ofbiz.service.jms.JmsTopicListener";
public static final String QUEUE_LISTENER_CLASS = "org.ofbiz.service.jms.JmsQueueListener";
- protected static Map<String, GenericMessageListener> listeners = FastMap.newInstance();
- protected static Map<String, Server> servers = FastMap.newInstance();
+ protected static Map<String, GenericMessageListener> listeners = new ConcurrentHashMap<String, GenericMessageListener>();
+ protected static Map<String, Server> servers = new ConcurrentHashMap<String, Server>();
private static final AtomicReference<JmsListenerFactory> jlFactoryRef = new AtomicReference<JmsListenerFactory>(null);
diff --git a/framework/service/src/org/ofbiz/service/jms/JmsServiceEngine.java b/framework/service/src/org/ofbiz/service/jms/JmsServiceEngine.java
index 90d5eb9..28e6c64 100644
--- a/framework/service/src/org/ofbiz/service/jms/JmsServiceEngine.java
+++ b/framework/service/src/org/ofbiz/service/jms/JmsServiceEngine.java
@@ -19,6 +19,7 @@
package org.ofbiz.service.jms;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -43,8 +44,6 @@
import javax.naming.NamingException;
import javax.transaction.xa.XAResource;
-import javolution.util.FastMap;
-
import org.ofbiz.base.config.GenericConfigException;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
@@ -310,7 +309,7 @@
JmsService serviceElement = getServiceElement(modelService);
List<Server> serverList = serviceElement.getServers();
- Map<String, Object> result = FastMap.newInstance();
+ Map<String, Object> result = new HashMap<String, Object>();
for (Server server: serverList) {
String serverType = server.getType();
if (serverType.equals("topic"))
diff --git a/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java b/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java
index 6809df6..6c748d2 100644
--- a/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java
+++ b/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java
@@ -21,12 +21,11 @@
import java.io.IOException;
import java.sql.Timestamp;
import java.util.Date;
+import java.util.HashMap;
import java.util.Map;
import javax.xml.parsers.ParserConfigurationException;
-import javolution.util.FastMap;
-
import org.apache.commons.lang.StringUtils;
import org.ofbiz.base.config.GenericConfigException;
import org.ofbiz.base.util.Debug;
@@ -291,7 +290,7 @@
}
}
if (context == null) {
- context = FastMap.newInstance();
+ context = new HashMap<String, Object>();
}
// check the runAsUser
if (!UtilValidate.isEmpty(jobValue.getString("runAsUser"))) {
diff --git a/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java b/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java
index 0f44dfe..a49806e 100644
--- a/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java
+++ b/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java
@@ -18,12 +18,13 @@
*******************************************************************************/
package org.ofbiz.service.mail;
+import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.sql.Timestamp;
+import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
@@ -36,8 +37,6 @@
import javax.mail.Session;
import javax.mail.internet.MimeMessage;
-import javolution.util.FastList;
-
import org.ofbiz.base.conversion.AbstractConverter;
import org.ofbiz.base.conversion.ConversionException;
import org.ofbiz.base.conversion.Converters;
@@ -248,7 +247,7 @@
}
public List<String> getAttachmentIndexes() {
- List<String> attachments = FastList.newInstance();
+ List<String> attachments = new LinkedList<String>();
if (getMainPartCount() == 0) { // single part message (no attachments)
return attachments;
} else {
diff --git a/framework/service/src/org/ofbiz/service/mail/ServiceMcaAction.java b/framework/service/src/org/ofbiz/service/mail/ServiceMcaAction.java
index 30c0fbc..2baf989 100644
--- a/framework/service/src/org/ofbiz/service/mail/ServiceMcaAction.java
+++ b/framework/service/src/org/ofbiz/service/mail/ServiceMcaAction.java
@@ -18,18 +18,16 @@
*******************************************************************************/
package org.ofbiz.service.mail;
+import java.util.HashMap;
import java.util.Map;
-import javolution.util.FastMap;
-
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.GenericValue;
import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ServiceUtil;
-import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.Debug;
-import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.entity.GenericValue;
-
import org.w3c.dom.Element;
@SuppressWarnings("serial")
@@ -54,7 +52,7 @@
}
public boolean runAction(LocalDispatcher dispatcher, MimeMessageWrapper messageWrapper, GenericValue userLogin) throws GenericServiceException {
- Map<String, Object> serviceContext = FastMap.newInstance();
+ Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.putAll(UtilMisc.toMap("messageWrapper", messageWrapper, "userLogin", userLogin));
serviceContext.put("userLogin", ServiceUtil.getUserLogin(dispatcher.getDispatchContext(), serviceContext, runAsUser));
diff --git a/framework/service/src/org/ofbiz/service/mail/ServiceMcaCondition.java b/framework/service/src/org/ofbiz/service/mail/ServiceMcaCondition.java
index 0af1ad7..6ab417f 100644
--- a/framework/service/src/org/ofbiz/service/mail/ServiceMcaCondition.java
+++ b/framework/service/src/org/ofbiz/service/mail/ServiceMcaCondition.java
@@ -19,8 +19,10 @@
package org.ofbiz.service.mail;
import java.io.IOException;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+
import javax.mail.Address;
import javax.mail.BodyPart;
import javax.mail.MessagingException;
@@ -28,15 +30,12 @@
import javax.mail.Part;
import javax.mail.internet.MimeMessage;
-import javolution.util.FastList;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.service.LocalDispatcher;
-import org.ofbiz.service.GenericServiceException;
-import org.ofbiz.service.ServiceUtil;
import org.ofbiz.entity.GenericValue;
-
+import org.ofbiz.service.GenericServiceException;
+import org.ofbiz.service.LocalDispatcher;
+import org.ofbiz.service.ServiceUtil;
import org.w3c.dom.Element;
@SuppressWarnings("serial")
@@ -250,7 +249,7 @@
if (c instanceof String) {
return UtilMisc.toList((String) c);
} else if (c instanceof Multipart) {
- List<String> textContent = FastList.newInstance();
+ List<String> textContent = new LinkedList<String>();
int count = ((Multipart) c).getCount();
for (int i = 0; i < count; i++) {
BodyPart bp = ((Multipart) c).getBodyPart(i);
@@ -258,7 +257,7 @@
}
return textContent;
} else {
- return FastList.newInstance();
+ return new LinkedList<String>();
}
}
}
diff --git a/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java b/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java
index da7e625..b63332c 100644
--- a/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java
+++ b/framework/service/src/org/ofbiz/service/rmi/ExampleRemoteClient.java
@@ -18,15 +18,13 @@
*******************************************************************************/
package org.ofbiz.service.rmi;
+import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
-import java.net.MalformedURLException;
+import java.util.HashMap;
import java.util.Map;
-import javolution.util.FastMap;
-
-import org.ofbiz.service.rmi.RemoteDispatcher;
import org.ofbiz.service.GenericServiceException;
/** An example of how to remotely access the Service Engine's RemoteDispatcher.
@@ -67,7 +65,7 @@
}
public Map<String, Object> runTestService() throws RemoteException, GenericServiceException {
- Map<String, Object> context = FastMap.newInstance();
+ Map<String, Object> context = new HashMap<String, Object>();
context.put("message", "Remote Service Test");
return rd.runSync("testScv", context);
}
diff --git a/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java b/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java
index 7086dd0..b19fc87 100644
--- a/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java
+++ b/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java
@@ -18,12 +18,11 @@
*/
package org.ofbiz.service.test;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import javolution.util.FastList;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
@@ -53,7 +52,7 @@
// make sure to wait for these to both finish to make sure results aren't checked until they are done
Map<String, Object> threadAResult = threadAWaiter.waitForResult();
Map<String, Object> threadBResult = threadBWaiter.waitForResult();
- List<Object> errorList = FastList.newInstance();
+ List<Object> errorList = new LinkedList<Object>();
if (ServiceUtil.isError(threadAResult)) {
errorList.add(UtilProperties.getMessage(resource, "ServiceTestDeadLockThreadA", UtilMisc.toMap("errorString", ServiceUtil.getErrorMessage(threadAResult)), locale));
}
@@ -148,7 +147,7 @@
// make sure to wait for these to both finish to make sure results aren't checked until they are done
Map<String, Object> grabberResult = grabberWaiter.waitForResult();
Map<String, Object> waiterResult = waiterWaiter.waitForResult();
- List<Object> errorList = FastList.newInstance();
+ List<Object> errorList = new LinkedList<Object>();
if (ServiceUtil.isError(grabberResult)) {
errorList.add("Error running testServiceLockWaitTimeoutRetryGrabber: " + ServiceUtil.getErrorMessage(grabberResult));
}
diff --git a/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java b/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java
index f804635..24d6cbf 100644
--- a/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java
+++ b/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java
@@ -18,11 +18,10 @@
*/
package org.ofbiz.service.test;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.entity.GenericValue;
@@ -38,14 +37,14 @@
}
public void testSOAPSimpleService() throws Exception {
- Map<String, Object> serviceContext = FastMap.newInstance();
+ Map<String, Object> serviceContext = new HashMap<String, Object>();
serviceContext.put("defaultValue", new Double("123.4567"));
serviceContext.put("message", "Test Message !!!");
dispatcher.runSync("testSoapSimple", serviceContext);
}
public void testSOAPService() throws Exception {
- Map<String, Object> serviceContext = FastMap.newInstance();
+ Map<String, Object> serviceContext = new HashMap<String, Object>();
GenericValue testing = delegator.makeValue("Testing");
testing.put("testingId", "COMPLEX_TYPE_TEST");
testing.put("testingTypeId", "SOAP_TEST");
diff --git a/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java b/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java
index 4662618..0f174a0 100644
--- a/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java
+++ b/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java
@@ -21,6 +21,8 @@
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -30,10 +32,6 @@
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
-import org.w3c.dom.Element;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.ObjectType;
@@ -59,6 +57,7 @@
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.ModelService;
+import org.w3c.dom.Element;
@SuppressWarnings("serial")
public abstract class ModelWidgetAction implements Serializable {
@@ -140,6 +139,7 @@
}
}
+ @SuppressWarnings("rawtypes")
@Override
public void runAction(Map<String, Object> context) {
String globalStr = this.globalExdr.expandString(context);
@@ -179,9 +179,9 @@
if (UtilValidate.isNotEmpty(this.type)) {
if ("NewMap".equals(this.type)) {
- newValue = FastMap.newInstance();
+ newValue = new HashMap();
} else if ("NewList".equals(this.type)) {
- newValue = FastList.newInstance();
+ newValue = new LinkedList();
} else {
try {
newValue = ObjectType.simpleTypeConvert(newValue, this.type, null, (TimeZone) context.get("timeZone"), (Locale) context.get("locale"), true);
@@ -400,7 +400,7 @@
@Override
public void runAction(Map<String, Object> context) throws GeneralException {
if (location.endsWith(".xml")) {
- Map<String, Object> localContext = FastMap.newInstance();
+ Map<String, Object> localContext = new HashMap<String, Object>();
localContext.putAll(context);
DispatchContext ctx = WidgetWorker.getDispatcher(context).getDispatchContext();
MethodContext methodContext = new MethodContext(ctx, localContext, null);
@@ -445,7 +445,7 @@
if ("true".equals(autoFieldMapString)) {
DispatchContext dc = WidgetWorker.getDispatcher(context).getDispatchContext();
// try a map called "parameters", try it first so values from here are overriden by values in the main context
- Map<String, Object> combinedMap = FastMap.newInstance();
+ Map<String, Object> combinedMap = new HashMap<String, Object>();
Map<String, Object> parametersObj = UtilGenerics.toMap(context.get("parameters"));
if (parametersObj != null) {
combinedMap.putAll(parametersObj);
@@ -460,7 +460,7 @@
}
}
if (serviceContext == null) {
- serviceContext = FastMap.newInstance();
+ serviceContext = new HashMap<String, Object>();
}
if (this.fieldMap != null) {
diff --git a/framework/widget/src/org/ofbiz/widget/WidgetFactory.java b/framework/widget/src/org/ofbiz/widget/WidgetFactory.java
index b59298b..5b9f591 100644
--- a/framework/widget/src/org/ofbiz/widget/WidgetFactory.java
+++ b/framework/widget/src/org/ofbiz/widget/WidgetFactory.java
@@ -24,8 +24,7 @@
import java.util.Iterator;
import java.util.Map;
import java.util.ServiceLoader;
-
-import javolution.util.FastMap;
+import java.util.concurrent.ConcurrentHashMap;
import org.ofbiz.base.util.Assert;
import org.ofbiz.base.util.Debug;
@@ -42,7 +41,7 @@
public class WidgetFactory {
public static final String module = WidgetFactory.class.getName();
- protected static final Map<String, Constructor<? extends ModelScreenWidget>> screenWidgets = FastMap.newInstance();
+ protected static final Map<String, Constructor<? extends ModelScreenWidget>> screenWidgets = new ConcurrentHashMap<String, Constructor<? extends ModelScreenWidget>>();
static {
loadStandardWidgets();
diff --git a/framework/widget/src/org/ofbiz/widget/WidgetWorker.java b/framework/widget/src/org/ofbiz/widget/WidgetWorker.java
index 66fd030..fd31822 100644
--- a/framework/widget/src/org/ofbiz/widget/WidgetWorker.java
+++ b/framework/widget/src/org/ofbiz/widget/WidgetWorker.java
@@ -25,6 +25,8 @@
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -34,9 +36,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilDateTime;
@@ -414,7 +413,7 @@
public static class AutoServiceParameters {
private String serviceName;
- List<String> excludeList = FastList.newInstance();
+ List<String> excludeList = new ArrayList<String>();
boolean includePk;
boolean includeNonPk;
boolean sendIfEmpty;
@@ -433,7 +432,7 @@
@SuppressWarnings("unchecked")
public Map<String, String> getParametersMap(Map<String, Object> context, String defaultServiceName) {
- Map<String, String> autServiceParams = FastMap.newInstance();
+ Map<String, String> autServiceParams = new HashMap<String, String>();
LocalDispatcher dispatcher = (LocalDispatcher) context.get("dispatcher");
if (dispatcher == null) {
Debug.logError("We can not append auto service Parameters since we could not find dispatcher in the current context", module);
@@ -477,7 +476,7 @@
public static class AutoEntityParameters {
private String entityName;
private String includeType;
- List<String> excludeList = FastList.newInstance();
+ List<String> excludeList = new ArrayList<String>();
boolean includePk;
boolean includeNonPk;
boolean sendIfEmpty;
@@ -499,7 +498,7 @@
@SuppressWarnings("unchecked")
public Map<String, String> getParametersMap(Map<String, Object> context, String defaultEntityName) {
- Map<String, String> autEntityParams = FastMap.newInstance();
+ Map<String, String> autEntityParams = new HashMap<String, String>();
Delegator delegator = (Delegator) context.get("delegator");
if (delegator == null) {
Debug.logError("We can not append auto entity Parameters since we could not find delegator in the current context", module);
diff --git a/framework/widget/src/org/ofbiz/widget/cache/WidgetContextCacheKey.java b/framework/widget/src/org/ofbiz/widget/cache/WidgetContextCacheKey.java
index 1fa209a..56c0e0f 100644
--- a/framework/widget/src/org/ofbiz/widget/cache/WidgetContextCacheKey.java
+++ b/framework/widget/src/org/ofbiz/widget/cache/WidgetContextCacheKey.java
@@ -18,24 +18,24 @@
*******************************************************************************/
package org.ofbiz.widget.cache;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import javolution.util.FastMap;
-import javolution.util.FastSet;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilMisc;
-public class WidgetContextCacheKey {
+public final class WidgetContextCacheKey {
public static final String module = WidgetContextCacheKey.class.getName();
- private static Set<String> fieldNamesToSkip;
+ private static Set<String> fieldNamesToSkip = createFieldNamesToSkip();
- static {
- fieldNamesToSkip = FastSet.newInstance();
+ private static Set<String> createFieldNamesToSkip(){
+ Set<String> fieldNamesToSkip = new HashSet<String>();
fieldNamesToSkip.add("globalContext");
fieldNamesToSkip.add("delegator");
fieldNamesToSkip.add("dispatcher");
@@ -76,13 +76,13 @@
// parameters
fieldNamesToSkip.add("visit");
fieldNamesToSkip.add("visitor");
+ return Collections.unmodifiableSet(fieldNamesToSkip);
}
- protected Map<String, Object> context;
+ private final Map<String, Object> context;
public WidgetContextCacheKey(Map<String, ? extends Object> context) {
- this.context = FastMap.newInstance();
- this.context.putAll(context);
+ this.context = Collections.unmodifiableMap(new HashMap<String, Object>(context));
}
@Override
@@ -103,7 +103,7 @@
return false;
}
- Set<String> unifiedContext = FastSet.newInstance();
+ Set<String> unifiedContext = new HashSet<String>();
unifiedContext.addAll(this.context.keySet());
unifiedContext.addAll(key.context.keySet());
for (String fieldName: unifiedContext) {
@@ -135,7 +135,7 @@
@Override
public String toString() {
- Map<String, Object> printableMap = FastMap.newInstance();
+ Map<String, Object> printableMap = new HashMap<String, Object>();
for (String fieldName: this.context.keySet()) {
if (!fieldNamesToSkip.contains(fieldName) && !"parameters".equals(fieldName)) {
printableMap.put(fieldName, this.context.get(fieldName));
@@ -146,7 +146,7 @@
}
public static String printMap(Map<String, ? extends Object> map) {
- Map<String, Object> printableMap = FastMap.newInstance();
+ Map<String, Object> printableMap = new HashMap<String, Object>();
for (Map.Entry<String, ? extends Object> entry : map.entrySet()) {
String fieldName = entry.getKey();
if (!fieldNamesToSkip.contains(fieldName) &&
@@ -160,7 +160,7 @@
}
public static boolean parametersAreEqual(Map<String, ? extends Object> map1, Map<String, ? extends Object> map2) {
- Set<String> unifiedContext = FastSet.newInstance();
+ Set<String> unifiedContext = new HashSet<String>();
unifiedContext.addAll(map1.keySet());
unifiedContext.addAll(map2.keySet());
for (String fieldName: unifiedContext) {
diff --git a/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java b/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
index fb62680..e516a4f 100644
--- a/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
+++ b/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
@@ -26,6 +26,7 @@
import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -37,8 +38,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javolution.util.FastList;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilFormatOut;
@@ -87,18 +86,18 @@
* Widget Library - Form Renderer implementation based on Freemarker macros
*
*/
-public class MacroFormRenderer implements FormStringRenderer {
+public final class MacroFormRenderer implements FormStringRenderer {
public static final String module = MacroFormRenderer.class.getName();
- private Template macroLibrary;
- private WeakHashMap<Appendable, Environment> environments = new WeakHashMap<Appendable, Environment>();
- private StringUtil.SimpleEncoder internalEncoder;
- protected RequestHandler rh;
- protected HttpServletRequest request;
- protected HttpServletResponse response;
- protected boolean javaScriptEnabled = false;
- protected boolean renderPagination = true;
- protected boolean widgetCommentsEnabled = false;
+ private final Template macroLibrary;
+ private final WeakHashMap<Appendable, Environment> environments = new WeakHashMap<Appendable, Environment>();
+ private final StringUtil.SimpleEncoder internalEncoder;
+ private final RequestHandler rh;
+ private final HttpServletRequest request;
+ private final HttpServletResponse response;
+ private final boolean javaScriptEnabled;
+ private boolean renderPagination = true;
+ private boolean widgetCommentsEnabled = false;
public MacroFormRenderer(String macroLibraryPath, HttpServletRequest request, HttpServletResponse response) throws TemplateException, IOException {
macroLibrary = FreeMarkerWorker.getTemplate(macroLibraryPath);
@@ -1087,7 +1086,7 @@
String backgroundSubmitRefreshTarget = submitField.getBackgroundSubmitRefreshTarget(context);
if (UtilValidate.isNotEmpty(backgroundSubmitRefreshTarget)) {
if (updateAreas == null) {
- updateAreas = FastList.newInstance();
+ updateAreas = new LinkedList<ModelForm.UpdateArea>();
}
updateAreas.add(new ModelForm.UpdateArea("submit", formId, backgroundSubmitRefreshTarget));
}
@@ -1414,8 +1413,8 @@
this.renderNextPrev(writer, context, modelForm);
}
List<ModelFormField> childFieldList = modelForm.getFieldList();
- List<String> columnStyleList = FastList.newInstance();
- List<String> fieldNameList = FastList.newInstance();
+ List<String> columnStyleList = new LinkedList<String>();
+ List<String> fieldNameList = new LinkedList<String>();
for (ModelFormField childField : childFieldList) {
int childFieldType = childField.getFieldInfo().getFieldType();
if (childFieldType == ModelFormField.FieldInfo.HIDDEN || childFieldType == ModelFormField.FieldInfo.IGNORED) {
@@ -2012,7 +2011,7 @@
autoCompleterTarget = lookupFieldFormName + "&amp;";
}
autoCompleterTarget = autoCompleterTarget + "ajaxLookup=Y";
- updateAreas = FastList.newInstance();
+ updateAreas = new LinkedList<ModelForm.UpdateArea>();
updateAreas.add(new ModelForm.UpdateArea("change", id, autoCompleterTarget));
}
boolean ajaxEnabled = updateAreas != null && this.javaScriptEnabled;
diff --git a/framework/widget/src/org/ofbiz/widget/form/ModelForm.java b/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
index 162d78b..9305f41 100644
--- a/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
+++ b/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
@@ -21,7 +21,10 @@
import java.io.IOException;
import java.util.ArrayList;
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;
@@ -30,10 +33,6 @@
import java.util.TreeMap;
import java.util.TreeSet;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-import javolution.util.FastSet;
-
import org.ofbiz.base.util.BshUtil;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
@@ -131,12 +130,12 @@
protected boolean overridenListSize = false;
protected boolean clientAutocompleteFields = true;
- protected List<AltTarget> altTargets = FastList.newInstance();
- protected List<AutoFieldsService> autoFieldsServices = FastList.newInstance();
- protected List<AutoFieldsEntity> autoFieldsEntities = FastList.newInstance();
- protected List<String> lastOrderFields = FastList.newInstance();
- protected List<SortField> sortOrderFields = FastList.newInstance();
- protected List<AltRowStyle> altRowStyles = FastList.newInstance();
+ protected List<AltTarget> altTargets = new ArrayList<AltTarget>();
+ protected List<AutoFieldsService> autoFieldsServices = new ArrayList<AutoFieldsService>();
+ protected List<AutoFieldsEntity> autoFieldsEntities = new ArrayList<AutoFieldsEntity>();
+ protected List<String> lastOrderFields = new ArrayList<String>();
+ protected List<SortField> sortOrderFields = new ArrayList<SortField>();
+ protected List<AltRowStyle> altRowStyles = new ArrayList<AltRowStyle>();
/** This List will contain one copy of each field for each field name in the order
* they were encountered in the service, entity, or form definition; field definitions
@@ -147,25 +146,25 @@
* necessary to use the Map. The Map is used when loading the form definition to keep the
* list clean and implement the override features for field definitions.
*/
- protected List<ModelFormField> fieldList = FastList.newInstance();
+ protected List<ModelFormField> fieldList = new ArrayList<ModelFormField>();
/** This Map is keyed with the field name and has a ModelFormField for the value.
*/
- protected Map<String, ModelFormField> fieldMap = FastMap.newInstance();
+ protected Map<String, ModelFormField> fieldMap = new HashMap<String, ModelFormField>();
/** Keeps track of conditional fields to help ensure that only one is rendered
*/
- protected Set<String> useWhenFields = FastSet.newInstance();
+ protected Set<String> useWhenFields = new HashSet<String>();
/** This is a list of FieldGroups in the order they were created.
* Can also include Banner objects.
*/
- protected List<FieldGroupBase> fieldGroupList = FastList.newInstance();
+ protected List<FieldGroupBase> fieldGroupList = new ArrayList<FieldGroupBase>();
/** This Map is keyed with the field name and has a FieldGroup for the value.
* Can also include Banner objects.
*/
- protected Map<String, FieldGroupBase> fieldGroupMap = FastMap.newInstance();
+ protected Map<String, FieldGroupBase> fieldGroupMap = new HashMap<String, FieldGroupBase>();
/** This field group will be the "catch-all" group for fields that are not
* included in an explicit field-group.
@@ -192,7 +191,7 @@
protected List<ModelFormAction> actions;
protected List<ModelFormAction> rowActions;
protected FlexibleStringExpander rowCountExdr;
- protected List<ModelFormField> multiSubmitFields = FastList.newInstance();
+ protected List<ModelFormField> multiSubmitFields = new ArrayList<ModelFormField>();
protected int rowCount = 0;
private String sortFieldParameterName = "sortField";
@@ -571,7 +570,7 @@
// reorder fields according to sort order
if (sortOrderFields.size() > 0) {
- List<ModelFormField> sortedFields = FastList.newInstance();
+ List<ModelFormField> sortedFields = new LinkedList<ModelFormField>();
for (SortField sortField: this.sortOrderFields) {
String fieldName = sortField.getFieldName();
if (UtilValidate.isEmpty(fieldName)) {
@@ -599,7 +598,7 @@
}
if (UtilValidate.isNotEmpty(this.lastOrderFields)) {
- List<ModelFormField> lastedFields = FastList.newInstance();
+ List<ModelFormField> lastedFields = new LinkedList<ModelFormField>();
for (String fieldName: this.lastOrderFields) {
if (UtilValidate.isEmpty(fieldName)) {
continue;
@@ -695,7 +694,7 @@
protected void addOnSubmitUpdateArea(UpdateArea updateArea) {
if (onSubmitUpdateAreas == null) {
- onSubmitUpdateAreas = FastList.newInstance();
+ onSubmitUpdateAreas = new ArrayList<UpdateArea>();
}
int index = onSubmitUpdateAreas.indexOf(updateArea);
if (index != -1) {
@@ -707,7 +706,7 @@
protected void addOnPaginateUpdateArea(UpdateArea updateArea) {
if (onPaginateUpdateAreas == null) {
- onPaginateUpdateAreas = FastList.newInstance();
+ onPaginateUpdateAreas = new ArrayList<UpdateArea>();
}
int index = onPaginateUpdateAreas.indexOf(updateArea);
if (index != -1) {
@@ -724,7 +723,7 @@
protected void addOnSortColumnUpdateArea(UpdateArea updateArea) {
if (onSortColumnUpdateAreas == null) {
- onSortColumnUpdateAreas = FastList.newInstance();
+ onSortColumnUpdateAreas = new ArrayList<UpdateArea>();
}
int index = onSortColumnUpdateAreas.indexOf(updateArea);
if (index != -1) {
@@ -916,7 +915,7 @@
}
public void renderSingleFormString(Appendable writer, Map<String, Object> context, FormStringRenderer formStringRenderer, int positions) throws IOException {
- List<ModelFormField> tempFieldList = FastList.newInstance();
+ List<ModelFormField> tempFieldList = new LinkedList<ModelFormField>();
tempFieldList.addAll(this.fieldList);
// Check to see if there is a field, same name and same use-when (could come from extended form)
@@ -1212,7 +1211,7 @@
// in this model: we can have more fields with the same name when use-when
// conditions are used or when a form is extended or when the fields are
// automatically retrieved by a service or entity definition.
- List<ModelFormField> tempFieldList = FastList.newInstance();
+ List<ModelFormField> tempFieldList = new LinkedList<ModelFormField>();
tempFieldList.addAll(this.fieldList);
for (int j = 0; j < tempFieldList.size(); j++) {
ModelFormField modelFormField = tempFieldList.get(j);
@@ -1230,13 +1229,13 @@
// We get a sorted (by position, ascending) set of lists;
// each list contains all the fields with that position.
Collection<List<ModelFormField>> fieldListsByPosition = this.getFieldListsByPosition(tempFieldList);
- List<Map<String, List<ModelFormField>>> fieldRowsByPosition = FastList.newInstance(); // this list will contain maps, each one containing the list of fields for a position
+ List<Map<String, List<ModelFormField>>> fieldRowsByPosition = new LinkedList<Map<String, List<ModelFormField>>>(); // this list will contain maps, each one containing the list of fields for a position
for (List<ModelFormField> mainFieldList: fieldListsByPosition) {
int numOfColumns = 0;
- List<ModelFormField> innerDisplayHyperlinkFieldsBegin = FastList.newInstance();
- List<ModelFormField> innerFormFields = FastList.newInstance();
- List<ModelFormField> innerDisplayHyperlinkFieldsEnd = FastList.newInstance();
+ List<ModelFormField> innerDisplayHyperlinkFieldsBegin = new LinkedList<ModelFormField>();
+ List<ModelFormField> innerFormFields = new LinkedList<ModelFormField>();
+ List<ModelFormField> innerDisplayHyperlinkFieldsEnd = new LinkedList<ModelFormField>();
// render title for each field, except hidden & ignored, etc
@@ -1522,7 +1521,7 @@
int itemIndex = -1;
Object item = null;
context.put("wholeFormContext", context);
- Map<String, Object> previousItem = FastMap.newInstance();
+ Map<String, Object> previousItem = new HashMap<String, Object>();
while ((item = this.safeNext(iter)) != null) {
itemIndex++;
if (itemIndex >= highIndex) {
@@ -1556,7 +1555,7 @@
this.resetBshInterpreter(localContext);
localContext.push();
localContext.put("previousItem", previousItem);
- previousItem = FastMap.newInstance();
+ previousItem = new HashMap<String, Object>();
previousItem.putAll(itemMap);
ModelFormAction.runSubActions(this.rowActions, localContext);
@@ -1571,7 +1570,7 @@
if (Debug.verboseOn()) Debug.logVerbose("In form got another row, context is: " + localContext, module);
// Check to see if there is a field, same name and same use-when (could come from extended form)
- List<ModelFormField> tempFieldList = FastList.newInstance();
+ List<ModelFormField> tempFieldList = new LinkedList<ModelFormField>();
tempFieldList.addAll(this.fieldList);
for (int j = 0; j < tempFieldList.size(); j++) {
ModelFormField modelFormField = tempFieldList.get(j);
@@ -1608,9 +1607,9 @@
// we have two phases: preprocessing and rendering
this.rowCount++;
- List<ModelFormField> innerDisplayHyperlinkFieldsBegin = FastList.newInstance();
- List<ModelFormField> innerFormFields = FastList.newInstance();
- List<ModelFormField> innerDisplayHyperlinkFieldsEnd = FastList.newInstance();
+ List<ModelFormField> innerDisplayHyperlinkFieldsBegin = new LinkedList<ModelFormField>();
+ List<ModelFormField> innerFormFields = new LinkedList<ModelFormField>();
+ List<ModelFormField> innerDisplayHyperlinkFieldsEnd = new LinkedList<ModelFormField>();
// Preprocessing:
// all the form fields are evaluated and the ones that will
@@ -1737,7 +1736,7 @@
// render row formatting open
formStringRenderer.renderFormatItemRowOpen(writer, localContext, this);
Iterator<ModelFormField> innerDisplayHyperlinkFieldsBeginIter = innerDisplayHyperlinkFieldsBegin.iterator();
- Map<String, Integer> fieldCount = FastMap.newInstance();
+ Map<String, Integer> fieldCount = new HashMap<String, Integer>();
while(innerDisplayHyperlinkFieldsBeginIter.hasNext()){
ModelFormField modelFormField = innerDisplayHyperlinkFieldsBeginIter.next();
if(fieldCount.containsKey(modelFormField.getFieldName())){
@@ -1862,7 +1861,7 @@
}
public List<ModelFormField> getHiddenIgnoredFields(Map<String, Object> context, Set<String> alreadyRendered, List<ModelFormField> fieldList, int position) {
- List<ModelFormField> hiddenIgnoredFieldList = FastList.newInstance();
+ List<ModelFormField> hiddenIgnoredFieldList = new LinkedList<ModelFormField>();
for (ModelFormField modelFormField: fieldList) {
// with position == -1 then gets all the hidden fields
if (position != -1 && modelFormField.getPosition() != position) {
@@ -1927,7 +1926,7 @@
Integer position = Integer.valueOf(modelFormField.getPosition());
List<ModelFormField> fieldListByPosition = fieldsByPosition.get(position);
if (fieldListByPosition == null) {
- fieldListByPosition = FastList.newInstance();
+ fieldListByPosition = new LinkedList<ModelFormField>();
fieldsByPosition.put(position, fieldListByPosition);
}
fieldListByPosition.add(modelFormField);
@@ -1936,7 +1935,7 @@
}
public List<ModelFormField> getFieldListByPosition(List<ModelFormField> modelFormFieldList, int position) {
- List<ModelFormField> fieldListByPosition = FastList.newInstance();
+ List<ModelFormField> fieldListByPosition = new LinkedList<ModelFormField>();
for (ModelFormField modelFormField: modelFormFieldList) {
if (modelFormField.getPosition() == position) {
fieldListByPosition.add(modelFormField);
@@ -2812,7 +2811,7 @@
}
public void setDefaultEntityNameOnUpdateAreas() {
- List<UpdateArea> allUpdateAreas = FastList.newInstance();
+ List<UpdateArea> allUpdateAreas = new LinkedList<UpdateArea>();
if (UtilValidate.isNotEmpty(this.onSubmitUpdateAreas)) allUpdateAreas.addAll(this.onSubmitUpdateAreas);
if (UtilValidate.isNotEmpty(this.onPaginateUpdateAreas)) allUpdateAreas.addAll(this.onPaginateUpdateAreas);
for (UpdateArea updateArea : allUpdateAreas) {
@@ -2823,7 +2822,7 @@
}
public void setDefaultServiceNameOnUpdateAreas() {
- List<UpdateArea> allUpdateAreas = FastList.newInstance();
+ List<UpdateArea> allUpdateAreas = new LinkedList<UpdateArea>();
if (UtilValidate.isNotEmpty(this.onSubmitUpdateAreas)) allUpdateAreas.addAll(this.onSubmitUpdateAreas);
if (UtilValidate.isNotEmpty(this.onPaginateUpdateAreas)) allUpdateAreas.addAll(this.onPaginateUpdateAreas);
for (UpdateArea updateArea : allUpdateAreas) {
@@ -2901,7 +2900,7 @@
protected String defaultEntityName;
protected WidgetWorker.AutoEntityParameters autoEntityParameters;
protected WidgetWorker.AutoEntityParameters autoServiceParameters;
- List<WidgetWorker.Parameter> parameterList = FastList.newInstance();
+ protected List<WidgetWorker.Parameter> parameterList = new ArrayList<WidgetWorker.Parameter>();
/** XML constructor.
* @param updateAreaElement The <code><on-xxx-update-area></code>
* XML element.
@@ -2950,7 +2949,7 @@
return FlexibleStringExpander.expandString(areaTarget, context);
}
public Map<String, String> getParameterMap(Map<String, Object> context) {
- Map<String, String> fullParameterMap = FastMap.newInstance();
+ Map<String, String> fullParameterMap = new HashMap<String, String>();
if (autoServiceParameters != null) {
fullParameterMap.putAll(autoServiceParameters.getParametersMap(context, defaultServiceName));
}
@@ -3175,7 +3174,7 @@
}
public Set<String> getAllEntityNamesUsed() {
- Set<String> allEntityNamesUsed = FastSet.newInstance();
+ Set<String> allEntityNamesUsed = new HashSet<String>();
for (AutoFieldsEntity autoFieldsEntity: this.autoFieldsEntities) {
allEntityNamesUsed.add(autoFieldsEntity.entityName);
}
@@ -3221,7 +3220,7 @@
}
public Set<String> getAllServiceNamesUsed() {
- Set<String> allServiceNamesUsed = FastSet.newInstance();
+ Set<String> allServiceNamesUsed = new HashSet<String>();
for (AutoFieldsService autoFieldsService: this.autoFieldsServices) {
allServiceNamesUsed.add(autoFieldsService.serviceName);
}
@@ -3254,7 +3253,7 @@
}
public Set<String> getLinkedRequestsLocationAndUri() throws GeneralException {
- Set<String> allRequestsUsed = FastSet.newInstance();
+ Set<String> allRequestsUsed = new HashSet<String>();
if (this.fieldList != null) {
for (ModelFormField modelFormField: this.fieldList) {
@@ -3306,7 +3305,7 @@
}
public Set<String> getTargetedRequestsLocationAndUri() throws GeneralException {
- Set<String> allRequestsUsed = FastSet.newInstance();
+ Set<String> allRequestsUsed = new HashSet<String>();
if (this.altTargets != null) {
for (AltTarget altTarget: this.altTargets) {
diff --git a/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java b/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java
index 4803ed7..aced639 100644
--- a/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java
+++ b/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java
@@ -28,9 +28,6 @@
import java.util.TimeZone;
import java.util.regex.PatternSyntaxException;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.ObjectType;
@@ -131,6 +128,7 @@
}
}
+ @SuppressWarnings("rawtypes")
@Override
public void runAction(Map<String, Object> context) {
String globalStr = this.globalExdr.expandString(context);
@@ -152,9 +150,9 @@
if (UtilValidate.isNotEmpty(this.type)) {
if ("NewMap".equals(this.type)) {
- newValue = FastMap.newInstance();
+ newValue = new HashMap();
} else if ("NewList".equals(this.type)) {
- newValue = FastList.newInstance();
+ newValue = new LinkedList();
} else {
try {
newValue = ObjectType.simpleTypeConvert(newValue, this.type, null, (TimeZone) context.get("timeZone"), (Locale) context.get("locale"), true);
@@ -286,7 +284,7 @@
@Override
public void runAction(Map<String, Object> context) {
if (location.endsWith(".xml")) {
- Map<String, Object> localContext = FastMap.newInstance();
+ Map<String, Object> localContext = new HashMap<String, Object>();
localContext.putAll(context);
DispatchContext ctx = this.modelForm.dispatchContext;
MethodContext methodContext = new MethodContext(ctx, localContext, null);
diff --git a/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java b/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
index ab18ad0..e92d525 100644
--- a/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
+++ b/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
@@ -23,6 +23,7 @@
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.NumberFormat;
+import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
@@ -32,9 +33,6 @@
import java.util.StringTokenizer;
import java.util.TimeZone;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.conversion.ConversionException;
import org.ofbiz.base.conversion.DateTimeConverters;
import org.ofbiz.base.conversion.DateTimeConverters.StringToTimestamp;
@@ -218,13 +216,13 @@
}
protected void addOnChangeUpdateArea(UpdateArea updateArea) {
- if (onChangeUpdateAreas == null) onChangeUpdateAreas = FastList.newInstance();
+ if (onChangeUpdateAreas == null) onChangeUpdateAreas = new ArrayList<UpdateArea>();
onChangeUpdateAreas.add(updateArea);
Debug.logInfo(this.modelForm.getName() + ":" + this.name + " onChangeUpdateAreas size = " + onChangeUpdateAreas.size(), module);
}
protected void addOnClickUpdateArea(UpdateArea updateArea) {
- if (onClickUpdateAreas == null) onClickUpdateAreas = FastList.newInstance();
+ if (onClickUpdateAreas == null) onClickUpdateAreas = new ArrayList<UpdateArea>();
onClickUpdateAreas.add(updateArea);
}
@@ -1519,7 +1517,7 @@
List<? extends Object> dataList = UtilGenerics.checkList(this.listAcsr.get(context));
if (dataList != null && dataList.size() != 0) {
for (Object data: dataList) {
- Map<String, Object> localContext = FastMap.newInstance();
+ Map<String, Object> localContext = new HashMap<String, Object>();
localContext.putAll(context);
if (UtilValidate.isNotEmpty(this.listEntryName)) {
localContext.put(this.listEntryName, data);
@@ -2225,7 +2223,7 @@
protected FlexibleStringExpander imageTitle;
protected FlexibleStringExpander targetWindowExdr;
protected FlexibleMapAccessor<Map<String, String>> parametersMapAcsr;
- protected List<WidgetWorker.Parameter> parameterList = FastList.newInstance();
+ protected List<WidgetWorker.Parameter> parameterList = new ArrayList<WidgetWorker.Parameter>();
protected WidgetWorker.AutoServiceParameters autoServiceParameters;
protected WidgetWorker.AutoEntityParameters autoEntityParameters;
@@ -2337,7 +2335,7 @@
}
public Map<String, String> getParameterMap(Map<String, Object> context) {
- Map<String, String> fullParameterMap = FastMap.newInstance();
+ Map<String, String> fullParameterMap = new HashMap<String, String>();
Map<String, String> addlParamMap = this.parametersMapAcsr.get(context);
if (addlParamMap != null) {
@@ -2433,7 +2431,7 @@
protected FlexibleStringExpander target;
protected FlexibleStringExpander description;
protected FlexibleStringExpander targetWindowExdr;
- protected List<WidgetWorker.Parameter> parameterList = FastList.newInstance();
+ protected List<WidgetWorker.Parameter> parameterList = new ArrayList<WidgetWorker.Parameter>();
protected boolean requestConfirmation = false;
protected FlexibleStringExpander confirmationMsgExdr;
protected ModelFormField modelFormField;
@@ -2500,7 +2498,7 @@
}
public Map<String, String> getParameterMap(Map<String, Object> context) {
- Map<String, String> fullParameterMap = FastMap.newInstance();
+ Map<String, String> fullParameterMap = new HashMap<String, String>();
/* leaving this here... may want to add it at some point like the hyperlink element:
Map<String, String> addlParamMap = this.parametersMapAcsr.get(context);
@@ -3607,7 +3605,7 @@
}
public List<String> getTargetParameterList() {
- List<String> paramList = FastList.newInstance();
+ List<String> paramList = new LinkedList<String>();
if (UtilValidate.isNotEmpty(this.targetParameter)) {
StringTokenizer stk = new StringTokenizer(this.targetParameter, ", ");
while (stk.hasMoreTokens()) {
diff --git a/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java b/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
index db11bf1..20fdbf6 100644
--- a/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
+++ b/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
@@ -20,6 +20,7 @@
import java.io.IOException;
import java.util.HashSet;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -29,8 +30,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javolution.util.FastList;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.StringUtil.SimpleEncoder;
@@ -958,7 +957,7 @@
String backgroundSubmitRefreshTarget = submitField.getBackgroundSubmitRefreshTarget(context);
if (UtilValidate.isNotEmpty(backgroundSubmitRefreshTarget)) {
if (updateAreas == null) {
- updateAreas = FastList.newInstance();
+ updateAreas = new LinkedList<ModelForm.UpdateArea>();
}
updateAreas.add(new ModelForm.UpdateArea("submit", formId, backgroundSubmitRefreshTarget));
}
diff --git a/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java b/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java
index 90f871e..2184cdc 100644
--- a/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java
+++ b/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java
@@ -29,8 +29,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilFormatOut;
@@ -52,8 +50,8 @@
import org.ofbiz.widget.menu.MenuStringRenderer;
import org.ofbiz.widget.menu.ModelMenu;
import org.ofbiz.widget.screen.ModelScreenWidget;
-import org.ofbiz.widget.screen.ScreenStringRenderer;
import org.ofbiz.widget.screen.ModelScreenWidget.ColumnContainer;
+import org.ofbiz.widget.screen.ScreenStringRenderer;
/**
* Widget Library - HTML Form Renderer implementation
@@ -667,7 +665,7 @@
Delegator delegator = (Delegator) context.get("delegator");
// make a new map for content rendering; so our current map does not get clobbered
- Map<String, Object> contentContext = FastMap.newInstance();
+ Map<String, Object> contentContext = new HashMap<String, Object>();
contentContext.putAll(context);
String dataResourceId = (String)contentContext.get("dataResourceId");
if (Debug.verboseOn()) Debug.logVerbose("expandedContentId:" + expandedContentId, module);
@@ -800,7 +798,7 @@
Delegator delegator = (Delegator) context.get("delegator");
// create a new map for the content rendering; so our current context does not get overwritten!
- Map<String, Object> contentContext = FastMap.newInstance();
+ Map<String, Object> contentContext = new HashMap<String, Object>();
contentContext.putAll(context);
try {
diff --git a/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java b/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java
index da1006c..283329f 100644
--- a/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java
+++ b/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java
@@ -20,6 +20,8 @@
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -28,9 +30,6 @@
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.ObjectType;
@@ -140,6 +139,7 @@
}
}
+ @SuppressWarnings("rawtypes")
@Override
public void runAction(Map<String, Object> context) {
String globalStr = this.globalExdr.expandString(context);
@@ -189,9 +189,9 @@
if (UtilValidate.isNotEmpty(this.type)) {
if ("NewMap".equals(this.type)) {
- newValue = FastMap.newInstance();
+ newValue = new HashMap();
} else if ("NewList".equals(this.type)) {
- newValue = FastList.newInstance();
+ newValue = new LinkedList();
} else {
try {
newValue = ObjectType.simpleTypeConvert(newValue, this.type, null, (TimeZone) context.get("timeZone"), (Locale) context.get("locale"), true);
@@ -379,7 +379,7 @@
List<? extends Element> fieldMapElementList = UtilXml.childElementList(serviceElement, "field-map");
if (fieldMapElementList.size() > 0) {
- this.fieldMap = FastMap.newInstance();
+ this.fieldMap = new HashMap<FlexibleMapAccessor<Object>, FlexibleMapAccessor<Object>>();
for (Element fieldMapElement: fieldMapElementList) {
// set the env-name for each field-name, noting that if no field-name is specified it defaults to the env-name
this.fieldMap.put(
@@ -404,7 +404,7 @@
if (autoFieldMapBool) {
serviceContext = WidgetWorker.getDispatcher(context).getDispatchContext().makeValidContext(serviceNameExpanded, ModelService.IN_PARAM, context);
} else {
- serviceContext = FastMap.newInstance();
+ serviceContext = new HashMap<String, Object>();
}
if (this.fieldMap != null) {
diff --git a/framework/widget/src/org/ofbiz/widget/menu/ModelMenuCondition.java b/framework/widget/src/org/ofbiz/widget/menu/ModelMenuCondition.java
index 57722a4..2306bac 100644
--- a/framework/widget/src/org/ofbiz/widget/menu/ModelMenuCondition.java
+++ b/framework/widget/src/org/ofbiz/widget/menu/ModelMenuCondition.java
@@ -19,13 +19,12 @@
package org.ofbiz.widget.menu;
import java.lang.reflect.Method;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
-import javolution.util.FastList;
-
import org.apache.oro.text.regex.MalformedPatternException;
import org.apache.oro.text.regex.Pattern;
import org.apache.oro.text.regex.PatternMatcher;
@@ -101,7 +100,7 @@
}
public static List<MenuCondition> readSubConditions(ModelMenuItem modelMenuItem, Element conditionElement) {
- List<MenuCondition> condList = FastList.newInstance();
+ List<MenuCondition> condList = new LinkedList<MenuCondition>();
List<? extends Element> subElementList = UtilXml.childElementList(conditionElement);
for (Element subElement: subElementList) {
condList.add(readCondition(modelMenuItem, subElement));
@@ -422,7 +421,7 @@
fieldVal = "";
}
- List<Object> messages = FastList.newInstance();
+ List<Object> messages = new LinkedList<Object>();
Boolean resultBool = BaseCompare.doRealCompare(fieldVal, value, operator, type, format, messages, null, null, true);
if (messages.size() > 0) {
messages.add(0, "Error with comparison in if-compare between field [" + fieldAcsr.toString() + "] with value [" + fieldVal + "] and value [" + value + "] with operator [" + operator + "] and type [" + type + "]: ");
@@ -473,7 +472,7 @@
fieldVal = "";
}
- List<Object> messages = FastList.newInstance();
+ List<Object> messages = new LinkedList<Object>();
Boolean resultBool = BaseCompare.doRealCompare(fieldVal, toFieldVal, operator, type, format, messages, null, null, false);
if (messages.size() > 0) {
messages.add(0, "Error with comparison in if-compare-field between field [" + fieldAcsr.toString() + "] with value [" + fieldVal + "] and to-field [" + toFieldVal.toString() + "] with value [" + toFieldVal + "] with operator [" + operator + "] and type [" + type + "]: ");
diff --git a/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java b/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
index 137e30c..e1c0d52 100644
--- a/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
+++ b/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
@@ -19,6 +19,7 @@
package org.ofbiz.widget.menu;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@@ -27,9 +28,6 @@
import javax.xml.parsers.ParserConfigurationException;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilFormatOut;
@@ -39,8 +37,8 @@
import org.ofbiz.base.util.collections.FlexibleMapAccessor;
import org.ofbiz.base.util.string.FlexibleStringExpander;
import org.ofbiz.entity.GenericValue;
-import org.ofbiz.widget.WidgetWorker;
import org.ofbiz.widget.PortalPageWorker;
+import org.ofbiz.widget.WidgetWorker;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
@@ -569,7 +567,7 @@
protected WidgetWorker.AutoServiceParameters autoServiceParameters;
protected WidgetWorker.AutoEntityParameters autoEntityParameters;
protected FlexibleMapAccessor<Map<String, String>> parametersMapAcsr;
- protected List<WidgetWorker.Parameter> parameterList = FastList.newInstance();
+ protected List<WidgetWorker.Parameter> parameterList = new ArrayList<WidgetWorker.Parameter>();
protected boolean requestConfirmation = false;
protected FlexibleStringExpander confirmationMsgExdr;
@@ -702,7 +700,7 @@
return this.parameterList;
}
public Map<String, String> getParameterMap(Map<String, Object> context) {
- Map<String, String> fullParameterMap = FastMap.newInstance();
+ Map<String, String> fullParameterMap = new HashMap<String, String>();
if (this.parametersMapAcsr != null) {
Map<String, String> addlParamMap = this.parametersMapAcsr.get(context);
diff --git a/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java b/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java
index 520a871..cbd38b7 100644
--- a/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java
+++ b/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java
@@ -22,11 +22,10 @@
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.StringUtil;
@@ -220,7 +219,7 @@
public static class HtmlTemplateDecorator extends ModelScreenWidget {
protected FlexibleStringExpander locationExdr;
- protected Map<String, HtmlTemplateDecoratorSection> sectionMap = FastMap.newInstance();
+ protected Map<String, HtmlTemplateDecoratorSection> sectionMap = new HashMap<String, HtmlTemplateDecoratorSection>();
public HtmlTemplateDecorator(ModelScreen modelScreen, Element htmlTemplateDecoratorElement) {
super(modelScreen, htmlTemplateDecoratorElement);
diff --git a/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java b/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java
index 2beeaee..ce38940 100644
--- a/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java
+++ b/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java
@@ -34,8 +34,6 @@
import javax.servlet.http.HttpServletResponse;
import javax.xml.parsers.ParserConfigurationException;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilFormatOut;
@@ -59,7 +57,8 @@
import org.ofbiz.widget.form.ModelForm;
import org.ofbiz.widget.html.HtmlScreenRenderer.ScreenletMenuRenderer;
import org.ofbiz.widget.menu.MenuStringRenderer;
-import org.ofbiz.widget.screen.ModelScreenWidget.*;
+import org.ofbiz.widget.screen.ModelScreenWidget.Column;
+import org.ofbiz.widget.screen.ModelScreenWidget.ColumnContainer;
import org.xml.sax.SAXException;
import freemarker.core.Environment;
@@ -156,7 +155,7 @@
this.widgetCommentsEnabled = ModelWidget.widgetBoundaryCommentsEnabled(context);
}
if (this.widgetCommentsEnabled) {
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
StringBuilder sb = new StringBuilder("Begin ");
sb.append(section.isMainSection ? "Screen " : "Section Widget ");
sb.append(section.getBoundaryCommentName());
@@ -166,7 +165,7 @@
}
public void renderSectionEnd(Appendable writer, Map<String, Object> context, ModelScreenWidget.Section section) throws IOException {
if (this.widgetCommentsEnabled) {
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
StringBuilder sb = new StringBuilder();
sb.append("End ");
sb.append(section.isMainSection ? "Screen " : "Section Widget ");
@@ -190,7 +189,7 @@
RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_");
autoUpdateLink = rh.makeLink(request, response, autoUpdateTarget);
}
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("id", containerId);
parameters.put("style", container.getStyle(context));
parameters.put("autoUpdateLink", autoUpdateLink);
@@ -203,7 +202,7 @@
}
public void renderLabel(Appendable writer, Map<String, Object> context, ModelScreenWidget.Label label) throws IOException {
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("text", label.getText(context));
parameters.put("id", label.getId(context));
parameters.put("style", label.getStyle(context));
@@ -211,7 +210,7 @@
}
public void renderHorizontalSeparator(Appendable writer, Map<String, Object> context, ModelScreenWidget.HorizontalSeparator separator) throws IOException {
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("id", separator.getId(context));
parameters.put("style", separator.getStyle(context));
executeMacro(writer, "renderHorizontalSeparator", parameters);
@@ -341,7 +340,7 @@
} else {
urlString = src;
}
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("src", src);
parameters.put("id", image.getId(context));
parameters.put("style", image.getStyle(context));
@@ -360,7 +359,7 @@
if (Debug.verboseOn()) Debug.logVerbose("directEditRequest:" + editRequest, module);
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("editRequest", editRequest);
parameters.put("enableEditValue", enableEditValue == null ? "" : enableEditValue);
parameters.put("editContainerStyle", content.getEditContainerStyle(context));
@@ -378,7 +377,7 @@
Delegator delegator = (Delegator) context.get("delegator");
// make a new map for content rendering; so our current map does not get clobbered
- Map<String, Object> contentContext = FastMap.newInstance();
+ Map<String, Object> contentContext = new HashMap<String, Object>();
contentContext.putAll(context);
String dataResourceId = (String)contentContext.get("dataResourceId");
if (Debug.verboseOn()) Debug.logVerbose("expandedContentId:" + expandedContentId, module);
@@ -454,7 +453,7 @@
urlString = rh.makeLink(request, response, editRequest, false, false, false);
}
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("urlString", urlString);
parameters.put("editMode", editMode);
parameters.put("editContainerStyle", content.getEditContainerStyle(context));
@@ -476,7 +475,7 @@
fullUrlString = rh.makeLink(request, response, urlString, true, false, false);
}
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("fullUrl", fullUrlString);
parameters.put("width", content.getWidth());
parameters.put("height", content.getHeight());
@@ -488,7 +487,7 @@
String enableEditName = content.getEnableEditName(context);
String enableEditValue = (String)context.get(enableEditName);
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("editContainerStyle", content.getEditContainerStyle(context));
parameters.put("editRequest", content.getEditRequest(context));
parameters.put("enableEditValue", enableEditValue == null ? "" : enableEditValue);
@@ -505,7 +504,7 @@
Delegator delegator = (Delegator) context.get("delegator");
// create a new map for the content rendering; so our current context does not get overwritten!
- Map<String, Object> contentContext = FastMap.newInstance();
+ Map<String, Object> contentContext = new HashMap<String, Object>();
contentContext.putAll(context);
try {
@@ -570,7 +569,7 @@
}
}
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("urlString", urlString);
parameters.put("editMode", editMode);
parameters.put("editContainerStyle", content.getEditContainerStyle(context));
@@ -628,7 +627,7 @@
menuString = sb.toString();
}
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("title", title);
parameters.put("collapsible", collapsible);
parameters.put("saveCollapsed", screenlet.saveCollapsed());
@@ -781,7 +780,7 @@
firstLinkUrl = rh.makeLink(request, response, linkText);
}
- Map<String, Object> parameters = FastMap.newInstance();
+ Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("lowIndex", modelForm.getLowIndex(context));
parameters.put("actualPageSize", actualPageSize);
parameters.put("ofLabel", ofLabel);
diff --git a/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java b/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java
index 2bad488..99d9114 100644
--- a/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java
+++ b/framework/widget/src/org/ofbiz/widget/screen/ModelScreen.java
@@ -19,12 +19,11 @@
package org.ofbiz.widget.screen;
import java.util.Collection;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import javolution.util.FastSet;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilGenerics;
@@ -84,7 +83,7 @@
}
public Set<String> getAllServiceNamesUsed() {
- Set<String> allServiceNamesUsed = FastSet.newInstance();
+ Set<String> allServiceNamesUsed = new HashSet<String>();
findServiceNamesUsedInWidget(this.section, allServiceNamesUsed);
return allServiceNamesUsed;
}
@@ -144,7 +143,7 @@
}
}
public Set<String> getAllEntityNamesUsed() {
- Set<String> allEntityNamesUsed = FastSet.newInstance();
+ Set<String> allEntityNamesUsed = new HashSet<String>();
findEntityNamesUsedInWidget(this.section, allEntityNamesUsed);
return allEntityNamesUsed;
}
@@ -215,7 +214,7 @@
}
}
public Set<String> getAllFormNamesIncluded() {
- Set<String> allFormNamesIncluded = FastSet.newInstance();
+ Set<String> allFormNamesIncluded = new HashSet<String>();
findFormNamesIncludedInWidget(this.section, allFormNamesIncluded);
return allFormNamesIncluded;
}
@@ -268,7 +267,7 @@
}
public Set<String> getAllRequestsLocationAndUri() throws GeneralException {
- Set<String> allRequestNamesIncluded = FastSet.newInstance();
+ Set<String> allRequestNamesIncluded = new HashSet<String>();
findRequestNamesLinkedtoInWidget(this.section, allRequestNamesIncluded);
return allRequestNamesIncluded;
}
diff --git a/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java b/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java
index 75841cc..4048eb2 100644
--- a/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java
+++ b/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java
@@ -21,6 +21,8 @@
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -30,9 +32,6 @@
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.ObjectType;
@@ -82,9 +81,8 @@
@Deprecated
public static List<ModelScreenAction> readSubActions(ModelScreen modelScreen, Element parentElement) {
- List<ModelScreenAction> actions = FastList.newInstance();
-
List<? extends Element> actionElementList = UtilXml.childElementList(parentElement);
+ List<ModelScreenAction> actions = new ArrayList<ModelScreenAction>(actionElementList.size());
for (Element actionElement: actionElementList) {
if ("set".equals(actionElement.getNodeName())) {
actions.add(new SetField(modelScreen, actionElement));
@@ -150,6 +148,7 @@
}
}
+ @SuppressWarnings("rawtypes")
@Override
public void runAction(Map<String, Object> context) {
String globalStr = this.globalExdr.expandString(context);
@@ -189,9 +188,9 @@
if (UtilValidate.isNotEmpty(this.type)) {
if ("NewMap".equals(this.type)) {
- newValue = FastMap.newInstance();
+ newValue = new HashMap();
} else if ("NewList".equals(this.type)) {
- newValue = FastList.newInstance();
+ newValue = new LinkedList();
} else {
try {
newValue = ObjectType.simpleTypeConvert(newValue, this.type, null, (TimeZone) context.get("timeZone"), (Locale) context.get("locale"), true);
@@ -414,7 +413,7 @@
@Override
public void runAction(Map<String, Object> context) throws GeneralException {
if (location.endsWith(".xml")) {
- Map<String, Object> localContext = FastMap.newInstance();
+ Map<String, Object> localContext = new HashMap<String, Object>();
localContext.putAll(context);
DispatchContext ctx = this.modelScreen.getDispatcher(context).getDispatchContext();
MethodContext methodContext = new MethodContext(ctx, localContext, null);
@@ -460,7 +459,7 @@
if ("true".equals(autoFieldMapString)) {
DispatchContext dc = this.modelScreen.getDispatcher(context).getDispatchContext();
// try a map called "parameters", try it first so values from here are overriden by values in the main context
- Map<String, Object> combinedMap = FastMap.newInstance();
+ Map<String, Object> combinedMap = new HashMap<String, Object>();
Map<String, Object> parametersObj = UtilGenerics.toMap(context.get("parameters"));
if (parametersObj != null) {
combinedMap.putAll(parametersObj);
@@ -475,7 +474,7 @@
}
}
if (serviceContext == null) {
- serviceContext = FastMap.newInstance();
+ serviceContext = new HashMap<String, Object>();
}
if (this.fieldMap != null) {
diff --git a/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java b/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java
index fd0e6f9..8265712 100644
--- a/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java
+++ b/framework/widget/src/org/ofbiz/widget/screen/ModelScreenCondition.java
@@ -20,13 +20,13 @@
import java.io.Serializable;
import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
-import javolution.util.FastList;
-
import org.apache.oro.text.regex.MalformedPatternException;
import org.apache.oro.text.regex.Pattern;
import org.apache.oro.text.regex.PatternMatcher;
@@ -85,8 +85,8 @@
}
public static List<ScreenCondition> readSubConditions(ModelScreen modelScreen, Element conditionElement) {
- List<ScreenCondition> condList = FastList.newInstance();
List<? extends Element> subElementList = UtilXml.childElementList(conditionElement);
+ List<ScreenCondition> condList = new ArrayList<ScreenCondition>(subElementList.size());
for (Element subElement: subElementList) {
condList.add(readCondition(modelScreen, subElement));
}
@@ -420,7 +420,7 @@
fieldVal = "";
}
- List<Object> messages = FastList.newInstance();
+ List<Object> messages = new LinkedList<Object>();
Boolean resultBool = BaseCompare.doRealCompare(fieldVal, value, operator, type, format, messages, null, null, true);
if (messages.size() > 0) {
messages.add(0, "Error with comparison in if-compare between field [" + fieldAcsr.toString() + "] with value [" + fieldVal + "] and value [" + value + "] with operator [" + operator + "] and type [" + type + "]: ");
@@ -471,7 +471,7 @@
fieldVal = "";
}
- List<Object> messages = FastList.newInstance();
+ List<Object> messages = new LinkedList<Object>();
Boolean resultBool = BaseCompare.doRealCompare(fieldVal, toFieldVal, operator, type, format, messages, null, null, false);
if (messages.size() > 0) {
messages.add(0, "Error with comparison in if-compare-field between field [" + fieldAcsr.toString() + "] with value [" + fieldVal + "] and to-field [" + toFieldAcsr.toString() + "] with value [" + toFieldVal + "] with operator [" + operator + "] and type [" + type + "]: ");
diff --git a/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java b/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java
index 329ac1d..6e3bbd7 100644
--- a/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java
+++ b/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java
@@ -23,15 +23,13 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import javax.xml.parsers.ParserConfigurationException;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.StringUtil;
@@ -85,7 +83,7 @@
public abstract String rawString();
public static List<ModelScreenWidget> readSubWidgets(ModelScreen modelScreen, List<? extends Element> subElementList) {
- List<ModelScreenWidget> subWidgets = FastList.newInstance();
+ List<ModelScreenWidget> subWidgets = new ArrayList<ModelScreenWidget>(subElementList.size());
for (Element subElement: subElementList) {
subWidgets.add(WidgetFactory.getModelScreenWidget(modelScreen, subElement));
}
@@ -570,7 +568,7 @@
// build the widgetpath
List<String> widgetTrail = UtilGenerics.toList(context.get("_WIDGETTRAIL_"));
if (widgetTrail == null) {
- widgetTrail = FastList.newInstance();
+ widgetTrail = new LinkedList<String>();
}
String thisName = nameExdr.expandString(context);
@@ -1273,7 +1271,7 @@
protected String linkType;
protected String width;
protected String height;
- protected List<WidgetWorker.Parameter> parameterList = FastList.newInstance();
+ protected List<WidgetWorker.Parameter> parameterList = new ArrayList<WidgetWorker.Parameter>();
protected WidgetWorker.AutoServiceParameters autoServiceParameters;
protected WidgetWorker.AutoEntityParameters autoEntityParameters;
@@ -1397,7 +1395,7 @@
}
public Map<String, String> getParameterMap(Map<String, Object> context) {
- Map<String, String> fullParameterMap = FastMap.newInstance();
+ Map<String, String> fullParameterMap = new HashMap<String, String>();
/* leaving this here... may want to add it at some point like the hyperlink element:
Map<String, String> addlParamMap = this.parametersMapAcsr.get(context);
diff --git a/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java b/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java
index 71829a7..860564d 100644
--- a/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java
+++ b/framework/widget/src/org/ofbiz/widget/screen/ScreenFactory.java
@@ -20,6 +20,7 @@
import java.io.IOException;
import java.net.URL;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -27,8 +28,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.xml.parsers.ParserConfigurationException;
-import javolution.util.FastMap;
-
import org.ofbiz.base.location.FlexibleLocation;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
@@ -162,7 +161,7 @@
}
public static Map<String, ModelScreen> readScreenDocument(Document screenFileDoc, String sourceLocation) {
- Map<String, ModelScreen> modelScreenMap = FastMap.newInstance();
+ Map<String, ModelScreen> modelScreenMap = new HashMap<String, ModelScreen>();
if (screenFileDoc != null) {
// read document and construct ModelScreen for each screen element
Element rootElement = screenFileDoc.getDocumentElement();
diff --git a/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java b/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java
index 2d06608..e0b2fa8 100644
--- a/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java
+++ b/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java
@@ -21,6 +21,8 @@
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
+import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -32,9 +34,6 @@
import javax.servlet.http.HttpSession;
import javax.xml.parsers.ParserConfigurationException;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilDateTime;
@@ -186,6 +185,7 @@
populateContextForRequest(context, this, request, response, servletContext);
}
+ @SuppressWarnings("rawtypes")
public static void populateContextForRequest(MapStack<String> context, ScreenRenderer screens, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) {
HttpSession session = request.getSession();
@@ -246,7 +246,7 @@
context.put("requestParameters", UtilHttp.getParameterMap(request));
// this is a dummy object to stand-in for the JPublish page object for backward compatibility
- context.put("page", FastMap.newInstance());
+ context.put("page", new HashMap());
// some information from/about the ControlServlet environment
context.put("controlPath", request.getAttribute("_CONTROL_PATH_"));
@@ -260,9 +260,9 @@
// setup message lists
List<String> eventMessageList = UtilGenerics.toList(request.getAttribute("eventMessageList"));
- if (eventMessageList == null) eventMessageList = FastList.newInstance();
+ if (eventMessageList == null) eventMessageList = new LinkedList<String>();
List<String> errorMessageList = UtilGenerics.toList(request.getAttribute("errorMessageList"));
- if (errorMessageList == null) errorMessageList = FastList.newInstance();
+ if (errorMessageList == null) errorMessageList = new LinkedList<String>();
if (request.getAttribute("_EVENT_MESSAGE_") != null) {
eventMessageList.add(UtilFormatOut.replaceString((String) request.getAttribute("_EVENT_MESSAGE_"), "\n", "<br/>"));
diff --git a/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java b/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java
index b2c6425..7af1bea 100644
--- a/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java
+++ b/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java
@@ -20,8 +20,10 @@
import java.io.IOException;
import java.io.StringWriter;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
@@ -29,9 +31,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.xml.parsers.ParserConfigurationException;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.StringUtil;
@@ -43,11 +42,6 @@
import org.ofbiz.base.util.UtilXml;
import org.ofbiz.base.util.collections.MapStack;
import org.ofbiz.base.util.string.FlexibleStringExpander;
-import org.ofbiz.widget.WidgetWorker;
-import org.ofbiz.widget.screen.ModelScreen;
-import org.ofbiz.widget.screen.ScreenFactory;
-import org.ofbiz.widget.screen.ScreenStringRenderer;
-import org.ofbiz.widget.screen.ScreenRenderException;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
@@ -56,6 +50,11 @@
import org.ofbiz.entity.util.EntityListIterator;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.widget.ModelWidget;
+import org.ofbiz.widget.WidgetWorker;
+import org.ofbiz.widget.screen.ModelScreen;
+import org.ofbiz.widget.screen.ScreenFactory;
+import org.ofbiz.widget.screen.ScreenRenderException;
+import org.ofbiz.widget.screen.ScreenStringRenderer;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
@@ -71,8 +70,8 @@
protected String rootNodeName;
protected String defaultRenderStyle;
protected FlexibleStringExpander defaultWrapStyleExdr;
- protected List<ModelNode> nodeList = FastList.newInstance();
- protected Map<String, ModelNode> nodeMap = FastMap.newInstance();
+ protected List<ModelNode> nodeList = new ArrayList<ModelNode>();
+ protected Map<String, ModelNode> nodeMap = new HashMap<String, ModelNode>();
protected Delegator delegator;
protected LocalDispatcher dispatcher;
protected FlexibleStringExpander expandCollapseRequestExdr;
@@ -227,6 +226,7 @@
* different tree elements; implementing your own makes it possible to
* use the same tree definitions for many types of tree UIs
*/
+ @SuppressWarnings("rawtypes")
public void renderTreeString(StringBuffer buf, Map<String, Object> context, TreeStringRenderer treeStringRenderer) throws GeneralException {
Map<String, Object> parameters = UtilGenerics.checkMap(context.get("parameters"));
@@ -246,10 +246,10 @@
context.put("rootEntityId", trail.get(0));
context.put(defaultPkName, trail.get(0));
} else {
- trail = FastList.newInstance();
+ trail = new LinkedList<String>();
}
context.put("targetNodeTrail", trail);
- context.put("currentNodeTrail", FastList.newInstance());
+ context.put("currentNodeTrail", new LinkedList());
StringWriter writer = new StringWriter();
try {
node.renderNodeString(writer, context, treeStringRenderer, 0);
@@ -282,8 +282,8 @@
protected Label label;
protected Link link;
protected Image image;
- protected List<ModelSubNode> subNodeList = FastList.newInstance();
- protected List<ModelTreeAction> actions = FastList.newInstance();
+ protected List<ModelSubNode> subNodeList = new ArrayList<ModelSubNode>();
+ protected List<ModelTreeAction> actions = new ArrayList<ModelTreeAction>();
protected String name;
protected ModelTree modelTree;
protected List<Object []> subNodeValues;
@@ -545,7 +545,7 @@
}
public void getChildren(Map<String, Object> context) {
- this.subNodeValues = FastList.newInstance();
+ this.subNodeValues = new ArrayList<Object []>();
for (ModelSubNode subNode: subNodeList) {
String nodeName = subNode.getNodeName(context);
ModelNode node = modelTree.nodeMap.get(nodeName);
@@ -699,7 +699,7 @@
protected ModelNode rootNode;
protected FlexibleStringExpander nodeNameExdr;
- protected List<ModelTreeAction> actions = FastList.newInstance();
+ protected List<ModelTreeAction> actions = new ArrayList<ModelTreeAction>();
protected ListIterator<? extends Map<String, ? extends Object>> listIterator;
public ModelSubNode() {}
@@ -813,7 +813,7 @@
protected boolean secure = false;
protected boolean encode = false;
protected String linkType;
- protected List<WidgetWorker.Parameter> parameterList = FastList.newInstance();
+ protected List<WidgetWorker.Parameter> parameterList = new ArrayList<WidgetWorker.Parameter>();
public Link() {
setText(null);
@@ -936,7 +936,7 @@
}
public Map<String, String> getParameterMap(Map<String, Object> context) {
- Map<String, String> fullParameterMap = FastMap.newInstance();
+ Map<String, String> fullParameterMap = new HashMap<String, String>();
/* leaving this here... may want to add it at some point like the hyperlink element:
Map<String, String> addlParamMap = this.parametersMapAcsr.get(context);
diff --git a/framework/widget/src/org/ofbiz/widget/tree/ModelTreeAction.java b/framework/widget/src/org/ofbiz/widget/tree/ModelTreeAction.java
index 4f67c1f..01fecd7 100644
--- a/framework/widget/src/org/ofbiz/widget/tree/ModelTreeAction.java
+++ b/framework/widget/src/org/ofbiz/widget/tree/ModelTreeAction.java
@@ -18,6 +18,8 @@
*******************************************************************************/
package org.ofbiz.widget.tree;
+import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Locale;
@@ -25,9 +27,6 @@
import java.util.TimeZone;
import java.util.regex.PatternSyntaxException;
-import javolution.util.FastList;
-import javolution.util.FastMap;
-
import org.ofbiz.base.util.BshUtil;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
@@ -128,6 +127,7 @@
}
}
+ @SuppressWarnings("rawtypes")
@Override
public void runAction(Map<String, Object> context) {
String globalStr = this.globalExdr.expandString(context);
@@ -142,9 +142,9 @@
}
if (UtilValidate.isNotEmpty(this.type)) {
if ("NewMap".equals(this.type)) {
- newValue = FastMap.newInstance();
+ newValue = new HashMap();
} else if ("NewList".equals(this.type)) {
- newValue = FastList.newInstance();
+ newValue = new LinkedList();
} else {
try {
newValue = ObjectType.simpleTypeConvert(newValue, this.type, null, (TimeZone) context.get("timeZone"), (Locale) context.get("locale"), true);
@@ -264,7 +264,7 @@
if (autoFieldMapBool) {
serviceContext = this.modelTree.getDispatcher().getDispatchContext().makeValidContext(serviceNameExpanded, ModelService.IN_PARAM, context);
} else {
- serviceContext = FastMap.newInstance();
+ serviceContext = new HashMap<String, Object>();
}
if (this.fieldMap != null) {
diff --git a/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java b/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java
index 10a7919..bb420a1 100644
--- a/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java
+++ b/framework/widget/src/org/ofbiz/widget/tree/ModelTreeCondition.java
@@ -19,13 +19,13 @@
package org.ofbiz.widget.tree;
import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
-import javolution.util.FastList;
-
import org.apache.oro.text.regex.MalformedPatternException;
import org.apache.oro.text.regex.Pattern;
import org.apache.oro.text.regex.PatternMatcher;
@@ -77,7 +77,7 @@
}
public static List<TreeCondition> readSubConditions(ModelTree modelTree, Element conditionElement) {
- List<TreeCondition> condList = FastList.newInstance();
+ List<TreeCondition> condList = new ArrayList<TreeCondition>();
for (Element subElement: UtilXml.childElementList(conditionElement)) {
condList.add(readCondition(modelTree, subElement));
}
@@ -323,7 +323,7 @@
fieldVal = "";
}
- List<Object> messages = FastList.newInstance();
+ List<Object> messages = new LinkedList<Object>();
Boolean resultBool = BaseCompare.doRealCompare(fieldVal, value, operator, type, format, messages, null, null, true);
if (messages.size() > 0) {
messages.add(0, "Error with comparison in if-compare between field [" + fieldAcsr.toString() + "] with value [" + fieldVal + "] and value [" + value + "] with operator [" + operator + "] and type [" + type + "]: ");
@@ -374,7 +374,7 @@
fieldVal = "";
}
- List<Object> messages = FastList.newInstance();
+ List<Object> messages = new LinkedList<Object>();
Boolean resultBool = BaseCompare.doRealCompare(fieldVal, toFieldVal, operator, type, format, messages, null, null, false);
if (messages.size() > 0) {
messages.add(0, "Error with comparison in if-compare-field between field [" + fieldAcsr.toString() + "] with value [" + fieldVal + "] and to-field [" + toFieldVal.toString() + "] with value [" + toFieldVal + "] with operator [" + operator + "] and type [" + type + "]: ");
diff --git a/specialpurpose/scrum/script/org/ofbiz/scrum/ScrumServices.xml b/specialpurpose/scrum/script/org/ofbiz/scrum/ScrumServices.xml
index 44c70fa..bb3ba24 100644
--- a/specialpurpose/scrum/script/org/ofbiz/scrum/ScrumServices.xml
+++ b/specialpurpose/scrum/script/org/ofbiz/scrum/ScrumServices.xml
@@ -75,13 +75,13 @@
<if-compare operator="equals" value="${parameters.custRequestId}"
field="custReq[i].custRequestId">
<if-compare operator="not-equals" value="0" field="i">
- <set field="temp" from-field="custReq[i].custSequenceNum" /><log level="always" message="$$$$$$$$$ temp : ${temp}"></log>
+ <set field="temp" from-field="custReq[i].custSequenceNum" /><!--<log level="always" message="$$$$$$$$$ temp : ${temp}"></log>-->
<set field="custReq[i].custSequenceNum" from-field="custReq[i-1].custSequenceNum" />
<set field="custReq[i-1].custSequenceNum" from-field="temp" />
<entity-one value-field="firstup" entity-name="CustRequest">
<field-map field-name="custRequestId" from-field="custReq[i].custRequestId" />
- </entity-one><log level="always" message="666666666666666666666 firstup : ${firstup}"></log>
+ </entity-one><!--<log level="always" message="666666666666666666666 firstup : ${firstup}"></log>-->
<set field="firstup.custSequenceNum" from-field="custReq[i].custSequenceNum" />
<if-empty field="firstup">
<add-error><fail-message message="Cannot find with ID [${custReq[i].custRequestId}] and custSequenceNum [${custReq[i].custSequenceNum}]"/></add-error>
@@ -322,7 +322,7 @@
<set field="index" value="${getNum-1}" />
<set field="bottomCustReq" from-field="custReq[index]" />
<!-- loop search selected custReq -->
- <loop count="${index}" field="i"><log level="always" message="////////// i : ${i}"></log>
+ <loop count="${index}" field="i"><!--<log level="always" message="////////// i : ${i}"></log>-->
<if-compare-field operator="equals"
field="parameters.custRequestId" to-field="custReq[i].custRequestId">
<set field="selectedCustReq" from-field="custReq[i]" />
@@ -330,7 +330,7 @@
<set field="selectedIndex" from-field="i" />
</if-compare-field>
</loop>
- <loop count="${diffIndex}" field="j"><log level="always" message="////////// j : ${j}"></log>
+ <loop count="${diffIndex}" field="j"><!--<log level="always" message="////////// j : ${j}"></log>-->
<set field="lowerSeqNum" from-field="custReq[j+selectedIndex].custSequenceNum" />
<entity-one value-field="update" entity-name="CustRequest">
@@ -2377,7 +2377,7 @@
</if-not-empty>
</simple-method>
<simple-method method-name="autoSprintNotification" short-description="Auto Sprint Notification">
- <log level="always" message="==========>>> Auto Sprint Notification : ${parameters.sprintStatusId} for sprintId # ${parameters.sprintId}"/>
+ <!--<log level="always" message="==========>>> Auto Sprint Notification : ${parameters.sprintStatusId} for sprintId # ${parameters.sprintId}"/>-->
<if-compare operator="equals" value="SPRINT_ACTIVE" field="parameters.sprintStatusId">
<call-simple-method method-name="checkProductOwnerOfSprint"/>
<if-not-empty field="ownerPartyId">
@@ -2404,7 +2404,7 @@
</if-compare>
</simple-method>
<simple-method method-name="autoBacklogNotification" short-description="Auto backlog Notification">
- <log level="always" message="==========>>> Auto backlog Notification : ${parameters.custRequestStatusId} for custRequestId # ${parameters.custRequestId}"/>
+ <!--<log level="always" message="==========>>> Auto backlog Notification : ${parameters.custRequestStatusId} for custRequestId # ${parameters.custRequestId}"/>-->
<if-compare operator="equals" value="CRQ_ACCEPTED" field="parameters.custRequestStatusId">
<call-simple-method method-name="checkProductOwnerOfBacklog"/>
<if-not-empty field="ownerPartyId">