Skip to content

Commit

Permalink
Code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmcmu committed Oct 3, 2024
1 parent 110d7ad commit bc8a339
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -708,7 +710,7 @@ private static int getJsonTypeDefinition(FieldDef field, HashMap<Integer, Intege

int childTypeHash = getJsonTypeDefinition(field.getDef(0), typeDefinitionMap, typeDefinitions);
int childTypeIndex = typeDefinitionMap.get(childTypeHash);
String childTypeName = "ty" + (childTypeIndex + 1);
String childTypeName = ESP_TYPE_NAME_PREFIX + (childTypeIndex + 1);
typeDef.put("child", childTypeName);
break;
}
Expand Down Expand Up @@ -750,7 +752,7 @@ private static int getJsonTypeDefinition(FieldDef field, HashMap<Integer, Intege

int childTypeHash = getJsonTypeDefinition(childField, typeDefinitionMap, typeDefinitions);
int childTypeIndex = typeDefinitionMap.get(childTypeHash);
String childTypeName = "ty" + (childTypeIndex + 1);
String childTypeName = ESP_TYPE_NAME_PREFIX + (childTypeIndex + 1);
int childTypeID = getTypeID(childField);

JSONObject childJson = new JSONObject();
Expand Down Expand Up @@ -792,7 +794,7 @@ else if (childField.getFieldType() == FieldType.SET)

int childTypeHash = getJsonTypeDefinition(nonKeyedField, typeDefinitionMap, typeDefinitions);
int childTypeIndex = typeDefinitionMap.get(childTypeHash);
String childTypeName = "ty" + (childTypeIndex + 1);
String childTypeName = ESP_TYPE_NAME_PREFIX + (childTypeIndex + 1);
typeDef.put("child", childTypeName);
}

Expand Down

0 comments on commit bc8a339

Please sign in to comment.