From d1a36e54224d7fed7f4e0f72acc27d551e5b20e3 Mon Sep 17 00:00:00 2001 From: iroqueta <46004974+iroqueta@users.noreply.github.com> Date: Mon, 24 Jun 2024 10:10:52 -0300 Subject: [PATCH] Reimplement Case insensitive in GxProperties (#878) * Reimplement Case insensitive in GxProperties Issue: 109185 * Reimplement Case insensitive in GxProperties Issue: 109185 --- .../src/main/java/com/genexus/util/GXProperties.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/common/src/main/java/com/genexus/util/GXProperties.java b/common/src/main/java/com/genexus/util/GXProperties.java index 9b6bfa9ff..9f645da8e 100644 --- a/common/src/main/java/com/genexus/util/GXProperties.java +++ b/common/src/main/java/com/genexus/util/GXProperties.java @@ -14,7 +14,6 @@ public class GXProperties implements IGxJSONSerializable { private LinkedHashMap < String, GXProperty > properties = new LinkedHashMap < > (); - private LinkedHashMap < String, GXProperty > originalProperties = new LinkedHashMap < > (); private boolean eof; private int lastElement; @@ -27,9 +26,8 @@ public void set(String name, String value) { public void add(String name, String value) { this.put(name, value); } public void put(String name, String value) { - originalProperties.put(name, new GXProperty(name, value)); - name = name.toLowerCase(); - properties.put(name, new GXProperty(name, value)); + String lowerName = name.toLowerCase(); + properties.put(lowerName, new GXProperty(name, value)); } public String toString() { @@ -45,7 +43,6 @@ public String get(String name) { } public void remove(String name) { - originalProperties.remove(name); name = name.toLowerCase(); properties.remove(name); } @@ -57,7 +54,7 @@ public boolean containsKey(String name) { public GXProperty item(int i) { int counter = 0; - for (Map.Entry < String, GXProperty > entry: originalProperties.entrySet()) { + for (Map.Entry < String, GXProperty > entry: properties.entrySet()) { if (counter++ == i) { return entry.getValue(); } @@ -75,14 +72,13 @@ public int count() { public void clear() { properties.clear(); - originalProperties.clear(); } public GXProperty first() { eof = false; if (count() > 0) { lastElement = 0; - return originalProperties.entrySet().iterator().next().getValue(); + return properties.entrySet().iterator().next().getValue(); } else { eof = true; return null;