Skip to contentSkip to conversation

Fix: Use Java 6 syntax in JUL examples

PATCH Mathieu Desnoyers 2 participants 2 messages Feb 15, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mathieu Desnoyers

author Applied
#1 lore raw

merged, thanks!

Mathieu

Quoted 28 lines · ----- On Feb 15, 2016, at 2:29 PM, Michael Jeanson [email protected] wrote:

---
doc/examples/java-jul/ApplicationContextExample.java | 7 +++----

1 file changed, 3 insertions(+), 4 deletions(-)
doc/examples/java-jul/ApplicationContextExample.java +3 -5
index 3da3ac8..52cef3f 100644
@@ -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

Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
#2 lore raw
In reply to a message not in the archive
Quoted 25 lines · Michael Jeanson
---
  doc/examples/java-jul/ApplicationContextExample.java | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)
doc/examples/java-jul/ApplicationContextExample.java +3 -4
index 3da3ac8..52cef3f 100644
@@ -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;
  			}
  		}