changeset 7243:18ca3f87dab2

RT-37500: [Android] Map.computeIfAbsent call in StyleManager
author David Grieve<david.grieve@oracle.com>
date Wed, 11 Jun 2014 13:32:05 -0400
parents 0cfa9e528b26
children dddec7c8b7c2
files modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java	Wed Jun 11 10:14:59 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java	Wed Jun 11 13:32:05 2014 -0400
@@ -173,12 +173,11 @@
 
         if (root == null) return null;
 
-        CacheContainer container = cacheContainerMap.computeIfAbsent(
-                root,
-                (key) -> {
-                    return new CacheContainer();
-                }
-        );
+        CacheContainer container = cacheContainerMap.get(root);
+        if (container == null) {
+            container = new CacheContainer();
+            cacheContainerMap.put(root, container);
+        }
 
         return container;