changeset 128:01f7eeea81f1

6643627: JMX source code includes incorrect Java code Summary: javac compiler bug accepts incorrect code; JMX code inadvertently has such code Reviewed-by: dfuchs
author emcmanus
date Fri, 21 Mar 2008 18:07:57 +0100
parents 9a97ca4eb8b7
children 75b405bff406 7dd94e5bbec4
files src/share/classes/com/sun/jmx/mbeanserver/OpenConverter.java src/share/classes/java/beans/MetaData.java
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/jmx/mbeanserver/OpenConverter.java	Fri Mar 21 09:49:40 2008 +0100
+++ b/src/share/classes/com/sun/jmx/mbeanserver/OpenConverter.java	Fri Mar 21 18:07:57 2008 +0100
@@ -1118,11 +1118,11 @@
             final Class<ConstructorProperties> propertyNamesClass = ConstructorProperties.class;
 
             Class targetClass = getTargetClass();
-            Constructor[] constrs = targetClass.getConstructors();
+            Constructor<?>[] constrs = targetClass.getConstructors();
 
             // Applicable if and only if there are any annotated constructors
-            List<Constructor> annotatedConstrList = newList();
-            for (Constructor constr : constrs) {
+            List<Constructor<?>> annotatedConstrList = newList();
+            for (Constructor<?> constr : constrs) {
                 if (Modifier.isPublic(constr.getModifiers())
                         && constr.getAnnotation(propertyNamesClass) != null)
                     annotatedConstrList.add(constr);
@@ -1152,7 +1152,7 @@
             // Also remember the set of properties in that constructor
             // so we can test unambiguity.
             Set<BitSet> getterIndexSets = newSet();
-            for (Constructor constr : annotatedConstrList) {
+            for (Constructor<?> constr : annotatedConstrList) {
                 String[] propertyNames =
                     constr.getAnnotation(propertyNamesClass).value();
 
@@ -1309,10 +1309,10 @@
         }
 
         private static class Constr {
-            final Constructor constructor;
+            final Constructor<?> constructor;
             final int[] paramIndexes;
             final BitSet presentParams;
-            Constr(Constructor constructor, int[] paramIndexes,
+            Constr(Constructor<?> constructor, int[] paramIndexes,
                    BitSet presentParams) {
                 this.constructor = constructor;
                 this.paramIndexes = paramIndexes;
--- a/src/share/classes/java/beans/MetaData.java	Fri Mar 21 09:49:40 2008 +0100
+++ b/src/share/classes/java/beans/MetaData.java	Fri Mar 21 18:07:57 2008 +0100
@@ -1553,7 +1553,7 @@
     private static String[] getConstructorProperties(Class type) {
         String[] names = null;
         int length = 0;
-        for (Constructor constructor : type.getConstructors()) {
+        for (Constructor<?> constructor : type.getConstructors()) {
             String[] value = getAnnotationValue(constructor);
             if ((value != null) && (length < value.length) && isValid(constructor, value)) {
                 names = value;
@@ -1563,14 +1563,14 @@
         return names;
     }
 
-    private static String[] getAnnotationValue(Constructor constructor) {
+    private static String[] getAnnotationValue(Constructor<?> constructor) {
         ConstructorProperties annotation = constructor.getAnnotation(ConstructorProperties.class);
         return (annotation != null)
                 ? annotation.value()
                 : null;
     }
 
-    private static boolean isValid(Constructor constructor, String[] names) {
+    private static boolean isValid(Constructor<?> constructor, String[] names) {
         Class[] parameters = constructor.getParameterTypes();
         if (names.length != parameters.length) {
             return false;