You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2005/12/01 01:08:14 UTC

svn commit: r350080 - /jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/samplers/SampleEvent.java

Author: sebb
Date: Wed Nov 30 16:08:02 2005
New Revision: 350080

URL: http://svn.apache.org/viewcvs?rev=350080&view=rev
Log:
Fix typo and mutable string problem

Modified:
    jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/samplers/SampleEvent.java

Modified: jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/samplers/SampleEvent.java
URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/samplers/SampleEvent.java?rev=350080&r1=350079&r2=350080&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/samplers/SampleEvent.java (original)
+++ jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/samplers/SampleEvent.java Wed Nov 30 16:08:02 2005
@@ -1,6 +1,5 @@
-// $Header$
 /*
- * Copyright 2001-2004 The Apache Software Foundation.
+ * Copyright 2001-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,6 +21,9 @@
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 
+import org.apache.jorphan.logging.LoggingManager;
+import org.apache.log.Logger;
+
 /**
  * Packages information regarding the target of a sample event, such as the
  * result from that event and the thread group it ran in.
@@ -29,14 +31,18 @@
  * @version $Revision$
  */
 public class SampleEvent implements Serializable {
-	public static String HOSTNMAME;
+    private static final Logger log = LoggingManager.getLoggerForClass();
+
+    public static final String HOSTNAME;
 
 	static {
+        String hn=null;
 		try {
-			HOSTNMAME = InetAddress.getLocalHost().getHostName();
+			hn = InetAddress.getLocalHost().getHostName();
 		} catch (UnknownHostException e) {
-			e.printStackTrace();
+            log.error("Cannot obtain local host name "+e);
 		}
+        HOSTNAME=hn;
 	}
 
 	SampleResult result;
@@ -51,7 +57,7 @@
 	public SampleEvent(SampleResult result, String threadGroup) {
 		this.result = result;
 		this.threadGroup = threadGroup;
-		this.hostname = HOSTNMAME;
+		this.hostname = HOSTNAME;
 	}
 
 	public SampleResult getResult() {



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org