diff --git a/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java b/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java index 015e32a0b9..96bc0dc587 100644 --- a/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java +++ b/intg/src/main/java/org/apache/atlas/model/discovery/AtlasSearchResult.java @@ -174,12 +174,12 @@ public void addSort(String guid, ArrayList sort) { if(MapUtils.isEmpty(this.searchMetadata)) { this.searchMetadata = new LinkedHashMap<>(); } - ElasticsearchMetadata v = this.searchMetadata.getOrDefault(guid, new ElasticsearchMetadata()); - v.addSort(sort); + ElasticsearchMetadata sortMetadata = this.searchMetadata.getOrDefault(guid, new ElasticsearchMetadata()); + sortMetadata.addSort(sort); if (this.searchMetadata.containsKey(guid)) { - this.searchMetadata.replace(guid, v); + this.searchMetadata.replace(guid, sortMetadata); } else { - this.searchMetadata.put(guid, v); + this.searchMetadata.put(guid, sortMetadata); } }