NetRexx bug: CONCAT null

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

NetRexx bug: CONCAT null

Jeff Hennick-3

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 at netrexx.lang.Rexx.concat(Rexx.java:2261) at netrexx.lang.Rexx.OpCcblank(Rexx.java:1593) at test_say.main(test_say.java:4) PS C:\Users\Jeff\documents\pipe tests>

[Note that it reports the error as being in line 4 of this 3-line program.]

I think that both CONCAT and SAY should handle nulls by quietly ignoring them.

Jeff Hennick


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: NetRexx bug: CONCAT null

Jason Martin
3 line NetRexx but generated Java is more lines.

Some new code added to RexxIO in last year that I have not used much or
looked over yet.

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: NetRexx bug: CONCAT null

rvjansen
’Say’ does handle nulls gracefully. But ‘concat’ does not. Do we want ‘concat’ to ignore them?

René.

> On 9 Dec 2019, at 16:39, Jason Martin <[hidden email]> wrote:
>
> 3 line NetRexx but generated Java is more lines.
>
> Some new code added to RexxIO in last year that I have not used much or looked over yet.
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : https://urldefense.proofpoint.com/v2/url?u=http-3A__ibm-2Dnetrexx.215625.n3.nabble.com_&d=DwIFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=PSnAayI5lL_QgPgGYnCa113QdIiygZy-OAalzLC0vqk&s=U7YEPxGHSHTkp2GBvFQUX_WOuaCPILDRiL8OOOUde8E&e= 
>


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: NetRexx bug: CONCAT null

Jason Martin
NetRexx Language Reference

chapter on Type conversions

My mind is not clear but obey the rules there?

Do not remember but 'Say' was designed with some thought on
terminal/device output.

I vaguely remember sending output to printer.

Leave the thing in there.

Send another doc to overlay and then form feed

Get just the one page.


On 2019-12-09 17:04, René Jansen wrote:
> ’Say’ does handle nulls gracefully. But ‘concat’ does not. Do we want ‘concat’ to ignore them?
>
> René.

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: NetRexx bug: CONCAT null

ThSITC
My personal opinion is that NULL Rexx Variables shall be reported as an
error in this case (as far as I do understand it).

Thomas.

===================================================================================

Am 10.12.2019 um 00:19 schrieb Jason Martin:

> NetRexx Language Reference
>
> chapter on Type conversions
>
> My mind is not clear but obey the rules there?
>
> Do not remember but 'Say' was designed with some thought on
> terminal/device output.
>
> I vaguely remember sending output to printer.
>
> Leave the thing in there.
>
> Send another doc to overlay and then form feed
>
> Get just the one page.
>
>
> On 2019-12-09 17:04, René Jansen wrote:
>> ’Say’ does handle nulls gracefully. But ‘concat’ does not. Do we want
>> ‘concat’ to ignore them?
>>
>> René.
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : https://urldefense.proofpoint.com/v2/url?u=http-3A__ibm-2Dnetrexx.215625.n3.nabble.com_&d=DwIDaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=JnL3voSBa1altTbZjPxnc6W2dNRvycW29arPLb8fWrI&s=8gj7zDCcsbjt5os5dhvfpRzqBSE34-nVLEK43sSeKsE&e= 
>

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Thomas Schneider, Vienna, Austria (Europe) :-)

www.thsitc.com
www.db-123.com
Reply | Threaded
Open this post in threaded view
|

Re: NetRexx bug: CONCAT null

Jeff Hennick-3
In reply to this post by rvjansen

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 "bug."

Jeff

On 12/9/2019 5:04 PM, René Jansen wrote:
’Say’ does handle nulls gracefully. But ‘concat’ does not. Do we want ‘concat’ to ignore them?

René.

On 9 Dec 2019, at 16:39, Jason Martin [hidden email] wrote:

3 line NetRexx but generated Java is more lines.

Some new code added to RexxIO in last year that I have not used much or looked over yet.

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : https://urldefense.proofpoint.com/v2/url?u=http-3A__ibm-2Dnetrexx.215625.n3.nabble.com_&d=DwIFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=PSnAayI5lL_QgPgGYnCa113QdIiygZy-OAalzLC0vqk&s=U7YEPxGHSHTkp2GBvFQUX_WOuaCPILDRiL8OOOUde8E&e= 


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/