Skip to content

Commit

Permalink
Merge pull request #2319 from telefonicaid/task/check_feature_equals_…
Browse files Browse the repository at this point in the history
…ignore_case

Task/check feature equals ignore case
  • Loading branch information
fgalan authored Nov 3, 2023
2 parents 031d7b0 + db8f423 commit 8c8bac7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- [cygnus-common] [MongoDB] fix error about reindex when datamodel changed
- [cygnus-common] [Arcgis] check featureId ignore case (#2320)
- [cygnus-common] [Arcgis] check object_id ignore case (#2313)
- [cygnus-common] [Arcgis] fix url quoted based on uniqueFieldType (#2311)
- [cygnus-common] [SQL] Add Primary Key on Timestamp to Error Log table (#2302)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ protected void splitFeatureListIfExists(List<Feature> featureArray,
Feature serverFeature = serverFeatures.get(i);
String serverFeatureId = serverFeature.getAttributes().get(uniqueField).toString();

if (featureId.equals(serverFeatureId)) {
if (featureId.equalsIgnoreCase(serverFeatureId)) {
found = true;
Integer oid = serverFeature.getObjectId();
feature.setObjectId(oid);
Expand Down Expand Up @@ -622,7 +622,15 @@ public int getErrorCode() {
* @return
*/
public boolean hasAttribute(String attName) {
return arcGISFeatureTable.getTableAttributes().containsKey(attName);
// return arcGISFeatureTable.getTableAttributes().containsKey(attName);
// Check containsKey but both in lowerCase
Map<String, Field> map = arcGISFeatureTable.getTableAttributes();
for (Map.Entry<String, Field> entry : map.entrySet()) {
if (entry.getKey().toLowerCase().equals(attName.toLowerCase())) {
return true;
}
}
return false;
}

/**
Expand Down

0 comments on commit 8c8bac7

Please sign in to comment.