Commit ac7d473c authored by Florian Schmaus's avatar Florian Schmaus

Use switch/case instead of if/else in OfflineMessageStrategy

parent 41b001b9
...@@ -130,24 +130,29 @@ public class OfflineMessageStrategy extends BasicModule { ...@@ -130,24 +130,29 @@ public class OfflineMessageStrategy extends BasicModule {
} }
} }
if (type == Type.bounce) { switch (type) {
case bounce:
bounce(message); bounce(message);
} break;
else if (type == Type.store) { case store:
store(message); store(message);
} break;
else if (type == Type.store_and_bounce) { case store_and_bounce:
if (underQuota(message)) { if (underQuota(message)) {
store(message); store(message);
} }
else { else {
bounce(message); bounce(message);
} }
} break;
else if (type == Type.store_and_drop) { case store_and_drop:
if (underQuota(message)) { if (underQuota(message)) {
store(message); store(message);
} }
break;
case drop:
// Drop essentially means silently ignore/do nothing
break;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment