AAVSO / VStar

VStar is a visualisation and analysis tool for variable star data brought to you by AAVSO
https://www.aavso.org/vstar
GNU Affero General Public License v3.0
10 stars 3 forks source link

ANOVA result: getting java.lang.IllegalArgumentException: null #308

Closed orionlee closed 1 year ago

orionlee commented 1 year ago

When clicking on ANOVA result, I get "java.lang.IllegalArgumentException: null" error dialog box:

image

Clicking on the data points on other tabs, including the plot in Periodogram tab, also results in the same error.

It is not blocking the workflow per se. It's just nuisance.

Data used: TESS TIC 298734307, sector 57 2 minute cadence SPOC fits file, SAP_FLUX.

I got the same error from some other TESS fits files and AAVSO database.

Version: v2.22.0 and the lastet master The older v2.21.3 does not have the same problem.

dbenn commented 1 year ago

@orionlee, I am not yet able to reproduce the problem with the specified dataset and 2.22.0 master branch:

image

Can you tell me what AoV parameters you are using? I've tried a few but for the screenshot:

Also feel free to point me to another target with JD range in AAVSO database.

Thanks.

orionlee commented 1 year ago

Ah, I think I narrowed down the specific scenario the error happened. It happened in the following workflow, irrespective of the underlying dataset:

  1. Run DC DFT on some lightcurve
  2. Do not dismiss the DC DFT result dialog
  3. Run AoV
  4. Click the result of AoV, while DC DFT result dialog is still present.

Note: I kept DC DFT dialog because to create a model from AoV period, I needed to create model button from DC DFT result. With the (recent?) addition of "Fourier model..." in Analysis menu, keeping DC DFT result is not strictly necessary anymore, but potentially still to be a nice to have.

Below is the stacktrace from Log dialog (from the recent master build). It seems that when an user clicks AoV result, DC DFT result dialog somehow catches the event and thus incorrectly responds.

Dec 27, 2022 9:03:10 PM org.aavso.tools.vstar.ui.dialog.MessageBox showErrorDialog
SEVERE: Error
java.lang.IllegalArgumentException
    at org.aavso.tools.vstar.util.period.dcdft.PeriodAnalysisDataPoint.getValue(Unknown Source)
    at org.aavso.tools.vstar.ui.dialog.period.PeriodAnalysis2DChartPane$3.update(Unknown Source)
    at org.aavso.tools.vstar.ui.dialog.period.PeriodAnalysis2DChartPane$3.update(Unknown Source)
    at org.aavso.tools.vstar.util.notification.Notifier.notifyListeners(Unknown Source)
    at org.aavso.tools.vstar.ui.dialog.period.PeriodAnalysis2DChartPane.chartMouseClicked(Unknown Source)
    at org.jfree.chart.ChartPanel.mouseClicked(ChartPanel.java:2115)
    at java.desktop/java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:278)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6638)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
    at java.desktop/java.awt.Component.processEvent(Component.java:6400)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4556)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
dbenn commented 1 year ago

So, it appears that the DCDFT result PeriodAnalysisDataPoint code is responding to an AoV notification that it should ignore. Right now the code (line 111 of PeriodAnalysisDataPoint) throws an exception in the else clause. Removing this should solve the problem.

dbenn commented 1 year ago

Will also have to think about how the return value of PeriodAnalysisDataPoint.getValue() is consumed and whether the exception should still be thrown and then caught in the caller or whether null or an Optional should be returned, as opposed to what I've suggested above.