From 1921290855b638e6b565dacab45fa20498688ef6 Mon Sep 17 00:00:00 2001 From: kitfox Date: Tue, 5 Feb 2013 06:04:24 +0000 Subject: Fixing URL parsing. git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@145 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b --- src/main/java/com/kitfox/svg/xml/StyleAttribute.java | 11 +++++++---- 1 file 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); } -- cgit v1.2.3-55-g7522