You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by fs...@apache.org on 2016/12/27 14:58:27 UTC

svn commit: r1776141 - /jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java

Author: fschumacher
Date: Tue Dec 27 14:58:27 2016
New Revision: 1776141

URL: http://svn.apache.org/viewvc?rev=1776141&view=rev
Log:
javadoc: Rename type param to comply with java coding standards and document usage.

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java?rev=1776141&r1=1776140&r2=1776141&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java Tue Dec 27 14:58:27 2016
@@ -99,14 +99,20 @@ public class Sample {
      *            the target class of the data
      * @param index
      *            the rank of the column
-     * @param fieldName Field name
+     * @param fieldName
+     *            Field name
+     * @param <T>
+     *            type of data to be fetched
      * @return the converted value of the data
      */
-    public <TData> TData getData(Class<TData> clazz, int index, String fieldName) {
+    public <T> T getData(Class<T> clazz, int index, String fieldName) {
         try {
             return Converters.convert(clazz, data[index]);
         } catch (ConvertException ex) {
-            throw new SampleException(ERROR_ON_SAMPLE + (row+1) + " converting field:"+fieldName+" at column:"+index+" to:"+clazz.getName()+", fieldValue:'"+data[index]+"'", ex);
+            throw new SampleException(ERROR_ON_SAMPLE + (row + 1)
+                    + " converting field:" + fieldName + " at column:" + index
+                    + " to:" + clazz.getName() + ", fieldValue:'" + data[index]
+                    + "'", ex);
         }
     }
 
@@ -118,9 +124,11 @@ public class Sample {
      *            the target class of the data
      * @param name
      *            the name of the column
+     * @param <T>
+     *            type of data to be fetched
      * @return the converted value of the data
      */
-    public <TData> TData getData(Class<TData> clazz, String name) {
+    public <T> T getData(Class<T> clazz, String name) {
         return getData(clazz, metadata.ensureIndexOf(name), name);
     }