From bc8a3395fd07f7524af43d6ef6093abc792b2285 Mon Sep 17 00:00:00 2001 From: James McMullan Date: Thu, 3 Oct 2024 09:23:14 -0400 Subject: [PATCH] Code review changes --- .../java/org/hpccsystems/commons/ecl/FieldDef.java | 2 +- .../commons/ecl/RecordDefinitionTranslator.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/commons-hpcc/src/main/java/org/hpccsystems/commons/ecl/FieldDef.java b/commons-hpcc/src/main/java/org/hpccsystems/commons/ecl/FieldDef.java index 1d9028016..d813d0e64 100644 --- a/commons-hpcc/src/main/java/org/hpccsystems/commons/ecl/FieldDef.java +++ b/commons-hpcc/src/main/java/org/hpccsystems/commons/ecl/FieldDef.java @@ -319,7 +319,7 @@ public boolean isUnsigned() } /** - * Is the underlying value biased? + * Is the underlying value biased? Deprecated in favor of isNonStandardInt. * * @return true when biased * diff --git a/commons-hpcc/src/main/java/org/hpccsystems/commons/ecl/RecordDefinitionTranslator.java b/commons-hpcc/src/main/java/org/hpccsystems/commons/ecl/RecordDefinitionTranslator.java index a0b0eedb3..dbae989e4 100644 --- a/commons-hpcc/src/main/java/org/hpccsystems/commons/ecl/RecordDefinitionTranslator.java +++ b/commons-hpcc/src/main/java/org/hpccsystems/commons/ecl/RecordDefinitionTranslator.java @@ -34,6 +34,8 @@ public class RecordDefinitionTranslator private static final String CHILD_KEY = "child"; private static final String FLAGS_KEY = "flags"; + private static final String ESP_TYPE_NAME_PREFIX = "ty"; + private static final int FLAG_UNSIGNED = 256; private static final int FLAG_UNKNOWN_SIZE = 1024; private static final int TYPE_ID_MASK = 0xff; // 0x7fff & ~FLAG_UNKNOWN_SIZE & ~FLAG_UNSIGNED; @@ -460,7 +462,7 @@ public static JSONObject toJsonRecord(FieldDef field) throws Exception continue; } - rootDefinition.put("ty" + (i + 1), typeDefinition); + rootDefinition.put(ESP_TYPE_NAME_PREFIX + (i + 1), typeDefinition); } return rootDefinition; @@ -708,7 +710,7 @@ private static int getJsonTypeDefinition(FieldDef field, HashMap