Java optimization and formatting fixes (#4857)

This commit is contained in:
Sriman Achanta
2022-12-26 14:37:53 -05:00
committed by GitHub
parent 92149efa11
commit 26bdbf3d41
13 changed files with 21 additions and 35 deletions

View File

@@ -118,8 +118,10 @@ public enum NetworkTableType {
} else if (data instanceof Float) {
return "float";
} else if (data instanceof Long) {
// Checking Long because NT supports 64-bit integers
return "int";
} else if (data instanceof Double || data instanceof Number) {
// If typeof Number class, return "double" as the type. Functions as a "catch-all".
return "double";
} else if (data instanceof String) {
return "string";
@@ -130,6 +132,7 @@ public enum NetworkTableType {
} else if (data instanceof long[] || data instanceof Long[]) {
return "int[]";
} else if (data instanceof double[] || data instanceof Double[] || data instanceof Number[]) {
// If typeof Number class, return "double[]" as the type. Functions as a "catch-all".
return "double[]";
} else if (data instanceof String[]) {
return "string[]";

View File

@@ -15,7 +15,7 @@ public class PubSubOption {
disableRemote,
disableLocal,
excludePublisher,
excludeSelf;
excludeSelf
}
PubSubOption(Kind kind, boolean value) {