changeset 2892:6045e676948b

RT-21967: if absolute path without a scheme, strip leading / before resolving URL.
author David Grieve<david.grieve@oracle.com>
date Tue, 12 Mar 2013 18:05:57 -0400
parents 1ee809c26ddd
children ecc8529fdc5b
files javafx-ui-common/src/com/sun/javafx/css/converters/URLConverter.java
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/com/sun/javafx/css/converters/URLConverter.java	Tue Mar 12 17:41:24 2013 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/converters/URLConverter.java	Tue Mar 12 18:05:57 2013 -0400
@@ -71,10 +71,12 @@
                 } catch (MalformedURLException malf) {
                     // This may be a relative URL, so try resolving
                     // it using the application classloader
+                    if (uriStr.startsWith("/")) uriStr = uriStr.substring(1);                    
                     final ClassLoader cl = Thread.currentThread().getContextClassLoader();
                     resolvedURL = cl.getResource(uriStr);
                 }
             } else {
+                if (uriStr.startsWith("/")) uriStr = uriStr.substring(1);
                 // resolve doesn't work with opaque URI's, but this does.
                 resolvedURL = new URL(stylesheetURL, uriStr);
             }