Beispiel #1
0
 public Class<?>[] getInterfaces() {
   if (type.isArrayType()) {
     // arrays implement JavaLangSerializable & JavaLangCloneable
     return new Class[] {
       RVMType.JavaLangCloneableType.getClassForType(),
       RVMType.JavaIoSerializableType.getClassForType()
     };
   } else if (type.isClassType()) {
     RVMClass[] interfaces = type.asClass().getDeclaredInterfaces();
     Class<?>[] jinterfaces = new Class[interfaces.length];
     for (int i = 0; i != interfaces.length; i++) jinterfaces[i] = interfaces[i].getClassForType();
     return jinterfaces;
   } else {
     return new Class[0];
   }
 }
Beispiel #2
0
 public Type[] getGenericInterfaces() {
   if (type.isPrimitiveType() || type.isUnboxedType()) {
     return new Type[0];
   } else if (type.isArrayType()) {
     // arrays implement JavaLangSerializable & JavaLangCloneable
     return new Class[] {
       RVMType.JavaLangCloneableType.getClassForType(),
       RVMType.JavaIoSerializableType.getClassForType()
     };
   } else {
     RVMClass klass = type.asClass();
     Atom sig = klass.getSignature();
     if (sig == null) {
       return getInterfaces();
     } else {
       return JikesRVMHelpers.getInterfaceTypesFromSignature(this, sig);
     }
   }
 }