This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 3354f6e  Error when loading Templates on Windows
3354f6e is described below

commit 3354f6e929b2a7b3b215951da73c72a565b13723
Author: Felix Schumacher <felix.schumac...@internetallee.de>
AuthorDate: Sun Mar 15 10:45:48 2020 +0100

    Error when loading Templates on Windows
    
    The document parser expects an URI and not a file path.
    So let us convert the file to a string representation of
    the URI.
    
    Bugzilla Id: 64227
---
 .../java/org/apache/jmeter/gui/action/template/TemplateManager.java     | 2 +-
 xdocs/changes.xml                                                       | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/src/core/src/main/java/org/apache/jmeter/gui/action/template/TemplateManager.java
 
b/src/core/src/main/java/org/apache/jmeter/gui/action/template/TemplateManager.java
index d2e4f21..74fa96c 100644
--- 
a/src/core/src/main/java/org/apache/jmeter/gui/action/template/TemplateManager.java
+++ 
b/src/core/src/main/java/org/apache/jmeter/gui/action/template/TemplateManager.java
@@ -172,7 +172,7 @@ public class TemplateManager {
         bd.setEntityResolver(new DefaultEntityResolver());
         LoggingErrorHandler errorHandler = new LoggingErrorHandler(log, file);
         bd.setErrorHandler(errorHandler);
-        Document document = bd.parse(file.getAbsolutePath());
+        Document document = bd.parse(file.toURI().toString());
         document.getDocumentElement().normalize();
         Map<String, Template> templates = new TreeMap<>();
         NodeList templateNodes = document.getElementsByTagName("template");
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index a35cdc4..2ee393b 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -211,6 +211,7 @@ to view the last release notes of version 5.2.1.
   <li><bug>63945</bug>NPE when opening a file after file system change</li>
   <li><bug>64034</bug>Shell scripts fail if space in <code>JAVA_HOME</code> 
path. Contributed by ray7219 (ray7219 at hotmail.com)</li>
   <li><bug>63856</bug>Set <code>connectTime</code> on parent samples when 
using a transaction controller</li>
+  <li><bug>64227</bug>Error when loading Templates on Windows</li>
 </ul>
 
  <!--  =================== Thanks =================== -->

Reply via email to