< prev index next >

src/com/sun/javatest/exec/RenderingUtilities.java

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

@@ -39,15 +39,15 @@
 import com.sun.javatest.TestResultTable;
 import com.sun.javatest.tool.I18NUtils;
 import com.sun.javatest.util.I18NResourceBundle;
 
 class RenderingUtilities {
-    static ListCellRenderer createTestListRenderer() {
+    static ListCellRenderer<Object> createTestListRenderer() {
         return new TestCellRenderer(i18n);
     }
 
-    static ListCellRenderer createTRTNodeRenderer() {
+    static ListCellRenderer<Object> createTRTNodeRenderer() {
         return new TestCellRenderer(i18n);
     }
 
     static ListCellRenderer<TestFilter> createFilterListRenderer() {
         return new FilterCellRenderer(i18n);

@@ -61,17 +61,17 @@
     // --------- Inner classes -------
 
     /**
      * Render a list of tests (TestResult objects).
      */
-    static class TestCellRenderer extends JLabel implements ListCellRenderer {
+    static class TestCellRenderer extends JLabel implements ListCellRenderer<Object> {
          public TestCellRenderer(I18NResourceBundle i18n) {
              setOpaque(false);
              this.i18n = i18n;
          }
 
-        public Component getListCellRendererComponent(JList list,
+        public Component getListCellRendererComponent(JList<?> list,
             Object value, int index, boolean isSelected, boolean cellHasFocus) {
             if (value == null)  // very strange...
                 return this;
 
             if (value instanceof TestResult) {

@@ -105,11 +105,11 @@
             setFont(getFont().deriveFont(Font.PLAIN));
 
             return this;
         }
 
-        private void setBasicAttribs(boolean isSelected, JList list) {
+        private void setBasicAttribs(boolean isSelected, JList<?> list) {
             // Hopefully safe to share...will help with saving space
             // This border is to provide space between the text and the
             // side of the widget, helping readability.
             setBorder(spacerBorder);
 

@@ -157,11 +157,11 @@
             setFont(false);
 
             return this;
         }
 
-        private void setColors(boolean isSelected, JList list) {
+        private void setColors(boolean isSelected, JList<?> list) {
             if (isSelected) {
                 setOpaque(true);
                 setForeground(list.getSelectionForeground());
                 setBackground(list.getSelectionBackground());
             }
< prev index next >