Author: pmouawad
Date: Mon Sep 3 20:14:30 2012
New Revision: 1380342
URL: http://svn.apache.org/viewvc?rev=1380342&view=rev
Log:
Remove caching as it is subject to thread corruption
Modified:
jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/XPathPanel.java
Modified: jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/XPathPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/XPathPanel.java?rev=1380342&r1=1380341&r2=1380342&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/XPathPanel.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/XPathPanel.java Mon Sep
3 20:14:30 2012
@@ -42,9 +42,6 @@ public class XPathPanel extends JPanel {
private static final Logger log = LoggingManager.getLoggerForClass();
- // Lazily constructed. Does not matter if it is constructed more than once.
- private static Document testDoc;
-
private JCheckBox negated;
private JTextField xpath;
@@ -182,14 +179,11 @@ public class XPathPanel extends JPanel {
public static boolean validXPath(String xpathString, boolean showDialog) {
String ret = null;
boolean success = true;
+ Document testDoc = null;
try {
- if (testDoc == null) {
- Document doc = XPathUtil.makeDocumentBuilder(false, false, false, false).newDocument();
- testDoc = doc;
- Element el = testDoc.createElement("root"); //$NON-NLS-1$
- doc.appendChild(el);
-
- }
+ testDoc = XPathUtil.makeDocumentBuilder(false, false, false, false).newDocument();
+ Element el = testDoc.createElement("root"); //$NON-NLS-1$
+ testDoc.appendChild(el);
XPathUtil.validateXPath(testDoc, xpathString);
} catch (IllegalArgumentException e) {
log.warn(e.getLocalizedMessage());
|