code: public boolean isSameOrSubTypeOf(XClass type, String baseType, boolean checkActualClasses) throws ClassNotFoundException
      {
          String qualifiedBaseType = baseType.replace('$', '.');
  
          if (type.getQualifiedName().equals(qualifiedBaseType))
          {
              return true;
          }
  
          // first search via XDoclet
          ArrayList queue      = new ArrayList();
          boolean   canSpecify = false;
          XClass    curType;
  
          queue.add(type);
          while (!queue.isEmpty())
          {
              curType = (XClass)queue.get(0);
              queue.remove(0);
              if (qualifiedBaseType.equals(curType.getQualifiedName()))
              {
                  return true;
              }
              if (curType.getInterfaces() != null)
              {
                  for (Iterator it = curType.getInterfaces().iterator(); it.hasNext(); )
                  {
                      queue.add(it.next());
                  }
              }
              if (!curType.isInterface())
              {
                  if (curType.getSuperclass() != null)
                  {
                      queue.add(curType.getSuperclass());
                  }
              }
          }
  
          // if not found, we try via actual classes
          return checkActualClasses ? isSameOrSubTypeOf(type.getQualifiedName(), qualifiedBaseType) : false;
      }
docs: Determines whether the given type is the same or a sub type of the other type.
  
  @param type               The type
  @param baseType           The possible base type
  @param checkActualClasses Whether to use the actual classes for the test
  @return <code>true</code> If <code>type</code> specifies the same or a sub type of <code>baseType</code>
  @throws ClassNotFoundException If the two classes are not on the classpath