If message contains '=', it can not be showed fully since '=' is splitted out.
So, for representing whole message, "key" is determined startsWith(),
and "value" splitted just once by '='.
Change-Id: I74a9450b9524f1bfc6a6fa9aa231bab8943d8610
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
}
private static String getSimpleMsg(String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- String[] split = arg.split("=");
-
- if (1 < split.length) {
- if (ArgsConstants.SIMPLE_MESSAGE.equals(
- split[0].trim())) {
- return split[1].trim();
+ for (String arg : args) {
+ if (arg.startsWith(ArgsConstants.SIMPLE_MESSAGE)) {
+ String[] split = arg.split("=", 2);
+ if (split.length == 2) {
+ return split[1];
}
}
}