1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-10-31 15:35:05 -04:00

Fix 2717446 from Eivind Tagseth

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@497 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-04-02 00:00:16 +00:00
parent 0998567fdf
commit 94d3deb6b4

View File

@ -23,8 +23,8 @@ public final class XMLStreamUtil {
return inputFactory; return inputFactory;
} }
public static Map<String,Map<String,String>> getElementContentsAsMap(InputStream inputStream, String rowName, String idName) throws IOException { public static Map<String, Map<String, String>> getElementContentsAsMap(InputStream inputStream, String rowName, String idName) throws IOException {
Map<String,Map<String,String>> results = new HashMap<String,Map<String,String>>(); Map<String, Map<String, String>> results = new HashMap<String, Map<String, String>>();
Map<String, String> item = null; Map<String, String> item = null;
String currentElement = null; String currentElement = null;
XMLStreamReader reader = null; XMLStreamReader reader = null;
@ -36,7 +36,9 @@ public final class XMLStreamUtil {
if (event == XMLStreamConstants.START_ELEMENT && rowName.equals(reader.getLocalName())) { if (event == XMLStreamConstants.START_ELEMENT && rowName.equals(reader.getLocalName())) {
item = new HashMap<String, String>(); item = new HashMap<String, String>();
} else if (event == XMLStreamConstants.END_ELEMENT && rowName.equals(reader.getLocalName())) { } else if (event == XMLStreamConstants.END_ELEMENT && rowName.equals(reader.getLocalName())) {
results.put(item.get(idName).toLowerCase(),item); if (item.containsKey(idName)) {
results.put(item.get(idName).toLowerCase(), item);
}
item = null; item = null;
} else if (event == XMLStreamConstants.START_ELEMENT && item != null) { } else if (event == XMLStreamConstants.START_ELEMENT && item != null) {
currentElement = reader.getLocalName(); currentElement = reader.getLocalName();