Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@deboer-tim
Copy link
Collaborator

Deleting contest objects like runs or submissions was working, but deleting configuration/registration objects like teams or groups is failing. e.g. if you have some groups and use a set in the event feed to replace with a different set, it fails with the following in the log:

R Error adding property: problems/test_data_count:null
R java.lang.NumberFormatException: null
R at org.icpc.tools.contest.model.internal.ContestObject.parseInt(ContestObject.java:142)
R Could not parse event feed line: {"type":"groups","token":"...","id": null,"data": [{...},{...}]}
R java.lang.NullPointerException: null
R at org.icpc.tools.cds.util.PlaybackContest.applyDefaults(PlaybackContest.java:538)

The fix is in PlaybackContest - we shouldn't try to apply default values to something we're deleting.

While I was debugging I changed a few cases to contest.add(new Deletion()) solely because the syntax looked nicer :) , and moved the line 'IContestObject[] allObjs' higher up because it's more efficient to remove deleted items from the list prior to adding new ones (e.g. if you have 5 groups and set it to 8, you only need to look through the original 5 to see if any were deleted. Likewise, if you have no groups and set it to 7, there aren't any you need to delete)

Deleting contest objects like runs or submissions was working, but deleting configuration/registration
objects like teams or groups is failing. e.g. if you have some groups and use a set in the event feed
to replace with a different set, it fails with the following in the log:

 R Error adding property: problems/test_data_count:null
 R    java.lang.NumberFormatException: null
 R    at org.icpc.tools.contest.model.internal.ContestObject.parseInt(ContestObject.java:142)
 R Could not parse event feed line: {"type":"groups","token":"...","id": null,"data": [{...},{...}]}
 R    java.lang.NullPointerException: null
 R    at org.icpc.tools.cds.util.PlaybackContest.applyDefaults(PlaybackContest.java:538)

The fix is in PlaybackContest - we shouldn't try to apply default values to something we're deleting.

While I was debugging I changed a few cases to contest.add(new Deletion()) solely because the syntax
looked nicer :) , and moved the line 'IContestObject[] allObjs' higher up because it's more efficient
to remove deleted items from the list prior to adding new ones (e.g. if you have 5 groups and set it
to 8, you only need to look through the original 5 to see if any were deleted. Likewise, if you have
no groups and set it to 7, there aren't any you need to delete)
@deboer-tim deboer-tim merged commit a64ee88 into icpctools:main Apr 3, 2025
4 checks passed
@deboer-tim deboer-tim deleted the config-delete branch April 3, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants