2362N/A * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A // The method has to be a method on Object since 0N/A // arrays don't have methods nor any other 'superclasses' 0N/A // So, use the ClassTypeImpl for Object instead of 0N/A // the ArrayTypeImpl for the array itself. 0N/A * Return array length. 0N/A * Need not be synchronized since it cannot be provably stale. 0N/A * Validate that the range to set/get is valid. 0N/A * length of -1 (meaning rest of array) has been converted 0N/A // because length can be computed from index, 0N/A // index must be tested first for correct error message 0N/A "Invalid array range: " +
0N/A if (
length == -
1) {
// -1 means the rest of the array 0N/A if (
length == -
1) {
// -1 means the rest of the array 0N/A // shorter of, the rest of the array and rest of 0N/A // the source values 0N/A "Invalid source range: " +
0N/A // Validate and convert if necessary 0N/A * Since we got this exception, 0N/A * the component must be a reference type. 0N/A * This means the class has not yet been loaded 0N/A * through the defining class's class loader. 0N/A * If the value we're trying to set is null, 0N/A * then setting to null is essentially a 0N/A * no-op, and we should allow it without an 0N/A * An array can be used extensively without the 0N/A * enclosing loader being recorded by the VM as an 0N/A * initiating loader of the array type. In addition, the 0N/A * load of an array class is fairly harmless as long as 0N/A * the component class is already loaded. So we relax the 0N/A * rules a bit and allow the assignment as long as the 0N/A * ultimate component types are assignable. 0N/A * Remove all dimensions from the destination. Remove 0N/A * the same number of dimensions from the source. 0N/A * Get types for both and check to see if they are 0N/A * Represents an array component to other internal parts of this 0N/A * implementation. This is not exposed at the JDI level. Currently, 0N/A * this class is needed only for type checking so it does not even 0N/A * reference a particular component - just a generic component 0N/A * of this array. In the future we may need to expand its use.