harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Zhou (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-5915) [beans] Introspector.getBeanInfo() will exclude public static methods.
Date Thu, 17 Jul 2008 06:43:32 GMT
[beans] Introspector.getBeanInfo() will exclude public static methods.
----------------------------------------------------------------------

                 Key: HARMONY-5915
                 URL: https://issues.apache.org/jira/browse/HARMONY-5915
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M6
            Reporter: Kevin Zhou
             Fix For: 5.0M6


Given the following test case,
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.MethodDescriptor;
import java.beans.PropertyDescriptor;
public class BeansTest {
public static void main(String[] args) throws Throwable { dumpBean(Empty.class); dumpBean(Static.class);
}
static void dumpBean(final Class cl) throws Throwable {
System.out.println("Introspecting: " + cl.getName());
BeanInfo beanInfo = Introspector.getBeanInfo(cl);
System.out.println(" Properties: ");
for (PropertyDescriptor p : beanInfo.getPropertyDescriptors()) { System.out.println(" + "
+ p.getName()); System.out.println(" - read: " + p.getReadMethod()); System.out.println("
- write: " + p.getReadMethod()); }
System.out.println(" Methods: ");
for (MethodDescriptor m : beanInfo.getMethodDescriptors()) { System.out.println(" + " + m.getName());
System.out.println(" - " + m.getMethod()); }
}
}
class Empty {
}
class Static {
public static String getName() { return "static class"; }
}
When this test case is run, the output from introspecting the Empty class is identical to
that of the output from introspecting the Static class.
There is no information returned for getName(). If I remove the "static" keyword in the declaration
of class Static, then introspection DOES return the "getName()" method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message