logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject cvs commit: logging-log4j/src/java/org/apache/log4j/lbel/comparator LoggerComparator.java MessageComparator.java
Date Thu, 27 Jan 2005 19:53:10 GMT
ceki        2005/01/27 11:53:10

  Modified:    src/java/org/apache/log4j/lbel/comparator
                        LoggerComparator.java MessageComparator.java
  Log:
  Bug fix
  
  Revision  Changes    Path
  1.2       +1 -1      logging-log4j/src/java/org/apache/log4j/lbel/comparator/LoggerComparator.java
  
  Index: LoggerComparator.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/lbel/comparator/LoggerComparator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LoggerComparator.java	27 Jan 2005 19:25:08 -0000	1.1
  +++ LoggerComparator.java	27 Jan 2005 19:53:10 -0000	1.2
  @@ -60,7 +60,7 @@
         }
       }
       
  -    int compResult = rightSide.compareTo(event.getLoggerName());
  +    int compResult = event.getLoggerName().compareTo(rightSide);
       switch(operator.getCode()) {
       case Operator.EQUAL: return compResult == 0;   
       case Operator.NOT_EQUAL: return compResult != 0;      
  
  
  
  1.2       +9 -2      logging-log4j/src/java/org/apache/log4j/lbel/comparator/MessageComparator.java
  
  Index: MessageComparator.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/lbel/comparator/MessageComparator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MessageComparator.java	27 Jan 2005 19:25:08 -0000	1.1
  +++ MessageComparator.java	27 Jan 2005 19:53:10 -0000	1.2
  @@ -75,8 +75,15 @@
           return !match;
         }
       }
  -
  -    int compResult = rightSide.compareTo(event.getRenderedMessage());
  +    int compResult;
  +    
  +    String leftSide = event.getRenderedMessage();
  +    if(leftSide == null) {
  +      compResult = -1;
  +    } else {
  +      compResult = event.getRenderedMessage().compareTo(rightSide);
  +    }
  +    
       switch (operator.getCode()) {
       case Operator.EQUAL:
         return compResult == 0;
  
  
  

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


Mime
View raw message