system/src/sc/lang/java/ModelUtil.java
public static Object resolveBaseTypeParameter(Object subType, Object baseType, Object typeParam) {
      if (ModelUtil.sameTypes(subType, baseType)) {
         String typeParamName = ModelUtil.getTypeParameterName(typeParam);
         int srcIx = ModelUtil.getTypeParameterPosition(subType, typeParamName);
         if (srcIx == -1) {
            System.err.println("*** Unresolveable base type parameter!");
            return null;
         }
         if (ModelUtil.hasTypeParameters(subType) && ModelUtil.getNumTypeParameters(subType) > srcIx)
            return ModelUtil.getTypeParameter(subType, srcIx);
         return typeParam;
      }
      List<Object> extTypes = getExtendsJavaTypePath(baseType, subType);

      return resolveBaseTypeParameterInternal(extTypes, subType, baseType, typeParam);
   }
/**
    * TODO: this seems like the same thing as resolveTypeParameter - can we eliminate one implementation?
    *
    * Given a subType and baseType and the typeParameter in the base-type, returns the type or type parameter in the sub type.
    * For example, given List&lt;E&gt; and MyList implements List&lt;Integer&gt; you provide subType = MyList, baseType = List and typeParam = E
    * and get back Integer.
    */
this seems like the same thing as resolveTypeParameter - can we eliminate one implementation.
Given a subType and baseType and the typeParameter in the base-type, returns the type or type parameter in the sub type.
For example, given List<E> and MyList implements List<Integer> you provide subType = MyList, baseType = List and typeParam = E
and get back Integer.
this seems like the same thing as resolveTypeParameter - can we eliminate one implementation . Given a subType and baseType and the typeParameter in the base - type returns the type or type parameter in the sub type . For example given List<E > and MyList implements List<Integer > you provide subType = MyList baseType = List and typeParam = E and get back Integer .
public static Object resolveBaseTypeParameter(Object subType, Object baseType, Object typeParam) {
      if (ModelUtil.sameTypes(subType, baseType)) {
         String typeParamName = ModelUtil.getTypeParameterName(typeParam);
         int srcIx = ModelUtil.getTypeParameterPosition(subType, typeParamName);
         if (srcIx == -1) {
            System.err.println("*** Unresolveable base type parameter!");
            return null;
         }
         if (ModelUtil.hasTypeParameters(subType) && ModelUtil.getNumTypeParameters(subType) > srcIx)
            return ModelUtil.getTypeParameter(subType, srcIx);
         return typeParam;
      }
      List<Object> extTypes = getExtendsJavaTypePath(baseType, subType);
      return resolveBaseTypeParameterInternal(extTypes, subType, baseType, typeParam);
   }
public static Object resolveBaseTypeParameter ( Object subType , Object baseType , Object typeParam ) { if ( ModelUtil . sameTypes ( subType , baseType ) ) { String typeParamName = ModelUtil . getTypeParameterName ( typeParam ) ; int srcIx = ModelUtil . getTypeParameterPosition ( subType , typeParamName ) ; if ( srcIx == - 1 ) { System . err . println ( "*** Unresolveable base type parameter!" ) ; return null ; } if ( ModelUtil . hasTypeParameters ( subType ) && ModelUtil . getNumTypeParameters ( subType ) > srcIx ) return ModelUtil . getTypeParameter ( subType , srcIx ) ; return typeParam ; } List < Object > extTypes = getExtendsJavaTypePath ( baseType , subType ) ; return resolveBaseTypeParameterInternal ( extTypes , subType , baseType , typeParam ) ; }
TODO: this seems like the same thing as resolveTypeParameter - can we eliminate one implementation?
TODO : this seems like the same thing as resolveTypeParameter - can we eliminate one implementation?