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

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Mon Feb 15 14:39:35 EST 2016


merged, thanks!

Mathieu

----- On Feb 15, 2016, at 2:29 PM, Michael Jeanson mjeanson at efficios.com wrote:

> 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

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list