james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject cvs commit: james-server/src/java/org/apache/james/transport/matchers CompareNumericHeaderValue.java
Date Mon, 07 Jul 2003 22:53:42 GMT
noel        2003/07/07 15:53:42

  Modified:    src/java/org/apache/james/transport/matchers Tag:
                        branch_2_1_fcs CompareNumericHeaderValue.java
  Log:
  Removed JDK 1.4 dependency
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.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.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- CompareNumericHeaderValue.java	23 Jun 2003 18:50:04 -0000	1.1.2.1
  +++ CompareNumericHeaderValue.java	7 Jul 2003 22:53:42 -0000	1.1.2.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: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message