Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import edu.wpi.first.util.protobuf.ProtobufBuffer;
import edu.wpi.first.util.struct.Struct;
import edu.wpi.first.util.struct.StructBuffer;
import edu.wpi.first.util.struct.StructGenerator;
import edu.wpi.first.util.struct.StructSerializable;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.util.Color;
Expand Down Expand Up @@ -843,9 +844,9 @@ public <T extends StructSerializable> void put(String key, T[][] value) {
}
}

private Struct<?> findRecordStructType(Class<?> classObj) {
private Struct<?> findRecordStructType(Class<? extends Record> classObj) {
if (!structTypeCache.containsKey(classObj.getName())) {
structTypeCache.put(classObj.getName(), new RecordStruct(classObj));
structTypeCache.put(classObj.getName(), StructGenerator.genRecord(classObj));

// Warn about record logging when enabled
if (DriverStation.isEnabled()) {
Expand Down Expand Up @@ -888,7 +889,7 @@ public <R extends Record> void put(String key, R value) {
public <R extends Record> void put(String key, R... value) {
if (value == null) return;
// If struct is supported, write as struct
Struct<R> struct = (Struct<R>) findRecordStructType(value.getClass().getComponentType());
Struct<R> struct = (Struct<R>) findRecordStructType((Class<? extends Record>) value.getClass().getComponentType());
if (struct != null) {
put(key, struct, value);
}
Expand Down Expand Up @@ -1606,7 +1607,7 @@ public <R extends Record> R[] get(String key, R... defaultValue) {
String typeString = data.get(prefix + key).customTypeStr;
if (typeString.startsWith("struct:")) {
Struct<R> struct =
(Struct<R>) findRecordStructType(defaultValue.getClass().getComponentType());
(Struct<R>) findRecordStructType((Class<? extends Record>) defaultValue.getClass().getComponentType());
if (struct != null) {
return get(key, struct, defaultValue);
}
Expand Down
327 changes: 0 additions & 327 deletions akit/src/main/java/org/littletonrobotics/junction/RecordStruct.java

This file was deleted.