1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.bcel.verifier.structurals;
18
19
20 import org.apache.bcel.Constants;
21 import org.apache.bcel.generic.ObjectType;
22 import org.apache.bcel.generic.ReferenceType;
23
24 /***
25 * This class represents an uninitialized object type; see The Java
26 * Virtual Machine Specification, Second Edition, page 147: 4.9.4 for
27 * more details.
28 *
29 * @version $Id: UninitializedObjectType.java 386056 2006-03-15 11:31:56Z tcurdt $
30 * @author Enver Haase
31 */
32 public class UninitializedObjectType extends ReferenceType implements Constants{
33
34 /*** The "initialized" version. */
35 private ObjectType initialized;
36
37 /*** Creates a new instance. */
38 public UninitializedObjectType(ObjectType t){
39 super(T_UNKNOWN, "<UNINITIALIZED OBJECT OF TYPE '"+t.getClassName()+"'>");
40 initialized = t;
41 }
42
43 /***
44 * Returns the ObjectType of the same class as the one of the uninitialized object
45 * represented by this UninitializedObjectType instance.
46 */
47 public ObjectType getInitialized(){
48 return initialized;
49 }
50
51 /*** @return a hash code value for the object.
52 */
53 public int hashCode() { return initialized.hashCode(); }
54
55 /***
56 * Returns true on equality of this and o.
57 * Equality means the ObjectType instances of "initialized"
58 * equal one another in this and the o instance.
59 *
60 */
61 public boolean equals(Object o){
62 if (! (o instanceof UninitializedObjectType)) {
63 return false;
64 }
65 return initialized.equals(((UninitializedObjectType)o).initialized);
66 }
67 }