logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r563407 - in /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw: LogPanel.java LogUI.java
Date Tue, 07 Aug 2007 06:55:03 GMT
Author: sdeboy
Date: Mon Aug  6 23:55:02 2007
New Revision: 563407

URL: http://svn.apache.org/viewvc?view=rev&rev=563407
Log:
Prevent npes, outofbounds exceptions

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java?view=diff&rev=563407&r1=563406&r2=563407
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java Mon Aug 
6 23:55:02 2007
@@ -963,13 +963,15 @@
     clearButton.addActionListener(
             new AbstractAction() {
                 public void actionPerformed(ActionEvent e){
-                    String selectedItem = filterCombo.getSelectedItem().toString();
-                    if (e.getSource() == clearButton && !selectedItem.equals("")){
-                        if (filterExpressionVector.contains(selectedItem)){
-                            filterExpressionVector.remove(selectedItem);
+                	Object selectedItem = filterCombo.getSelectedItem();
+                    if (e.getSource() == clearButton && selectedItem != null &&
!selectedItem.toString().equals("")){
+                        if (filterExpressionVector.contains(selectedItem.toString())){
+                            filterExpressionVector.remove(selectedItem.toString());
                         }
                         filterCombo.setSelectedIndex(-1);
                     }
+                    //don't just remove the entry from the store, clear the refine focus
field
+                    filterText.setText(null);
                 }
             }
     );

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java?view=diff&rev=563407&r1=563406&r2=563407
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java Mon Aug  6 23:55:02
2007
@@ -2052,7 +2052,7 @@
             while (true) {
               //if this tab is active, remove the icon
               //don't process undocked tabs
-              if (
+              if (getTabbedPane().indexOfTab(ident) > -1 && 
                 getTabbedPane().getSelectedIndex() == getTabbedPane()
                                                           .indexOfTab(ident)) {
                 getTabbedPane().setIconAt(
@@ -2094,7 +2094,7 @@
 
     public void stateChanged(ChangeEvent event) {
       if (
-        getTabbedPane().indexOfTab(ident) == getTabbedPane().getSelectedIndex()) {
+        getTabbedPane().indexOfTab(ident) > -1 && getTabbedPane().indexOfTab(ident)
== getTabbedPane().getSelectedIndex()) {
         getTabbedPane().setIconAt(getTabbedPane().indexOfTab(ident), SELECTED);
       }
     }



Mime
View raw message