question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullPointerException when importing from delimited file and quickly changing the Import File Parser option

See original GitHub issue

Prerequisites

Description

A NullPointerException occurs when you quickly change the Import File Parser option from the dropdown menu after opening the component for importing from delimited file.

Steps to Reproduce

  1. Open clean build of Constellation.
  2. File > Import > From Delimited File…
  3. Select any other option from the dropdown menu for Import File Parser.

Expected behaviour: Any new Import File Parser option is selected without a NullPointerException occurring.

Actual behaviour: NullPointerException occurs.

Reproduces how often: 100%

Additional Information

The issue lies in RunPane.java at the top of the constructor at line 140, where the thread is not being returned in time for the dropdown menu and so a NullPointerException occurs.

image

(GIF of issue being reproduced will be added here)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
serpens24commented, Feb 18, 2021

@arcturus2 - as discussed, the problem relates to the changes made in https://github.com/constellation-app/constellation/pull/847

What is occuring is that in some cases if you start trying to import a file using the dialog too soon the rowFilter member has not yet been set.

It may be worth backing out this change for the time being ?

Edit, the following code seemd to avoid the issue for me: if (rowFilter == null) { rowFilter = new RowFilter(); // new Thread(() -> { // rowFilter = new RowFilter(); // }, ROW_FILTER_INITIALISER).start(); }

basically performing the rowFilter = new RowFilter() in the current thread rather than a new thread.

Note, my change above has no improvement over the original code that was fixed in the mentioned pull requesat. A quick stopwatch comparison indicated that it takes about 7 seconds to open the dialog (the first time) without the pull request changes. This also suggests that its within this seven seconds (roughly) that the user needs to try and open a file to cause the exception.

‘Maybe’ two ideas to investigate are:

  1. Only enable to open (+) icon once the rowFilter member is set, or
  2. investigate why creating a new RowFilter takes so long.
0reactions
antares1470commented, Oct 12, 2021

I believe this is done as I tested removing some null checks for rowFilter (that wouldn’t have been present when this issue was created) and was able to get the exception following the reproducer. Couldn’t get it happen with the null checks in place

Read more comments on GitHub >

github_iconTop Results From Across the Web

NullPointerException when importing XML-file into Processing ...
When the migration is complete, you will access your Teams at stackoverflowteams.com, and they will no longer appear in the left sidebar on ......
Read more >
NullPointerException when importing filters via Object Manager
Using a properly created op-config.xml file to import filters causes a Null Pointer Exception (NPE). This loader file can load fine in other ......
Read more >
java.lang.NullPointerException while Parsing a file
Hello, my problem is in following I have socket client-server interaction where client sends the file and server receives it.
Read more >
Import Data from CSV Files Using Salesforce Flow - UnofficialSF
This Post was most recently updated on: 4/17/22. You can now upload CSV data and turn it into Salesforce records with just a...
Read more >
How to Fix and Avoid NullPointerException in Java - Rollbar
NullPointerException in Java occurs when a variable is accessed which is not pointing to any object and refers to nothing or null.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found