Title: Null Array Parameter is persisted as an Array containing a single element, which is null · Issue #466 · scijava/scijava-common · GitHub
Open Graph Title: Null Array Parameter is persisted as an Array containing a single element, which is null · Issue #466 · scijava/scijava-common
X Title: Null Array Parameter is persisted as an Array containing a single element, which is null · Issue #466 · scijava/scijava-common
Description: I have a command with a non-required array parameter: @Parameter(label = "Select Bvv Windows to synchronize", required = false) BvvHandle[] bvvhs; Before, when nothing was set, bvvhs was returned as a null object. Now, when bvvhs is not ...
Open Graph Description: I have a command with a non-required array parameter: @Parameter(label = "Select Bvv Windows to synchronize", required = false) BvvHandle[] bvvhs; Before, when nothing was set, bvvhs was returned a...
X Description: I have a command with a non-required array parameter: @Parameter(label = "Select Bvv Windows to synchronize", required = false) BvvHandle[] bvvhs; Before, when nothing was set, bvvhs was ...
Opengraph URL: https://github.com/scijava/scijava-common/issues/466
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Null Array Parameter is persisted as an Array containing a single element, which is null","articleBody":"\r\nI have a command with a non-required array parameter:\r\n\r\n```\r\n\t@Parameter(label = \"Select Bvv Windows to synchronize\", required = false)\r\n\tBvvHandle[] bvvhs;\r\n```\r\n\r\n\r\nBefore, when nothing was set, `bvvhs` was returned as a null object. Now, when `bvvhs` is not set, the parameter is set to an array of size 1, with the element being a null object.\r\n\r\nIt's a change of behaviour which breaks a few things in my code. It's probably manageable, but the current behaviour needs to be changed:\r\n\r\nreturn null is fine, returning an empty array is probably also fine, but returning a one-element array with null inside do not look good.\r\n\r\nFYI, I checked in the prefs how the parameter is remembered, and this is how it looks:\r\n\r\n\r\n\r\nI think it should be:\r\n\r\n\r\n\r\nRelated as mentioned by @ctrueden:\r\n\r\nhttps://github.com/scijava/scijava-common/issues/450\r\nhttps://github.com/scijava/scijava-common/commit/ce135b7c9e3197a87423e9ef0e8fc58f5d400387\r\n\r\nOriginal forum thread: \r\nhttps://forum.image.sc/t/change-of-behaviour-in-scijava-parameter-table-of-size-one-with-null-object-inside-instead-of-null-object/83625/2\r\n\r\n---\r\n\r\nIt does not look like a critical issue, but it might pop here and there","author":{"url":"https://github.com/NicoKiaru","@type":"Person","name":"NicoKiaru"},"datePublished":"2023-07-13T18:18:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/466/scijava-common/issues/466"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f8157f53-7357-efc2-c4ee-c556fb774983 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B3B6:16CDE4:27C4C31:351A67E:696F07C8 |
| html-safe-nonce | 3509f24d7158fbe700f4b3c784b8b9005fdd600662c6b11dbc0242ed34f1235c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0I2OjE2Q0RFNDoyN0M0QzMxOjM1MUE2N0U6Njk2RjA3QzgiLCJ2aXNpdG9yX2lkIjoiMTIwNjI1NzgwNjEyMTgzMDM0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | efe5a51ced719156942dd20d41508f80fa5b723fc51a9a171fbe5c1ce5cde701 |
| hovercard-subject-tag | issue:1803539064 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/scijava/scijava-common/466/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6f5e33d21027150a17cd7a1c68218139ba5552370f295c590d7c074b9e3250ea/scijava/scijava-common/issues/466 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6f5e33d21027150a17cd7a1c68218139ba5552370f295c590d7c074b9e3250ea/scijava/scijava-common/issues/466 |
| og:image:alt | I have a command with a non-required array parameter: @Parameter(label = "Select Bvv Windows to synchronize", required = false) BvvHandle[] bvvhs; Before, when nothing was set, bvvhs was returned a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NicoKiaru |
| hostname | github.com |
| expected-hostname | github.com |
| None | b278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee |
| turbo-cache-control | no-preview |
| go-import | github.com/scijava/scijava-common git https://github.com/scijava/scijava-common.git |
| octolytics-dimension-user_id | 1262770 |
| octolytics-dimension-user_login | scijava |
| octolytics-dimension-repository_id | 3594497 |
| octolytics-dimension-repository_nwo | scijava/scijava-common |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3594497 |
| octolytics-dimension-repository_network_root_nwo | scijava/scijava-common |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 39aed5006635ab6f45e6b77d23e73b08a00272a3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width