system/src/sc/lang/java/ModelUtil.java
private static Object mapClassToType(Class t, JavaModel model) {
      String name = t.getName();
      name = name.replace("$", ".");
      if (model == null || t.isPrimitive())
         return t;
      Object res = model.findTypeDeclaration(name, false);
      if (res != null) {
         if (res != t && t.isPrimitive())
            System.err.println("*** invalid optimization!"); // TODO: optimization - skip this whole thing for primitives which we never override
         return res;
      }
      // certain array classes do not get resolved this way - e.g. [[Lsc.lang.java.DynStubParameters.DynConstructor;
      return t;
   }
/**
    * Remap the Class back into either a type or the same class.
    * If we get a Class from reflection, we might have a more specific version, such as with an annotation layer 
    */
Remap the Class back into either a type or the same class.
If we get a Class from reflection, we might have a more specific version, such as with an annotation layer
Remap the Class back into either a type or the same class . If we get a Class from reflection we might have a more specific version such as with an annotation layer
private static Object mapClassToType(Class t, JavaModel model) {
      String name = t.getName();
      name = name.replace("$", ".");
      if (model == null || t.isPrimitive())
         return t;
      Object res = model.findTypeDeclaration(name, false);
      if (res != null) {
         if (res != t && t.isPrimitive())
            System.err.println("*** invalid optimization!"); 
         return res;
      }
      return t;
   }
private static Object mapClassToType ( Class t , JavaModel model ) { String name = t . getName ( ) ; name = name . replace ( "$" , "." ) ; if ( model == null || t . isPrimitive ( ) ) return t ; Object res = model . findTypeDeclaration ( name , false ) ; if ( res != null ) { if ( res != t && t . isPrimitive ( ) ) System . err . println ( "*** invalid optimization!" ) ; return res ; } return t ; }
Remap the Class back into either a type or the same class.
Remap the Class back into either a type or the same class .
// TODO: optimization - skip this whole thing for primitives which we never override // certain array classes do not get resolved this way - e.g. [[Lsc.lang.java.DynStubParameters.DynConstructor;