Add All Constraints To Event button overwrites existing constraints with associated Implements in Events List GUI

Bug #322294 reported by Ken McLean
2
Affects Status Importance Assigned to Milestone
OpenScore
Fix Released
High
Craig Mahony

Bug Description

Add All Constraints To Event button overwrites existing constraints with associated Implements in Events List GUI. Should we perform a check first and only add in constraints that do not already exist?

Ken McLean (kenmclean)
Changed in openscore:
importance: Undecided → Low
status: New → Confirmed
Ken McLean (kenmclean)
Changed in openscore:
assignee: nobody → cmahony
Revision history for this message
Craig Mahony (cmahony) wrote :

Does this matter? The constraint will still be there and there is no duplication. Checking for previous constraints will just slow the process.

Revision history for this message
Ken McLean (kenmclean) wrote :

Yes it does matter, because it overwrites any Implement data you have already. For example, I have a shotput event with men only. I decide to add all the female constraints to the event, so I hit Add All Constraints To Event. All my Implement data for the men's constraints is lost.

Ken McLean (kenmclean)
Changed in openscore:
importance: Low → High
milestone: none → heatwave
Revision history for this message
Craig Mahony (cmahony) wrote :

A fix has been comitted to the Cranbourne branch. Tudor will need to decide whether to port it to the main branch. The new version of EventsGui requires the constraints to have a ReturnType of "Result" or no constraints will appear in the comboBox. Similarly with the new version of ResultsTable and the constraints comboBox there.

Changed in openscore:
status: Confirmed → In Progress
Revision history for this message
Ken McLean (kenmclean) wrote :

NPE. Steps to replicate.

1. Open new session
2. Select Meet from Meet Menu
3. Select Meet > Events > Event List
The following NPE is triggered

09:47:10.187:INFO :Updating Menus to Connected
09:47:29.609:INFO :coreEvents has 19
java.lang.NullPointerException
        at avscoreswt.gui.Meets.ConstraintTableEditSupport.<init>(EventsPanel.java:764)
        at avscoreswt.gui.Meets.EventsPanel.<init>(EventsPanel.java:360)
        at avscoreswt.gui.BaseFrame$20.run(BaseFrame.java:643)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
        at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
        at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
        at org.eclipse.jface.window.Window.open(Window.java:801)
        at avscoreswt.gui.BaseFrame.run(BaseFrame.java:183)
        at avscoreswt.gui.BaseFrame.start(BaseFrame.java:986)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at avscoreswt.OpenScore.main(OpenScore.java:57)

Changed in openscore:
status: In Progress → Triaged
Revision history for this message
Ken McLean (kenmclean) wrote :

Sorry, I just realised that the above bug that stops me from testing this fix already exists: Bug #373085

Revision history for this message
Craig Mahony (cmahony) wrote :

Fix committed to main trunk.

Changed in openscore:
status: Triaged → Fix Committed
Revision history for this message
Ken McLean (kenmclean) wrote :

This is still occurring, but now it's throwing a thread error:

15:32:32.058:INFO :Added Event[157] object to MODIFIED queue.
15:32:32.058:INFO :Event[157] came from storage, so not adding to any queue.
15:32:32.449:INFO :Poll files for changes.
15:32:32.449:INFO :Files polled and (potentially) data updated.
15:32:32.449:INFO :Flushing wait queue
15:32:32.449:Last message repeated 2 times.
15:32:32.449:INFO :Changing Event on line 157 to ,2,,14,,1,13,1=>13=>12:00 PM,69

15:32:32.449:INFO :CSVFile:,2,,14,,1,13,1=>13=>12:00 PM,69 is the same as
               ,2,,14,,1,13,1=>13=>12:00 PM,69 ignoring...
15:32:32.449:INFO :Changed Event object 157, 0 remaining.
15:32:32.449:INFO :Storage:Update complete, yielding...
15:32:34.949:INFO :Added Event[157] object to MODIFIED queue.
15:32:34.949:INFO :Event[157] came from storage, so not adding to any queue.
15:33:02.449:INFO :Poll files for changes.
15:33:02.449:INFO :Files polled and (potentially) data updated.
15:33:02.449:INFO :Flushing wait queue
Exception in thread "Thread-6" java.lang.NullPointerException
        at avscoreswt.storage.Storage_CSVFolder.buildArrayFromObject(Storage_CSVFolder.java:1034)
        at avscoreswt.storage.Storage_CSVFolder.flushQueue(Storage_CSVFolder.java:2283)
        at avscoreswt.storage.Storage_CSVFolder.doEvent(Storage_CSVFolder.java:2531)
        at avscoreswt.util.TimedEventController.run(TimedEventController.java:89)
        at java.lang.Thread.run(Unknown Source)

