equal
deleted
inserted
replaced
108 throw new IllegalArgumentException("Null Map"); |
108 throw new IllegalArgumentException("Null Map"); |
109 SortedMap<String, Object> map = |
109 SortedMap<String, Object> map = |
110 new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER); |
110 new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER); |
111 for (Map.Entry<String, ?> entry : fields.entrySet()) { |
111 for (Map.Entry<String, ?> entry : fields.entrySet()) { |
112 String name = entry.getKey(); |
112 String name = entry.getKey(); |
113 if (name == null || name.equals("")) |
113 if (name == null || name.isEmpty()) |
114 throw new IllegalArgumentException("Empty or null field name"); |
114 throw new IllegalArgumentException("Empty or null field name"); |
115 if (map.containsKey(name)) |
115 if (map.containsKey(name)) |
116 throw new IllegalArgumentException("Duplicate name: " + name); |
116 throw new IllegalArgumentException("Duplicate name: " + name); |
117 map.put(name, entry.getValue()); |
117 map.put(name, entry.getValue()); |
118 } |
118 } |
164 throw new IllegalArgumentException("Different size arrays"); |
164 throw new IllegalArgumentException("Different size arrays"); |
165 SortedMap<String, Object> map = |
165 SortedMap<String, Object> map = |
166 new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER); |
166 new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER); |
167 for (int i = 0; i < fieldNames.length; i++) { |
167 for (int i = 0; i < fieldNames.length; i++) { |
168 String name = fieldNames[i]; |
168 String name = fieldNames[i]; |
169 if (name == null || name.equals("")) |
169 if (name == null || name.isEmpty()) |
170 throw new IllegalArgumentException("Empty or null field name"); |
170 throw new IllegalArgumentException("Empty or null field name"); |
171 Object old = map.put(name, fieldValues[i]); |
171 Object old = map.put(name, fieldValues[i]); |
172 if (old != null) { |
172 if (old != null) { |
173 throw new IllegalArgumentException("Duplicate field name: " + |
173 throw new IllegalArgumentException("Duplicate field name: " + |
174 name); |
174 name); |
331 if (fieldNames == null) |
331 if (fieldNames == null) |
332 return values.clone(); |
332 return values.clone(); |
333 Object[] result = new Object[fieldNames.length]; |
333 Object[] result = new Object[fieldNames.length]; |
334 for (int i = 0; i < fieldNames.length; i++) { |
334 for (int i = 0; i < fieldNames.length; i++) { |
335 String name = fieldNames[i]; |
335 String name = fieldNames[i]; |
336 if (name != null && !name.equals("")) |
336 if (name != null && !name.isEmpty()) |
337 result[i] = getFieldValue(name); |
337 result[i] = getFieldValue(name); |
338 } |
338 } |
339 return result; |
339 return result; |
340 } |
340 } |
341 |
341 |
541 else |
541 else |
542 return d; |
542 return d; |
543 } |
543 } |
544 |
544 |
545 private static void checkIllegalFieldName(String name) { |
545 private static void checkIllegalFieldName(String name) { |
546 if (name == null || name.equals("")) |
546 if (name == null || name.isEmpty()) |
547 illegal("Null or empty field name"); |
547 illegal("Null or empty field name"); |
548 } |
548 } |
549 |
549 |
550 private static void unsupported() { |
550 private static void unsupported() { |
551 UnsupportedOperationException uoe = |
551 UnsupportedOperationException uoe = |