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