aboutsummaryrefslogtreecommitdiff
path: root/libraries/launcher/org/prismlauncher/EntryPoint.java
diff options
context:
space:
mode:
authorTheKodeToad <TheKodeToad@proton.me>2022-11-03 17:30:13 +0000
committerTheKodeToad <TheKodeToad@proton.me>2022-11-08 16:36:33 +0000
commit5b9bfe8891f007a9dcec1a4754df6bc62e0396eb (patch)
tree55025556bd049d0bd8a68b2e0163ddb75971c808 /libraries/launcher/org/prismlauncher/EntryPoint.java
parent779bc2c63df131fce0d230401a5a891eb2eb8794 (diff)
downloadPrismLauncher-5b9bfe8891f007a9dcec1a4754df6bc62e0396eb.tar.gz
PrismLauncher-5b9bfe8891f007a9dcec1a4754df6bc62e0396eb.tar.bz2
PrismLauncher-5b9bfe8891f007a9dcec1a4754df6bc62e0396eb.zip
Attempt to mimic clang-format
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
Diffstat (limited to 'libraries/launcher/org/prismlauncher/EntryPoint.java')
-rw-r--r--libraries/launcher/org/prismlauncher/EntryPoint.java35
1 files changed, 14 insertions, 21 deletions
diff --git a/libraries/launcher/org/prismlauncher/EntryPoint.java b/libraries/launcher/org/prismlauncher/EntryPoint.java
index be180d6a..88d5d8be 100644
--- a/libraries/launcher/org/prismlauncher/EntryPoint.java
+++ b/libraries/launcher/org/prismlauncher/EntryPoint.java
@@ -71,25 +71,25 @@ import java.util.logging.Logger;
public final class EntryPoint {
private static final Logger LOGGER = Logger.getLogger("EntryPoint");
- private EntryPoint() {
- }
+ private EntryPoint() {}
- public static void main(String[] args) {
+ public static void main(String[] args)
+ {
ExitCode exitCode = listen();
if (exitCode != ExitCode.NORMAL) {
LOGGER.warning("Exiting with " + exitCode);
- //noinspection CallToSystemExit
+ // noinspection CallToSystemExit
System.exit(exitCode.numericalCode);
}
}
- private static PreLaunchAction parseLine(String input, Parameters params) throws ParseException {
+ private static PreLaunchAction parseLine(String input, Parameters params) throws ParseException
+ {
if (input.isEmpty()) // TODO: 2022-11-01 Should we just ignore this?
throw new ParseException("Unexpected empty string! You should not pass empty newlines to stdin.");
-
if ("launch".equalsIgnoreCase(input))
return PreLaunchAction.LAUNCH;
else if ("abort".equalsIgnoreCase(input))
@@ -98,8 +98,8 @@ public final class EntryPoint {
String[] pair = StringUtils.splitStringPair(' ', input);
if (pair == null)
throw new ParseException(String.format(
- "Could not split input string '%s' by space. All input provided from stdin must be either 'launch', 'abort', or " +
- "in the format '[param name] [param]'.",
+ "Could not split input string '%s' by space. All input provided from stdin must be either 'launch', 'abort', or "
+ + "in the format '[param name] [param]'.",
input));
params.add(pair[0], pair[1]);
@@ -108,7 +108,8 @@ public final class EntryPoint {
}
}
- private static ExitCode listen() {
+ private static ExitCode listen()
+ {
Parameters parameters = new Parameters();
PreLaunchAction preLaunchAction = PreLaunchAction.PROCEED;
@@ -116,7 +117,7 @@ public final class EntryPoint {
String line;
while (preLaunchAction == PreLaunchAction.PROCEED) {
- //noinspection NestedAssignment
+ // noinspection NestedAssignment
if ((line = reader.readLine()) != null)
preLaunchAction = parseLine(line, parameters);
else
@@ -157,23 +158,15 @@ public final class EntryPoint {
}
private enum PreLaunchAction {
- PROCEED,
- LAUNCH,
- ABORT
+ PROCEED, LAUNCH, ABORT
}
private enum ExitCode {
- NORMAL(0),
- ABORT(1),
- ERROR(2),
- ILLEGAL_ARGUMENT(3),
- REFLECTION_EXCEPTION(4);
+ NORMAL(0), ABORT(1), ERROR(2), ILLEGAL_ARGUMENT(3), REFLECTION_EXCEPTION(4);
private final int numericalCode;
- ExitCode(int numericalCode) {
- this.numericalCode = numericalCode;
- }
+ ExitCode(int numericalCode) { this.numericalCode = numericalCode; }
}
}