Implemented: Refer to objects by their interfaces rather than class when instantiating Collection implementation classes in Java files
(OFBIZ-9023) (OFBIZ-9026)(OFBIZ-9027)(OFBIZ-9032)(OFBIZ-9034)(OFBIZ-9036)(OFBIZ-9030) Thanks: Divesh Dutta, Amit Gadaley and Shubham Agrawal for the contribution. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1768189 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -75,12 +75,12 @@ public class MiscTests extends GenericTestCaseBase {
|
||||
BigDecimal bigDecimal = new BigDecimal("1.234");
|
||||
URL url = new URL("http://ofbiz.apache.org");
|
||||
List<String> baseList = UtilMisc.toList("a", "1", "b", "2", "c", "3");
|
||||
ArrayList<String> arrayList = new ArrayList<String>();
|
||||
List<String> arrayList = new ArrayList<String>();
|
||||
arrayList.addAll(baseList);
|
||||
List<String> fastList = new LinkedList<String>();
|
||||
fastList.addAll(baseList);
|
||||
Map<String, String> baseMap = UtilMisc.toMap("a", "1", "b", "2", "c", "3");
|
||||
HashMap<String, String> hashMap = new HashMap<String, String>();
|
||||
Map<String, String> hashMap = new HashMap<String, String>();
|
||||
hashMap.putAll(baseMap);
|
||||
Map<String, String> fastMap = new HashMap<String, String>();
|
||||
fastMap.putAll(baseMap);
|
||||
|
||||
@@ -44,7 +44,7 @@ public abstract class GenericTestCaseBase extends TestCase {
|
||||
}
|
||||
|
||||
public static void useAllMemory() throws Exception {
|
||||
LinkedList<long[]> dummy = new LinkedList<long[]>();
|
||||
List<long[]> dummy = new LinkedList<long[]>();
|
||||
try {
|
||||
do {
|
||||
dummy.add(new long[1048576]);
|
||||
@@ -300,7 +300,7 @@ OUTER:
|
||||
Map<?, ?> gotMap = (Map<?, ?>) got;
|
||||
if (!got.equals(wanted)) {
|
||||
Set<T> leftKeys = new LinkedHashSet<T>(wanted.keySet());
|
||||
HashSet<Object> rightKeys = new HashSet<Object>(gotMap.keySet());
|
||||
Set<Object> rightKeys = new HashSet<Object>(gotMap.keySet());
|
||||
for (T key: leftKeys) {
|
||||
assertTrue(msg + "got key(" + key + ")", rightKeys.remove(key));
|
||||
assertEquals(msg + "key(" + key + ") value", wanted.get(key), gotMap.get(key));
|
||||
@@ -345,7 +345,7 @@ OUTER:
|
||||
}
|
||||
|
||||
public static <T> List<T> list(T value) {
|
||||
ArrayList<T> list = new ArrayList<T>(1);
|
||||
List<T> list = new ArrayList<T>(1);
|
||||
list.add(value);
|
||||
return list;
|
||||
}
|
||||
@@ -355,7 +355,7 @@ OUTER:
|
||||
}
|
||||
|
||||
public static <T> Set<T> set(T value) {
|
||||
HashSet<T> set = new HashSet<T>(1);
|
||||
Set<T> set = new HashSet<T>(1);
|
||||
set.add(value);
|
||||
return set;
|
||||
}
|
||||
@@ -369,7 +369,7 @@ OUTER:
|
||||
}
|
||||
|
||||
public static <T> Set<T> set(Iterator<T> it) {
|
||||
HashSet<T> set = new HashSet<T>();
|
||||
Set<T> set = new HashSet<T>();
|
||||
while (it.hasNext()) {
|
||||
T item = it.next();
|
||||
set.add(item);
|
||||
|
||||
@@ -122,7 +122,7 @@ public final class UtilDateTime {
|
||||
}
|
||||
|
||||
public static String formatInterval(double interval, int count, Locale locale) {
|
||||
ArrayList<Double> parts = new ArrayList<Double>(timevals.length);
|
||||
List<Double> parts = new ArrayList<Double>(timevals.length);
|
||||
for (String[] timeval: timevals) {
|
||||
int value = Integer.valueOf(timeval[0]);
|
||||
double remainder = interval % value;
|
||||
|
||||
Reference in New Issue
Block a user