private void addExposedTypes(Class<?> clazz,Class<?> cause){
  if (pruned(clazz)) {
    return;
  }
  boolean alreadyDone=done(clazz);
  visit(clazz);
  recordExposure(clazz,cause);
  if (alreadyDone || pruned(clazz)) {
    return;
  }
  TypeToken<?> token=TypeToken.of(clazz);
  for (  TypeToken<?> superType : token.getTypes()) {
    if (!superType.equals(token)) {
      logger.debug("Adding exposed types from {}, which is a super type token on {}",superType,clazz);
      addExposedTypes(superType,clazz);
    }
  }
  for (  Class innerClass : clazz.getDeclaredClasses()) {
    if (exposed(innerClass.getModifiers())) {
      logger.debug("Adding exposed types from {}, which is an exposed inner class of {}",innerClass,clazz);
      addExposedTypes(innerClass,clazz);
    }
  }
  for (  Field field : clazz.getDeclaredFields()) {
    if (exposed(field.getModifiers())) {
      logger.debug("Adding exposed types from {}, which is an exposed field on {}",field,clazz);
      addExposedTypes(field,clazz);
    }
  }
  for (  Invokable invokable : getExposedInvokables(token)) {
    logger.debug("Adding exposed types from {}, which is an exposed invokable on {}",invokable,clazz);
    addExposedTypes(invokable,clazz);
  }
}

private void addExposedTypes ( Class < ? > clazz , Class < ? > cause ) { if ( pruned ( clazz ) ) { return ; } boolean alreadyDone = done ( clazz ) ; visit ( clazz ) ; recordExposure ( clazz , cause ) ; if ( alreadyDone || pruned ( clazz ) ) { return ; } TypeToken < ? > token = TypeToken . of ( clazz ) ; for ( TypeToken < ? > superType : token . getTypes ( ) ) { if ( ! superType . equals ( token ) ) { logger . debug ( "Adding exposed types from {}, which is a super type token on {}" , superType , clazz ) ; addExposedTypes ( superType , clazz ) ; } } for ( Class innerClass : clazz . getDeclaredClasses ( ) ) { if ( exposed ( innerClass . getModifiers ( ) ) ) { logger . debug ( "Adding exposed types from {}, which is an exposed inner class of {}" , innerClass , clazz ) ; addExposedTypes ( innerClass , clazz ) ; } } for ( Field field : clazz . getDeclaredFields ( ) ) { if ( exposed ( field . getModifiers ( ) ) ) { logger . debug ( "Adding exposed types from {}, which is an exposed field on {}" , field , clazz ) ; addExposedTypes ( field , clazz ) ; } } for ( Invokable invokable : getExposedInvokables ( token ) ) { logger . debug ( "Adding exposed types from {}, which is an exposed invokable on {}" , invokable , clazz ) ; addExposedTypes ( invokable , clazz ) ; } }
adds a class and all of the types it exposes . the cause of the class being exposed is given , and the cause of everything within the class is that class itself .
