1 24 25 package org.aspectj.compiler.base.ast; 26 27 import org.aspectj.compiler.base.bcg.CodeBuilder; 28 import org.aspectj.compiler.base.JavaCompiler; 29 30 public class NullType extends RefType { 31 public NullType(JavaCompiler compiler) { 32 super(compiler); 33 } 34 35 public boolean isSubtypeOf(Type other) { 39 return (other instanceof RefType); 40 } 41 42 public boolean isAssignableFrom(Type other) { 43 return other instanceof NullType; 46 } 49 50 public boolean isMethodConvertableTo(Type other) { 51 return other.isReferenceType(); 52 } 53 54 public boolean isCoercableTo(Type other) { 55 return true; 56 } 57 58 protected void showNotFoundError(String id, ASTObject fromWhere, String kind) { 59 getCompiler().showError(fromWhere, "no " + kind + "s on null"); 60 } 61 62 public boolean isAnyType() { 63 return false; 64 } 65 66 public String getString() { 67 return "null"; 68 } 69 70 public String toShortString() { 71 return "null"; 72 } 73 74 public String getDescriptor() { 76 throw new RuntimeException ("No bytecode type descriptor for Null type"); 77 } 78 79 } 80 | Popular Tags |