# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: src/core/org/apache/jmeter/util/NameUpdater.java =================================================================== --- src/core/org/apache/jmeter/util/NameUpdater.java (revision 1202577) +++ src/core/org/apache/jmeter/util/NameUpdater.java (working copy) @@ -25,6 +25,10 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.Enumeration; +import java.util.Iterator; import java.util.Properties; import org.apache.jorphan.logging.LoggingManager; @@ -53,8 +57,44 @@ } finally { JOrphanUtils.closeQuietly(fis); } + + //load additionnal name conversion rules from plugins + Enumeration enu = null; + + try { + enu = JMeterUtils.class.getClassLoader().getResources("META-INF/resources/org.apache.jmeter.nameupdater.properties"); + } catch (IOException e) { + log.error("Error in finding additional nameupdater.properties files: ", e); } + if(enu != null) { + while(enu.hasMoreElements()) { + URL ressourceUrl = enu.nextElement(); + Properties tmp = new Properties(); + InputStream is = null; + try { + is = ressourceUrl.openStream(); + tmp.load(is); + } catch (IOException e) { + log.error("Error processing upgrade file: " + ressourceUrl.getPath(), e); + } finally { + JOrphanUtils.closeQuietly(is); + } + + Iterator items = tmp.stringPropertyNames().iterator(); + while (items.hasNext()) { + String key = items.next(); + if (!nameMap.contains(key)) { + nameMap.put(key, tmp.get(key)); + log.info("Added additional nameMap entry: " + key); + } else { + log.warn("Additional nameMap entry: '" + key + "' rejected as already defined."); + } + } + } + } + } + public static String getCurrentName(String className) { if (nameMap.containsKey(className)) { String newName = nameMap.getProperty(className);