]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed some warnings
authorArtur Signell <artur.signell@itmill.com>
Tue, 5 Oct 2010 10:12:11 +0000 (10:12 +0000)
committerArtur Signell <artur.signell@itmill.com>
Tue, 5 Oct 2010 10:12:11 +0000 (10:12 +0000)
svn changeset:15408/svn branch:6.5

src/com/vaadin/data/util/DefaultItemSorter.java
src/com/vaadin/terminal/gwt/client/ui/VTabsheetBase.java

index 372e94a5f9da543313e0ad527b546e9cdd40f998..fa36ef1a576959f9747f4bc9fcdc06d9f3afd74d 100644 (file)
@@ -154,7 +154,8 @@ public class DefaultItemSorter implements ItemSorter {
         // Removes any non-sortable property ids
         final List<Object> ids = new ArrayList<Object>();
         final List<Boolean> orders = new ArrayList<Boolean>();
-        final Collection sortable = container.getSortableContainerPropertyIds();
+        final Collection<?> sortable = container
+                .getSortableContainerPropertyIds();
         for (int i = 0; i < propertyId.length; i++) {
             if (sortable.contains(propertyId[i])) {
                 ids.add(propertyId[i]);
@@ -180,6 +181,7 @@ public class DefaultItemSorter implements ItemSorter {
     public static class DefaultPropertyValueComparator implements
             Comparator<Object>, Serializable {
 
+        @SuppressWarnings("unchecked")
         public int compare(Object o1, Object o2) {
             int r = 0;
             // Normal non-null comparison
@@ -197,7 +199,7 @@ public class DefaultItemSorter implements ItemSorter {
                 } else {
                     // Assume the objects can be cast to Comparable, throw
                     // ClassCastException otherwise.
-                    r = ((Comparable) o1).compareTo(o2);
+                    r = ((Comparable<Object>) o1).compareTo(o2);
                 }
             } else if (o1 == o2) {
                 // Objects are equal if both are null
@@ -212,7 +214,6 @@ public class DefaultItemSorter implements ItemSorter {
 
             return r;
         }
-
     }
 
 }
index 1ed309dc05a44a4a168aa375de893515ee7dbd6a..159ff62609e912dddf9baac4d0c678b8f4c87fa5 100644 (file)
@@ -21,11 +21,11 @@ abstract class VTabsheetBase extends ComplexPanel implements Container {
     String id;
     ApplicationConnection client;
 
-    protected final ArrayList tabKeys = new ArrayList();
+    protected final ArrayList<String> tabKeys = new ArrayList<String>();
     protected int activeTabIndex = 0;
     protected boolean disabled;
     protected boolean readonly;
-    protected Set disabledTabKeys = new HashSet();
+    protected Set<String> disabledTabKeys = new HashSet<String>();
     protected boolean cachedUpdate = false;
 
     public VTabsheetBase(String classname) {
@@ -50,8 +50,9 @@ abstract class VTabsheetBase extends ComplexPanel implements Container {
         final UIDL tabs = uidl.getChildUIDL(0);
 
         // Paintables in the TabSheet before update
-        ArrayList oldPaintables = new ArrayList();
-        for (Iterator iterator = getPaintableIterator(); iterator.hasNext();) {
+        ArrayList<Object> oldPaintables = new ArrayList<Object>();
+        for (Iterator<Object> iterator = getPaintableIterator(); iterator
+                .hasNext();) {
             oldPaintables.add(iterator.next());
         }
 
@@ -60,7 +61,7 @@ abstract class VTabsheetBase extends ComplexPanel implements Container {
         disabledTabKeys.clear();
 
         int index = 0;
-        for (final Iterator it = tabs.getChildIterator(); it.hasNext();) {
+        for (final Iterator<Object> it = tabs.getChildIterator(); it.hasNext();) {
             final UIDL tab = (UIDL) it.next();
             final String key = tab.getStringAttribute("key");
             final boolean selected = tab.getBooleanAttribute("selected");
@@ -90,7 +91,8 @@ abstract class VTabsheetBase extends ComplexPanel implements Container {
         }
 
         // Perform unregister for any paintables removed during update
-        for (Iterator iterator = oldPaintables.iterator(); iterator.hasNext();) {
+        for (Iterator<Object> iterator = oldPaintables.iterator(); iterator
+                .hasNext();) {
             Object oldPaintable = iterator.next();
             if (oldPaintable instanceof Paintable) {
                 Widget w = (Widget) oldPaintable;
@@ -106,7 +108,7 @@ abstract class VTabsheetBase extends ComplexPanel implements Container {
     /**
      * @return a list of currently shown Paintables
      */
-    abstract protected Iterator getPaintableIterator();
+    abstract protected Iterator<Object> getPaintableIterator();
 
     /**
      * Clears current tabs and contents