summaryrefslogtreecommitdiff
path: root/javaunohelper
diff options
context:
space:
mode:
authorrbuj <robert.buj@gmail.com>2014-08-11 12:14:50 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-08-12 12:38:57 +0200
commit43cda91057c2e5aeb361c9a5fde216023de37713 (patch)
tree477b12f3656f702b948d967dc5f0810b33ee9fb0 /javaunohelper
parenteda3beff19f95c634fa6f0320e7ab0f942f51f3e (diff)
javaunohelper: Fix Bootstrap_Test.java & add warning messages
Accept bootstrap parameters that contained more than one = Reject empty key Change-Id: Ie04364867d56d5687cbbc2c142ea73be90bbafdf Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'javaunohelper')
-rw-r--r--javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java b/javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java
index f52ce28f16b7..0031e1a576b3 100644
--- a/javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java
+++ b/javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java
@@ -94,13 +94,17 @@ public class Bootstrap_Test {
java.util.HashMap<String,String> bootstrap_parameters = new java.util.HashMap<String,String>();
for ( int nPos = 1; nPos < args.length; ++nPos ) {
if (args[nPos].contains("=")) {
- String bootstrap_parameter[] = args[nPos].split("=");
- if (bootstrap_parameter.length == 2){
+ String bootstrap_parameter[] = args[nPos].split("=",2);
+ if (bootstrap_parameter[0].length() > 0) {
bootstrap_parameters.put( bootstrap_parameter[0], bootstrap_parameter[1] );
- } else{
+ } else {
+ System.out.println();
+ System.out.println("The 1st argument in a bootstrap parameter is the key of a HashMap element and can't be null : '" + args[nPos] + "'");
usage();
}
- } else{
+ } else {
+ System.out.println();
+ System.out.println("Missing '=' in bootstrap parameter : '" + args[nPos] + "'");
usage();
}
}