Skip to content

Commit 2c44fcf

Browse files
committed
Remove use of tabs in source code (#14)
1 parent 6465976 commit 2c44fcf

File tree

18 files changed

+216
-220
lines changed

18 files changed

+216
-220
lines changed

olcut-config-edn/src/test/java/com/oracle/labs/mlrg/olcut/config/edn/SerializeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void setUp() throws IOException {
7272
@AfterEach
7373
public void tearDown() throws IOException {
7474
try {
75-
Files.delete(serPath);
75+
Files.delete(serPath);
7676
}catch(Exception e) {}
7777
}
7878

olcut-config-json/src/test/java/com/oracle/labs/mlrg/olcut/config/json/SerializeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void setUp() throws IOException {
7272
@AfterEach
7373
public void tearDown() throws IOException {
7474
try {
75-
Files.delete(serPath);
75+
Files.delete(serPath);
7676
}catch(Exception e) {}
7777
}
7878

olcut-core/src/main/java/com/oracle/labs/mlrg/olcut/command/CommandInterface.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public interface CommandInterface {
4242
/**
4343
* Execute the given command.
4444
*
45-
* @param ci the command interpreter that invoked this command.
46-
* @param args command line arguments (just like main).
47-
* @return a command result
45+
* @param ci the command interpreter that invoked this command.
46+
* @param args command line arguments (just like main).
47+
* @return a command result
4848
* @throws Exception Can throw an exception.
4949
*/
5050
public String execute(CommandInterpreter ci, String[] args) throws Exception;

olcut-core/src/main/java/com/oracle/labs/mlrg/olcut/command/CommandInterpreter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ public void add(String commandName, String groupName, CommandInterface command)
322322
/**
323323
* Adds the given command to the command list.
324324
*
325-
* @param name the name of the command.
326-
* @param command the command to be executed.
325+
* @param name the name of the command.
326+
* @param command the command to be executed.
327327
*
328328
*/
329329
public void add(String name, CommandInterface command) {
@@ -667,8 +667,8 @@ private String invokeMethod(Method m,
667667
/**
668668
* Adds an alias to the command
669669
*
670-
* @param command the name of the command.
671-
* @param alias the new alias
670+
* @param command the name of the command.
671+
* @param alias the new alias
672672
*
673673
*/
674674
public void addAlias(String command, String alias) {
@@ -763,7 +763,7 @@ protected void onExit() {
763763
/**
764764
* Execute the given command.
765765
*
766-
* @param args command args, args[0] contains name of cmd.
766+
* @param args command args, args[0] contains name of cmd.
767767
* @return The output produced by the command.
768768
*/
769769
public String execute(String[] args) {
@@ -773,7 +773,7 @@ public String execute(String[] args) {
773773
/**
774774
* Execute the given command.
775775
*
776-
* @param args command args, args[0] contains name of cmd.
776+
* @param args command args, args[0] contains name of cmd.
777777
* @return The output produced by the command.
778778
*/
779779
private String execute(String[] args, boolean first) {

olcut-core/src/main/java/com/oracle/labs/mlrg/olcut/config/ConfigurationManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public ConfigurationManager() throws PropertyException, ConfigLoaderException {
208208
* @throws ConfigLoaderException if an error occurs while loading configuration from the location
209209
*/
210210
public ConfigurationManager(String path) throws PropertyException, ConfigLoaderException {
211-
this(new String[]{"-"+configFileOption.charName(),path},EMPTY_OPTIONS);
211+
this(new String[]{"-"+configFileOption.charName(),path},EMPTY_OPTIONS);
212212
}
213213

214214

olcut-core/src/main/java/com/oracle/labs/mlrg/olcut/config/PropertySheet.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -820,13 +820,13 @@ public static List<Class<?>> getGenericClass(Field f) {
820820
if (genericType instanceof ParameterizedType) {
821821
ParameterizedType pt = (ParameterizedType) genericType;
822822
for (Type t : pt.getActualTypeArguments()) {
823-
//update the type to the raw type if appropriate
824-
if(t instanceof ParameterizedType) {
825-
t = ((ParameterizedType) t).getRawType();
823+
//update the type to the raw type if appropriate
824+
if(t instanceof ParameterizedType) {
825+
t = ((ParameterizedType) t).getRawType();
826826
}
827-
//not an else here. t has been updated if the previous
828-
//condition holds.
829-
if (t instanceof Class) {
827+
//not an else here. t has been updated if the previous
828+
//condition holds.
829+
if (t instanceof Class) {
830830
list.add((Class<?>)t);
831831
}
832832
}

olcut-core/src/main/java/com/oracle/labs/mlrg/olcut/provenance/ProvenanceUtil.java

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -806,47 +806,47 @@ private static Provenance unmarshalFlat(String hostProvName, FlatMarshalledProve
806806
}
807807
}
808808

809-
/**
810-
* This method can be used for custom implementations of the writeObject method
811-
* used for customized object serialization to facilitate the serialization of
812-
* member variables whose type is Provenancable. You should exercise extreme
813-
* caution when using this method as you are wandering into specialized usage of
814-
* java serialization which is problematic in its own right. Just because your
815-
* member satisfies the type of the first parameter does not mean it will
816-
* serialize and deserialize correctly now or in the future. Therefore, you are
817-
* advised to <b>avoid using this method</b> but if you do use it, then you
818-
* should extensively unit test code that depends on this method.
819-
*
820-
* @param provenancable The provenancable object to serialize.
821-
* @param outputStream The output stream to write to.
822-
* @throws IOException If the stream couldn't be written to.
823-
*/
824-
public static void writeObject(Provenancable<? extends ConfiguredObjectProvenance> provenancable, ObjectOutputStream outputStream) throws IOException {
825-
ObjectProvenance provenance = provenancable.getProvenance();
826-
outputStream.writeObject(provenance);
827-
}
828-
829-
/**
830-
* This method can be used for custom implementations of the readObject method
831-
* used for customized object serialization. Please see the javadoc note for
832-
* {@link #writeObject(Provenancable, ObjectOutputStream)} for why you should
833-
* take extra care when deliberating whether or not to use this method.
834-
*
835-
* @param inputStream The stream to read from.
836-
* @return The object reconstructed from it's provenance.
837-
* @throws ClassNotFoundException If the class isn't available.
838-
* @throws IOException If the stream couldn't be read.
839-
*/
840-
public static Provenancable<? extends ConfiguredObjectProvenance> readObject(ObjectInputStream inputStream) throws ClassNotFoundException, IOException {
841-
ConfiguredObjectProvenance provenance = (ConfiguredObjectProvenance) inputStream.readObject();
842-
List<ConfigurationData> configurationData = ProvenanceUtil.extractConfiguration(provenance);
843-
String componentName = configurationData.get(0).getName();
844-
ConfigurationManager cm = new ConfigurationManager();
845-
cm.addConfiguration(configurationData);
846-
@SuppressWarnings("unchecked")
847-
Provenancable<ConfiguredObjectProvenance> provenancable = (Provenancable<ConfiguredObjectProvenance>) cm.lookup(componentName);
848-
cm.close();
849-
return provenancable;
850-
}
809+
/**
810+
* This method can be used for custom implementations of the writeObject method
811+
* used for customized object serialization to facilitate the serialization of
812+
* member variables whose type is Provenancable. You should exercise extreme
813+
* caution when using this method as you are wandering into specialized usage of
814+
* java serialization which is problematic in its own right. Just because your
815+
* member satisfies the type of the first parameter does not mean it will
816+
* serialize and deserialize correctly now or in the future. Therefore, you are
817+
* advised to <b>avoid using this method</b> but if you do use it, then you
818+
* should extensively unit test code that depends on this method.
819+
*
820+
* @param provenancable The provenancable object to serialize.
821+
* @param outputStream The output stream to write to.
822+
* @throws IOException If the stream couldn't be written to.
823+
*/
824+
public static void writeObject(Provenancable<? extends ConfiguredObjectProvenance> provenancable, ObjectOutputStream outputStream) throws IOException {
825+
ObjectProvenance provenance = provenancable.getProvenance();
826+
outputStream.writeObject(provenance);
827+
}
828+
829+
/**
830+
* This method can be used for custom implementations of the readObject method
831+
* used for customized object serialization. Please see the javadoc note for
832+
* {@link #writeObject(Provenancable, ObjectOutputStream)} for why you should
833+
* take extra care when deliberating whether or not to use this method.
834+
*
835+
* @param inputStream The stream to read from.
836+
* @return The object reconstructed from it's provenance.
837+
* @throws ClassNotFoundException If the class isn't available.
838+
* @throws IOException If the stream couldn't be read.
839+
*/
840+
public static Provenancable<? extends ConfiguredObjectProvenance> readObject(ObjectInputStream inputStream) throws ClassNotFoundException, IOException {
841+
ConfiguredObjectProvenance provenance = (ConfiguredObjectProvenance) inputStream.readObject();
842+
List<ConfigurationData> configurationData = ProvenanceUtil.extractConfiguration(provenance);
843+
String componentName = configurationData.get(0).getName();
844+
ConfigurationManager cm = new ConfigurationManager();
845+
cm.addConfiguration(configurationData);
846+
@SuppressWarnings("unchecked")
847+
Provenancable<ConfiguredObjectProvenance> provenancable = (Provenancable<ConfiguredObjectProvenance>) cm.lookup(componentName);
848+
cm.close();
849+
return provenancable;
850+
}
851851

852852
}

olcut-core/src/main/java/com/oracle/labs/mlrg/olcut/util/CDateParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
*/
4747
public class CDateParser {
4848

49-
static long _32_bit_seconds = 0x7fffffffL * 1000L; // largest date that fits in 32 bits
49+
static long _32_bit_seconds = 0x7fffffffL * 1000L; // largest date that fits in 32 bits
5050

5151
LinkedList<DateFormat> dateFormats = new LinkedList<>();
5252

olcut-core/src/main/java/com/oracle/labs/mlrg/olcut/util/Getopt.java

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -37,96 +37,96 @@
3737
*/
3838
@Deprecated
3939
public final class Getopt {
40-
private static final Logger logger = Logger.getLogger(Getopt.class.getName());
41-
42-
private final String[] argList;// the argument List to be parsed
43-
private final String optStr; // the string of arguments in the form "ab:" see getopt man
44-
public String optArg; // argument of an option
45-
public int optInd = 0; // index of the option
46-
private int nbArgs = 0; // number of args in the argList
47-
private int optPos = 1; // position of option letter in current argument scanned
48-
49-
static final int EOF = -1; // returned when no option left
50-
51-
public Getopt(String[] args, String opts) {
52-
argList = args;
53-
nbArgs = argList.length;
54-
optStr = opts;
55-
optInd = 0;
56-
optPos = 1;
57-
optArg = null;
58-
}
59-
60-
private void optError(String msg, char optLetter) {
61-
logger.warning("Getopt: " + msg + " / " + optLetter);
62-
}
63-
64-
public int getopt() {
65-
optArg = null;
66-
67-
// checking boundaries cases
68-
if (argList == null || optStr == null) return EOF;
69-
if (optInd < 0 || optInd >= nbArgs) return EOF;
70-
71-
// get current Arg out of the argList
72-
String currentArg = argList[optInd];
73-
int argLength = currentArg.length();
74-
75-
// checking special cases
76-
// if arg starts with optLetter "a", "xyz"..
77-
// if arg only 1 char in length "a", "-"
78-
if (argLength <= 1 || currentArg.charAt(0) != '-') {
79-
return EOF;
80-
} else if (currentArg.equals("--")) { // end of options case
81-
optInd++;
82-
return EOF;
83-
}
84-
85-
// get next "letter" from option argument
86-
char optLetter = currentArg.charAt(optPos);
87-
88-
// find position of option in optStr
89-
int pos = optStr.indexOf(optLetter);
90-
if (pos == -1 || optLetter == ':') {
91-
optError("illegal option", optLetter);
92-
optLetter = '?';
93-
} else { // check if option requires argument
94-
if (pos < optStr.length() - 1 && optStr.charAt(pos + 1) == ':') {
95-
// if remain characters after the current option in currentArg
96-
if (optPos != argLength - 1) {
97-
// take rest of current arg as the option argument
98-
optArg = currentArg.substring(optPos + 1);
99-
optPos = argLength - 1; // go to next arg below in argList
100-
} else { // take next arg as optArg
101-
optInd++;
102-
if (optInd < nbArgs &&
103-
(argList[optInd].charAt(0) != '-' ||
104-
argList[optInd].length() >= 2 &&
105-
(optStr.indexOf(argList[optInd].charAt(1)) == -1 ||
106-
argList[optInd].charAt(1) == ':')
107-
)
108-
) {
109-
optArg = argList[optInd];
110-
} else {
111-
optError("option '" + optLetter + "' requires an argument", optLetter);
112-
optArg = null;
113-
optLetter = '?';
114-
}
115-
}
116-
}
117-
}
118-
119-
// next option argument,
120-
// either in currentArg or next arg in argList
121-
optPos++;
122-
123-
// if no more option in currentArg
124-
if (optPos >= argLength) {
125-
optInd++;
126-
optPos = 1; // reset position of opt letter
127-
}
128-
return optLetter;
129-
}
40+
private static final Logger logger = Logger.getLogger(Getopt.class.getName());
41+
42+
private final String[] argList;// the argument List to be parsed
43+
private final String optStr; // the string of arguments in the form "ab:" see getopt man
44+
public String optArg; // argument of an option
45+
public int optInd = 0; // index of the option
46+
private int nbArgs = 0; // number of args in the argList
47+
private int optPos = 1; // position of option letter in current argument scanned
48+
49+
static final int EOF = -1; // returned when no option left
50+
51+
public Getopt(String[] args, String opts) {
52+
argList = args;
53+
nbArgs = argList.length;
54+
optStr = opts;
55+
optInd = 0;
56+
optPos = 1;
57+
optArg = null;
58+
}
59+
60+
private void optError(String msg, char optLetter) {
61+
logger.warning("Getopt: " + msg + " / " + optLetter);
62+
}
63+
64+
public int getopt() {
65+
optArg = null;
66+
67+
// checking boundaries cases
68+
if (argList == null || optStr == null) return EOF;
69+
if (optInd < 0 || optInd >= nbArgs) return EOF;
70+
71+
// get current Arg out of the argList
72+
String currentArg = argList[optInd];
73+
int argLength = currentArg.length();
74+
75+
// checking special cases
76+
// if arg starts with optLetter "a", "xyz"..
77+
// if arg only 1 char in length "a", "-"
78+
if (argLength <= 1 || currentArg.charAt(0) != '-') {
79+
return EOF;
80+
} else if (currentArg.equals("--")) { // end of options case
81+
optInd++;
82+
return EOF;
83+
}
84+
85+
// get next "letter" from option argument
86+
char optLetter = currentArg.charAt(optPos);
87+
88+
// find position of option in optStr
89+
int pos = optStr.indexOf(optLetter);
90+
if (pos == -1 || optLetter == ':') {
91+
optError("illegal option", optLetter);
92+
optLetter = '?';
93+
} else { // check if option requires argument
94+
if (pos < optStr.length() - 1 && optStr.charAt(pos + 1) == ':') {
95+
// if remain characters after the current option in currentArg
96+
if (optPos != argLength - 1) {
97+
// take rest of current arg as the option argument
98+
optArg = currentArg.substring(optPos + 1);
99+
optPos = argLength - 1; // go to next arg below in argList
100+
} else { // take next arg as optArg
101+
optInd++;
102+
if (optInd < nbArgs &&
103+
(argList[optInd].charAt(0) != '-' ||
104+
argList[optInd].length() >= 2 &&
105+
(optStr.indexOf(argList[optInd].charAt(1)) == -1 ||
106+
argList[optInd].charAt(1) == ':')
107+
)
108+
) {
109+
optArg = argList[optInd];
110+
} else {
111+
optError("option '" + optLetter + "' requires an argument", optLetter);
112+
optArg = null;
113+
optLetter = '?';
114+
}
115+
}
116+
}
117+
}
118+
119+
// next option argument,
120+
// either in currentArg or next arg in argList
121+
optPos++;
122+
123+
// if no more option in currentArg
124+
if (optPos >= argLength) {
125+
optInd++;
126+
optPos = 1; // reset position of opt letter
127+
}
128+
return optLetter;
129+
}
130130

131131
}
132132

olcut-core/src/main/java/com/oracle/labs/mlrg/olcut/util/IOUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,6 @@ public static URI createClasspathURI(String resourcePath) throws URISyntaxExcept
698698
}
699699

700700
public static String replaceBackSlashes(String path) {
701-
return path.replaceAll("\\\\", "/");
701+
return path.replaceAll("\\\\", "/");
702702
}
703703
}

0 commit comments

Comments
 (0)