UninitializedType.java 865 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright (c) 2008 Per M.A. Bothner.
  2. // This is free software; for terms and warranty disclaimer see ./COPYING.
  3. package gnu.bytecode;
  4. /** A pseudo-type used for allocated but uninitialized objects. */
  5. public class UninitializedType extends ObjectType
  6. {
  7. ClassType ctype;
  8. /** If non-null, the location of the 'new' instruction. */
  9. Label label;
  10. UninitializedType (ClassType ctype)
  11. {
  12. super(ctype.getName());
  13. setSignature(ctype.getSignature());
  14. this.ctype = ctype;
  15. }
  16. UninitializedType (ClassType ctype, Label label)
  17. {
  18. this(ctype);
  19. this.label = label;
  20. }
  21. static UninitializedType uninitializedThis (ClassType ctype)
  22. {
  23. return new UninitializedType(ctype);
  24. }
  25. public Type getImplementationType()
  26. {
  27. return ctype;
  28. }
  29. public String toString()
  30. {
  31. return "Uninitialized<" + ctype.getName() + '>';
  32. }
  33. }