summaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/data
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-01-02 14:40:19 +0000
committerArtur Signell <artur.signell@itmill.com>2009-01-02 14:40:19 +0000
commitd9a13c237889ba32830edb27ad34c4d9ea2f180b (patch)
treed1bda61bf6de5b5b3724eb99f2618861fb45abcb /src/com/itmill/toolkit/data
parent19636fc0509e45d3bcedf4d7ba92670fdea4630d (diff)
downloadvaadin-framework-d9a13c237889ba32830edb27ad34c4d9ea2f180b.tar.gz
vaadin-framework-d9a13c237889ba32830edb27ad34c4d9ea2f180b.zip
Cleaned up the whole project
svn changeset:6398/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/data')
-rw-r--r--src/com/itmill/toolkit/data/Buffered.java1
-rw-r--r--src/com/itmill/toolkit/data/util/ContainerHierarchicalWrapper.java5
-rw-r--r--src/com/itmill/toolkit/data/util/ContainerOrderedWrapper.java2
-rw-r--r--src/com/itmill/toolkit/data/util/FilesystemContainer.java3
-rw-r--r--src/com/itmill/toolkit/data/util/HierarchicalContainer.java4
-rw-r--r--src/com/itmill/toolkit/data/util/IndexedContainer.java10
-rw-r--r--src/com/itmill/toolkit/data/util/MethodProperty.java2
-rw-r--r--src/com/itmill/toolkit/data/util/ObjectProperty.java1
-rw-r--r--src/com/itmill/toolkit/data/util/PropertyFormatter.java1
-rw-r--r--src/com/itmill/toolkit/data/util/PropertysetItem.java7
-rw-r--r--src/com/itmill/toolkit/data/util/QueryContainer.java1
11 files changed, 35 insertions, 2 deletions
diff --git a/src/com/itmill/toolkit/data/Buffered.java b/src/com/itmill/toolkit/data/Buffered.java
index fde5ca03d3..8fd9b1c5be 100644
--- a/src/com/itmill/toolkit/data/Buffered.java
+++ b/src/com/itmill/toolkit/data/Buffered.java
@@ -198,6 +198,7 @@ public interface Buffered {
* is possible if the commit operation triggers more than
* one error at the same time.
*/
+ @Override
public final Throwable getCause() {
if (causes.length == 0) {
return null;
diff --git a/src/com/itmill/toolkit/data/util/ContainerHierarchicalWrapper.java b/src/com/itmill/toolkit/data/util/ContainerHierarchicalWrapper.java
index a07d4041f7..91dd00fc46 100644
--- a/src/com/itmill/toolkit/data/util/ContainerHierarchicalWrapper.java
+++ b/src/com/itmill/toolkit/data/util/ContainerHierarchicalWrapper.java
@@ -440,8 +440,9 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
public Item addItem(Object itemId) throws UnsupportedOperationException {
// Null ids are not accepted
- if (itemId == null)
+ if (itemId == null) {
throw new NullPointerException("Container item id can not be null");
+ }
final Item item = container.addItem(itemId);
if (!hierarchical && item != null) {
@@ -672,10 +673,12 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
}
+ @Override
public boolean equals(Object obj) {
return obj == listener || (obj != null && obj.equals(listener));
}
+ @Override
public int hashCode() {
return listener.hashCode();
}
diff --git a/src/com/itmill/toolkit/data/util/ContainerOrderedWrapper.java b/src/com/itmill/toolkit/data/util/ContainerOrderedWrapper.java
index 1753a051c9..c9e5736b9a 100644
--- a/src/com/itmill/toolkit/data/util/ContainerOrderedWrapper.java
+++ b/src/com/itmill/toolkit/data/util/ContainerOrderedWrapper.java
@@ -588,10 +588,12 @@ public class ContainerOrderedWrapper implements Container.Ordered,
}
+ @Override
public boolean equals(Object obj) {
return obj == listener || (obj != null && obj.equals(listener));
}
+ @Override
public int hashCode() {
return listener.hashCode();
}
diff --git a/src/com/itmill/toolkit/data/util/FilesystemContainer.java b/src/com/itmill/toolkit/data/util/FilesystemContainer.java
index 5ede26cc4f..f1d5273003 100644
--- a/src/com/itmill/toolkit/data/util/FilesystemContainer.java
+++ b/src/com/itmill/toolkit/data/util/FilesystemContainer.java
@@ -628,6 +628,7 @@ public class FilesystemContainer implements Container.Hierarchical {
*
* @return A locally unique hash-code as integer
*/
+ @Override
public int hashCode() {
return file.hashCode() ^ FilesystemContainer.this.hashCode();
}
@@ -641,6 +642,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* @return <code>true</code> if the given object is the same as this
* object, <code>false</code> if not
*/
+ @Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof FileItem)) {
return false;
@@ -698,6 +700,7 @@ public class FilesystemContainer implements Container.Hierarchical {
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
if ("".equals(file.getName())) {
return file.getAbsolutePath();
diff --git a/src/com/itmill/toolkit/data/util/HierarchicalContainer.java b/src/com/itmill/toolkit/data/util/HierarchicalContainer.java
index 4af097e5bb..c702c14795 100644
--- a/src/com/itmill/toolkit/data/util/HierarchicalContainer.java
+++ b/src/com/itmill/toolkit/data/util/HierarchicalContainer.java
@@ -237,6 +237,7 @@ public class HierarchicalContainer extends IndexedContainer implements
*
* @see com.itmill.toolkit.data.util.IndexedContainer#addItem()
*/
+ @Override
public Object addItem() {
final Object id = super.addItem();
if (id != null && !roots.contains(id)) {
@@ -252,6 +253,7 @@ public class HierarchicalContainer extends IndexedContainer implements
* @see
* com.itmill.toolkit.data.util.IndexedContainer#addItem(java.lang.Object)
*/
+ @Override
public Item addItem(Object itemId) {
final Item item = super.addItem(itemId);
if (item != null) {
@@ -265,6 +267,7 @@ public class HierarchicalContainer extends IndexedContainer implements
*
* @see com.itmill.toolkit.data.util.IndexedContainer#removeAllItems()
*/
+ @Override
public boolean removeAllItems() {
final boolean success = super.removeAllItems();
@@ -284,6 +287,7 @@ public class HierarchicalContainer extends IndexedContainer implements
* com.itmill.toolkit.data.util.IndexedContainer#removeItem(java.lang.Object
* )
*/
+ @Override
public boolean removeItem(Object itemId) {
final boolean success = super.removeItem(itemId);
diff --git a/src/com/itmill/toolkit/data/util/IndexedContainer.java b/src/com/itmill/toolkit/data/util/IndexedContainer.java
index bf08158ee0..eca382d91c 100644
--- a/src/com/itmill/toolkit/data/util/IndexedContainer.java
+++ b/src/com/itmill/toolkit/data/util/IndexedContainer.java
@@ -1116,6 +1116,7 @@ public class IndexedContainer implements Container, Container.Indexed,
*
* @return <code>String</code> representation of the Item contents
*/
+ @Override
public String toString() {
String retValue = "";
@@ -1138,6 +1139,7 @@ public class IndexedContainer implements Container, Container.Indexed,
*
* @return A locally unique hash-code as integer
*/
+ @Override
public int hashCode() {
return itemId.hashCode();
}
@@ -1151,6 +1153,7 @@ public class IndexedContainer implements Container, Container.Indexed,
* @return <code>true</code> if the given object is the same as this
* object, <code>false</code> if not
*/
+ @Override
public boolean equals(Object obj) {
if (obj == null
|| !obj.getClass().equals(IndexedContainerItem.class)) {
@@ -1347,6 +1350,7 @@ public class IndexedContainer implements Container, Container.Indexed,
* @return <code>String</code> representation of the value stored in the
* Property
*/
+ @Override
public String toString() {
final Object value = getValue();
if (value == null) {
@@ -1364,6 +1368,7 @@ public class IndexedContainer implements Container, Container.Indexed,
*
* @return A locally unique hash-code as integer
*/
+ @Override
public int hashCode() {
return itemId.hashCode() ^ propertyId.hashCode();
}
@@ -1377,6 +1382,7 @@ public class IndexedContainer implements Container, Container.Indexed,
* @return <code>true</code> if the given object is the same as this
* object, <code>false</code> if not
*/
+ @Override
public boolean equals(Object obj) {
if (obj == null
|| !obj.getClass().equals(IndexedContainerProperty.class)) {
@@ -1533,6 +1539,7 @@ public class IndexedContainer implements Container, Container.Indexed,
* @throws CloneNotSupportedException
* if an object cannot be cloned. .
*/
+ @Override
public Object clone() throws CloneNotSupportedException {
// Creates the clone
@@ -1589,6 +1596,7 @@ public class IndexedContainer implements Container, Container.Indexed,
*
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
return super.equals(obj);
}
@@ -1608,6 +1616,7 @@ public class IndexedContainer implements Container, Container.Indexed,
this.onlyMatchPrefix = onlyMatchPrefix;
}
+ @Override
public boolean equals(Object obj) {
// Only ones of the objects of the same class can be equal
@@ -1635,6 +1644,7 @@ public class IndexedContainer implements Container, Container.Indexed,
return true;
}
+ @Override
public int hashCode() {
return (propertyId != null ? propertyId.hashCode() : 0)
^ (filterString != null ? filterString.hashCode() : 0);
diff --git a/src/com/itmill/toolkit/data/util/MethodProperty.java b/src/com/itmill/toolkit/data/util/MethodProperty.java
index 45a3e53a4e..165d54c902 100644
--- a/src/com/itmill/toolkit/data/util/MethodProperty.java
+++ b/src/com/itmill/toolkit/data/util/MethodProperty.java
@@ -559,6 +559,7 @@ public class MethodProperty implements Property, Property.ValueChangeNotifier,
*
* @return String representation of the value stored in the Property
*/
+ @Override
public String toString() {
final Object value = getValue();
if (value == null) {
@@ -734,6 +735,7 @@ public class MethodProperty implements Property, Property.ValueChangeNotifier,
/**
* @see java.lang.Throwable#getCause()
*/
+ @Override
public Throwable getCause() {
return cause;
}
diff --git a/src/com/itmill/toolkit/data/util/ObjectProperty.java b/src/com/itmill/toolkit/data/util/ObjectProperty.java
index c89d1f5cc9..1821a815ed 100644
--- a/src/com/itmill/toolkit/data/util/ObjectProperty.java
+++ b/src/com/itmill/toolkit/data/util/ObjectProperty.java
@@ -122,6 +122,7 @@ public class ObjectProperty implements Property, Property.ValueChangeNotifier,
* @return <code>String</code> representation of the value stored in the
* ObjectProperty
*/
+ @Override
public String toString() {
final Object value = getValue();
if (value != null) {
diff --git a/src/com/itmill/toolkit/data/util/PropertyFormatter.java b/src/com/itmill/toolkit/data/util/PropertyFormatter.java
index 62f793213f..c6454a7f47 100644
--- a/src/com/itmill/toolkit/data/util/PropertyFormatter.java
+++ b/src/com/itmill/toolkit/data/util/PropertyFormatter.java
@@ -143,6 +143,7 @@ public abstract class PropertyFormatter implements Property,
* @return If the datasource returns null, this is null. Otherwise this is
* String given by format().
*/
+ @Override
public String toString() {
Object value = dataSource == null ? false : dataSource.getValue();
if (value == null) {
diff --git a/src/com/itmill/toolkit/data/util/PropertysetItem.java b/src/com/itmill/toolkit/data/util/PropertysetItem.java
index fd60121ebc..dfc819ca7e 100644
--- a/src/com/itmill/toolkit/data/util/PropertysetItem.java
+++ b/src/com/itmill/toolkit/data/util/PropertysetItem.java
@@ -109,8 +109,9 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
public boolean addItemProperty(Object id, Property property) {
// Null ids are not accepted
- if (id == null)
+ if (id == null) {
throw new NullPointerException("Item property id can not be null");
+ }
// Cant add a property twice
if (map.containsKey(id)) {
@@ -135,6 +136,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
*
* @return <code>String</code> representation of the Item contents
*/
+ @Override
public String toString() {
String retValue = "";
@@ -243,6 +245,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
*
* @see java.lang.Object#clone()
*/
+ @Override
public Object clone() throws CloneNotSupportedException {
final PropertysetItem npsi = new PropertysetItem();
@@ -267,6 +270,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
* otherwise <code>false</code>.
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof PropertysetItem)) {
@@ -310,6 +314,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
* @return the hash code value.
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return (list == null ? 0 : list.hashCode())
diff --git a/src/com/itmill/toolkit/data/util/QueryContainer.java b/src/com/itmill/toolkit/data/util/QueryContainer.java
index b22064dbdb..2c76e58702 100644
--- a/src/com/itmill/toolkit/data/util/QueryContainer.java
+++ b/src/com/itmill/toolkit/data/util/QueryContainer.java
@@ -562,6 +562,7 @@ public class QueryContainer implements Container, Container.Ordered,
*
* @see #close()
*/
+ @Override
public void finalize() {
try {
close();