Skip to content

Commit

Permalink
Merge pull request #737 from ftence/nodiamond
Browse files Browse the repository at this point in the history
Replace diamond operator with explicit declaration
  • Loading branch information
hbs authored Apr 17, 2020
2 parents 2376128 + 40ae783 commit 0e49752
Show file tree
Hide file tree
Showing 22 changed files with 57 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public QuasarTokenFilter(Properties props, KeyStore keystore) {

public ReadToken getReadToken(String cryptedToken) throws QuasarTokenException { // Decode the token hex string to byte array
long now = System.nanoTime();
Map<String,String> labels = new HashMap<>();
Map<String,String> labels = new HashMap<String,String>();
try {
labels.put("type", "READ");
// Check if the filter is correctly initialized
Expand Down Expand Up @@ -121,7 +121,7 @@ public boolean available() {

public WriteToken getWriteToken(String cryptedToken) throws QuasarTokenException {
long now = System.nanoTime();
Map<String,String> labels = new HashMap<>();
Map<String,String> labels = new HashMap<String,String>();
try {
labels.put("type", "WRITE");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class QuasarTokenRevocationListLoader {
private static long appIdSipHashKeyK0 = 0L;
private static long appIdSipHashKeyK1 = 0L;

private List<QuasarTRLLoadedHandler> quasarTRLLoadedHandler = new ArrayList<>();
private List<QuasarTRLLoadedHandler> quasarTRLLoadedHandler = new ArrayList<QuasarTRLLoadedHandler>();

private String trlPattern = "^([a-zA-Z0-9_-]*)\\.(read|write|full)\\.([0-9]*)-([a-f0-9]{32})\\.trl$";

Expand Down
2 changes: 1 addition & 1 deletion warp10/src/main/java/io/warp10/ThrowableUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static String getErrorMessage(Throwable t, int maxSize) {
String simpleClassName = t.getClass().getSimpleName();

// Maintain a list of Throwable causes to avoid the unlikely case of a cycle in causes.
final ArrayList<Throwable> throwables = new ArrayList<>();
final ArrayList<Throwable> throwables = new ArrayList<Throwable>();

List<String> messages = new ArrayList<String>();

Expand Down
2 changes: 1 addition & 1 deletion warp10/src/main/java/io/warp10/WarpConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static void setProperties(String[] files) throws IOException {
// If a file starts with '@', treat it as a file containing lists of files
//

List<String> filenames = new ArrayList<>(Arrays.asList(files));
List<String> filenames = new ArrayList<String>(Arrays.asList(files));

StringBuilder sb = new StringBuilder();

Expand Down
2 changes: 1 addition & 1 deletion warp10/src/main/java/io/warp10/continuum/Tokens.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class Tokens {

private static QuasarTokenFilter tokenFilter;

private static List<AuthenticationPlugin> plugins = new ArrayList<>();
private static List<AuthenticationPlugin> plugins = new ArrayList<AuthenticationPlugin>();

private static final List<String> blockedAttributes;

Expand Down
2 changes: 1 addition & 1 deletion warp10/src/main/java/io/warp10/continuum/store/Store.java
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ public Object call() throws Exception {

Metadata meta = msg.getMetadata();
if (null != meta) {
Map<String, String> labels = new HashMap<>();
Map<String, String> labels = new HashMap<String, String>();
labels.put(SensisionConstants.SENSISION_LABEL_OWNER, meta.getLabels().get(Constants.OWNER_LABEL));
labels.put(SensisionConstants.SENSISION_LABEL_APPLICATION, meta.getLabels().get(Constants.APPLICATION_LABEL));
Sensision.update(SensisionConstants.SENSISION_CLASS_CONTINUUM_STORE_HBASE_DELETE_DATAPOINTS_PEROWNERAPP, labels, noOfDeletedVersions);
Expand Down
4 changes: 2 additions & 2 deletions warp10/src/main/java/io/warp10/hadoop/Warp10InputFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public List<InputSplit> getSplits(JobContext context) throws IOException {
}
}

List<String> fallbacks = new ArrayList<>();
List<String> fallbacks = new ArrayList<String>();

boolean fallbacksonly = "true".equals(getProperty(context, PROPERTY_WARP10_FETCHER_FALLBACKSONLY));

Expand Down Expand Up @@ -300,7 +300,7 @@ public List<InputSplit> getSplits(JobContext context) throws IOException {
}
}

List<InputSplit> splits = new ArrayList<>();
List<InputSplit> splits = new ArrayList<InputSplit>();

br = new BufferedReader(new FileReader(outfile));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public void init(Properties properties) {
maxthreads = Integer.parseInt(properties.getProperty(CONF_HTTP_MAXTHREADS, String.valueOf(maxthreads)));

if (properties.containsKey(CONF_HTTP_QUEUESIZE)) {
queue = new BlockingArrayQueue<>(Integer.parseInt(properties.getProperty(CONF_HTTP_QUEUESIZE)));
queue = new BlockingArrayQueue<Runnable>(Integer.parseInt(properties.getProperty(CONF_HTTP_QUEUESIZE)));
}

gzip = !"false".equals(properties.getProperty(CONF_HTTP_GZIP));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static Map<String, Object> generateInfo(FormattedWarpScriptFunction funct
List<String> tags, List<String> related, List<String> examples, List<String> conf,
List<ArgumentSpecification> outputs) {

LinkedHashMap<String, Object> info = new LinkedHashMap<>();
LinkedHashMap<String, Object> info = new LinkedHashMap<String, Object>();

info.put("name", function.getName());
info.put("since", since);
Expand All @@ -60,8 +60,8 @@ public static Map<String, Object> generateInfo(FormattedWarpScriptFunction funct
// Signature generation
//

List<List<List<Object>>> sig = new ArrayList<>();
List<Object> output = new ArrayList<>();
List<List<List<Object>>> sig = new ArrayList<List<List<Object>>>();
List<Object> output = new ArrayList<Object>();
for (ArgumentSpecification arg: Lists.reverse(outputs)) {
output.add(arg.getName() + ":" + arg.WarpScriptType());
}
Expand All @@ -70,11 +70,11 @@ public static Map<String, Object> generateInfo(FormattedWarpScriptFunction funct
// Sig without opt args on the stack
//

List<List<Object>> sig1 = new ArrayList<>();
List<Object> input1 = new ArrayList<>();
List<List<Object>> sig1 = new ArrayList<List<Object>>();
List<Object> input1 = new ArrayList<Object>();

if (0 == args.size() && 0 != optArgs.size()) {
input1.add(new LinkedHashMap<>());
input1.add(new LinkedHashMap<String, String>());
}

for (ArgumentSpecification arg: Lists.reverse(args)) {
Expand All @@ -89,9 +89,9 @@ public static Map<String, Object> generateInfo(FormattedWarpScriptFunction funct
// Sig with opt args on the stack (in a map)
//

List<List<Object>> sig2 = new ArrayList<>();
List<Object> input2 = new ArrayList<>();
LinkedHashMap<String, String> optMap = new LinkedHashMap<>();
List<List<Object>> sig2 = new ArrayList<List<Object>>();
List<Object> input2 = new ArrayList<Object>();
LinkedHashMap<String, String> optMap = new LinkedHashMap<String, String>();

for (ArgumentSpecification arg: Lists.reverse(optArgs)) {
optMap.put(arg.getName(), arg.getName() + ":" + arg.WarpScriptType());
Expand All @@ -112,7 +112,7 @@ public static Map<String, Object> generateInfo(FormattedWarpScriptFunction funct
// Params generation
//

LinkedHashMap<String, String> params = new LinkedHashMap<>();
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
for (ArgumentSpecification arg: Lists.reverse(optArgs)) {
params.put(arg.getName(), arg.getDoc());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ private Arguments(List<ArgumentSpecification> args, List<ArgumentSpecification>
}

public List<ArgumentSpecification> getArgsCopy() {
return new ArrayList<>(args);
return new ArrayList<ArgumentSpecification>(args);
}

public List<ArgumentSpecification> getOptArgsCopy() {
return new ArrayList<>(optArgs);
return new ArrayList<ArgumentSpecification>(optArgs);
}

public boolean isListExpandable() {
Expand All @@ -86,8 +86,8 @@ public static class ArgumentsBuilder {
private boolean listExpandable;

public ArgumentsBuilder() {
args = new ArrayList<>();
optArgs = new ArrayList<>();
args = new ArrayList<ArgumentSpecification>();
optArgs = new ArrayList<ArgumentSpecification>();
listExpandable = false;
}

Expand Down Expand Up @@ -377,7 +377,7 @@ final public Object apply(WarpScriptStack stack) throws WarpScriptException {
// Check List and Map arguments sub types
//

List<ArgumentSpecification> both = new ArrayList<>();
List<ArgumentSpecification> both = new ArrayList<ArgumentSpecification>();
both.addAll(args);
both.addAll(optArgs);

Expand Down Expand Up @@ -453,7 +453,7 @@ final public Object apply(WarpScriptStack stack) throws WarpScriptException {

stack.push(args.size() - 1);
Object[] cache = stack.popn();
List<Object> arr = new ArrayList<>();
List<Object> arr = new ArrayList<Object>();
arr.add(stack.pop());
stack.push(arr);
for (Object o: cache) {
Expand Down Expand Up @@ -581,7 +581,7 @@ final public Object apply(WarpScriptStack stack) throws WarpScriptException {
} else {

// first arg list is empty so result is empty
stack.push(new ArrayList<>());
stack.push(new ArrayList<Object>());
return stack;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class RunAndGenerateDocumentationWithUnitTests {
}

private static String VERSION = "all";
private static List<String> TAGS = new ArrayList<>();
private static List<String> TAGS = new ArrayList<String>();
static {
//
// Tags that are common to all functions for which the documentation is being written, for example:
Expand All @@ -67,11 +67,11 @@ public class RunAndGenerateDocumentationWithUnitTests {
//TAGS.add("tensors");
}
private static boolean MAKE_FUNCTIONS_RELATED_WITHIN_SAME_PACKAGE = true;
private static List<String> RELATED = new ArrayList<>();
private static List<String> RELATED = new ArrayList<String>();
private static String SINCE = "2.1";
private static String DEPRECATED = "";
private static String DELETED = "";
private static List<String> CONF = new ArrayList<>();
private static List<String> CONF = new ArrayList<String>();

//
// outputs, examples, tags and related are retrieved in each instance of FormattedWarpScriptFunction if they were set
Expand Down Expand Up @@ -127,7 +127,7 @@ final protected void generate(List<String> functionNames) throws Exception {
System.out.println("Generate and assert doc for " + function.getClass().getName());

// outputs
List<ArgumentSpecification> output = new ArrayList<>();
List<ArgumentSpecification> output = new ArrayList<ArgumentSpecification>();
Method m = searchMethod(function, "getOutput");
if (null != m) {
m.setAccessible(true);
Expand All @@ -141,7 +141,7 @@ final protected void generate(List<String> functionNames) throws Exception {
}

// examples
List<String> examples = new ArrayList<>();
List<String> examples = new ArrayList<String>();
m = searchMethod(function, "getExamples");
if (null != m) {
m.setAccessible(true);
Expand All @@ -152,7 +152,7 @@ final protected void generate(List<String> functionNames) throws Exception {
}

// tags
List<String> tags = new ArrayList<>(TAGS());
List<String> tags = new ArrayList<String>(TAGS());
m = searchMethod(function, "getTags");
if (null != m) {
m.setAccessible(true);
Expand Down Expand Up @@ -242,7 +242,7 @@ final protected void generate(List<String> functionNames) throws Exception {
public static List<String> getRelatedClasses(ClassLoader cl, String pack) throws Exception {

String dottedPackage = pack.replaceAll("[/]", ".");
List<String> classNames = new ArrayList<>();
List<String> classNames = new ArrayList<String>();
pack = pack.replaceAll("[.]", "/");
URL upackage = cl.getResource(pack);

Expand Down
2 changes: 1 addition & 1 deletion warp10/src/main/java/io/warp10/script/functions/SET.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public Object apply(WarpScriptStack stack) throws WarpScriptException {
}
}

List<Long> copyIndices = new ArrayList<>((List<Long>) key);
List<Long> copyIndices = new ArrayList<Long>((List<Long>) key);
int lastIdx = copyIndices.remove(copyIndices.size() - 1).intValue();
Object container;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private List<Long> recHullShape(List list) {
List<Long> res = new ArrayList<Long>();
res.add((long) list.size());

List<Long> hull = new ArrayList<>();
List<Long> hull = new ArrayList<Long>();
for (Object el: list) {
if (el instanceof List) {
hull = maximizeHull(hull, recHullShape((List) el));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private void recPermute(List<Object> tensor, List<Object> result, List<Long> ind

} else {

List<Object> nested = new ArrayList<>();
List<Object> nested = new ArrayList<Object>();
result.add(nested);
recPermute(tensor, nested, new_indices, dimension + 1, pattern, newShape);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
gts++;

// Log detailed metrics for this GTS owner and app
Map<String, String> labels = new HashMap<>();
Map<String, String> labels = new HashMap<String, String>();
labels.put(SensisionConstants.SENSISION_LABEL_OWNER, metadata.getLabels().get(Constants.OWNER_LABEL));
labels.put(SensisionConstants.SENSISION_LABEL_APPLICATION, metadata.getLabels().get(Constants.APPLICATION_LABEL));
Sensision.update(SensisionConstants.SENSISION_CLASS_CONTINUUM_STANDALONE_DELETE_DATAPOINTS_PEROWNERAPP, labels, localCount);
Expand Down
2 changes: 1 addition & 1 deletion warp10/src/main/java/io/warp10/worf/Worf.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public static Properties readConfig(String file, PrintWriter out) throws WorfExc

Pattern VAR = Pattern.compile(".*\\$\\{([^}]+)\\}.*");

Set<String> emptyProperties = new HashSet<>();
Set<String> emptyProperties = new HashSet<String>();

for (Map.Entry<Object, Object> entry : properties.entrySet()) {
String name = entry.getKey().toString();
Expand Down
6 changes: 3 additions & 3 deletions warp10/src/main/java/io/warp10/worf/WorfCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public int execute(String[] args) {

// extract uuid with the pattern owner{owner1,owner2}
if (matcher.matches()) {
authorizedProducersUID = new ArrayList<>();
authorizedProducersUID = new ArrayList<String>();
String[] uuids = matcher.group(2).split(",");

// adds uuid to the list, fail otherwise
Expand Down Expand Up @@ -227,7 +227,7 @@ public int execute(String[] args) {

// extract uuid with the pattern owner{owner1,owner2}
if (matcher.matches()) {
authorizedOwnersUID = new ArrayList<>();
authorizedOwnersUID = new ArrayList<String>();
String[] uuids = matcher.group(2).split(",");

// adds uuid to the list, fail otherwise
Expand Down Expand Up @@ -260,7 +260,7 @@ public int execute(String[] args) {

// extract app names of pattern app{app,app1,app2}
if (matcher.matches()) {
authorizedApplications = new ArrayList<>();
authorizedApplications = new ArrayList<String>();
String[] apps = matcher.group(2).split(",");

// adds uuid to the list, fail otherwise
Expand Down
2 changes: 1 addition & 1 deletion warp10/src/main/java/io/warp10/worf/WorfInteractive.java
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ private List<String> getUUIDs(String line, PrintWriter out, boolean optional, St
try {
if (Strings.isNullOrEmpty(line) && Strings.isNullOrEmpty(uuidDefault)) {
if (optional) {
return new ArrayList<>();
return new ArrayList<String>();
}
return null;
}
Expand Down
8 changes: 4 additions & 4 deletions warp10/src/main/java/io/warp10/worf/WorfTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public WorfTemplate(Properties config, String templateFilePath) throws WorfExcep
}

public List<String> getCryptoKeys() throws WorfException {
List<String> keys = new ArrayList<>();
List<String> keys = new ArrayList<String>();

for (Map.Entry<Object,Object> configEntry : config.entrySet()) {
String key = (String) configEntry.getKey();
Expand Down Expand Up @@ -86,7 +86,7 @@ public List<String> getCryptoKeys() throws WorfException {
}

public List<String> getTokenKeys() throws WorfException {
List<String> keys = new ArrayList<>();
List<String> keys = new ArrayList<String>();
for (Map.Entry<Object,Object> configEntry : config.entrySet()) {
String key = (String) configEntry.getKey();
String value = (String) configEntry.getValue();
Expand All @@ -113,7 +113,7 @@ public List<String> getTokenKeys() throws WorfException {
}

public Stack<Pair<String, String[]>> getFieldsStack() throws WorfException {
Stack<Pair<String, String[]>> stack = new Stack<>();
Stack<Pair<String, String[]>> stack = new Stack<Pair<String, String[]>>();

for (Map.Entry<Object,Object> configEntry : config.entrySet()) {
String key = (String) configEntry.getKey();
Expand All @@ -132,7 +132,7 @@ public Stack<Pair<String, String[]>> getFieldsStack() throws WorfException {
if (templateValues.length != 3) {
throw new WorfException("Read template error key=" + key + " t=" + value);
}
stack.push(new Pair<>(value, templateValues));
stack.push(new Pair<String, String[]>(value, templateValues));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public void testExpandedFirstArg() throws Exception {
public void testDocGeneration() throws Exception {
MemoryWarpScriptStack stack = new MemoryWarpScriptStack(null, null);

List<ArgumentSpecification> output = new ArrayList<>();
List<ArgumentSpecification> output = new ArrayList<ArgumentSpecification>();
output.add(new ArgumentSpecification(Map.class, "result", "A map containing the input arguments."));

stack.execMulti(generateWarpScriptDoc(this, output));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected boolean OVERWRITE() {
}

protected List<String> TAGS() {
List<String> tags = new ArrayList<>();
List<String> tags = new ArrayList<String>();
//tags.add("some tag");
return tags;
}
Expand Down
Loading

0 comments on commit 0e49752

Please sign in to comment.