Skip to content

Commit 3da2a6e

Browse files
Make the get and remove method case insenstivie
1 parent 66d6500 commit 3da2a6e

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

common/src/main/java/com/genexus/util/GXProperties.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,22 @@ public String toString() {
3838
}
3939

4040
public String get(String name) {
41-
return containsKey(name) ? properties.get(name).getValue() : "";
41+
return containsKey(name) ? this.getCaseInsensitive(name).getValue() : "";
42+
}
43+
44+
public GXProperty getCaseInsensitive(String name) {
45+
for (Map.Entry<String, GXProperty> entry : properties.entrySet())
46+
if (entry.getKey().equalsIgnoreCase(name))
47+
return entry.getValue();
48+
return null;
4249
}
4350

4451
public void remove(String name) {
45-
properties.remove(name);
52+
this.removeCaseInsensitive(name);
53+
}
54+
55+
public void removeCaseInsensitive(String name) {
56+
properties.entrySet().removeIf(entry -> entry.getKey().equalsIgnoreCase(name));
4657
}
4758

4859
public boolean containsKey(String name) {

0 commit comments

Comments
 (0)