logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r1024146 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
Date Tue, 19 Oct 2010 07:34:34 GMT
Author: sdeboy
Date: Tue Oct 19 07:34:34 2010
New Revision: 1024146

URL: http://svn.apache.org/viewvc?rev=1024146&view=rev
Log:
Fixed minor bug in filtered combobox population logic

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.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?rev=1024146&r1=1024145&r2=1024146&view=diff
==============================================================================
--- 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 Tue Oct 19
07:34:34 2010
@@ -4219,7 +4219,6 @@ public class LogPanel extends DockablePa
                 for (Iterator iter = entriesCopy.iterator();iter.hasNext();) {
                     String thisEntry = iter.next().toString();
                     if (thisEntry.toLowerCase().contains(textToMatch.toLowerCase())) {
-                        displayedEntries.add(thisEntry);
                         model.addElement(thisEntry);
                     }
                 }
@@ -4286,13 +4285,16 @@ public class LogPanel extends DockablePa
 
             public void addElement(Object obj) {
                 //assuming add is to displayed list...add to full list (only if not a dup)
-                if (allEntries.contains(obj)) {
-                    return;
-                }
                 bypassFiltering = true;
-                allEntries.add(obj);
+
+              boolean entryExists = !allEntries.contains(obj);
+              if (entryExists) {
+                  allEntries.add(obj);
+                }
                 displayedEntries.add(obj);
-                fireIntervalAdded(this, displayedEntries.size() - 1, displayedEntries.size());
+                if (!entryExists) {
+                  fireIntervalAdded(this, displayedEntries.size() - 1, displayedEntries.size());
+                }
                 bypassFiltering = false;
             }
 



Mime
View raw message