Skip to content

Commit

Permalink
remove parameters since the Command has them IQSS#4262
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Nov 13, 2017
1 parent 26eb11d commit 023cb8f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public <R> R submit(Command<R> aCommand) throws CommandException {
DataverseRequest dvReq = aCommand.getRequest();

Map<String, DvObject> affectedDvObjects = aCommand.getAffectedDvObjects();
logRec.setInfo( aCommand.describe(affectedDvObjects) );
logRec.setInfo(aCommand.describe());
for (Map.Entry<String, ? extends Set<Permission>> pair : requiredMap.entrySet()) {
String dvName = pair.getKey();
if (!affectedDvObjects.containsKey(dvName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
public abstract class AbstractCommand<R> implements Command<R> {

// FIXME: rename this from "affectedDataverses" to "affectedDvObjects". It's confusing.
private final Map<String, DvObject> affectedDataverses;
private final DataverseRequest request;

Expand Down Expand Up @@ -83,9 +84,9 @@ protected User getUser() {
}

@Override
public String describe(Map<String, DvObject> dvObjMap) {
public String describe() {
StringBuilder sb = new StringBuilder();
for (Map.Entry<String, DvObject> ent : dvObjMap.entrySet()) {
for (Map.Entry<String, DvObject> ent : affectedDataverses.entrySet()) {
DvObject value = ent.getValue();
sb.append(ent.getKey()).append(":");
sb.append((value != null) ? value.accept(DvObject.NameIdPrinter) : "<null>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ public interface Command<R> {
*/
Map<String,Set<Permission>> getRequiredPermissions();

public String describe(Map<String, DvObject> dvObjMap);
public String describe();
}

0 comments on commit 023cb8f

Please sign in to comment.