< prev index next >

src/com/sun/javatest/tool/UIFactory.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg

@@ -410,11 +410,11 @@
      * for i18n strings; the bundle is named i18n.properties
      * in the same package as the specified class.
      * @param c the class used to determine the i18n properties
      * @param helpBroker the help broker to be used when creating help buttons
      */
-    public UIFactory(Class c, HelpBroker helpBroker) {
+    public UIFactory(Class<?> c, HelpBroker helpBroker) {
         this(c, null, helpBroker);
     }
 
     /**
      * Create a UIFactory object for a specific component.

@@ -435,11 +435,11 @@
      * in the same package as the specified class.
      * @param c the class used to determine the i18n properties
      * @param p the parent component to be used for any dialogs that are created
      * @param helpBroker the help broker to be used when creating help buttons
      */
-    public UIFactory(Class c, Component p, HelpBroker helpBroker) {
+    public UIFactory(Class<?> c, Component p, HelpBroker helpBroker) {
         this.helpBroker = helpBroker;
         clientClass = c;
         parent = p;
         i18n = I18NResourceBundle.getBundleForClass(c);
     }

@@ -1159,11 +1159,11 @@
      * @param choiceKeys an array of strings used to construct the resource
      * names for the choices.
      * @return the choice item that was created
      * @see #createLiteralChoice
      */
-    public JComboBox createChoice(final String uiKey, final String[] choiceKeys) {
+    public JComboBox<String> createChoice(final String uiKey, final String[] choiceKeys) {
         return createChoice(uiKey, choiceKeys, false);
     }
 
     /**
      * Same as the two parameter <code>createChoice</code>, except you can

@@ -1204,11 +1204,11 @@
                 ed_ac.setAccessibleDescription(ac.getAccessibleDescription());
             }
         }
 
         choice.setRenderer(new DefaultListCellRenderer() {
-            public Component getListCellRendererComponent(JList list, Object o, int index,
+            public Component getListCellRendererComponent(JList<?> list, Object o, int index,
                                 boolean isSelected, boolean cellHasFocus) {
                 Object c = o;
                 for (int i = 0; i < choiceKeys.length; i++) {
                     if (choiceKeys[i] == o) {
                         c = choices[i];

@@ -1230,11 +1230,11 @@
      * </table>
      * In addition, the name of the choice is set to <i>uiKey</i>.
      * @param uiKey the base name of the resources to be used for the menu
      * @return the choice component that was created
      */
-    public JComboBox createChoice(String uiKey) {
+    public <E> JComboBox<E> createChoice(String uiKey) {
         return createChoice(uiKey, false);
     }
 
     /**
      * Same as single parameter version, except you can select a

@@ -1243,12 +1243,12 @@
      * @param editable True if the user should be allowed to edit the
      * response.
      * @return the choice component that was created
      * @see #createChoice(String)
      */
-    public JComboBox createChoice(String uiKey, boolean editable) {
-        return createChoice(uiKey, editable, (JLabel) null);
+    public <E> JComboBox<E> createChoice(String uiKey, boolean editable) {
+        return createChoice(uiKey, editable, null);
     }
 
     /**
      * Same as the one parameter version, except a label can be
      * associated with this component.  This is to support accessibility.

@@ -3550,11 +3550,11 @@
                     }
                 }
             }
         };
 
-    private Class clientClass;
+    private Class<?> clientClass;
     private Component parent;
     private I18NResourceBundle i18n;
     private HelpBroker helpBroker;
 
     private static I18NResourceBundle local_i18n = I18NResourceBundle.getBundleForClass(UIFactory.class);

@@ -3569,13 +3569,13 @@
      * This class might be helpful, when a component extends another components
      * from a different package.
      */
     public static class UIFactoryExt extends UIFactory {
         private I18NResourceBundle i18n_alt;
-        private Class altClass;
+        private Class<?> altClass;
 
-        public UIFactoryExt(UIFactory uif, Class altClass) {
+        public UIFactoryExt(UIFactory uif, Class<?> altClass) {
             super(uif.clientClass, uif.parent, uif.helpBroker);
             i18n_alt = I18NResourceBundle.getBundleForClass(altClass);
             this.altClass = altClass;
         }
 
< prev index next >