You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ps...@apache.org on 2004/06/10 09:28:10 UTC

cvs commit: logging-log4j/src/java/org/apache/log4j/chainsaw/filter EventTypeEntryContainer.java

psmith      2004/06/10 00:28:10

  Modified:    src/java/org/apache/log4j/chainsaw/filter
                        EventTypeEntryContainer.java
  Log:
  This fixes an NPE that can occur.
  
  Stephen Pain noticed that when a Receiver is restarted in Chainsaw, the GUI looks fine, but no events are displayed
  from that point onwards.  A real bummer.
  
  It turns out that it is during the restart of Socket based Receivers, an LoggingEvent is sent through
  describing the socket close issue.  Unfortunately the event has no properties set.
  
  Currently the LoggingEvent.getProperties() method could return null.  It might be worth changing this so that
  it return an empty Map instead, but I was not prepared to make that call right now.
  
  I might also consider checking out why the Thread that gets that NPE causes Chainsaw to become useless, it
  should try and deal with those sort of issues in much the same way as the Swing EventDispatch thread does, it
  seems to go merrily along even after exceptions.
  
  Revision  Changes    Path
  1.8       +3 -0      logging-log4j/src/java/org/apache/log4j/chainsaw/filter/EventTypeEntryContainer.java
  
  Index: EventTypeEntryContainer.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/filter/EventTypeEntryContainer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- EventTypeEntryContainer.java	12 May 2004 06:37:30 -0000	1.7
  +++ EventTypeEntryContainer.java	10 Jun 2004 07:28:10 -0000	1.8
  @@ -148,6 +148,9 @@
     }
   
     void addProperties(Map properties) {
  +    if(properties == null) {
  +     return;   
  +    }
           for (Iterator iter = properties.entrySet().iterator(); iter.hasNext();) {
               Map.Entry entry = (Map.Entry)iter.next();
               if (!(propListModel.contains(entry.getKey()))) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org