Browse Source

Fixed some warnings

svn changeset:15408/svn branch:6.5
tags/6.7.0.beta1
Artur Signell 13 years ago
parent
commit
d584271615

+ 4
- 3
src/com/vaadin/data/util/DefaultItemSorter.java View 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;
}

}

}

+ 9
- 7
src/com/vaadin/terminal/gwt/client/ui/VTabsheetBase.java View 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

Loading…
Cancel
Save