Skip to content

Commit

Permalink
Simplify constant Map
Browse files Browse the repository at this point in the history
This also avoids a Java complaint about missing a serial version uid
  • Loading branch information
aaudiber committed Feb 25, 2016
1 parent 54510bc commit ff6d254
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions shell/src/main/java/alluxio/shell/AlluxioShell.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import alluxio.util.CommonUtils;

import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.lang.ArrayUtils;
Expand All @@ -30,7 +31,6 @@
import java.io.IOException;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
Expand All @@ -43,15 +43,13 @@
@NotThreadSafe
public class AlluxioShell implements Closeable {
private static final Logger LOG = LoggerFactory.getLogger(Constants.LOGGER_TYPE);
private static final HashMap<String, String[]> CMD_ALIAS = new HashMap<String, String[]>() {
{
put("chgrpr", new String[] {"chgrp", "-R"});
put("chmodr", new String[] {"chmod", "-R"});
put("chownr", new String[] {"chown", "-R"});
put("lsr", new String[] {"ls", "-R"});
put("rmr", new String[] {"rm", "-R"});
}
};
private static final Map<String, String[]> CMD_ALIAS = ImmutableMap.<String, String[]> builder()
.put("chgrpr", new String[] {"chgrp", "-R"})
.put("chmodr", new String[] {"chmod", "-R"})
.put("chownr", new String[] {"chown", "-R"})
.put("lsr", new String[] {"ls", "-R"})
.put("rmr", new String[] {"rm", "-R"})
.build();

/**
* Main method, starts a new AlluxioShell.
Expand Down

0 comments on commit ff6d254

Please sign in to comment.