So the purpose is to recursively get all interfaces?
What if the same interface is extended by two super interfaces, won't
it pick the same one up twice? Perhaps a Set should be used.
Lacking context...what makes all the interfaces relevant in this
context?
Some comments as to intent would be helpful.
Lloyd
..............................................
Lloyd Chambers
lloyd.chambers_at_sun.com
GlassFish team, LSARC member
On Sep 17, 2008, at 11:18 PM, Sumasri Uppala wrote:
> Hi,
>
> For this bug,changed the appserv-core.Please review the code for bug
> 1048 and let me know the status .
>
> Thanks and Regards
> Suma
> Index: ManagementRulesMBeanHelper.java
> ===================================================================
> RCS file: /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/
> admin/selfmanagement/event/ManagementRulesMBeanHelper.java,v
> retrieving revision 1.8
> diff -u -r1.8 ManagementRulesMBeanHelper.java
> --- ManagementRulesMBeanHelper.java 5 May 2007 05:33:44 -0000 1.8
> +++ ManagementRulesMBeanHelper.java 17 Sep 2008 06:38:59 -0000
> @@ -125,7 +125,7 @@
> else
> class1 = Class.forName(implClassName);
> while (class1 != null) {
> - ifList = class1.getInterfaces();
> + ifList = getInterfaces(class1);
> if(ifList != null) {
> for (int i=0; i<ifList.length; i++) {
> String canonicalName =
> ifList[i].getCanonicalName().trim();
> @@ -142,6 +142,22 @@
> return false;
> }
>
> + private static Class[] getInterfaces(Class aClass) {
> + Class[] interfaces;
> + interfaces=aClass.getInterfaces();
> + Class[] tempInterfaces=interfaces;
> + if(tempInterfaces!=null){
> + for(int i=0;i<tempInterfaces.length;i++){
> + Class[] extendedInterfaces =
> getInterfaces(tempInterfaces[i]);
> + Class[] temp=new Class[extendedInterfaces.length
> +interfaces.length];
> + System.arraycopy(interfaces, 0, temp, 0,
> interfaces.length);
> + System.arraycopy(extendedInterfaces, 0,
> temp ,interfaces.length,extendedInterfaces.length);
> + interfaces=temp;
> + }
> + }
> + return interfaces;
> + }
> +
> private static ClassLoader getMBeanClassLoader() {
> try {
> return (ClassLoader) Class.forName(
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net