< prev index next >

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

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


 282                 columnNames = new String[COLUMN_COUNT];
 283                 columnNames[TEST_NAME_COL] = uif.getI18NString("elb.col.testName");
 284                 columnNames[TEST_CASE_COL] = uif.getI18NString("elb.col.testCase");
 285                 columnNames[BUG_COL] = uif.getI18NString("elb.col.bugId");
 286                 columnNames[KEYWORDS_COL] = uif.getI18NString("elb.col.keywords");
 287                 columnNames[SYNOPSIS_COL] = uif.getI18NString("elb.col.synopsis");
 288             }
 289 
 290             // The following operation is slow and should arguably be
 291             // done by a worker thread, perhaps using the nested List class as
 292             // a Runnable.
 293             SortedSet<ExcludeList.Entry> sortedEntries = new TreeSet<>(new Comparator<ExcludeList.Entry>() {
 294                     public int compare(ExcludeList.Entry o1, ExcludeList.Entry o2) {
 295                         String s1 = entryToString(o1);
 296                         String s2 = entryToString(o2);
 297                         return s1.compareTo(s2);
 298                     }
 299                 });
 300 
 301             if (list != null) {
 302                 for (Iterator iter = list.getIterator(false); iter.hasNext(); ) {
 303                     ExcludeList.Entry ee = (ExcludeList.Entry) (iter.next());
 304                     sortedEntries.add(ee);
 305                 }
 306             }
 307 
 308             entries = new ExcludeList.Entry[sortedEntries.size()];
 309             sortedEntries.toArray(entries);
 310         }
 311 
 312         ExcludeList.Entry getEntry(int index) {
 313             return (index < 0 || index >= entries.length ? null : entries[index]);
 314         }
 315 
 316         public void addTableModelListener(TableModelListener l) {
 317             // model never changes, so ignore listener
 318         }
 319 
 320         public Class getColumnClass(int columnIndex) {
 321             // for now, all are strings
 322             return String.class;
 323         }
 324 
 325         public int getColumnCount() {
 326             return COLUMN_COUNT;
 327         }
 328 
 329         public String getColumnName(int index) {
 330             return columnNames[index];
 331         }
 332 
 333         public int getRowCount() {
 334             return entries.length;
 335         }
 336 
 337         public Object getValueAt(int rowIndex, int colIndex) {
 338             ExcludeList.Entry e = entries[rowIndex];
 339             switch (colIndex) {
 340             case TEST_NAME_COL:




 282                 columnNames = new String[COLUMN_COUNT];
 283                 columnNames[TEST_NAME_COL] = uif.getI18NString("elb.col.testName");
 284                 columnNames[TEST_CASE_COL] = uif.getI18NString("elb.col.testCase");
 285                 columnNames[BUG_COL] = uif.getI18NString("elb.col.bugId");
 286                 columnNames[KEYWORDS_COL] = uif.getI18NString("elb.col.keywords");
 287                 columnNames[SYNOPSIS_COL] = uif.getI18NString("elb.col.synopsis");
 288             }
 289 
 290             // The following operation is slow and should arguably be
 291             // done by a worker thread, perhaps using the nested List class as
 292             // a Runnable.
 293             SortedSet<ExcludeList.Entry> sortedEntries = new TreeSet<>(new Comparator<ExcludeList.Entry>() {
 294                     public int compare(ExcludeList.Entry o1, ExcludeList.Entry o2) {
 295                         String s1 = entryToString(o1);
 296                         String s2 = entryToString(o2);
 297                         return s1.compareTo(s2);
 298                     }
 299                 });
 300 
 301             if (list != null) {
 302                 for (Iterator<?> iter = list.getIterator(false); iter.hasNext(); ) {
 303                     ExcludeList.Entry ee = (ExcludeList.Entry) (iter.next());
 304                     sortedEntries.add(ee);
 305                 }
 306             }
 307 
 308             entries = new ExcludeList.Entry[sortedEntries.size()];
 309             sortedEntries.toArray(entries);
 310         }
 311 
 312         ExcludeList.Entry getEntry(int index) {
 313             return (index < 0 || index >= entries.length ? null : entries[index]);
 314         }
 315 
 316         public void addTableModelListener(TableModelListener l) {
 317             // model never changes, so ignore listener
 318         }
 319 
 320         public Class<?> getColumnClass(int columnIndex) {
 321             // for now, all are strings
 322             return String.class;
 323         }
 324 
 325         public int getColumnCount() {
 326             return COLUMN_COUNT;
 327         }
 328 
 329         public String getColumnName(int index) {
 330             return columnNames[index];
 331         }
 332 
 333         public int getRowCount() {
 334             return entries.length;
 335         }
 336 
 337         public Object getValueAt(int rowIndex, int colIndex) {
 338             ExcludeList.Entry e = entries[rowIndex];
 339             switch (colIndex) {
 340             case TEST_NAME_COL:


< prev index next >