Skip to content
Permalink
Browse files

handle VSD Deprecation Warnings

  • Loading branch information...
klk32003 committed Oct 23, 2018
1 parent 9aab301 commit abdb902374c0711c87b8438ba8a7e1e3a2096d29
Showing with 23 additions and 9 deletions.
  1. +23 −9 java/src/jmri/jmrit/vsdecoder/VSDecoderManager.java
@@ -511,11 +511,18 @@ protected void registerBeanListener(Manager beanManager, String sysName) {

protected void registerReporterListeners() {
// Walk through the list of reporters
for (String sysName : jmri.InstanceManager.getDefault(jmri.ReporterManager.class).getSystemNameList()) {
registerReporterListener(sysName);
Set<Reporter> reporterSet = jmri.InstanceManager.getDefault(jmri.ReporterManager.class).getNamedBeanSet();
for (Reporter r : reporterSet) {
if (r != null) {
registerReporterListener(r.getSystemName());
}
}
for (String sysname : jmri.InstanceManager.getDefault(jmri.BlockManager.class).getSystemNameList()) {
registerBeanListener(jmri.InstanceManager.getDefault(jmri.BlockManager.class), sysname);

Set<Block> blockSet = jmri.InstanceManager.getDefault(jmri.BlockManager.class).getNamedBeanSet();
for (Block b : blockSet) {
if (b != null) {
registerBeanListener(jmri.InstanceManager.getDefault(jmri.BlockManager.class), b.getSystemName());
}
}
}

@@ -534,11 +541,18 @@ private void setupReporterManagerListener() {

// Now, the Reporter Table might already be loaded and filled out, so we need to get all the Reporters and list them.
// And add ourselves as a listener to them.
for (String sysName : jmri.InstanceManager.getDefault(jmri.ReporterManager.class).getSystemNameList()) {
registerReporterListener(sysName);
}
for (String sysname : jmri.InstanceManager.getDefault(jmri.BlockManager.class).getSystemNameList()) {
registerBeanListener(jmri.InstanceManager.getDefault(jmri.BlockManager.class), sysname);
Set<Reporter> reporterSet = jmri.InstanceManager.getDefault(jmri.ReporterManager.class).getNamedBeanSet();
for (Reporter r : reporterSet) {
if (r != null) {
registerReporterListener(r.getSystemName());
}
}

Set<Block> blockSet = jmri.InstanceManager.getDefault(jmri.BlockManager.class).getNamedBeanSet();
for (Block b : blockSet) {
if (b != null) {
registerBeanListener(jmri.InstanceManager.getDefault(jmri.BlockManager.class), b.getSystemName());
}
}
}

0 comments on commit abdb902

Please sign in to comment.
You can’t perform that action at this time.