Change header template for a new version
[jabaws.git] / webservices / compbio / ws / client / MetadataHelper.java
index d69c3c1..4803e16 100644 (file)
@@ -1,8 +1,26 @@
+/* Copyright (c) 2011 Peter Troshin\r
+ *  \r
+ *  JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0     \r
+ * \r
+ *  This library is free software; you can redistribute it and/or modify it under the terms of the\r
+ *  Apache License version 2 as published by the Apache Software Foundation\r
+ * \r
+ *  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\r
+ *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache \r
+ *  License for more details.\r
+ * \r
+ *  A copy of the license is in apache_license.txt. It is also available here:\r
+ * @see: http://www.apache.org/licenses/LICENSE-2.0.txt\r
+ * \r
+ * Any republication or derived work distributed in source code form\r
+ * must include this copyright and license notice.\r
+ */\r
 package compbio.ws.client;\r
 \r
 import static compbio.ws.client.Constraints.pseparator;\r
 \r
 import java.util.ArrayList;\r
+import java.util.Collections;\r
 import java.util.List;\r
 \r
 import compbio.data.msa.Metadata;\r
@@ -27,7 +45,11 @@ public class MetadataHelper {
         */\r
        static <T> List<Option<T>> getParametersList(Metadata<T> msaws) {\r
                assert msaws != null;\r
-               return msaws.getRunnerOptions().getArguments();\r
+               RunnerConfig<T> config = msaws.getRunnerOptions();\r
+               if (config == null) {\r
+                       return Collections.emptyList();\r
+               }\r
+               return config.getArguments();\r
        }\r
 \r
        /**\r