HistoryKey should empty pathes as null
The HistoryKey curently distinguishes between pathes which are empty ('') or null. Since they are semantically the same they should be treated the same.

diff --git a/agent/core/src/main/java/org/jolokia/history/HistoryKey.java b/agent/core/src/main/java/org/jolokia/history/HistoryKey.java
index be494b66..d35f4b8f 100644
--- a/agent/core/src/main/java/org/jolokia/history/HistoryKey.java
+++ b/agent/core/src/main/java/org/jolokia/history/HistoryKey.java
@@ -144,7 +144,7 @@ public class HistoryKey implements Serializable {
         type = "attribute";
         mBean = new ObjectName(pMBean);
         secondary = pAttribute;
-        path = pPath;
+        path = sanitize(pPath);
         target = pTarget;
     }
 
diff --git a/agent/core/src/main/java/org/jolokia/http/AgentServlet.java b/agent/core/src/main/java/org/jolokia/http/AgentServlet.java
index 0a1a28cf..d55658a9 100755
--- a/agent/core/src/main/java/org/jolokia/http/AgentServlet.java
+++ b/agent/core/src/main/java/org/jolokia/http/AgentServlet.java
@@ -328,15 +328,19 @@ public class AgentServlet extends HttpServlet {
         // Lookup the Agent URL if needed
         AgentDetails details = backendManager.getAgentDetails();
         if (details.isInitRequired()) {
-            if (details.isUrlMissing()) {
-                String url = getBaseUrl(NetworkUtil.sanitizeLocalUrl(pReq.getRequestURL().toString()),
-                                        extractServletPath(pReq));
-                details.setUrl(url);
-            }
-            if (details.isSecuredMissing()) {
-                details.setSecured(pReq.getAuthType() != null);
+            synchronized (details) {
+                if (details.isInitRequired()) {
+                    if (details.isUrlMissing()) {
+                        String url = getBaseUrl(NetworkUtil.sanitizeLocalUrl(pReq.getRequestURL().toString()),
+                                extractServletPath(pReq));
+                        details.setUrl(url);
+                    }
+                    if (details.isSecuredMissing()) {
+                        details.setSecured(pReq.getAuthType() != null);
+                    }
+                    details.seal();
+                }
             }
-            details.seal();
         }
     }
 
['agent/core/src/main/java/org/jolokia/history/HistoryKey.java', 'agent/core/src/main/java/org/jolokia/http/AgentServlet.java']