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

Alexandre Montplaisir alexmonthy at voxpopuli.im
Mon Feb 15 14:43:32 EST 2016


Reviewed-by: Alexandre Montplaisir <alexmonthy at efficios.com>

On 2016-02-15 02:29 PM, Michael Jeanson 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;
>   			}
>   		}




More information about the lttng-dev mailing list