camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r802383 - in /camel/sandbox/tuning-experiment/camel-core/src: main/java/org/apache/camel/impl/DefaultMessage.java test/java/org/apache/camel/impl/DefaultMessageCaseAgnosticLookupHeaderTest.java
Date Sat, 08 Aug 2009 13:58:50 GMT
Author: davsclaus
Date: Sat Aug  8 13:58:50 2009
New Revision: 802383

URL: http://svn.apache.org/viewvc?rev=802383&view=rev
Log:
Tuning removed header lookup being incase sensitive.

Removed:
    camel/sandbox/tuning-experiment/camel-core/src/test/java/org/apache/camel/impl/DefaultMessageCaseAgnosticLookupHeaderTest.java
Modified:
    camel/sandbox/tuning-experiment/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java

Modified: camel/sandbox/tuning-experiment/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
URL: http://svn.apache.org/viewvc/camel/sandbox/tuning-experiment/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java?rev=802383&r1=802382&r2=802383&view=diff
==============================================================================
--- camel/sandbox/tuning-experiment/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
(original)
+++ camel/sandbox/tuning-experiment/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
Sat Aug  8 13:58:50 2009
@@ -33,7 +33,6 @@
 public class DefaultMessage extends MessageSupport {
     private boolean fault;
     private Map<String, Object> headers;
-    private Map<String, Object> lowerCaseHeaders;
     private Map<String, DataHandler> attachments;
 
     @Override
@@ -56,18 +55,7 @@
     }
     
     public Object getHeader(String name) {
-        Object answer = getHeaders().get(name);
-        if (answer != null) {
-            return answer;
-        }
-
-        // not found then try a lower case lookup
-        if (!getHeaders().isEmpty()) {
-            return getLowerCaseHeaders().get(name.toLowerCase());
-        }
-
-        // not found
-        return null;
+        return getHeaders().get(name);
     }
 
     public <T> T getHeader(String name, Class<T> type) {
@@ -95,19 +83,10 @@
             headers = createHeaders();
         }
         headers.put(name, value);
-
-        // keep lower case in sync
-        if (lowerCaseHeaders != null) {
-            lowerCaseHeaders.put(name.toLowerCase(), value);
-        }
     }
 
     public Object removeHeader(String name) {
         if (headers != null) {
-            // keep lower case in sync
-            if (lowerCaseHeaders != null) {
-                lowerCaseHeaders.remove(name.toLowerCase());
-            }
             return headers.remove(name);
         } else {
             return null;
@@ -123,11 +102,6 @@
 
     public void setHeaders(Map<String, Object> headers) {
         this.headers = headers;
-
-        if (this.lowerCaseHeaders != null) {
-            this.lowerCaseHeaders.clear();
-        }
-        this.lowerCaseHeaders = null;
     }
 
     public boolean hasHeaders() {
@@ -242,14 +216,4 @@
         return null;
     }
 
-    protected Map getLowerCaseHeaders() {
-        if (lowerCaseHeaders == null) {
-            lowerCaseHeaders = new HashMap<String, Object>(headers.size());
-            for (Map.Entry<String, Object> entry : headers.entrySet()) {
-                lowerCaseHeaders.put(entry.getKey().toLowerCase(), entry.getValue());
-            }
-        }
-        return lowerCaseHeaders;
-    }
-
 }



Mime
View raw message