Cleanup launcher classes

Cleanup a bunch of the code in launcher classes
- Migrate the majority of the reflection to ReflectionUtils
- Decrease logic in AbstractLauncher
- Add logging to launcher classes at FINE level
- make mcParams in AbstractLauncher an immutable list to prevent runtime manipulation
  - StandardLauncher instead copies the list to modify it

Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
This commit is contained in:
solonovamax
2022-11-01 12:27:04 -04:00
committed by TheKodeToad
parent 9b8096c699
commit dabb84f62a
8 changed files with 248 additions and 114 deletions

View File

@ -54,10 +54,28 @@
package org.prismlauncher.exception;
@SuppressWarnings("serial")
public final class ParameterNotFoundException extends IllegalArgumentException {
public ParameterNotFoundException(String key) {
super("Unknown parameter name: " + key);
public ParameterNotFoundException(String message, Throwable cause) {
super(message, cause);
}
public ParameterNotFoundException(Throwable cause) {
super(cause);
}
public ParameterNotFoundException(String message) {
super(message);
}
public ParameterNotFoundException() {
super();
}
public static ParameterNotFoundException forParameterName(String parameterName) {
return new ParameterNotFoundException(String.format("Unknown parameter name '%s'", parameterName));
}
}

View File

@ -54,10 +54,31 @@
package org.prismlauncher.exception;
@SuppressWarnings({ "serial", "unused" })
public final class ParseException extends IllegalArgumentException {
public ParseException(String message) {
super(message);
}
public ParseException(String message, Throwable cause) {
super(message, cause);
}
public ParseException(Throwable cause) {
super(cause);
}
public ParseException() {
super();
}
public static ParseException forInputString(String inputString) {
return new ParseException(String.format("Could not parse input string '%s'", inputString));
}
public static ParseException forInputString(String inputString, Throwable cause) {
return new ParseException(String.format("Could not parse input string '%s'", inputString), cause);
}
}