jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1570836 - /jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleEvent.java
Date Sat, 22 Feb 2014 13:20:19 GMT
Author: sebb
Date: Sat Feb 22 13:20:18 2014
New Revision: 1570836

URL: http://svn.apache.org/r1570836
Log:
ERROR - jmeter.util.JMeterUtils: Unable to get local host IP address
Reuse existing JMeterUtils code
Bugzilla Id: 56174

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleEvent.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleEvent.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleEvent.java?rev=1570836&r1=1570835&r2=1570836&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleEvent.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleEvent.java Sat Feb 22 13:20:18
2014
@@ -19,8 +19,6 @@
 package org.apache.jmeter.samplers;
 
 import java.io.Serializable;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
 import java.util.Arrays;
 
 import org.apache.jmeter.threads.JMeterVariables;
@@ -51,13 +49,7 @@ public class SampleEvent implements Seri
 
     // The hostname cannot change during a run, so safe to cache it just once
     static {
-        String hn="";
-        try {
-            hn = InetAddress.getLocalHost().getHostName();
-        } catch (UnknownHostException e) {
-            log.error("Cannot obtain local host name "+e);
-        }
-        HOSTNAME=hn;
+        HOSTNAME=JMeterUtils.getLocalHostName();
         initSampleVariables();
     }
 



Mime
View raw message