Skip to content

Commit

Permalink
resolve code review comments
Browse files Browse the repository at this point in the history
Signed-off-by: yuye-aws <[email protected]>
  • Loading branch information
yuye-aws committed Mar 8, 2024
1 parent bb263cc commit e89c063
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ private void validateAndParseAlgorithmMap(Map<String, Object> algorithmMap) {
this.chunkerType = algorithmKey;
this.chunkerParameters = (Map<String, Object>) algorithmValue;
chunker.validateParameters(chunkerParameters);
if (((Map<String, Object>) algorithmValue).containsKey(MAX_CHUNK_LIMIT_FIELD)) {
String maxChunkLimitString = ((Map<String, Object>) algorithmValue).get(MAX_CHUNK_LIMIT_FIELD).toString();
if (chunkerParameters.containsKey(MAX_CHUNK_LIMIT_FIELD)) {
String maxChunkLimitString = chunkerParameters.get(MAX_CHUNK_LIMIT_FIELD).toString();
if (!(NumberUtils.isParsable(maxChunkLimitString))) {
throw new IllegalArgumentException(
"Parameter [" + MAX_CHUNK_LIMIT_FIELD + "] cannot be cast to [" + Number.class.getName() + "]"
Expand All @@ -147,7 +147,7 @@ private void validateAndParseAlgorithmMap(Map<String, Object> algorithmMap) {
}

@SuppressWarnings("unchecked")
private boolean isListString(Object value) {
private boolean isListOfString(Object value) {
// an empty list is also List<String>
if (!(value instanceof List)) {
return false;
Expand Down Expand Up @@ -191,7 +191,7 @@ private List<String> chunkLeafType(Object value, ChunkCountWrapper chunkCountWra
List<String> chunkedResult = null;
if (value instanceof String) {
chunkedResult = chunkString(value.toString(), chunkCountWrapper);
} else if (isListString(value)) {
} else if (isListOfString(value)) {
chunkedResult = chunkList((List<String>) value, chunkCountWrapper);
}
return chunkedResult;
Expand Down

0 comments on commit e89c063

Please sign in to comment.