From 5793b6bb9adb54a83229da47a1fa59500b57c396 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 27 Jun 2013 12:01:58 +0200 Subject: message should be null if there are no message arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/ArgParser.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ArgParser.java b/src/ArgParser.java index c063b37..6611b04 100644 --- a/src/ArgParser.java +++ b/src/ArgParser.java @@ -1042,14 +1042,16 @@ public class ArgParser break; } } - final StringBuilder sb = new StringBuilder(); - for (final String file : this.files) - { sb.append(' '); - sb.append(file); + if (this.files.size() > 0) + { final StringBuilder sb = new StringBuilder(); + for (final String file : this.files) + { sb.append(' '); + sb.append(file); + } + this.message = sb.toString(); + if (this.message.length() > 0) + this.message = this.message.substring(1); } - this.message = sb.toString(); - if (this.message.length() > 0) - this.message = this.message.substring(1); if (this.unrecognisedCount > 5) { int more = this.unrecognisedCount - 5; -- cgit v1.2.3-70-g09d2