]> source.dussan.org Git - poi.git/commitdiff
preserve entries order in dictionaries
authorSergey Vladimirov <sergey@apache.org>
Sun, 2 Oct 2011 08:58:11 +0000 (08:58 +0000)
committerSergey Vladimirov <sergey@apache.org>
Sun, 2 Oct 2011 08:58:11 +0000 (08:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1178153 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hpsf/Property.java

index c06a807ef379634bf0f4f44f6f48d79c706c92fa..90cc01408296647e275a424dc0fad551588d2513 100644 (file)
@@ -18,7 +18,7 @@
 package org.apache.poi.hpsf;
 
 import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
 import org.apache.poi.util.HexDump;
@@ -193,7 +193,7 @@ public class Property
      * @throws UnsupportedEncodingException if the dictionary's codepage is not
      *         (yet) supported.
      */
-    protected Map readDictionary(final byte[] src, final long offset,
+    protected Map<?, ?> readDictionary(final byte[] src, final long offset,
                                  final int length, final int codepage)
     throws UnsupportedEncodingException
     {
@@ -210,7 +210,8 @@ public class Property
         final long nrEntries = LittleEndian.getUInt(src, o);
         o += LittleEndian.INT_SIZE;
 
-        final Map m = new HashMap((int) nrEntries, (float) 1.0);
+        final Map<Object, Object> m = new LinkedHashMap<Object, Object>(
+                (int) nrEntries, (float) 1.0 );
 
         try
         {