<Swing Dev> JDK 9 RFR of JDK-8047027: Fix raw and unchecked lint warnings in generated beaninfo files

Joe Darcy joe.darcy at oracle.com
Sat Jul 12 00:13:02 UTC 2014


Hello,

Please review the proposed changes to fix

     JDK-8047027: Fix raw and unchecked lint warnings in generated 
beaninfo files
     http://cr.openjdk.java.net/~darcy/8047027.0/

Thanks,

-Joe

--- old/make/data/swingbeaninfo/SwingBeanInfo.template    2014-07-11 
17:11:27.000000000 -0700
+++ new/make/data/swingbeaninfo/SwingBeanInfo.template    2014-07-11 
17:11:26.000000000 -0700
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights 
reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights 
reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
   */

  public class @(BeanClassName)BeanInfo extends 
javax.swing.SwingBeanInfoBase {
-    private static final Class class@(BeanClassName) = @(BeanClassObject);
+    private static final Class<?> class@(BeanClassName) = 
@(BeanClassObject);

      /**
       * @return a @(BeanClassName) BeanDescriptor
--- old/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java 
2014-07-11 17:11:27.000000000 -0700
+++ new/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java 
2014-07-11 17:11:27.000000000 -0700
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights 
reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights 
reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
@@ -67,7 +67,7 @@
       * its PropertyDescriptors will be included.
       */
      public BeanInfo[] getAdditionalBeanInfo() {
-        Class superClass = 
getBeanDescriptor().getBeanClass().getSuperclass();
+        Class<?> superClass = 
getBeanDescriptor().getBeanClass().getSuperclass();
          BeanInfo superBeanInfo = null;
          try {
              superBeanInfo = Introspector.getBeanInfo(superClass);
--- old/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java 2014-07-11 
17:11:27.000000000 -0700
+++ new/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java 2014-07-11 
17:11:27.000000000 -0700
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights 
reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights 
reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@
       * @see java.beans#PropertyDescriptor
       * @see java.beans#FeatureDescriptor
       */
-    public static PropertyDescriptor createPropertyDescriptor(Class 
cls, String name, Object[] args)
+    public static PropertyDescriptor createPropertyDescriptor(Class<?> 
cls, String name, Object[] args)
      {
          PropertyDescriptor pd = null;
          try {
@@ -156,7 +156,7 @@
                  String methodName = (String)value;
                  Method method;
                  try {
-                    method = cls.getMethod(methodName, new Class[0]);
+                    method = cls.getMethod(methodName, new Class<?>[0]);
                      pd.setReadMethod(method);
                  }
                  catch(Exception e) {
@@ -168,8 +168,8 @@
                  String methodName = (String)value;
                  Method method;
                  try {
-                    Class type = pd.getPropertyType();
-                    method = cls.getMethod(methodName, new Class[]{type});
+                    Class<?> type = pd.getPropertyType();
+                    method = cls.getMethod(methodName, new 
Class<?>[]{type});
                      pd.setWriteMethod(method);
                  }
                  catch(Exception e) {
@@ -215,9 +215,9 @@
       * @see java.beans#BeanInfo
       * @see java.beans#PropertyDescriptor
       */
-    public static BeanDescriptor createBeanDescriptor(Class cls, 
Object[] args)
+    public static BeanDescriptor createBeanDescriptor(Class<?> cls, 
Object[] args)
      {
-        Class customizerClass = null;
+        Class<?> customizerClass = null;

          /* For reasons I don't understand, customizerClass is a
           * readOnly property.  So we have to find it and pass it
@@ -242,11 +242,11 @@
      }

      static private PropertyDescriptor createReadOnlyPropertyDescriptor(
-        String name, Class cls) throws IntrospectionException {
+        String name, Class<?> cls) throws IntrospectionException {

          Method readMethod = null;
          String base = capitalize(name);
-        Class[] parameters = new Class[0];
+        Class<?>[] parameters = new Class<?>[0];

          // Is it a boolean?
          try {
@@ -264,7 +264,7 @@

          try {
              // Try indexed accessor pattern.
-            parameters = new Class[1];
+            parameters = new Class<?>[1];
              parameters[0] = int.class;
              readMethod = cls.getMethod("get" + base, parameters);
          } catch (NoSuchMethodException nsme) {




More information about the swing-dev mailing list