return;
}
server = sh.service;
- if (preset!=null) {
- if (preset instanceof JabaPreset){
- this.preset = ((JabaPreset)preset).p;
- } else
- if (preset instanceof JabaWsParamSet) {
- JabaWsParamSet pset = ((JabaWsParamSet)preset);
- if (arguments!=null && arguments.size()>0)
+ if (preset != null)
+ {
+ if (preset instanceof JabaPreset)
+ {
+ this.preset = ((JabaPreset) preset).p;
+ }
+ else if (preset instanceof JabaWsParamSet)
+ {
+ List<Argument> newargs = new ArrayList<Argument>();
+ JabaWsParamSet pset = ((JabaWsParamSet) preset);
+ for (Option opt : pset.getjabaArguments())
+ {
+ newargs.add(opt);
+ }
+ if (arguments != null && arguments.size() > 0)
+ {
+ // merge arguments with preset's own arguments.
+ for (Argument opt : arguments)
{
- // merge arguments with preset's own arguments.
- List<Argument> oldargs = arguments;
- arguments = new ArrayList<Argument>();
- for (Option opt : pset.getjabaArguments()) {
- arguments.add(opt);
- }
- for (Argument opt: oldargs)
- {
- arguments.add(opt);
- }
+ newargs.add(opt);
}
-
- }else{
- throw new Error("Implementation error: Can only instantiate Jaba parameter sets.");
+ }
+ paramset = newargs;
}
+ else
+ {
+ throw new Error(
+ "Implementation error: Can only instantiate Jaba parameter sets.");
+ }
+ }
+ else
+ {
+ // just provided with a bunch of arguments
+ this.paramset = arguments;
}
- this.paramset = arguments;
if (editParams)
{
- if (sh.paramStore==null)
+ if (sh.paramStore == null)
{
sh.paramStore = new JabaParamStore(sh);
}
return;
}
WsParamSetI prset = jobParams.getPreset();
- if (prset==null)
+ if (prset == null)
+ {
+ paramset = JabaParamStore.getJabafromJwsArgs(jobParams
+ .getJobParams());
+ }
+ else
{
- paramset = JabaParamStore.getJabafromJwsArgs(jobParams.getJobParams());
- } else {
- this.preset = ((JabaPreset)prset).p;
+ this.preset = ((JabaPreset) prset).p;
paramset = null; // no user supplied parameters.
}
}