Skip to content

Commit 56d70f8

Browse files
committed
Revert "Trying to adhere to java 14 rules"
This reverts commit 008af61.
1 parent 008af61 commit 56d70f8

File tree

2 files changed

+33
-21
lines changed

2 files changed

+33
-21
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
2-
* This package contains FileVisitors.
2+
* This package contains {@link FileVisitor}s.
33
*/
44
@javax.annotation.ParametersAreNonnullByDefault
55
package info.unterrainer.java.tools.scripting.bulkmakemkv.filevisitors;
6+

src/info/unterrainer/java/tools/scripting/bulkmakemkv/syscommandexecutor/SysCommandExecutor.java

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
***************************************************************************/
2020
package info.unterrainer.java.tools.scripting.bulkmakemkv.syscommandexecutor;
2121

22+
import info.unterrainer.java.tools.utils.NullUtils;
23+
2224
import java.io.File;
2325
import java.io.IOException;
2426
import java.io.InputStream;
@@ -28,13 +30,13 @@
2830

2931
import javax.annotation.Nullable;
3032

31-
import org.apache.commons.lang.StringUtils;
32-
33-
import info.unterrainer.java.tools.utils.NullUtils;
3433
import lombok.experimental.ExtensionMethod;
3534

35+
import org.apache.commons.lang.StringUtils;
36+
3637
/**
37-
* Usage of following class can go as ... <br>
38+
* Usage of following class can go as ...
39+
* <P>
3840
*
3941
* <PRE>
4042
* <CODE>
@@ -45,7 +47,9 @@
4547
* </CODE>
4648
* </PRE>
4749
*
48-
* OR <br>
50+
* </P>
51+
* OR
52+
* <P>
4953
*
5054
* <PRE>
5155
* <CODE>
@@ -56,6 +60,8 @@
5660
* String cmdOutput = cmdExecutor.getCommandOutput();
5761
* </CODE>
5862
* </PRE>
63+
*
64+
* </P>
5965
*/
6066

6167
@ExtensionMethod({ NullUtils.class })
@@ -78,44 +84,47 @@ public class SysCommandExecutor {
7884
@Nullable
7985
private AsyncStreamReader fCmdErrorThread;
8086

81-
public SysCommandExecutor(@Nullable final LogDevice fOuputLogDevice, @Nullable final LogDevice fErrorLogDevice) {
87+
public SysCommandExecutor(@Nullable LogDevice fOuputLogDevice, @Nullable LogDevice fErrorLogDevice) {
8288
super();
8389
this.fOuputLogDevice = fOuputLogDevice;
8490
this.fErrorLogDevice = fErrorLogDevice;
8591
}
8692

87-
public void setOutputLogDevice(final LogDevice logDevice) {
93+
public void setOutputLogDevice(LogDevice logDevice) {
8894
fOuputLogDevice = logDevice;
8995
}
9096

91-
public void setErrorLogDevice(final LogDevice logDevice) {
97+
public void setErrorLogDevice(LogDevice logDevice) {
9298
fErrorLogDevice = logDevice;
9399
}
94100

95-
public void setWorkingDirectory(final String workingDirectory) {
101+
public void setWorkingDirectory(String workingDirectory) {
96102
fWorkingDirectory = workingDirectory;
97103
}
98104

99-
public void setEnvironmentVar(final String name, final String value) {
100-
if (fEnvironmentVarList == null)
101-
fEnvironmentVarList = new ArrayList<>();
105+
public void setEnvironmentVar(String name, String value) {
106+
if (fEnvironmentVarList == null) {
107+
fEnvironmentVarList = new ArrayList<EnvironmentVar>();
108+
}
102109

103110
fEnvironmentVarList.noNull().add(new EnvironmentVar(name, value));
104111
}
105112

106113
public String getCommandOutput() {
107-
if (fCmdOutput == null)
114+
if (fCmdOutput == null) {
108115
return StringUtils.EMPTY;
116+
}
109117
return fCmdOutput.noNull().toString();
110118
}
111119

112120
public String getCommandError() {
113-
if (fCmdError == null)
121+
if (fCmdError == null) {
114122
return StringUtils.EMPTY;
123+
}
115124
return fCmdError.noNull().toString();
116125
}
117126

118-
public int runCommand(final String commandLine) throws Exception {
127+
public int runCommand(String commandLine) throws Exception {
119128
/* run command */
120129
Process process = runCommandHelper(commandLine);
121130

@@ -138,17 +147,18 @@ public int runCommand(final String commandLine) throws Exception {
138147
return exitStatus;
139148
}
140149

141-
private Process runCommandHelper(final String commandLine) throws IOException {
150+
private Process runCommandHelper(String commandLine) throws IOException {
142151
Process process = null;
143-
if (fWorkingDirectory == null)
152+
if (fWorkingDirectory == null) {
144153
process = Runtime.getRuntime().exec(commandLine, getEnvTokens());
145-
else
154+
} else {
146155
process = Runtime.getRuntime().exec(commandLine, getEnvTokens(), new File(fWorkingDirectory));
156+
}
147157

148158
return process;
149159
}
150160

151-
private void startOutputAndErrorReadThreads(final InputStream processOut, final InputStream processErr) {
161+
private void startOutputAndErrorReadThreads(InputStream processOut, InputStream processErr) {
152162
fCmdOutput = new StringBuffer();
153163
fCmdOutputThread = new AsyncStreamReader(processOut, fCmdOutput.noNull(), fOuputLogDevice, "OUTPUT");
154164
fCmdOutputThread.start();
@@ -165,8 +175,9 @@ private void notifyOutputAndErrorReadThreadsToStopReading() {
165175

166176
@Nullable
167177
private String[] getEnvTokens() {
168-
if (fEnvironmentVarList == null)
178+
if (fEnvironmentVarList == null) {
169179
return new String[0];
180+
}
170181

171182
String[] envTokenArray = new String[fEnvironmentVarList.noNull().size()];
172183
Iterator<EnvironmentVar> envVarIter = fEnvironmentVarList.noNull().iterator();

0 commit comments

Comments
 (0)