Make sure case insensitive keys are found before doing dictionary
lookup. (FELIX-2401)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@953126 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/FilterImpl.java b/framework/src/main/java/org/apache/felix/framework/FilterImpl.java
index 32373eb..e245b3a 100644
--- a/framework/src/main/java/org/apache/felix/framework/FilterImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/FilterImpl.java
@@ -140,11 +140,19 @@
             Object value = null;
             if (m_dict != null)
             {
+                // If attribute names are case insensitive, then look in
+                // the case insensitive key map to find the actual case of
+                // the key.
                 if (m_map != null)
                 {
                     key = (String) m_map.get(name);
                 }
-                value = m_dict.get(key);
+                // If the key could not be found in the case insensitive
+                // key map, then avoid doing the dictionary lookup on it.
+                if (key != null)
+                {
+                    value = m_dict.get(key);
+                }
             }
             return (value == null) ? null : new Attribute(key, value, false);
         }
@@ -205,4 +213,4 @@
             throw new UnsupportedOperationException("Not supported yet.");
         }
     }
-}
\ No newline at end of file
+}