*/
public Item getItem(Object itemId) {
- // Null ids are not accepted
- if (itemId == null) throw new NullPointerException("Container item id can not be null");
+ // Null ids are not accepted
+ if (itemId == null) {
+ throw new NullPointerException("Container item id can not be null");
+ }
if (items.containsKey(itemId)
&& (filteredItemIds == null || filteredItemIds.contains(itemId))) {
*/
public Item addItem(Object itemId) {
- // Null ids are not accepted
- if (itemId == null) throw new NullPointerException("Container item id can not be null");
-
+ // Null ids are not accepted
+ if (itemId == null) {
+ throw new NullPointerException("Container item id can not be null");
+ }
+
// Makes sure that the Item has not been created yet
if (items.containsKey(itemId)) {
return null;
*/
private IndexedContainerProperty(Object itemId, Object propertyId) {
if (itemId == null || propertyId == null) {
- // Null ids are not accepted
- throw new NullPointerException("Container item or property ids can not be null");
+ // Null ids are not accepted
+ throw new NullPointerException(
+ "Container item or property ids can not be null");
}
this.propertyId = propertyId;
this.itemId = itemId;
* @return A locally unique hash-code as integer
*/
public int hashCode() {
- return itemId.hashCode() ^ propertyId.hashCode()
- ^ IndexedContainer.this.hashCode();
+ return itemId.hashCode() ^ propertyId.hashCode();
}
/**