Commits

Anonymous committed eb099e0

Suppress exceptions from table sorter reported in NetBeans bugzilla - http://netbeans.org/bugzilla/show_bug.cgi?id=196948.

Comments (0)

Files changed (2)

logcat/manifest.mf

 OpenIDE-Module-Layer: org/nyerel/nbandroid/logcat/layer.xml
 OpenIDE-Module-Localizing-Bundle: org/nyerel/nbandroid/logcat/Bundle.properties
 AutoUpdate-Show-In-Client: false
-OpenIDE-Module-Specification-Version: 1.5
+OpenIDE-Module-Specification-Version: 1.6
 OpenIDE-Module-Java-Dependencies: Java > 1.6
 

logcat/src/org/nyerel/nbandroid/logcat/LogTopComponent.java

 import java.util.List;
 import java.util.Timer;
 import java.util.TimerTask;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
 autostore = false)
 public final class LogTopComponent extends TopComponent {
 
+  private static final Logger LOG = Logger.getLogger(LogTopComponent.class.getName());
   private static final String ICON_PATH = "org/nyerel/nbandroid/logcat/androidIcon.png";
 
   private static final String PREFERRED_ID = "LogTopComponent";
             
             LogTableModel model = new LogTableModel(filter);
             JTable table = new JTable(model);
-            table.setRowSorter(new TableRowSorter(model));
+            table.setRowSorter(new TableRowSorter(model) {
+
+              @Override
+              public void rowsInserted(int firstRow, int endRow) {
+                try {
+                  super.rowsInserted(firstRow, endRow);
+                } catch (IndexOutOfBoundsException ex) {
+                  LOG.log(Level.INFO, 
+                      "Ignoring exception caused by http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6582564", ex);
+                }
+              }
+
+              @Override
+              public int convertRowIndexToModel(int index) {
+                try {
+                  return super.convertRowIndexToModel(index);
+                } catch (NullPointerException ex) {
+                  LOG.log(Level.INFO, 
+                      "Ignoring exception reported in http://netbeans.org/bugzilla/show_bug.cgi?id=197503", ex);
+                  return 0;
+                }
+              }
+              
+            });
             table.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
             table.setShowHorizontalLines(false);