Skip to content

Commit

Permalink
Satisfied java format
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel1464 committed Dec 9, 2024
1 parent 21e018c commit 95135ec
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,21 @@ default String logPath(String logUnder) {
return Parser.logPathMap.getOrDefault(this, Parser.DEFAULT_NAMESPACE) + "/" + logUnder;
}

class Parser {
@SuppressWarnings("PMD.AvoidAccessibilityAlteration")
final class Parser {
private static final Map<Object, String> logPathMap = new WeakHashMap<>();
private static final String DEFAULT_NAMESPACE = "UNKNOWN";
private static boolean enabled = false;
private static boolean enabled;

/**
* Enables log path parsing. This must be called in your robot class to use this interface.
*
* @param robotInstance The TimedRobot instance
*/
public static void enable(Object robotInstance) {
if (enabled) return;
if (enabled) {
return;
}
enabled = true;
recurseLogPaths(robotInstance, "");
}
Expand All @@ -54,8 +57,9 @@ private static void recurseLogPaths(Object obj, String currentPath) {
recurseLogPaths(field.get(obj), currentPath + "/" + computeLogName(field));
} else {
var arraySubtype = field.getType().getComponentType();
if (arraySubtype == null || !InferLogPath.class.isAssignableFrom(arraySubtype))
if (arraySubtype == null || !InferLogPath.class.isAssignableFrom(arraySubtype)) {
continue;
}
field.setAccessible(true);
int index = 0;
var name = computeLogName(field);
Expand Down

0 comments on commit 95135ec

Please sign in to comment.