noel        2003/07/07 15:52:45

  Modified:    src/java/org/apache/james/transport/matchers
                        CompareNumericHeaderValue.java
  Log:
  Removed JDK 1.4 dependency
  
  Revision  Changes    Path
  1.2       +4 -5      
james-server/src/java/org/apache/james/transport/matchers/CompareNumericHeaderValue.java
  
  Index: CompareNumericHeaderValue.java
  ===================================================================
  RCS file: 
/home/cvs/james-server/src/java/org/apache/james/transport/matchers/CompareNumericHeaderValue.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CompareNumericHeaderValue.java    23 Jun 2003 18:43:32 -0000      1.1
  +++ CompareNumericHeaderValue.java    7 Jul 2003 22:52:45 -0000       1.2
  @@ -99,7 +99,7 @@
       private final static int GE = +1;
       private final static int GT = +2;
       
  -    private double headerValue;
  +    private Double headerValue;
   
       public void init() throws MessagingException {
           StringTokenizer st = new StringTokenizer(getCondition(), " \t", false);
  @@ -144,7 +144,7 @@
           if (st.hasMoreTokens()) {
               String headerValueString = st.nextToken().trim();
               try {
  -                headerValue = Double.parseDouble(headerValueString);
  +                headerValue = Double.valueof(headerValueString);
               }
               catch (NumberFormatException nfe) {
                   throw new MessagingException("Bad header comparison value: \""
  @@ -167,8 +167,7 @@
           String [] headerArray = message.getHeader(headerName);
           if (headerArray != null && headerArray.length > 0) {
               try {
  -                double messageHeaderValue = 
Double.parseDouble(headerArray[0].trim());
  -                int comparison = Double.compare(messageHeaderValue, headerValue);
  +                int comparison = 
Double.valueOf(headerArray[0].trim()).compareTo(headerValue);
                   switch (comparisonOperator) {
                       case LT:
                           if (comparison < 0) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to