summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-12-28 13:24:41 +0000
committerArtur Signell <artur.signell@itmill.com>2009-12-28 13:24:41 +0000
commit37f22730cfdd3e42b301e3a5f79653f572e262fc (patch)
tree38697859cb719113e020889479346032f49c6562 /src
parent8043a71c9cd8c6c0306c35ba9de762b166de2e65 (diff)
downloadvaadin-framework-37f22730cfdd3e42b301e3a5f79653f572e262fc.tar.gz
vaadin-framework-37f22730cfdd3e42b301e3a5f79653f572e262fc.zip
Fixed generics warnings
svn changeset:10553/svn branch:6.3
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/data/util/FilesystemContainer.java41
-rw-r--r--src/com/vaadin/data/util/IndexedContainer.java2
-rw-r--r--src/com/vaadin/terminal/CompositeErrorMessage.java24
-rw-r--r--src/com/vaadin/ui/AbstractComponent.java15
-rw-r--r--src/com/vaadin/ui/Component.java4
5 files changed, 47 insertions, 39 deletions
diff --git a/src/com/vaadin/data/util/FilesystemContainer.java b/src/com/vaadin/data/util/FilesystemContainer.java
index 126e2237dd..adcfcfe3a7 100644
--- a/src/com/vaadin/data/util/FilesystemContainer.java
+++ b/src/com/vaadin/data/util/FilesystemContainer.java
@@ -62,7 +62,7 @@ public class FilesystemContainer implements Container.Hierarchical {
/**
* List of the string identifiers for the available properties.
*/
- public static Collection FILE_PROPERTIES;
+ public static Collection<String> FILE_PROPERTIES;
private final static Method FILEITEM_LASTMODIFIED;
@@ -74,7 +74,7 @@ public class FilesystemContainer implements Container.Hierarchical {
static {
- FILE_PROPERTIES = new ArrayList();
+ FILE_PROPERTIES = new ArrayList<String>();
FILE_PROPERTIES.add(PROPERTY_NAME);
FILE_PROPERTIES.add(PROPERTY_ICON);
FILE_PROPERTIES.add(PROPERTY_SIZE);
@@ -201,10 +201,10 @@ public class FilesystemContainer implements Container.Hierarchical {
* add a JavaDoc comment here, we use the default documentation from
* implemented interface.
*/
- public Collection getChildren(Object itemId) {
+ public Collection<File> getChildren(Object itemId) {
if (!(itemId instanceof File)) {
- return Collections.unmodifiableCollection(new LinkedList());
+ return Collections.unmodifiableCollection(new LinkedList<File>());
}
File[] f;
if (filter != null) {
@@ -214,10 +214,10 @@ public class FilesystemContainer implements Container.Hierarchical {
}
if (f == null) {
- return Collections.unmodifiableCollection(new LinkedList());
+ return Collections.unmodifiableCollection(new LinkedList<File>());
}
- final List l = Arrays.asList(f);
+ final List<File> l = Arrays.asList(f);
Collections.sort(l);
return Collections.unmodifiableCollection(l);
@@ -276,7 +276,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* comment here, we use the default documentation from implemented
* interface.
*/
- public Collection rootItemIds() {
+ public Collection<File> rootItemIds() {
File[] f;
@@ -292,10 +292,10 @@ public class FilesystemContainer implements Container.Hierarchical {
}
if (f == null) {
- return Collections.unmodifiableCollection(new LinkedList());
+ return Collections.unmodifiableCollection(new LinkedList<File>());
}
- final List l = Arrays.asList(f);
+ final List<File> l = Arrays.asList(f);
Collections.sort(l);
return Collections.unmodifiableCollection(l);
@@ -392,18 +392,18 @@ public class FilesystemContainer implements Container.Hierarchical {
* @param f
* the root file where to start adding files
*/
- private void addItemIds(Collection col, File f) {
+ private void addItemIds(Collection<File> col, File f) {
File[] l;
if (filter != null) {
l = f.listFiles(filter);
} else {
l = f.listFiles();
}
- final List ll = Arrays.asList(l);
+ final List<File> ll = Arrays.asList(l);
Collections.sort(ll);
- for (final Iterator i = ll.iterator(); i.hasNext();) {
- final File lf = (File) i.next();
+ for (final Iterator<File> i = ll.iterator(); i.hasNext();) {
+ final File lf = i.next();
if (lf.isDirectory()) {
addItemIds(col, lf);
} else {
@@ -416,10 +416,10 @@ public class FilesystemContainer implements Container.Hierarchical {
* Gets the IDs of Items in the filesystem. Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
- public Collection getItemIds() {
+ public Collection<File> getItemIds() {
if (recursive) {
- final Collection col = new ArrayList();
+ final Collection<File> col = new ArrayList<File>();
for (int i = 0; i < roots.length; i++) {
addItemIds(col, roots[i]);
}
@@ -437,10 +437,11 @@ public class FilesystemContainer implements Container.Hierarchical {
}
if (f == null) {
- return Collections.unmodifiableCollection(new LinkedList());
+ return Collections
+ .unmodifiableCollection(new LinkedList<File>());
}
- final List l = Arrays.asList(f);
+ final List<File> l = Arrays.asList(f);
Collections.sort(l);
return Collections.unmodifiableCollection(l);
}
@@ -492,7 +493,7 @@ public class FilesystemContainer implements Container.Hierarchical {
*
* @return Unmodifiable collection containing all available file properties.
*/
- public Collection getContainerPropertyIds() {
+ public Collection<String> getContainerPropertyIds() {
return FILE_PROPERTIES;
}
@@ -505,7 +506,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* the ID of the property whose type is requested.
* @return data type of the requested property, or <code>null</code>
*/
- public Class getType(Object propertyId) {
+ public Class<?> getType(Object propertyId) {
if (propertyId.equals(PROPERTY_NAME)) {
return String.class;
@@ -617,7 +618,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* JavaDoc comment here, we use the default documentation from
* implemented interface.
*/
- public Collection getItemPropertyIds() {
+ public Collection<String> getItemPropertyIds() {
return getContainerPropertyIds();
}
diff --git a/src/com/vaadin/data/util/IndexedContainer.java b/src/com/vaadin/data/util/IndexedContainer.java
index c61b16bada..b246a50a6b 100644
--- a/src/com/vaadin/data/util/IndexedContainer.java
+++ b/src/com/vaadin/data/util/IndexedContainer.java
@@ -63,7 +63,7 @@ public class IndexedContainer implements Container.Indexed,
/**
* Linked list of ordered Property IDs.
*/
- private ArrayList propertyIds = new ArrayList();
+ private ArrayList<Object> propertyIds = new ArrayList<Object>();
/**
* Property ID to type mapping.
diff --git a/src/com/vaadin/terminal/CompositeErrorMessage.java b/src/com/vaadin/terminal/CompositeErrorMessage.java
index 776e6c919c..e2158c81ba 100644
--- a/src/com/vaadin/terminal/CompositeErrorMessage.java
+++ b/src/com/vaadin/terminal/CompositeErrorMessage.java
@@ -24,7 +24,7 @@ public class CompositeErrorMessage implements ErrorMessage, Serializable {
/**
* Array of all the errors.
*/
- private final List errors;
+ private final List<ErrorMessage> errors;
/**
* Level of the error.
@@ -39,7 +39,7 @@ public class CompositeErrorMessage implements ErrorMessage, Serializable {
* ignored, but at least one message is required.
*/
public CompositeErrorMessage(ErrorMessage[] errorMessages) {
- errors = new ArrayList(errorMessages.length);
+ errors = new ArrayList<ErrorMessage>(errorMessages.length);
level = Integer.MIN_VALUE;
for (int i = 0; i < errorMessages.length; i++) {
@@ -60,12 +60,13 @@ public class CompositeErrorMessage implements ErrorMessage, Serializable {
* the Collection of error messages that are listed togeter. At
* least one message is required.
*/
- public CompositeErrorMessage(Collection errorMessages) {
- errors = new ArrayList(errorMessages.size());
+ public CompositeErrorMessage(Collection<ErrorMessage> errorMessages) {
+ errors = new ArrayList<ErrorMessage>(errorMessages.size());
level = Integer.MIN_VALUE;
- for (final Iterator i = errorMessages.iterator(); i.hasNext();) {
- addErrorMessage((ErrorMessage) i.next());
+ for (final Iterator<ErrorMessage> i = errorMessages.iterator(); i
+ .hasNext();) {
+ addErrorMessage(i.next());
}
if (errors.size() == 0) {
@@ -105,7 +106,7 @@ public class CompositeErrorMessage implements ErrorMessage, Serializable {
*
* @return the error iterator.
*/
- public Iterator iterator() {
+ public Iterator<ErrorMessage> iterator() {
return errors.iterator();
}
@@ -115,7 +116,7 @@ public class CompositeErrorMessage implements ErrorMessage, Serializable {
public void paint(PaintTarget target) throws PaintException {
if (errors.size() == 1) {
- ((ErrorMessage) errors.iterator().next()).paint(target);
+ (errors.iterator().next()).paint(target);
} else {
target.startTag("error");
@@ -132,8 +133,9 @@ public class CompositeErrorMessage implements ErrorMessage, Serializable {
}
// Paint all the exceptions
- for (final Iterator i = errors.iterator(); i.hasNext();) {
- ((ErrorMessage) i.next()).paint(target);
+ for (final Iterator<ErrorMessage> i = errors.iterator(); i
+ .hasNext();) {
+ i.next().paint(target);
}
target.endTag("error");
@@ -165,7 +167,7 @@ public class CompositeErrorMessage implements ErrorMessage, Serializable {
public String toString() {
String retval = "[";
int pos = 0;
- for (final Iterator i = errors.iterator(); i.hasNext();) {
+ for (final Iterator<ErrorMessage> i = errors.iterator(); i.hasNext();) {
if (pos > 0) {
retval += ",";
}
diff --git a/src/com/vaadin/ui/AbstractComponent.java b/src/com/vaadin/ui/AbstractComponent.java
index 68910bb686..92bf90831b 100644
--- a/src/com/vaadin/ui/AbstractComponent.java
+++ b/src/com/vaadin/ui/AbstractComponent.java
@@ -119,7 +119,7 @@ public abstract class AbstractComponent implements Component, MethodEventSource
/**
* List of repaint request listeners or null if not listened at all.
*/
- private LinkedList repaintRequestListeners = null;
+ private LinkedList<RepaintRequestListener> repaintRequestListeners = null;
/**
* Are all the repaint listeners notified about recent changes ?
@@ -763,7 +763,8 @@ public abstract class AbstractComponent implements Component, MethodEventSource
}
/* Documentation copied from interface */
- public void childRequestedRepaint(Collection alreadyNotified) {
+ public void childRequestedRepaint(
+ Collection<RepaintRequestListener> alreadyNotified) {
// Invisible components (by flag in this particular component) do not
// need repaints
if (!visible) {
@@ -778,7 +779,8 @@ public abstract class AbstractComponent implements Component, MethodEventSource
*
* @param alreadyNotified
*/
- private void fireRequestRepaintEvent(Collection alreadyNotified) {
+ private void fireRequestRepaintEvent(
+ Collection<RepaintRequestListener> alreadyNotified) {
// Notify listeners only once
if (!repaintRequestListenersNotified) {
// Notify the listeners
@@ -788,12 +790,13 @@ public abstract class AbstractComponent implements Component, MethodEventSource
final RepaintRequestEvent event = new RepaintRequestEvent(this);
for (int i = 0; i < listeners.length; i++) {
if (alreadyNotified == null) {
- alreadyNotified = new LinkedList();
+ alreadyNotified = new LinkedList<RepaintRequestListener>();
}
if (!alreadyNotified.contains(listeners[i])) {
((RepaintRequestListener) listeners[i])
.repaintRequested(event);
- alreadyNotified.add(listeners[i]);
+ alreadyNotified
+ .add((RepaintRequestListener) listeners[i]);
repaintRequestListenersNotified = true;
}
}
@@ -810,7 +813,7 @@ public abstract class AbstractComponent implements Component, MethodEventSource
/* Documentation copied from interface */
public void addListener(RepaintRequestListener listener) {
if (repaintRequestListeners == null) {
- repaintRequestListeners = new LinkedList();
+ repaintRequestListeners = new LinkedList<RepaintRequestListener>();
}
if (!repaintRequestListeners.contains(listener)) {
repaintRequestListeners.add(listener);
diff --git a/src/com/vaadin/ui/Component.java b/src/com/vaadin/ui/Component.java
index 75d819f4b3..61df5164df 100644
--- a/src/com/vaadin/ui/Component.java
+++ b/src/com/vaadin/ui/Component.java
@@ -308,13 +308,15 @@ public interface Component extends Paintable, VariableOwner, Sizeable,
* and pass it forwards. Null parameter is interpreted as empty
* collection.
*/
- public void childRequestedRepaint(Collection alreadyNotified);
+ public void childRequestedRepaint(
+ Collection<RepaintRequestListener> alreadyNotified);
/* Component event framework */
/**
* Superclass of all component originated <code>Event</code>s.
*/
+ @SuppressWarnings("serial")
public class Event extends EventObject {
/**