BATCH-2491: use LinkedHashSet instead of HashSet for command line options

Before this commit, options passed on the command line were collected
in a HashSet. This does not keep options order as they are passed in
the command line.

This commit changes the "opts" variable type to LinkedHashSet.
Note there is no test for this change as "opts" is a local variable to
the main method.

Resolves BATCH-2491
This commit is contained in:
Mahmoud Ben Hassine
2018-01-31 10:21:45 +01:00
committed by Michael Minella
parent 1ed5a33bd1
commit daf0ecfc9f

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2013 the original author or authors.
* Copyright 2006-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -158,6 +158,7 @@ import org.springframework.util.StringUtils;
*
* @author Dave Syer
* @author Lucas Ward
* @author Mahmoud Ben Hassine
* @since 1.0
*/
public class CommandLineJobRunner {
@@ -556,7 +557,7 @@ public class CommandLineJobRunner {
}
}
Set<String> opts = new HashSet<String>();
Set<String> opts = new LinkedHashSet<String>();
List<String> params = new ArrayList<String>();
int count = 0;