changeset 8034:00c382cd0fab

RT-38758: [CSS] HelloSanity does not get the right CSS file when run from an IDE
author David Grieve<david.grieve@oracle.com>
date Mon, 22 Sep 2014 17:17:30 -0400
parents 6719035236ad
children 96f3db893a9f
files modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java	Mon Sep 22 17:17:29 2014 -0400
+++ b/modules/graphics/src/main/java/com/sun/javafx/css/StyleManager.java	Mon Sep 22 17:17:30 2014 -0400
@@ -1147,7 +1147,13 @@
                 StylesheetContainer container = platformUserAgentStylesheetContainers.get(n);
                 // assignment in this conditional is intentional!
                 if(isSame = fname.equals(container.fname)) {
-                    byte[] checksum = calculateCheckSum(fname);
+                    // don't use fname in calculateCheckSum since it is just the key to
+                    // find the StylesheetContainer. Rather, use the URL of the
+                    // stylesheet that was already loaded. For example, we could have
+                    // fname = "com/sun/javafx/scene/control/skin/modena/modena.css, but
+                    // the stylesheet URL could be jar:file://some/path/!com/sun/javafx/scene/control/skin/modena/modena.bss
+                    String stylesheetUrl = container.stylesheet.getUrl();
+                    byte[] checksum = calculateCheckSum(stylesheetUrl);
                     isSame = Arrays.equals(checksum, container.checksum);
                 }
             }