jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1339078 - /jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
Date Wed, 16 May 2012 09:18:23 GMT
Author: sebb
Date: Wed May 16 09:18:22 2012
New Revision: 1339078

URL: http://svn.apache.org/viewvc?rev=1339078&view=rev
Log:
Tidy; add usage comments

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java?rev=1339078&r1=1339077&r2=1339078&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java Wed May 16 09:18:22 2012
@@ -692,16 +692,17 @@ public class JMeterUtils implements Unit
      *
      * @return The XMLParser value
      */
+    // TODO only called by UserParameterXMLParser.getXMLParameters which is a deprecated
class
     public static XMLReader getXMLParser() {
         XMLReader reader = null;
+        final String parserName = getPropDefault("xml.parser", // $NON-NLS-1$
+                "org.apache.xerces.parsers.SAXParser");  // $NON-NLS-1$
         try {
-            reader = (XMLReader) instantiate(getPropDefault("xml.parser", // $NON-NLS-1$
-                    "org.apache.xerces.parsers.SAXParser"), // $NON-NLS-1$
+            reader = (XMLReader) instantiate(parserName,
                     "org.xml.sax.XMLReader"); // $NON-NLS-1$
             // reader = xmlFactory.newSAXParser().getXMLReader();
         } catch (Exception e) {
-            reader = (XMLReader) instantiate(getPropDefault("xml.parser", // $NON-NLS-1$
-                    "org.apache.xerces.parsers.SAXParser"), // $NON-NLS-1$
+            reader = (XMLReader) instantiate(parserName, // $NON-NLS-1$
                     "org.xml.sax.XMLReader"); // $NON-NLS-1$
         }
         return reader;
@@ -896,9 +897,10 @@ public class JMeterUtils implements Unit
      * @param className
      *            The name of the class to instantiate.
      * @param impls
-     *            The name of the class it subclases.
-     * @return Description of the Returned Value
+     *            The name of the class it must be an instance of
+     * @return an instance of the class, or null if instantiation failed or the class did
not implement/extend as required 
      */
+    // TODO probably not needed
     public static Object instantiate(String className, String impls) {
         if (className != null) {
             className = className.trim();



Mime
View raw message