jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1380342 - /jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/XPathPanel.java
Date Mon, 03 Sep 2012 21:35:45 GMT
On 3 September 2012 21:14,  <pmouawad@apache.org> wrote:
> 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

Are you sure?

> 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());
>
>

Mime
View raw message