From a4572a01b7fa2f1a628b06f76cabbc0b589589c6 Mon Sep 17 00:00:00 2001 From: Jonah Snider Date: Tue, 29 Apr 2025 20:52:27 -0700 Subject: [PATCH] [wpiutil] Add nested struct schemas before parent schema (#7935) When adding struct schemas, the current logic is to add the parent/outer schema, and then add the schemas for any nested inner schemas. This reverses that order to make it easier for tools to process. Matches C++ logic. --- wpiutil/src/main/java/edu/wpi/first/util/datalog/DataLog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpiutil/src/main/java/edu/wpi/first/util/datalog/DataLog.java b/wpiutil/src/main/java/edu/wpi/first/util/datalog/DataLog.java index 4a89542cb7..0e72b98adf 100644 --- a/wpiutil/src/main/java/edu/wpi/first/util/datalog/DataLog.java +++ b/wpiutil/src/main/java/edu/wpi/first/util/datalog/DataLog.java @@ -451,10 +451,10 @@ public class DataLog implements AutoCloseable { if (!seen.add(typeString)) { throw new UnsupportedOperationException(typeString + ": circular reference with " + seen); } - addSchema(typeString, "structschema", struct.getSchema(), timestamp); for (Struct inner : struct.getNested()) { addSchemaImpl(inner, timestamp, seen); } + addSchema(typeString, "structschema", struct.getSchema(), timestamp); seen.remove(typeString); }