public Type resolveNames(ClassDefinition c,Type t,boolean synth){
  if (tracing)   dtEvent("Environment.resolveNames: " + c + ", "+ t);
switch (t.getTypeCode()) {
case TC_CLASS:
{
      Identifier name=t.getClassName();
      Identifier rname;
      if (synth) {
        rname=resolvePackageQualifiedName(name);
      }
 else {
        rname=c.resolveName(this,name);
      }
      if (name != rname) {
        t=Type.tClass(rname);
      }
      break;
    }
case TC_ARRAY:
  t=Type.tArray(resolveNames(c,t.getElementType(),synth));
break;
case TC_METHOD:
{
Type ret=t.getReturnType();
Type rret=resolveNames(c,ret,synth);
Type args[]=t.getArgumentTypes();
Type rargs[]=new Type[args.length];
boolean changed=(ret != rret);
for (int i=args.length; i-- > 0; ) {
  Type arg=args[i];
  Type rarg=resolveNames(c,arg,synth);
  rargs[i]=rarg;
  if (arg != rarg) {
    changed=true;
  }
}
if (changed) {
  t=Type.tMethod(rret,rargs);
}
break;
}
}
return t;
}

public Type resolveNames ( ClassDefinition c , Type t , boolean synth ) { if ( tracing ) dtEvent ( "Environment.resolveNames: " + c + ", " + t ) ; switch ( t . getTypeCode ( ) ) { case TC_CLASS : { Identifier name = t . getClassName ( ) ; Identifier rname ; if ( synth ) { rname = resolvePackageQualifiedName ( name ) ; } else { rname = c . resolveName ( this , name ) ; } if ( name != rname ) { t = Type . tClass ( rname ) ; } break ; } case TC_ARRAY : t = Type . tArray ( resolveNames ( c , t . getElementType ( ) , synth ) ) ; break ; case TC_METHOD : { Type ret = t . getReturnType ( ) ; Type rret = resolveNames ( c , ret , synth ) ; Type args [ ] = t . getArgumentTypes ( ) ; Type rargs [ ] = new Type [ args . length ] ; boolean changed = ( ret != rret ) ; for ( int i = args . length ; i -- > 0 ; ) { Type arg = args [ i ] ; Type rarg = resolveNames ( c , arg , synth ) ; rargs [ i ] = rarg ; if ( arg != rarg ) { changed = true ; } } if ( changed ) { t = Type . tMethod ( rret , rargs ) ; } break ; } } return t ; }
resolve the names within a type , returning the adjusted type . adjust class names to reflect scoping . do not report errors . < p > note : it would be convenient to check for errors here , such as verifying that each component of a qualified name exists and is accessible . why must this be done in a separate phase ? < p > if the ' synth ' argument is true , indicating that the member whose type is being resolved is synthetic , names are resolved with respect to the package scope . ( fix for 4097882 )
