Skip to content

Commit c763ad2

Browse files
authored
Reimplement Case insensitive in GxProperties (#878)
* Reimplement Case insensitive in GxProperties Issue: 109185 * Reimplement Case insensitive in GxProperties Issue: 109185
1 parent 87b8d85 commit c763ad2

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
public class GXProperties implements IGxJSONSerializable {
1616
private LinkedHashMap < String, GXProperty > properties = new LinkedHashMap < > ();
17-
private LinkedHashMap < String, GXProperty > originalProperties = new LinkedHashMap < > ();
1817
private boolean eof;
1918
private int lastElement;
2019

@@ -27,9 +26,8 @@ public void set(String name, String value) {
2726
public void add(String name, String value) { this.put(name, value); }
2827

2928
public void put(String name, String value) {
30-
originalProperties.put(name, new GXProperty(name, value));
31-
name = name.toLowerCase();
32-
properties.put(name, new GXProperty(name, value));
29+
String lowerName = name.toLowerCase();
30+
properties.put(lowerName, new GXProperty(name, value));
3331
}
3432

3533
public String toString() {
@@ -45,7 +43,6 @@ public String get(String name) {
4543
}
4644

4745
public void remove(String name) {
48-
originalProperties.remove(name);
4946
name = name.toLowerCase();
5047
properties.remove(name);
5148
}
@@ -57,7 +54,7 @@ public boolean containsKey(String name) {
5754

5855
public GXProperty item(int i) {
5956
int counter = 0;
60-
for (Map.Entry < String, GXProperty > entry: originalProperties.entrySet()) {
57+
for (Map.Entry < String, GXProperty > entry: properties.entrySet()) {
6158
if (counter++ == i) {
6259
return entry.getValue();
6360
}
@@ -75,14 +72,13 @@ public int count() {
7572

7673
public void clear() {
7774
properties.clear();
78-
originalProperties.clear();
7975
}
8076

8177
public GXProperty first() {
8278
eof = false;
8379
if (count() > 0) {
8480
lastElement = 0;
85-
return originalProperties.entrySet().iterator().next().getValue();
81+
return properties.entrySet().iterator().next().getValue();
8682
} else {
8783
eof = true;
8884
return null;

0 commit comments

Comments
 (0)