diff --git a/modules/dcache-bulk/src/main/java/org/dcache/services/bulk/activity/plugin/pin/PinActivity.java b/modules/dcache-bulk/src/main/java/org/dcache/services/bulk/activity/plugin/pin/PinActivity.java index bd95b3142e3..d602bcba35d 100644 --- a/modules/dcache-bulk/src/main/java/org/dcache/services/bulk/activity/plugin/pin/PinActivity.java +++ b/modules/dcache-bulk/src/main/java/org/dcache/services/bulk/activity/plugin/pin/PinActivity.java @@ -127,6 +127,7 @@ public ListenableFuture perform(String rid, long tid, FsPath target, @Override protected void configure(Map arguments) { TimeUnit defaultUnit = TimeUnit.valueOf(lifetimeUnitDefault()); + Long defaultValue = Long.parseLong(lifetimeDefault()); if (arguments == null) { @@ -135,11 +136,17 @@ protected void configure(Map arguments) { String expire = arguments.get(LIFETIME); String unit = arguments.get(LIFETIME_UNIT); - Long value = (long) (Double.parseDouble(expire)); - - lifetimeInMillis = expire == null ? defaultUnit.toMillis(defaultValue) - : unit == null ? defaultUnit.toMillis(value) - : TimeUnit.valueOf(unit).toMillis(value); + /* + * Guard against erroneous argument names ... + */ + if (expire == null) { + lifetimeInMillis = unit == null ? defaultUnit.toMillis(defaultValue): + TimeUnit.valueOf(unit).toMillis(defaultValue); + } else { + Long value = (long) (Double.parseDouble(expire)); + lifetimeInMillis = unit == null ? defaultUnit.toMillis(value) + : TimeUnit.valueOf(unit).toMillis(value); + } } id = arguments == null ? null : arguments.get(PIN_REQUEST_ID);