diff options
author | mikaelpeltier <mikaelpeltier@google.com> | 2015-03-09 16:29:33 +0100 |
---|---|---|
committer | mikaelpeltier <mikaelpeltier@google.com> | 2015-03-09 16:29:33 +0100 |
commit | 9ac4cd8086417ea41bcd115d4daee18a24de7f84 (patch) | |
tree | 25169d9c7410f07bfab0087b3a2b0793cca27baf | |
parent | 6d2670e5f06cfe49d85d04f656cdb8d99579ff03 (diff) | |
download | toolchain_jack-9ac4cd8086417ea41bcd115d4daee18a24de7f84.zip toolchain_jack-9ac4cd8086417ea41bcd115d4daee18a24de7f84.tar.gz toolchain_jack-9ac4cd8086417ea41bcd115d4daee18a24de7f84.tar.bz2 |
Fix bug in duplicate PropertyId.Value
Change-Id: I99c8a7e73e774213b745633e2d970210f58274d0
-rw-r--r-- | sched/src/com/android/sched/util/config/AsapConfigBuilder.java | 3 | ||||
-rw-r--r-- | sched/src/com/android/sched/util/config/ConfigChecker.java | 7 |
2 files changed, 3 insertions, 7 deletions
diff --git a/sched/src/com/android/sched/util/config/AsapConfigBuilder.java b/sched/src/com/android/sched/util/config/AsapConfigBuilder.java index 5c623eb..c0f4176 100644 --- a/sched/src/com/android/sched/util/config/AsapConfigBuilder.java +++ b/sched/src/com/android/sched/util/config/AsapConfigBuilder.java @@ -457,7 +457,8 @@ public class AsapConfigBuilder { PropertyId<?> propertyId = (PropertyId<?>) keyId; if (!values.containsKey(keyId)) { - values.put(propertyId, propertyId.getDefaultValue(context)); + PropertyId<?>.Value defaultValue = propertyId.getDefaultValue(context); + values.put(propertyId, defaultValue != null ? defaultValue.duplicate() : null); locationsByKeyId.put(keyId, defaultLocationsByKeyId.get(keyId)); } } diff --git a/sched/src/com/android/sched/util/config/ConfigChecker.java b/sched/src/com/android/sched/util/config/ConfigChecker.java index dc94c3b..63a21e5 100644 --- a/sched/src/com/android/sched/util/config/ConfigChecker.java +++ b/sched/src/com/android/sched/util/config/ConfigChecker.java @@ -26,7 +26,6 @@ import com.android.sched.util.location.Location; import java.util.HashMap; import java.util.Map; -import java.util.Map.Entry; import javax.annotation.Nonnull; @@ -57,11 +56,7 @@ public class ConfigChecker { @Nonnull Map<ObjectId<?>, Object> instanceValues, @Nonnull Map<KeyId<?, ?>, Location> locationsById) { this.context = context; - for (Entry<PropertyId<?>, PropertyId<?>.Value> entry : stringValues.entrySet()) { - this.values.put(entry.getKey(), (entry.getValue() != null) ? entry.getValue().duplicate() - : null); - } - + this.values.putAll(stringValues); this.instances.putAll(instanceValues); this.locations.putAll(locationsById); } |