}
// look for Application class. Don't scan for one if there is a declared one.
if (declaredApplicationClass == null)
{
HierarchyIndex hier = du.getAttachment(HierarchyIndex.class);
if (hier != null)
{
Set<Class<? extends Application>> applicationClass = hier.getSubClassesOf(null, Application.class);
if (applicationClass != null)
{
if (applicationClass.size() > 1)
{
StringBuilder builder = new StringBuilder("Only one JAX-RS Application Class allowed.");