I have been running around with some unrepeatable errors while
generating tests for pipe stages.
One seems in involve, or trigger, a problem with nulls in SAY.
In trying to see what is going on, I wrote this 3-liner, which is
definitely causing a problem in CONCAT, before it gets to SAY.
PS C:\Users\Jeff\documents\pipe tests> type test_say.nrx
x = rexx null
y = 'test'
say y x
PS C:\Users\Jeff\documents\pipe tests> java test_say
Exception in thread "main" java.lang.NullPointerException
PS C:\Users\Jeff\documents\pipe tests>
[Note that it reports the error as being in line 4 of this 3-line
I think that both CONCAT and SAY should handle nulls by quietly
I have done some more reading and thinking on this.
My mistake: confusing a "null Rexx string," that is a zero
length, empty one, with a "null value of an object," [NULL]. And
expecting them to behave the same. (Note to self: a declared Rexx
string is an object, so it can have either a value of [NULL] or ""
which is a null string.)
So, trying to concatenate a [NULL] value should be an error, and
concatenating a null string to another string should just be the
other string's value.
And SAYing a null value emits a null string.
Moral (for myself) when in doubt, use "catch
NullPointerException" so [NULL]s don't get to CONCAT.
Thanks for all the help, and apologies for raising the word
On 12/9/2019 5:04 PM, René Jansen
’Say’ does handle nulls gracefully. But ‘concat’ does not. Do we want ‘concat’ to ignore them?