git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/jackcess-1.2.14@779 f203690c-595d-4dc9-a70b-905162fa7fd2tags/jackcess-1.2.14.2
@@ -4,6 +4,11 @@ | |||
<author email="javajedi@users.sf.net">Tim McCune</author> | |||
</properties> | |||
<body> | |||
<release version="1.2.14.2" date="TBD"> | |||
<action dev="jahlborn" type="fix" system="SourceForge2" issue="96"> | |||
Fix reading of Properties with multiple value blocks. | |||
</action> | |||
</release> | |||
<release version="1.2.14.1" date="2013-08-11"> | |||
<action dev="jahlborn" type="fix" system="SourceForge2Features" | |||
issue="25"> |
@@ -112,6 +112,24 @@ public class PropertyMap implements Iterable<PropertyMap.Property> | |||
return _props.values().iterator(); | |||
} | |||
PropertyMap merge(PropertyMap opm) { | |||
if(opm == null) { | |||
return this; | |||
} | |||
// merge into least map type | |||
PropertyMap dest = opm; | |||
PropertyMap src = this; | |||
if(dest._mapType < src._mapType) { | |||
dest = this; | |||
src = opm; | |||
} | |||
dest._props.putAll(src._props); | |||
return dest; | |||
} | |||
@Override | |||
public String toString() { | |||
StringBuilder sb = new StringBuilder(); |
@@ -98,7 +98,8 @@ public class PropertyMaps implements Iterable<PropertyMap> | |||
* Adds the given PropertyMap to this group. | |||
*/ | |||
public void put(PropertyMap map) { | |||
_maps.put(Database.toLookupName(map.getName()), map); | |||
String mapName = Database.toLookupName(map.getName()); | |||
_maps.put(mapName, map.merge(_maps.get(mapName))); | |||
} | |||
public Iterator<PropertyMap> iterator() { | |||
@@ -176,11 +177,8 @@ public class PropertyMaps implements Iterable<PropertyMap> | |||
if(type == PROPERTY_NAME_LIST) { | |||
propNames = readPropertyNames(bbBlock); | |||
} else if((type == DEFAULT_PROPERTY_VALUE_LIST) || | |||
(type == COLUMN_PROPERTY_VALUE_LIST)) { | |||
maps.put(readPropertyValues(bbBlock, propNames, type)); | |||
} else { | |||
throw new IOException("Unknown property block type " + type); | |||
maps.put(readPropertyValues(bbBlock, propNames, type)); | |||
} | |||
bb.position(endPos); |