More standard code formatting profile

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad
2022-11-03 18:39:34 +00:00
parent 5912ef3b45
commit 4abf3a20c6
10 changed files with 75 additions and 76 deletions

View File

@ -68,8 +68,7 @@ public final class Parameters {
private final Map<String, List<String>> map = new HashMap<>();
public void add(String key, String value)
{
public void add(String key, String value) {
List<String> params = map.get(key);
if (params == null) {
@ -81,8 +80,7 @@ public final class Parameters {
params.add(value);
}
public List<String> getList(String key) throws ParameterNotFoundException
{
public List<String> getList(String key) throws ParameterNotFoundException {
List<String> params = map.get(key);
if (params == null)
@ -91,8 +89,7 @@ public final class Parameters {
return params;
}
public List<String> getList(String key, List<String> def)
{
public List<String> getList(String key, List<String> def) {
List<String> params = map.get(key);
if (params == null || params.isEmpty())
@ -101,8 +98,7 @@ public final class Parameters {
return params;
}
public String getString(String key) throws ParameterNotFoundException
{
public String getString(String key) throws ParameterNotFoundException {
List<String> list = getList(key);
if (list.isEmpty())
@ -111,8 +107,7 @@ public final class Parameters {
return list.get(0);
}
public String getString(String key, String def)
{
public String getString(String key, String def) {
List<String> params = map.get(key);
if (params == null || params.isEmpty())

View File

@ -52,7 +52,8 @@ public final class ReflectionUtils {
private static final Logger LOGGER = Logger.getLogger("ReflectionUtils");
private ReflectionUtils() {}
private ReflectionUtils() {
}
/**
* Instantiate an applet class by name
@ -67,8 +68,7 @@ public final class ReflectionUtils {
* method handles
* @throws Throwable any exceptions from the class's constructor
*/
public static Applet createAppletClass(String appletClassName) throws Throwable
{
public static Applet createAppletClass(String appletClassName) throws Throwable {
Class<?> appletClass = ClassLoader.getSystemClassLoader().loadClass(appletClassName);
MethodHandle appletConstructor = MethodHandles.lookup().findConstructor(appletClass,
@ -83,8 +83,7 @@ public final class ReflectionUtils {
*
* @return The found field.
*/
public static Field getMinecraftGameDirField(Class<?> minecraftMainClass)
{
public static Field getMinecraftGameDirField(Class<?> minecraftMainClass) {
LOGGER.fine("Resolving minecraft game directory field");
// Field we're looking for is always
// private static File obfuscatedName = null;
@ -141,8 +140,7 @@ public final class ReflectionUtils {
* @throws IllegalAccessException If method handles cannot access the entrypoint
*/
public static MethodHandle findMainEntrypoint(Class<?> entrypointClass)
throws NoSuchMethodException, IllegalAccessException
{
throws NoSuchMethodException, IllegalAccessException {
return MethodHandles.lookup().findStatic(entrypointClass, "main",
MethodType.methodType(void.class, String[].class));
}
@ -168,7 +166,8 @@ public final class ReflectionUtils {
* @throws IllegalAccessException If method handles cannot access the entrypoint
*/
public static MethodHandle findMainMethod(String entrypointClassName)
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException
{ return findMainEntrypoint(ClassLoader.getSystemClassLoader().loadClass(entrypointClassName)); }
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException {
return findMainEntrypoint(ClassLoader.getSystemClassLoader().loadClass(entrypointClassName));
}
}

View File

@ -38,10 +38,10 @@ package org.prismlauncher.utils;
public final class StringUtils {
private StringUtils() {}
private StringUtils() {
}
public static String[] splitStringPair(char splitChar, String input)
{
public static String[] splitStringPair(char splitChar, String input) {
int splitPoint = input.indexOf(splitChar);
if (splitPoint == -1)
return null;