Skip to content

Commit 5ceec52

Browse files
Fixed add method in GxProperties, it must add the item at the end of de vector even if it already exists in the list. Unify behavior with .net.
Added new method values to get a string with all the values. Issue 74868
1 parent 489777f commit 5ceec52

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void set(String name, String value)
2626

2727
public void add(String name, String value)
2828
{
29-
put(name, value);
29+
addToTheEnd(name, value);
3030
}
3131

3232
public void put(String name, String value)
@@ -38,13 +38,23 @@ public void put(String name, String value)
3838
}
3939
else
4040
{
41-
GXProperty prop = new GXProperty();
42-
prop.setKey(name);
43-
prop.setValue(value);
44-
vector.addElement(prop);
41+
addToTheEnd(name, value);
4542
}
4643
}
47-
44+
public String values() {
45+
StringBuilder builder = new StringBuilder();
46+
for (Object property : vector) {
47+
builder.append(((GXProperty) property).getValue());
48+
}
49+
return builder.toString();
50+
}
51+
private void addToTheEnd(String name, String value){
52+
53+
GXProperty prop = new GXProperty();
54+
prop.setKey(name);
55+
prop.setValue(value);
56+
vector.addElement(prop);
57+
}
4858
public String get(String name)
4959
{
5060
int index = findElement(name);

0 commit comments

Comments
 (0)