Changed in openscore:
status: Fix Committed → Triaged
Revision history for this message
Ken McLean (kenmclean) wrote :

Sorry I should clarify, the ORIGINAL bug of Add All Constraints overwrites existing implements.

The Nullpointer, described later in the comments has been fixed.

Revision history for this message
Craig Mahony (cmahony) wrote :

Should be ok now.

Changed in openscore:
status: Triaged → Fix Committed
Revision history for this message
Ken McLean (kenmclean) wrote :

Resolved

Changed in openscore:
status: Fix Committed → Fix Released
Revision history for this message
Ken McLean (kenmclean) wrote :
Download full text (11.6 KiB)

Actually, I have discovered a bug in here.

Steps to reproduce:
1. Go to an event, and Add All Contraints.
2. Give half half these constraints Implements
3. Hit the Add All Contraints button
All the ones with Implments are deleted.
4. Hit the Add All Contraints button again
Nullpointers begin to appear on a thread in debug, and continue whilst using the program

eg.

Exception in thread "Thread-6" java.lang.NullPointerException
        at avscoreswt.storage.Storage_CSVFolder.buildArrayFromObject(Storage_CSVFolder.java:1035)
        at avscoreswt.storage.Storage_CSVFolder.flushQueue(Storage_CSVFolder.java:2306)
        at avscoreswt.storage.Storage_CSVFolder.doEvent(Storage_CSVFolder.java:2554)
        at avscoreswt.util.TimedEventController.run(TimedEventController.java:89)
        at java.lang.Thread.run(Unknown Source)

AND

12:19:02.203:INFO :CSVFile:0 Locks Open
12:19:02.203:INFO :CSVFile:Waiting to give others a chance.
12:19:02.296:INFO :Changed Event object 175, 2 remaining.
12:19:02.296:INFO :Changed Event object 158, 1 remaining.
12:19:02.296:INFO :Changed Event object 165, 0 remaining.
12:19:02.296:INFO :Storage:Update complete, yielding...
12:19:11.031:INFO :Added Event[175] object to MODIFIED queue.
12:19:32.296:INFO :Poll files for changes.
12:19:32.312:INFO :Files polled and (potentially) data updated.
12:19:32.312:INFO :Flushing wait queue
Exception in thread "Thread-6" java.lang.NullPointerException
        at avscoreswt.storage.Storage_CSVFolder.buildArrayFromObject(Storage_CSV
Folder.java:1035)
        at avscoreswt.storage.Storage_CSVFolder.flushQueue(Storage_CSVFolder.jav
a:2306)
        at avscoreswt.storage.Storage_CSVFolder.doEvent(Storage_CSVFolder.java:2
554)
        at avscoreswt.util.TimedEventController.run(TimedEventController.java:89
)
        at java.lang.Thread.run(Unknown Source)
12:19:36.625:Last message repeated 2 times.
12:19:36.625:INFO :Poll files for changes.
12:19:36.640:INFO :Files polled and (potentially) data updated.
12:19:36.640:INFO :Flushing wait queue
Exception in thread "Thread-8" java.lang.NullPointerException
        at avscoreswt.storage.Storage_CSVFolder.buildArrayFromObject(Storage_CSV
Folder.java:1035)
        at avscoreswt.storage.Storage_CSVFolder.flushQueue(Storage_CSVFolder.jav
a:2306)
        at avscoreswt.storage.Storage_CSVFolder.doEvent(Storage_CSVFolder.java:2
554)
        at avscoreswt.util.TimedEventController.run(TimedEventController.java:89
)
        at java.lang.Thread.run(Unknown Source)
12:19:39.562:Last message repeated 2 times.
12:19:39.562:INFO :Added Event[157] object to MODIFIED queue.
12:19:39.609:INFO :Poll files for changes.
12:19:39.609:INFO :Files polled and (potentially) data updated.
12:19:39.609:INFO :Flushing wait queue
Exception in thread "Thread-9" java.lang.NullPointerException
        at avscoreswt.storage.Storage_CSVFolder.buildArrayFromObject(Storage_CSV
Folder.java:1035)
        at avscoreswt.storage.Storage_CSVFolder.flushQueue(Storage_CSVFolder.jav
a:2276)
        at avscoreswt.storage.Storage_CSVFolder.doEvent(Storage_CSVFolder.java:2
554)
        at avscoreswt.util.TimedEventCont...

Changed in openscore:
status: Fix Released → Confirmed
Revision history for this message
Craig Mahony (cmahony) wrote :

Have fixed the constraint containing an implement disappearing. I did not get a nullpointer. So please see if this fix also fixes that.

Changed in openscore:
status: Confirmed → Fix Committed
Ken McLean (kenmclean)
Changed in openscore:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.