return Object.class;
case 1:
final Class superclass = superclasses[0];
if( Modifier.isFinal( superclass.getModifiers() ) )
{
throw new ProxyFactoryException(
"Proxy class cannot extend " + superclass.getName() + " as it is final." );
}
if( !hasSuitableDefaultConstructor( superclass ) )
{
throw new ProxyFactoryException( "Proxy class cannot extend " + superclass.getName() +
", because it has no visible \"default\" constructor." );
}
return superclass;
default:
final StringBuffer errorMessage = new StringBuffer( "Proxy class cannot extend " );
for( int i = 0; i < superclasses.length; i++ )
{
Class c = superclasses[i];
errorMessage.append( c.getName() );
if( i != superclasses.length - 1 )
{
errorMessage.append( ", " );
}
}
errorMessage.append( "; multiple inheritance not allowed." );
throw new ProxyFactoryException( errorMessage.toString() );
}
}