You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Brian Raymes <br...@teotech.com> on 2021/03/11 17:20:43 UTC

RE: [EXTERNAL] Re: Royale & NPE Behavior

The null pointer in this case is in the framework, not my code. I am using VSCode, pausing on exceptions is enabled, as well as pausing on uncaught exceptions.

The problem is, no exception is thrown. No error exists. Rendering just stops for whatever component encounters the NP.

To see what I'm talking about, try creating a VirtualList (jewel) without a ListPresentationModel. It will not render at all due to the NP. No errors, no exceptions.

Perhaps my first email was a bit misleading because I kept using NPE, when really it's NPs without the E.

I've noticed this same behavior within my own code. It's as is something is catching these and suppressing them.

The following will show my issue:

<j:VirtualList 
    width="100%"
    dataProvider="{someDataProvider}"
    itemRenderer="com.some.ItemRenderer">

    <j:beads>
        <!-- <j:ListPresentationModel rowHeight="80" /> -->
    </j:beads>

</j:VirtualList>


-----Original Message-----
From: Yishay Weiss <yi...@hotmail.com> 
Sent: Thursday, March 11, 2021 4:21 AM
To: dev@royale.apache.org
Subject: [EXTERNAL] Re: Royale & NPE Behavior

You got:

>Without, the code will throw a null pointer exception resulting in an empty list being displayed.

And you expect:

>Bare minimum, it would be nice to at least see an uncaught exception with the debugger.

Can you explain the difference? If what you need is for the debugger to halt execution with a stack trace, then you can switch on 'pause on exceptions' in the dev tools. I must be missing something...
________________________________
From: Brian Raymes <br...@teotech.com>
Sent: Wednesday, March 10, 2021 7:16 PM
To: dev@royale.apache.org <de...@royale.apache.org>
Subject: Royale & NPE Behavior

Hi all,

I've been noticing a problem with Royale that I think is time to bring up with the greater audience.

What is the expected behavior when encountering an NPE within a Royale application? I've notice that NPEs seem to break the UI with no notice of any kind.

For example, I recently started trying out VirtualLists. For quite some time, I could not figure out why they would not render any of my data. It turns out, Virtual list requires the bead ListPresentationModel with a non-null rowHeight. This is due to VirtualListVerticalLayout's layout method assuming the existence of an IListPresentationModel. Without, the code will throw a null pointer exception resulting in an empty list being displayed.

The problem I want to highlight is that as a developer, without diving through the framework code, and ultimately guessing on trying various things beforehand, there was no way for me to know that happened. There is no console log output stating the error, no uncaught exception for the debugger to catch, and no visible reasoning for what is occurring.

Is this the expected behavior, or can this be improved? I've wasted a surprising amount of time chasing these issues in the past year while working with Royale.

Bare minimum, it would be nice to at least see an uncaught exception with the debugger.

Brian