{"action":"created","issue":{"url":"https://api.github.com/repos/JMRI/JMRI/issues/5696","repository_url":"https://api.github.com/repos/JMRI/JMRI","labels_url":"https://api.github.com/repos/JMRI/JMRI/issues/5696/labels{/name}","comments_url":"https://api.github.com/repos/JMRI/JMRI/issues/5696/comments","events_url":"https://api.github.com/repos/JMRI/JMRI/issues/5696/events","html_url":"https://github.com/JMRI/JMRI/issues/5696","id":353633633,"node_id":"MDU6SXNzdWUzNTM2MzM2MzM=","number":5696,"title":"Reporter Table NPE","user":{"login":"devel-bobm","id":13856693,"node_id":"MDQ6VXNlcjEzODU2Njkz","avatar_url":"https://avatars0.githubusercontent.com/u/13856693?v=4","gravatar_id":"","url":"https://api.github.com/users/devel-bobm","html_url":"https://github.com/devel-bobm","followers_url":"https://api.github.com/users/devel-bobm/followers","following_url":"https://api.github.com/users/devel-bobm/following{/other_user}","gists_url":"https://api.github.com/users/devel-bobm/gists{/gist_id}","starred_url":"https://api.github.com/users/devel-bobm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devel-bobm/subscriptions","organizations_url":"https://api.github.com/users/devel-bobm/orgs","repos_url":"https://api.github.com/users/devel-bobm/repos","events_url":"https://api.github.com/users/devel-bobm/events{/privacy}","received_events_url":"https://api.github.com/users/devel-bobm/received_events","type":"User","site_admin":false},"labels":[{"id":262582064,"node_id":"MDU6TGFiZWwyNjI1ODIwNjQ=","url":"https://api.github.com/repos/JMRI/JMRI/labels/Bug","name":"Bug","color":"FF2020","default":false}],"state":"open","locked":false,"assignee":{"login":"bobjacobsen","id":2774117,"node_id":"MDQ6VXNlcjI3NzQxMTc=","avatar_url":"https://avatars1.githubusercontent.com/u/2774117?v=4","gravatar_id":"","url":"https://api.github.com/users/bobjacobsen","html_url":"https://github.com/bobjacobsen","followers_url":"https://api.github.com/users/bobjacobsen/followers","following_url":"https://api.github.com/users/bobjacobsen/following{/other_user}","gists_url":"https://api.github.com/users/bobjacobsen/gists{/gist_id}","starred_url":"https://api.github.com/users/bobjacobsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobjacobsen/subscriptions","organizations_url":"https://api.github.com/users/bobjacobsen/orgs","repos_url":"https://api.github.com/users/bobjacobsen/repos","events_url":"https://api.github.com/users/bobjacobsen/events{/privacy}","received_events_url":"https://api.github.com/users/bobjacobsen/received_events","type":"User","site_admin":false},"assignees":[{"login":"bobjacobsen","id":2774117,"node_id":"MDQ6VXNlcjI3NzQxMTc=","avatar_url":"https://avatars1.githubusercontent.com/u/2774117?v=4","gravatar_id":"","url":"https://api.github.com/users/bobjacobsen","html_url":"https://github.com/bobjacobsen","followers_url":"https://api.github.com/users/bobjacobsen/followers","following_url":"https://api.github.com/users/bobjacobsen/following{/other_user}","gists_url":"https://api.github.com/users/bobjacobsen/gists{/gist_id}","starred_url":"https://api.github.com/users/bobjacobsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobjacobsen/subscriptions","organizations_url":"https://api.github.com/users/bobjacobsen/orgs","repos_url":"https://api.github.com/users/bobjacobsen/repos","events_url":"https://api.github.com/users/bobjacobsen/events{/privacy}","received_events_url":"https://api.github.com/users/bobjacobsen/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-08-24T03:45:10Z","updated_at":"2018-08-24T07:52:21Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Seen in \"head of master\" code just now:\r\n\r\nUpon reception of a LocoNet \"Transponding\" message, if the associated `Reporter` does not exist, one is created.  When the `Reporter Table` is asked to display that created bean, and that bean was the first Reporter bean, the ReporterDataModel issues an NPE.\r\n\r\nIf __that specific__ `Reporter` is then manually added, it appears in the `Reporter Table` as a reporter number one higher than the one specified in the dialog box, but the original bean (from the LocoNet message `Reporter` creation) also shows up at its correct `Reporter` number.\r\n\r\nIf instead JMRI is started and then a fake (unrelated) reporter is created manually using the `Reporter Table` \"add\" button, then the LocoNet message is received, the automatically created Reporter displays correctly, without NPE.\r\n\r\nSteps to reproduce the problem:\r\n\r\n- Start JMRI in LocoNet Simulator mode\r\n\r\n- Open \"LocoNet\"->\"Send LocoNet Packet\" tool.\r\n\r\n- In the uppermost \"Packet\" field, enter the following string\r\n`D0 20 05 00 0B 01`\r\n\r\n- Actuate the \"send\" button immediately below the uppermost \"Packet\" field.\r\n\r\n- Open \"Tools\"->\"Tables\"->\"Reporters\".\r\n\r\nThe NPE will appear immediately, and the Reporter table will remain empty.\r\n\r\n- Actuate the \"Reporter Table\" \"Add\" button.  Specify hardware address 6.  Actuate \"Create\" button.\r\n\r\nThe \"Reporter Table\" will now show \"Reporter 6\" (from the LocoNet message) and \"Reporter 7\" (from the manual add operation).\r\n\r\nThis issue results from a rather long string of user-level problems reported by \"halaszgabor\" on the JMRI user's list.  The specific experiment stems directly from the LocoNet Transponding message HEX values posted by @pabender (see [https://groups.io/g/jmriusers/message/151087](url)) during the lifetime of that thread.\r\n"},"comment":{"url":"https://api.github.com/repos/JMRI/JMRI/issues/comments/415681869","html_url":"https://github.com/JMRI/JMRI/issues/5696#issuecomment-415681869","issue_url":"https://api.github.com/repos/JMRI/JMRI/issues/5696","id":415681869,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTY4MTg2OQ==","user":{"login":"klk32003","id":14908397,"node_id":"MDQ6VXNlcjE0OTA4Mzk3","avatar_url":"https://avatars3.githubusercontent.com/u/14908397?v=4","gravatar_id":"","url":"https://api.github.com/users/klk32003","html_url":"https://github.com/klk32003","followers_url":"https://api.github.com/users/klk32003/followers","following_url":"https://api.github.com/users/klk32003/following{/other_user}","gists_url":"https://api.github.com/users/klk32003/gists{/gist_id}","starred_url":"https://api.github.com/users/klk32003/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klk32003/subscriptions","organizations_url":"https://api.github.com/users/klk32003/orgs","repos_url":"https://api.github.com/users/klk32003/repos","events_url":"https://api.github.com/users/klk32003/events{/privacy}","received_events_url":"https://api.github.com/users/klk32003/received_events","type":"User","site_admin":false},"created_at":"2018-08-24T07:52:21Z","updated_at":"2018-08-24T07:52:21Z","author_association":"CONTRIBUTOR","body":"> Likely fix in #5697, would appreciate somebody checking it.\r\n\r\nTested under \r\n(1) JMRI 4.13.3ish, Windows 7, LocoNet Simulator\r\n(2) JMRI 4.13.3ish, Windows XP, LocoBuffer-USB, connected to my layout\r\n\r\nAll good. \r\n\r\nI didn't notice the NPE, because I'm using a XML file like...\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<?xml-stylesheet href=\"/xml/XSLT/panelfile-2-9-6.xsl\" type=\"text/xsl\"?>\r\n<layout-config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://jmri.org/xml/schema/layout-2-9-6.xsd\">\r\n  <reporters class=\"jmri.jmrix.loconet.configurexml.LnReporterManagerXml\">\r\n    <reporter>\r\n      <systemName>LR1</systemName>\r\n    </reporter>\r\n    <reporter>\r\n      <systemName>LR2</systemName>\r\n    </reporter>\r\n    ...\r\n  </reporters>\r\n</layout-config>\r\n```\r\n...at JMRI Startup to fill the Reporter table.\r\n\r\nAnother note (not related to the NPE, just wanted to mention it): \r\n```\r\nSend LocoNet Packet: D0 20 05 00 0B 01 --> [D0 20 05 00 0B 01]  Transponder address 11 (short) present at LR6 () (BDL16x Board ID 1 RX4 zone C).\r\nSend LocoNet Packet: D0 20 05 7D 0B 7C --> [D0 20 05 7D 0B 7C]  Transponder address 11 (short) (or long address 16011) present at LR6 () (BDL16x Board ID 1 RX4 zone C).\r\n```\r\n\r\nBoth seems to work. Digitrax [documents](http://www.digitrax.com/media/apps/products/detection-signaling/bdl168/documents/transponding%20bdl16xrx4%20app%20note_1.pdf) only the second variant.\r\n\r\n"}}
{"actor":{"display_login":"klk32003"}}