Exemplo n.º 1
0
 public static X10JavaSerializable $_deserialize_body(
     RuntimeType rt, X10JavaDeserializer deserializer) throws IOException {
   short classId = deserializer.readSerializationId();
   Class<?> clazz = deserializer.getClassForID(classId);
   rt.javaClass = clazz;
   rt.numParams = deserializer.readByte();
   // TODO parents needed?
   return rt;
 }
Exemplo n.º 2
0
 private static String typeName(Class<?> javaClass) {
   RuntimeType<?> rtt = null;
   if (javaClass.isArray()) {
     return X10_INTEROP_JAVA_ARRAY + "[" + typeName(javaClass.getComponentType()) + "]";
   } else if ((rtt = Types.getRTTForKnownType(javaClass)) != null) {
     return rtt.typeName();
   } else {
     return javaClass.getName();
   }
 }
Exemplo n.º 3
0
 // check "subType and subParams" <: "this and thisParams"
 final boolean isAssignableFrom(
     Type<?>[] thisParams, RuntimeType<?> subType, Type<?>[] subParams) {
   if (javaClass == subType.getJavaClass()) {
     if (thisParams != null) {
       for (int i = 0, s = thisParams.length; i < s; i++) {
         Variance variance;
         Type<?> subParam;
         Type<?> thisParam;
         variance = getVariance(i);
         subParam = subParams[i];
         thisParam = thisParams[i];
         if (!subtypeTestForParam(variance, thisParam, subParam)) {
           return false;
         }
       }
     }
     return true;
   } else if (javaClass.isAssignableFrom(subType.getJavaClass())) {
     return instantiateCheck(thisParams, subType, subParams);
   } else {
     return false;
   }
 }