Permalink
Browse files

- Java-API: allow the toAdd and toRemove lists in RequestList.addAddD…

…elOnList(String, List<T>, List<T>) to be null (an empty list will then be used)
  • Loading branch information...
1 parent fef90c5 commit 3440709ddb3df8aa1e426c6c265a3f3c88c27cae kruber@zib.de committed Dec 7, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 java-api/src/de/zib/scalaris/RequestList.java
@@ -189,9 +189,9 @@ public RequestList addAddDelOnList(final OtpErlangObject key, final OtpErlangLis
*/
public <T> RequestList addAddDelOnList(final String key, final List<T> toAdd, final List<T> toRemove)
throws UnsupportedOperationException {
- return addAddDelOnList(new OtpErlangString(key),
- (OtpErlangList) ErlangValue.convertToErlang(toAdd),
- (OtpErlangList) ErlangValue.convertToErlang(toRemove));
+ final OtpErlangList toAddErl = (toAdd == null) ? new OtpErlangList() : (OtpErlangList) ErlangValue.convertToErlang(toAdd);
+ final OtpErlangList toRemoveErl = (toRemove == null) ? new OtpErlangList() : (OtpErlangList) ErlangValue.convertToErlang(toRemove);
+ return addAddDelOnList(new OtpErlangString(key), toAddErl, toRemoveErl);
}
/**

0 comments on commit 3440709

Please sign in to comment.