From 8685da113a6ed01601be9b7db4fb4a1f4b72166d Mon Sep 17 00:00:00 2001 From: Alexandre Montplaisir Date: Tue, 21 Jul 2015 22:50:44 -0400 Subject: [PATCH] Fix: Small fixes to the Java agent example files Remove unused imports. Add missing dispose() in the log4j example. Fix typos. Signed-off-by: Alexandre Montplaisir Signed-off-by: Mathieu Desnoyers --- doc/examples/java-jul/Hello.java | 8 +++----- doc/examples/java-log4j/Hello.java | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/doc/examples/java-jul/Hello.java b/doc/examples/java-jul/Hello.java index 87b4c160..588ec815 100644 --- a/doc/examples/java-jul/Hello.java +++ b/doc/examples/java-jul/Hello.java @@ -20,8 +20,6 @@ * IN THE SOFTWARE. */ -import java.io.IOException; -import java.util.logging.Level; import java.util.logging.Logger; /* @@ -49,13 +47,13 @@ public class Hello Logger helloLog = Logger.getLogger("hello"); /* - * Get the LTTngAgent singelton reference. This will also initialize + * Get the LTTngAgent singleton reference. This will also initialize * the Agent and make it register to the session daemon if available. * When this returns, the Agent is registered and fully ready. If no * session daemon is found, it will return and retry every 3 seconds in * the background. TCP is used for communication. * - * Note that the LTTngAgent once registered is a seperate thread in + * Note that the LTTngAgent once registered is a separate thread in * your Java application. */ lttngAgent = LTTngAgent.getLTTngAgent(); @@ -95,7 +93,7 @@ public class Hello /* * Again, this is highly recommended so the session daemon socket gets - * cleaned up explicitely but it is not mandatory to do this step. + * cleaned up explicitly but it is not mandatory to do this step. */ lttngAgent.dispose(); } diff --git a/doc/examples/java-log4j/Hello.java b/doc/examples/java-log4j/Hello.java index 083ec12a..38725cb6 100644 --- a/doc/examples/java-log4j/Hello.java +++ b/doc/examples/java-log4j/Hello.java @@ -19,11 +19,9 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ -import java.io.IOException; -import org.apache.log4j.Logger; import org.apache.log4j.BasicConfigurator; - +import org.apache.log4j.Logger; import org.lttng.ust.agent.LTTngAgent; public class Hello @@ -51,5 +49,7 @@ public class Hello System.out.println("Firing hello delay in 5 seconds..."); Thread.sleep(5000); helloLog.info("Hello World delayed..."); + + lttngAgent.dispose(); } } -- 2.34.1