NullPointerException when importing from delimited file and quickly changing the Import File Parser option
See original GitHub issuePrerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Running the latest version of Constellation
- Attached the Support Package via
Help
>Support Package
- Checked the FAQs: https://github.com/constellation-app/constellation/wiki/FAQ
- Checked that your issue isn’t already filed: https://github.com/constellation-app/constellation/issues
- Checked that there is not already a module that provides the described functionality: https://github.com/constellation-app/constellation/wiki/Catalogue-of-Repositories
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
- Open clean build of Constellation.
- File > Import > From Delimited File…
- 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.
(GIF of issue being reproduced will be added here)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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:
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