summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkitfox2013-02-05 07:04:24 +0100
committerkitfox2013-02-05 07:04:24 +0100
commit1921290855b638e6b565dacab45fa20498688ef6 (patch)
tree6e52cfef91f8d1063b0bd133846e9356577ddc44 /src
parentUpdating headers to reflect BSD license. (diff)
downloadsvg-salamander-core-1921290855b638e6b565dacab45fa20498688ef6.tar.gz
svg-salamander-core-1921290855b638e6b565dacab45fa20498688ef6.tar.xz
svg-salamander-core-1921290855b638e6b565dacab45fa20498688ef6.zip
Fixing URL parsing.
git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@145 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/kitfox/svg/xml/StyleAttribute.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/com/kitfox/svg/xml/StyleAttribute.java b/src/main/java/com/kitfox/svg/xml/StyleAttribute.java
index 6425b7c..dd1fc3c 100644
--- a/src/main/java/com/kitfox/svg/xml/StyleAttribute.java
+++ b/src/main/java/com/kitfox/svg/xml/StyleAttribute.java
@@ -37,8 +37,8 @@
package com.kitfox.svg.xml;
import java.awt.*;
-import java.net.*;
import java.io.*;
+import java.net.*;
import java.util.regex.*;
/**
@@ -49,7 +49,7 @@ public class StyleAttribute implements Serializable
{
public static final long serialVersionUID = 0;
- static final Matcher matchUrl = Pattern.compile("\\s*url\\((.*)\\)\\s*").matcher("");
+ static final Pattern patternUrl = Pattern.compile("\\s*url\\((.*)\\)\\s*");
static final Matcher matchFpNumUnits = Pattern.compile("\\s*([-+]?((\\d*\\.\\d+)|(\\d+))([-+]?[eE]\\d+)?)\\s*(px|cm|mm|in|pc|pt|em|ex)\\s*").matcher("");
String name;
@@ -185,8 +185,11 @@ public class StyleAttribute implements Serializable
public String parseURLFn()
{
- matchUrl.reset(stringValue);
- if (!matchUrl.matches()) return null;
+ Matcher matchUrl = patternUrl.matcher(stringValue);
+ if (!matchUrl.matches())
+ {
+ return null;
+ }
return matchUrl.group(1);
}