An example change to limit some confusing errors caused by get(String).
Why not to use CharSequence everywhere? Don't want to change everything and equality of GStrings is a bit suprising when casting is involved.
For instance:
def a = "foo"
def b = "foo"
assert a == "$a"
assert "$a" == "$a"
assert "$a" == "$b"
// but
assert ((CharSequence)"a") != ((CharSequence)"$b")
Essentially, GString is being automatically converted to String when String is being used but it is not converted when CharSequence is being used. So it would not be equal to equivalent String anymore (wrong type).
Hence if one want to use CharSequence in API first thing to do is to convert it to String.
An example change to limit some confusing errors caused by
get(String)
.Why not to use CharSequence everywhere? Don't want to change everything and equality of GStrings is a bit suprising when casting is involved.
For instance:
Essentially, GString is being automatically converted to String when String is being used but it is not converted when CharSequence is being used. So it would not be equal to equivalent String anymore (wrong type).
Hence if one want to use CharSequence in API first thing to do is to convert it to String.