[lttng-dev] [PATCH lttng-ust] Fix: Use Java 6 syntax in JUL examples

Michael Jeanson mjeanson at efficios.com
Mon Feb 15 14:29:58 EST 2016


Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 doc/examples/java-jul/ApplicationContextExample.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/doc/examples/java-jul/ApplicationContextExample.java b/doc/examples/java-jul/ApplicationContextExample.java
index 3da3ac8..52cef3f 100644
--- a/doc/examples/java-jul/ApplicationContextExample.java
+++ b/doc/examples/java-jul/ApplicationContextExample.java
@@ -67,12 +67,11 @@ public class ApplicationContextExample {
 
 		@Override
 		public Object retrieveContextInfo(String key) {
-			switch (key) {
-			case CONTEXT_NAME_SHORT:
+			if (CONTEXT_NAME_SHORT.equals(key)) {
 				return (short) 42;
-			case CONTEXT_NAME_STRING:
+			} else if (CONTEXT_NAME_STRING.equals(key)) {
 				return "context-value!";
-			default:
+			} else {
 				return null;
 			}
 		}
-- 
2.7.0




More information about the lttng-dev mailing list