OpenJDK / bsd-port / jdk9 / nashorn
changeset 862:12c7c5ccf4ae
8043605: Enable history for empty property maps
Reviewed-by: jlaskey, sundar
author | attila |
---|---|
date | Wed, 21 May 2014 15:38:11 +0200 |
parents | 6fc56d9cbb73 |
children | 59b025df6d0a |
files | src/jdk/nashorn/internal/runtime/PropertyMap.java |
diffstat | 1 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/jdk/nashorn/internal/runtime/PropertyMap.java Wed May 21 12:52:58 2014 +0200 +++ b/src/jdk/nashorn/internal/runtime/PropertyMap.java Wed May 21 15:38:11 2014 +0200 @@ -651,13 +651,11 @@ * @param newMap Modified {@link PropertyMap}. */ private void addToHistory(final Property property, final PropertyMap newMap) { - if (!properties.isEmpty()) { - if (history == null) { - history = new WeakHashMap<>(); - } + if (history == null) { + history = new WeakHashMap<>(); + } - history.put(property, new SoftReference<>(newMap)); - } + history.put(property, new SoftReference<>(newMap)); } /**