Example usage for java.lang ArrayStoreException ArrayStoreException

List of usage examples for java.lang ArrayStoreException ArrayStoreException

Introduction

In this page you can find the example usage for java.lang ArrayStoreException ArrayStoreException.

Prototype

public ArrayStoreException() 

Source Link

Document

Constructs an ArrayStoreException with no detail message.

Usage

From source file:org.apache.jackrabbit.core.state.ChildNodeEntries.java

public Object[] toArray(Object[] a) {
    if (!a.getClass().getComponentType().isAssignableFrom(ChildNodeEntry.class)) {
        throw new ArrayStoreException();
    }/*  w w  w .  j a  v  a2s. c o m*/
    if (a.length < size()) {
        a = new ChildNodeEntry[size()];
    }
    MapIterator iter = entries.mapIterator();
    int i = 0;
    while (iter.hasNext()) {
        iter.next();
        a[i] = entries.getValue(i);
        i++;
    }
    while (i < a.length) {
        a[i++] = null;
    }
    return a;
}