Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6868189

Nested enum class with custom BeanInfo fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 7
    • Fix Version/s: 7
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b70
    • CPU:
      generic
    • OS:
      generic

      Description

      A recent change in the tl repository breaks the JMX test javax/management/monitor/AttributeArbitaryDataTypeTest.java. The bug was not present in b65 so must have been introduced since. I have boiled the failing test down to the following:

      import java.beans.*;
      import java.util.*;

      public class X {
          public enum Foo { BAR, BAZ };

          public static class FooBeanInfo extends SimpleBeanInfo {
              public PropertyDescriptor[] getPropertyDescriptors() {
                  try {
                      return new PropertyDescriptor[] {
                          new PropertyDescriptor("name", Foo.class, "name", null) };
                  } catch (IntrospectionException e ) {
                      e.printStackTrace();
                      return null;
                  }
              }
          }

          public static void main (String args[]) throws Exception {
              BeanInfo bi = Introspector.getBeanInfo(Foo.class);
              List<String> names = new ArrayList<String>();
              for (PropertyDescriptor pd : bi.getPropertyDescriptors())
                  names.add(pd.getName());
              if (names.equals(Arrays.asList("name")))
                  System.out.println("Test passed");
              else
                  System.out.println("TEST FAILED: " + names);
          }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              malenkov Sergey Malenkov (Inactive)
              Reporter:
              emcmanus Eamonn McManus
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: