List of usage examples for java.lang ArrayStoreException getMessage
public String getMessage()
From source file:ArrayMap.java
private static void put(Object array, Object element, int index) { try {/* w w w.ja v a 2s . com*/ if (array instanceof Object[]) { try { ((Object[]) array)[index] = element; } catch (ArrayStoreException e) { throw new IllegalArgumentException( e.getMessage() + ": " + (element == null ? "null" : element.getClass().getName()) + " into " + array.getClass().getName()); } } else { try { Array.set(array, index, element); } catch (IllegalArgumentException e) { throw new IllegalArgumentException( e.getMessage() + ": " + (element == null ? "null" : element.getClass().getName()) + " into " + array.getClass().getName(), e); } } } catch (ArrayIndexOutOfBoundsException e) { throw new ArrayIndexOutOfBoundsException(index + " into " + Array.getLength(array)); } }