Make main static

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>

Inline local variable

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad 2022-10-30 15:27:24 +00:00
parent 35d200356f
commit 609b30110b

View File

@ -70,12 +70,8 @@ public final class EntryPoint {
private static final Logger LOGGER = Logger.getLogger("EntryPoint");
private final Parameters params = new Parameters();
public static void main(String[] args) {
EntryPoint listener = new EntryPoint();
ExitCode exitCode = listener.listen();
ExitCode exitCode = listen();
if (exitCode != ExitCode.NORMAL) {
LOGGER.warning("Exiting with " + exitCode);
@ -112,7 +108,8 @@ public final class EntryPoint {
}
}
public ExitCode listen() {
private static ExitCode listen() {
Parameters parameters = new Parameters();
PreLaunchAction preLaunchAction = PreLaunchAction.PROCEED;
try (BufferedReader reader = new BufferedReader(new InputStreamReader(
@ -123,7 +120,7 @@ public final class EntryPoint {
while (preLaunchAction == PreLaunchAction.PROCEED) {
if ((line = reader.readLine()) != null) {
preLaunchAction = parseLine(line, this.params);
preLaunchAction = parseLine(line, parameters);
} else {
preLaunchAction = PreLaunchAction.ABORT;
}
@ -142,7 +139,7 @@ public final class EntryPoint {
}
try {
Launcher launcher = LauncherFactory.createLauncher(params);
Launcher launcher = LauncherFactory.createLauncher(parameters);
launcher.launch();