2002/css-validator/org/w3c/css/values CssURL.java,1.7,1.8

Update of /sources/public/2002/css-validator/org/w3c/css/values
In directory hutz:/tmp/cvs-serv13250/w3c/css/values

Modified Files:
	CssURL.java 
Log Message:
automatic aggregation of visited URIs, only namespaces URIs are in a weird state

Index: CssURL.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/values/CssURL.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- CssURL.java	5 Jan 2010 13:50:01 -0000	1.7
+++ CssURL.java	23 Feb 2012 14:28:10 -0000	1.8
@@ -59,6 +59,7 @@
     String full = null;
 
     URL base;
+    URL urlValue = null;
 
     /**
      * Set the value of this URL.
@@ -97,6 +98,13 @@
 //	}
         if (!urlHeading.startsWith("url"))
             throw new InvalidParamException("url", s, ac);
+        // now add the URL to the list of seen URLs in the context
+        try {
+            ac.addLinkedURI(getURL());
+        } catch (MalformedURLException mex) {
+            // error? throw an exception
+            throw new InvalidParamException("url", s, ac);
+        }
     }
 
     /**
@@ -113,7 +121,10 @@
      * @throws java.net.MalformedURLException (self explanatory)
      */
     public URL getURL() throws MalformedURLException {
-        return HTTPURL.getURL(base, value);
+        if (urlValue == null) {
+            urlValue = HTTPURL.getURL(base, value);
+        }
+        return urlValue;
     }
 
     /**

Received on Thursday, 23 February 2012 14:28:18 UTC