1

我有一个Hashtable<String, Hashtable<String, String>>我想用一个键获取哈希表的地方,但它返回另一个键的值。这是代码:

Hashtable<String, Hashtable<String, String>> testFormProperties = 
         formProperties.getFormProperties();

Hashtable<String, String> treeProps = 
        (Hashtable<String, String>)testFormProperties.get("clusterTreeItem");

现在treeProps包含

freeTextLabel= {
     guiType=TreeItem, 
     label=freeText, 
     path=/data[at0001]/items[openEHR-EHR-CLUSTER.cluster_test_data_types.v1]/items[at0001]
}

代替

clusterTreeItem={
    guiType=TreeItem,
    label=freeText, 
    path=/data[at0001]/items[openEHR-EHR-CLUSTER.cluster_test_data_types.v1]/items[at0001]
}

这里是根据调试器的 testFormProperties Hashtable 的内容:

{
   freeTextLabel =
     {guiType=TreeItem, label=freeText, path=/data[at0001]/items[openEHR-EHR-CLUSTER.cluster_test_data_types.v1]/items[at0001]
     }, 
  clusterTreeItem = 
     {guiType=TreeItem, label=freeText, path=/data[at0001]/items[openEHR-EHR-CLUSTER.cluster_test_data_types.v1]/items[at0001]
     }
}

我得到了相同的结果Properties<String, Hashtable<String, String>

有人可以解释什么是错的,为什么?

4

0 回答 0