Changeset 28607
- Timestamp:
- 01/09/08 16:49:32 (7 months ago)
- Files:
-
- org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/collections/ArrayMap.java (modified) (3 diffs)
- org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/collections/DependencyTree.java (modified) (2 diffs)
- org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/collections/ListenerList.java (modified) (3 diffs)
- org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/collections/PrimitiveArrays.java (modified) (2 diffs)
- org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/collections/SerializableArrayMap.java (modified) (3 diffs)
- org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/utils/ArrayUtils.java (modified) (2 diffs)
- org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/xmap/XAnnotatedMember.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/collections/ArrayMap.java
r19157 r28607 21 21 22 22 import java.util.Map; 23 24 import org.jetbrains.annotations.NotNull; 23 25 24 26 /** … … 140 142 } 141 143 142 public V put(K key, V value) { 143 if (key == null) { 144 throw new NullPointerException(); 145 } 146 144 public V put(@NotNull K key, V value) { 147 145 // handle the case where we don't have any attributes yet 148 146 if (elements == null) { … … 177 175 } 178 176 179 public void add(K key, V value) { 180 if (key == null) { 181 throw new IllegalArgumentException(); 182 } 183 177 public void add(@NotNull K key, V value) { 184 178 // handle the case where we don't have any attributes yet 185 179 int insertIndex; org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/collections/DependencyTree.java
r28168 r28607 156 156 } 157 157 158 159 158 public List<Entry<K, T>> getPendingEntries() { 160 159 List<Entry<K, T>> result = new ArrayList<Entry<K, T>>(); … … 205 204 return list; 206 205 } 207 208 206 209 207 public void clear() { org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/collections/ListenerList.java
r20633 r28607 19 19 20 20 package org.nuxeo.common.collections; 21 22 import org.jetbrains.annotations.NotNull; 21 23 22 24 … … 85 87 * @param listener the listener to add 86 88 */ 87 public synchronized void add(Object listener) { 88 if (listener == null) { 89 throw new IllegalArgumentException(); 90 } 89 public synchronized void add(@NotNull Object listener) { 91 90 // check for duplicates 92 91 final int oldSize = listeners.length; … … 147 146 * @param listener the listener 148 147 */ 149 public synchronized void remove(Object listener) { 150 if (listener == null) { 151 throw new IllegalArgumentException(); 152 } 148 public synchronized void remove(@NotNull Object listener) { 153 149 int oldSize = listeners.length; 154 150 for (int i = 0; i < oldSize; ++i) { org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/collections/PrimitiveArrays.java
r28168 r28607 25 25 import java.util.Iterator; 26 26 import java.util.List; 27 28 import org.jetbrains.annotations.NotNull; 27 29 28 30 /** … … 196 198 } 197 199 198 public static List<?> toList(Object array) { 199 Class<?> arrType = array.getClass().getComponentType(); 200 if (arrType == null) { 201 throw new IllegalArgumentException("Not an array"); 202 } 200 public static List<?> toList(@NotNull Object array) { 201 @NotNull Class<?> arrType = array.getClass().getComponentType(); 203 202 if (arrType.isPrimitive()) { 204 203 if (arrType == Integer.TYPE) { org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/collections/SerializableArrayMap.java
r22678 r28607 22 22 import java.io.Serializable; 23 23 import java.util.Map; 24 25 import org.jetbrains.annotations.NotNull; 24 26 25 27 /** … … 148 150 } 149 151 150 public V put(K key, V value) { 151 if (key == null) { 152 throw new NullPointerException(); 153 } 152 public V put(@NotNull K key, V value) { 154 153 155 154 // handle the case where we don't have any attributes yet … … 185 184 } 186 185 187 public void add(K key, V value) { 188 if (key == null) { 189 throw new IllegalArgumentException(); 190 } 191 186 public void add(@NotNull K key, V value) { 192 187 // handle the case where we don't have any attributes yet 193 188 int insertIndex; org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/utils/ArrayUtils.java
r28478 r28607 26 26 import java.util.List; 27 27 import java.util.Set; 28 29 import org.jetbrains.annotations.NotNull; 28 30 29 31 /** … … 84 86 */ 85 87 @SuppressWarnings("unchecked") 86 public static <T> T[] intersect(final T[]... arrays) { 87 if (null == arrays) { 88 throw new IllegalArgumentException("arrays cannot be null"); 89 } 90 88 public static <T> T[] intersect(@NotNull final T[]... arrays) { 91 89 final Class type = arrays.getClass().getComponentType() 92 90 .getComponentType(); org.nuxeo.common/branches/1.4/src/main/java/org/nuxeo/common/xmap/XAnnotatedMember.java
r26235 r28607 71 71 throw new IllegalArgumentException( 72 72 String.format("%s, setter=%s, value=%s", e.getMessage(), 73 setter, value) );73 setter, value), e); 74 74 } 75 75 }
