Fix: Use Java 6 syntax in JUL examples
[lttng-ust.git] / doc / examples / java-jul / ApplicationContextExample.java
index 3da3ac82e22c6574277b1937a9aa60bcb5d68a39..52cef3f216044fa9dbaf313002e7ee6a8b5b8f42 100644 (file)
@@ -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;
                        }
                }
This page took 0.023102 seconds and 4 git commands to generate.