2600N/A * Copyright (c) 1994, 2004, Oracle and/or its affiliates. All rights reserved. 2600N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2600N/A * This code is free software; you can redistribute it and/or modify it 2600N/A * under the terms of the GNU General Public License version 2 only, as 2600N/A * published by the Free Software Foundation. Oracle designates this 2600N/A * particular file as subject to the "Classpath" exception as provided 2600N/A * by Oracle in the LICENSE file that accompanied this code. 2600N/A * This code is distributed in the hope that it will be useful, but WITHOUT 2600N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2600N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2600N/A * version 2 for more details (a copy is included in the LICENSE file that 2600N/A * You should have received a copy of the GNU General Public License version 2600N/A * 2 along with this work; if not, write to the Free Software Foundation, 2600N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2600N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2600N/A * or visit www.oracle.com if you need additional information or have any 2600N/A * This class represents an Java class declaration. It refers 2600N/A * to either a binary or source definition. 2600N/A * ClassDefinitions are loaded on demand, this means that 2600N/A * class declarations are late bound. The definition of the 2600N/A * class is obtained in stages. The status field describes 2600N/A * the state of the class definition: 2600N/A * CS_UNDEFINED - the definition is not yet loaded 2600N/A * CS_UNDECIDED - a binary definition is loaded, but it is 2600N/A * still unclear if the source definition need to 2600N/A * CS_BINARY - the binary class is loaded 2600N/A * CS_PARSED - the class is loaded from the source file, the 2600N/A * type information is available, but the class has 2600N/A * CS_CHECKED - the class is loaded from the source file and has 2600N/A * CS_COMPILED - the class has been type checked, compiled, 2600N/A * CS_NOTFOUND - no class definition could be found 2600N/A * WARNING: The contents of this source file are not part of any 2600N/A * supported API. Code that depends on them does so at its own risk: 2600N/A * they are subject to change or removal without notice. 2600N/A * Get the status of the class 2600N/A * Get the name of the class 2600N/A * Get the type of the class 2600N/A * Check if the class is defined 2600N/A * Get the definition of this class. Returns null if 2600N/A * the class is not yet defined. * This is a flag for use by getClassDefinition(env). It is * used to mark that a class has been successfully looked up private boolean found =
false;
* Get the definition of this class, if the class is not * yet defined, load the definition. Loading a class may * throw various exceptions. // The majority of calls to getClassDefinition() are duplicates. // This check makes them fast. It also allows us to avoid // duplicate, useless calls to basicCheck(). In the future it // would be good to add an additional status value, CS_BASICCHECKED. //definition.basicCheck(env); // Classes inside a block, including anonymous classes, // are checked when their surrounding member is checked. * Get the definition of this class, if the class is not * yet defined, load the definition. Loading a class may * throw various exceptions. Perform no basicCheck() on this * Set the class definition // The name of the definition should match that of the declaration. // The status states can be considered ordered in the same // manner as their numerical values. We expect classes to // progress through a sequence of monotonically increasing // states. NOTE: There are currently exceptions to this rule // which are believed to be legitimate. In particular, a // class may be checked more than once, though we believe that // this is unnecessary and may be avoided. if (status <= this.status) { System.out.println("STATUS REGRESSION: " + this + " FROM " + this.status + " TO " + status);