summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-05-29 13:18:19 (EDT)
committerEike Stepper2006-05-29 13:18:19 (EDT)
commit62e14b03ccab40b4b842ece1fa3137381dce85bd (patch)
treebf53a618bc0b8afa1589ebee77cca9c215c6e0d7
parentb67befa6c438676cd84fdd6bef358f4bcbbacb1d (diff)
downloadcdo-62e14b03ccab40b4b842ece1fa3137381dce85bd.zip
cdo-62e14b03ccab40b4b842ece1fa3137381dce85bd.tar.gz
cdo-62e14b03ccab40b4b842ece1fa3137381dce85bd.tar.bz2
Fixed various UNCHECKED warnings.
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/ClassInfoImpl.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/PackageInfoImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/PackageManagerImpl.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/protocol/CommitTransactionIndication.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/protocol/DescribePackageIndication.java10
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSuites.java4
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/old/PoolTest.java2
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/protocol/ValueHelper.java1
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/BeanHelper.java30
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/StringHelper.java12
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/eclipse/ExtensionParser.java15
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/eclipse/ResourcesHelper.java4
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/thread/Worker.java17
13 files changed, 76 insertions, 75 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/ClassInfoImpl.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/ClassInfoImpl.java
index 1d2150b..dbe8ad1 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/ClassInfoImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/ClassInfoImpl.java
@@ -32,7 +32,7 @@ public class ClassInfoImpl implements ClassInfo
protected PackageInfo packageInfo;
- protected List attributeInfos = new ArrayList();
+ protected List<AttributeInfo> attributeInfos = new ArrayList<AttributeInfo>();
private ClassInfo cachedParent;
@@ -85,9 +85,9 @@ public class ClassInfoImpl implements ClassInfo
public AttributeInfo getAttributeInfo(int feature)
{
- for (Iterator iter = attributeInfos.iterator(); iter.hasNext();)
+ for (Iterator<AttributeInfo> iter = attributeInfos.iterator(); iter.hasNext();)
{
- AttributeInfo attributeInfo = (AttributeInfo) iter.next();
+ AttributeInfo attributeInfo = iter.next();
if (attributeInfo.getFeatureID() == feature)
{
@@ -106,7 +106,7 @@ public class ClassInfoImpl implements ClassInfo
public AttributeInfo[] getAttributeInfos()
{
- return (AttributeInfo[]) attributeInfos.toArray(new AttributeInfo[attributeInfos.size()]);
+ return attributeInfos.toArray(new AttributeInfo[attributeInfos.size()]);
}
public ClassInfo getParent()
@@ -126,9 +126,9 @@ public class ClassInfoImpl implements ClassInfo
StringBuffer buffer = new StringBuffer();
boolean first = true;
- for (Iterator iter = attributeInfos.iterator(); iter.hasNext();)
+ for (Iterator<AttributeInfo> iter = attributeInfos.iterator(); iter.hasNext();)
{
- AttributeInfo attributeInfo = (AttributeInfo) iter.next();
+ AttributeInfo attributeInfo = iter.next();
if (first)
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/PackageInfoImpl.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/PackageInfoImpl.java
index 94ab900..cae10db 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/PackageInfoImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/PackageInfoImpl.java
@@ -27,7 +27,7 @@ public class PackageInfoImpl implements PackageInfo
protected PackageManager packageManager;
- protected List classes = new ArrayList();
+ protected List<ClassInfo> classes = new ArrayList<ClassInfo>();
public PackageInfoImpl(int pid, String name, PackageManager packageManager)
{
@@ -61,6 +61,6 @@ public class PackageInfoImpl implements PackageInfo
public ClassInfo[] getClasses()
{
- return (ClassInfo[]) classes.toArray(new ClassInfo[classes.size()]);
+ return classes.toArray(new ClassInfo[classes.size()]);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/PackageManagerImpl.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/PackageManagerImpl.java
index ad26629..ea204d9 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/PackageManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/impl/PackageManagerImpl.java
@@ -27,17 +27,17 @@ import java.util.Map;
public class PackageManagerImpl extends ServiceImpl implements PackageManager
{
- protected Map cidToClassInfoMap = new HashMap(2111);
+ protected Map<Integer, ClassInfo> cidToClassInfoMap = new HashMap<Integer, ClassInfo>(2111);
- protected Map nameToClassInfoMap = new HashMap(2111);
+ protected Map<String, ClassInfo> nameToClassInfoMap = new HashMap<String, ClassInfo>(2111);
- protected Map packages = new HashMap();
+ protected Map<String, PackageInfo> packages = new HashMap<String, PackageInfo>();
- protected List listeners = new ArrayList();
+ protected List<PackageListener> listeners = new ArrayList<PackageListener>();
public PackageInfo getPackageInfo(String name)
{
- return (PackageInfo) packages.get(name);
+ return packages.get(name);
}
public PackageInfo addPackage(int pid, String name)
@@ -66,19 +66,19 @@ public class PackageManagerImpl extends ServiceImpl implements PackageManager
public ClassInfo getClassInfo(int cid)
{
- return (ClassInfo) cidToClassInfoMap.get(new Integer(cid));
+ return cidToClassInfoMap.get(new Integer(cid));
}
public ClassInfo getClassInfo(String name)
{
- return (ClassInfo) nameToClassInfoMap.get(name);
+ return nameToClassInfoMap.get(name);
}
protected void notifyPackageListeners()
{
- for (Iterator iter = listeners.iterator(); iter.hasNext();)
+ for (Iterator<PackageListener> iter = listeners.iterator(); iter.hasNext();)
{
- PackageListener listener = (PackageListener) iter.next();
+ PackageListener listener = iter.next();
listener.notifyAddedPackage();
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/protocol/CommitTransactionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/protocol/CommitTransactionIndication.java
index f562b16..da53b28 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/protocol/CommitTransactionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/protocol/CommitTransactionIndication.java
@@ -44,19 +44,19 @@ public class CommitTransactionIndication extends AbstractIndicationWithResponse
{
public static final int CAPACITY_tempIdtoPersistentIdMap = 499;
- private Map tempOIDs = new HashMap(CAPACITY_tempIdtoPersistentIdMap);
+ private Map<Long, Long> tempOIDs = new HashMap<Long, Long>(CAPACITY_tempIdtoPersistentIdMap);
- private List changedObjectIds = new ArrayList();
+ private List<Long> changedObjectIds = new ArrayList<Long>();
- private Map changedObjectOIDOCA = new HashMap();
+ private Map<Long, Integer> changedObjectOIDOCA = new HashMap<Long, Integer>();
- private List oidList = new ArrayList();
+ private List<Long> oidList = new ArrayList<Long>();
private boolean optimisticControlException = false;
private Mapper mapper;
- private List<ResourceChangeInfo> newResources = new ArrayList();
+ private List<ResourceChangeInfo> newResources = new ArrayList<ResourceChangeInfo>();
public short getSignalId()
{
@@ -104,20 +104,20 @@ public class CommitTransactionIndication extends AbstractIndicationWithResponse
transmitInt(oidList.size());
- for (Iterator iter = oidList.iterator(); iter.hasNext();)
+ for (Iterator<Long> iter = oidList.iterator(); iter.hasNext();)
{
- Long id = (Long) iter.next();
+ Long id = iter.next();
transmitLong(id.longValue());
}
transmitInt(changedObjectIds.size());
- for (Iterator iter = changedObjectIds.iterator(); iter.hasNext();)
+ for (Iterator<Long> iter = changedObjectIds.iterator(); iter.hasNext();)
{
- Long id = (Long) iter.next();
+ Long id = iter.next();
transmitLong(id.longValue());
- Integer oca = (Integer) changedObjectOIDOCA.get(id);
+ Integer oca = changedObjectOIDOCA.get(id);
transmitInt(oca.intValue());
}
}
@@ -247,7 +247,7 @@ public class CommitTransactionIndication extends AbstractIndicationWithResponse
*/
private long resolveTempOID(long tempOID)
{
- Long sourceVal = (Long) tempOIDs.get(new Long(tempOID));
+ Long sourceVal = tempOIDs.get(new Long(tempOID));
if (sourceVal == null)
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/protocol/DescribePackageIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/protocol/DescribePackageIndication.java
index 97eb620..20210fd 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/protocol/DescribePackageIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/protocol/DescribePackageIndication.java
@@ -27,7 +27,7 @@ import java.util.List;
public class DescribePackageIndication extends AbstractIndicationWithResponse
{
- private List infos;
+ private List<ClassInfo> infos;
public short getSignalId()
{
@@ -51,9 +51,9 @@ public class DescribePackageIndication extends AbstractIndicationWithResponse
{
transmitInt(infos.size());
- for (Iterator iter = infos.iterator(); iter.hasNext();)
+ for (Iterator<ClassInfo> iter = infos.iterator(); iter.hasNext();)
{
- ClassInfo classInfo = (ClassInfo) iter.next();
+ ClassInfo classInfo = iter.next();
if (isDebugEnabled())
debug("Responding class " + classInfo.getName() + " = " + classInfo.getCID());
@@ -62,9 +62,9 @@ public class DescribePackageIndication extends AbstractIndicationWithResponse
}
}
- private List receiveClasses(PackageInfo packageInfo)
+ private List<ClassInfo> receiveClasses(PackageInfo packageInfo)
{
- List result = new ArrayList();
+ List<ClassInfo> result = new ArrayList<ClassInfo>();
int count = receiveInt();
for (int i = 0; i < count; i++)
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSuites.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSuites.java
index b72e431..318b5bd 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSuites.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AllSuites.java
@@ -12,7 +12,7 @@
*
* </copyright>
*
- * $Id: AllSuites.java,v 1.2 2006-05-08 19:27:23 nickb Exp $
+ * $Id: AllSuites.java,v 1.3 2006-05-29 17:18:19 estepper Exp $
*/
package org.eclipse.net4j.tests;
@@ -40,7 +40,7 @@ public class AllSuites extends TestSuite
populateSuite();
}
- public AllSuites(Class theClass)
+ public AllSuites(Class<?> theClass)
{
super(theClass);
populateSuite();
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/old/PoolTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/old/PoolTest.java
index f6cb00d..398a9cd 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/old/PoolTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/old/PoolTest.java
@@ -38,7 +38,7 @@ public class PoolTest extends TestCase
protected class TestPool extends AbstractPool
{
- protected Class doGetPooledClass(Object key)
+ protected Class<TestPooled> doGetPooledClass(Object key)
{
return TestPooled.class;
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/protocol/ValueHelper.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/protocol/ValueHelper.java
index 74ce508..daced46 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/protocol/ValueHelper.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/protocol/ValueHelper.java
@@ -100,6 +100,7 @@ public class ValueHelper
channel.transmitByte(END_OF_TRANSMISSION);
}
+ @SuppressWarnings("unchecked")
public static Object[] receiveValues(Channel channel)
{
List list = new ArrayList();
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/BeanHelper.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/BeanHelper.java
index 5ae7af0..1b1cc4f 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/BeanHelper.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/BeanHelper.java
@@ -16,17 +16,17 @@ import java.lang.reflect.Method;
public class BeanHelper
{
- public static Class mostSpecificClass(Class[] classes)
+ public static Class<?> mostSpecificClass(Class[] classes)
{
int size = classes.length;
for (int i = 0; i < size; i++)
{
- Class iClass = classes[i];
+ Class<?> iClass = classes[i];
for (int k = i + 1; k < size; k++)
{
- Class kClass = classes[k];
+ Class<?> kClass = classes[k];
if (iClass.isAssignableFrom(kClass))
{
@@ -95,7 +95,7 @@ public class BeanHelper
try
{
- Class type = setter.getParameterTypes()[0];
+ Class<?> type = setter.getParameterTypes()[0];
if (type == Boolean.class)
{
@@ -169,7 +169,7 @@ public class BeanHelper
}
}
- public static Method findGetter(Class clazz, String name)
+ public static Method findGetter(Class<? extends Object> clazz, String name)
{
String accessor = "is" + capitalize(name);
Method method = findMethod(clazz, accessor);
@@ -182,7 +182,7 @@ public class BeanHelper
return null;
}
- public static Method findChildGetter(Class clazz, String name)
+ public static Method findChildGetter(Class<? extends Object> clazz, String name)
{
String accessor = "get" + capitalize(name) + "s";
Method method = findMethod(clazz, accessor);
@@ -191,21 +191,21 @@ public class BeanHelper
return null;
}
- public static Method findSetter(Class clazz, String name)
+ public static Method findSetter(Class<? extends Object> clazz, String name)
{
String accessor = "set" + capitalize(name);
Method method = findMethod(clazz, accessor);
return validSetter(method) ? method : null;
}
- public static Method findAdder(Class clazz, String name)
+ public static Method findAdder(Class<? extends Object> clazz, String name)
{
String accessor = "add" + capitalize(name);
Method method = findMethod(clazz, accessor);
return validAdder(method) ? method : null;
}
- public static Method findMethod(Class clazz, String name)
+ public static Method findMethod(Class<? extends Object> clazz, String name)
{
Method[] methods = clazz.getMethods();
for (int i = 0; i < methods.length; i++)
@@ -223,7 +223,7 @@ public class BeanHelper
Class[] paramTypes = method.getParameterTypes();
if (paramTypes != null || paramTypes.length != 0) return false;
- Class returnType = method.getReturnType();
+ Class<?> returnType = method.getReturnType();
if (returnType == null || !validAttributeType(returnType)) return false;
return true;
@@ -237,7 +237,7 @@ public class BeanHelper
if (paramTypes == null || paramTypes.length != 1 || !validAttributeType(paramTypes[0]))
return false;
- Class returnType = method.getReturnType();
+ Class<?> returnType = method.getReturnType();
if (returnType != null && returnType != void.class) return false;
return true;
@@ -250,7 +250,7 @@ public class BeanHelper
Class[] paramTypes = method.getParameterTypes();
if (paramTypes == null || paramTypes.length != 1) return false;
- Class returnType = method.getReturnType();
+ Class<?> returnType = method.getReturnType();
if (returnType != null && returnType != void.class) return false;
return true;
@@ -263,18 +263,18 @@ public class BeanHelper
Class[] paramTypes = method.getParameterTypes();
if (paramTypes != null || paramTypes.length != 0) return false;
- Class returnType = method.getReturnType();
+ Class<?> returnType = method.getReturnType();
if (returnType == null || !validChildType(returnType)) return false;
return true;
}
- private static boolean validAttributeType(Class type)
+ private static boolean validAttributeType(Class<?> type)
{
return type == String.class || type == Boolean.class;
}
- private static boolean validChildType(Class type)
+ private static boolean validChildType(Class<?> type)
{
return type.isArray();
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/StringHelper.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/StringHelper.java
index d823cd3..82b94ea 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/StringHelper.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/StringHelper.java
@@ -115,7 +115,7 @@ public class StringHelper
return str;
}
- public static String getSimpleClassName(Class aClass)
+ public static String getSimpleClassName(Class<?> aClass)
{
return getSimpleClassName(aClass.getName());
}
@@ -175,7 +175,7 @@ public class StringHelper
/**
* Replace string
*/
- public static String replaceString(String source, Map args)
+ public static String replaceString(String source, Map<?, ?> args)
{
int startIndex = 0;
int openIndex = source.indexOf('{', startIndex);
@@ -427,12 +427,12 @@ public class StringHelper
throw new NumberFormatException("'" + str + "' is neither 'true' nor 'false'");
}
- public static String implode(Collection collection, String separator)
+ public static String implode(Collection<?> collection, String separator)
{
if (collection == null) return null;
if (collection.size() == 0) return "";
- Iterator iter = collection.iterator();
+ Iterator<?> iter = collection.iterator();
StringBuffer result = new StringBuffer(iter.next().toString());
while (iter.hasNext())
@@ -475,9 +475,9 @@ public class StringHelper
return -1;
}
- public static List parseName(String name, char separator)
+ public static List<String> parseName(String name, char separator)
{
- List result = new ArrayList();
+ List<String> result = new ArrayList<String>();
StringBuffer currentWord = new StringBuffer();
int length = name.length();
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/eclipse/ExtensionParser.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/eclipse/ExtensionParser.java
index d012673..03dbfed 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/eclipse/ExtensionParser.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/eclipse/ExtensionParser.java
@@ -25,7 +25,6 @@ import org.apache.log4j.Logger;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
@@ -34,9 +33,9 @@ import java.util.regex.Pattern;
public class ExtensionParser
{
- protected Map elementDataFactoryRegistry = new HashMap();
+ protected Map<Pattern, Factory> elementDataFactoryRegistry = new HashMap<Pattern, Factory>();
- protected List contextStack = new ArrayList();
+ protected List<String> contextStack = new ArrayList<String>();
private static final Logger logger = Logger.getLogger(ExtensionParser.class.getName());
@@ -146,16 +145,16 @@ public class ExtensionParser
public Factory findFactory(String context)
{
- for (Iterator it = elementDataFactoryRegistry.entrySet().iterator(); it.hasNext();)
+ for (Map.Entry<Pattern, Factory> entry : elementDataFactoryRegistry.entrySet())
{
- Map.Entry entry = (Map.Entry) it.next();
- Pattern pattern = (Pattern) entry.getKey();
+ Pattern pattern = entry.getKey();
Matcher matcher = pattern.matcher(context);
if (matcher.matches())
{
- return (Factory) entry.getValue();
+ return entry.getValue();
}
}
+
return null;
}
@@ -167,7 +166,7 @@ public class ExtensionParser
protected String popContext()
{
if (contextStack.isEmpty()) throw new ImplementationError("contextStack is empty");
- return (String) contextStack.remove(contextStack.size() - 1);
+ return contextStack.remove(contextStack.size() - 1);
}
protected String getContextString()
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/eclipse/ResourcesHelper.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/eclipse/ResourcesHelper.java
index 5c47aa6..a7afbea 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/eclipse/ResourcesHelper.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/eclipse/ResourcesHelper.java
@@ -120,7 +120,7 @@ public class ResourcesHelper
public static String[] readFileIntoStringArray(InputStream stream) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(stream));
- List result = new ArrayList();
+ List<String> result = new ArrayList<String>();
String line;
while ((line = br.readLine()) != null)
@@ -128,7 +128,7 @@ public class ResourcesHelper
result.add(line);
}
- return (String[]) result.toArray(new String[result.size()]);
+ return result.toArray(new String[result.size()]);
}
public static IProject ensureProject(String name) throws CoreException
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/thread/Worker.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/thread/Worker.java
index c735726..0985b19 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/thread/Worker.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/thread/Worker.java
@@ -31,9 +31,9 @@ public abstract class Worker extends Thread
*/
private static final Logger logger = Logger.getLogger(Worker.class);
- private List progressListeners;
+ private List<ProgressListener> progressListeners;
- private List shutdownListeners;
+ private List<ShutdownListener> shutdownListeners;
private int progress;
@@ -278,8 +278,9 @@ public abstract class Worker extends Thread
{
if (progressListeners == null)
{
- progressListeners = new ArrayList();
+ progressListeners = new ArrayList<ProgressListener>();
}
+
progressListeners.add(listener);
}
@@ -295,7 +296,7 @@ public abstract class Worker extends Thread
{
if (shutdownListeners == null)
{
- shutdownListeners = new ArrayList();
+ shutdownListeners = new ArrayList<ShutdownListener>();
}
shutdownListeners.add(listener);
}
@@ -312,9 +313,9 @@ public abstract class Worker extends Thread
{
if (progressListeners != null)
{
- for (Iterator it = progressListeners.iterator(); it.hasNext();)
+ for (Iterator<ProgressListener> it = progressListeners.iterator(); it.hasNext();)
{
- ProgressListener listener = (ProgressListener) it.next();
+ ProgressListener listener = it.next();
listener.notifyProgress(this, progress);
}
}
@@ -324,9 +325,9 @@ public abstract class Worker extends Thread
{
if (shutdownListeners != null)
{
- for (Iterator it = shutdownListeners.iterator(); it.hasNext();)
+ for (Iterator<ShutdownListener> it = shutdownListeners.iterator(); it.hasNext();)
{
- ShutdownListener listener = (ShutdownListener) it.next();
+ ShutdownListener listener = it.next();
listener.notifyShutdown(this);
}
}