package lawOfDemeter.classform;
import org.aspectj.lang.JoinPoint;
import java.lang.reflect.*;
import lawOfDemeter.Any;
import java.util.*;
/**
 * @authors David H. Lorenz and Pengcheng Wu
 * @version 0.4, 12/19/02
 */
aspect DirectPart extends Pertype {
  public pointcut Pertype():
    Any.StaticInitialization();
  protected List getSuppliers(JoinPoint.StaticPart
    ejsp,JoinPoint.StaticPart jsp) {
    List suppliers=new ArrayList();
    Class currentClass =  
      jsp.getSignature().getDeclaringType();
    while(currentClass != null) {
      Field[] fields =
        currentClass.getDeclaredFields();
      for(int i=0; i<fields.length; i++)
        suppliers.add(fields[i].getType());
      currentClass=currentClass.getSuperclass();
    }
    return suppliers; 	 
  }
}

