Source:
<code>protected SyslogReceivingChannelAdapterSupport createInstance() throws Exception { SyslogReceivingChannelAdapterSupport adapter; if (this.protocol == Protocol.tcp) { adapter = new TcpSyslogReceivingChannelAdapter(); if (this.connectionFactory != null) { Assert.isNull(this.port, "Cannot specify both 'port' and 'connectionFactory'"); ((TcpSyslogReceivingChannelAdapter) adapter).setConnectionFactory(this.connectionFactory); } if (this.applicationEventPublisher != null) { ((TcpSyslogReceivingChannelAdapter) adapter).setApplicationEventPublisher(this.applicationEventPublisher); <START> } <END> Assert.isNull(this.udpAdapter, "Cannot specifiy 'udp-attributes' when the protocol is 'tcp'"); } else if(this.protocol == Protocol.udp) { adapter = new UdpSyslogReceivingChannelAdapter(); if (this.udpAdapter != null) { Assert.isNull(this.port, "Cannot specify both 'port' and 'udpAdapter'"); ((UdpSyslogReceivingChannelAdapter) adapter).setUdpAdapter(this.udpAdapter); } Assert.isNull(this.connectionFactory, "Cannot specifiy 'connection-factory' unless the protocol is 'tcp'"); } else { throw new IllegalStateException("Unsupported protocol: " + this.protocol.toString()); } if (this.port != null) { adapter.setPort(this.port); } if (this.outputChannel != null) { adapter.setOutputChannel(this.outputChannel); } adapter.setAutoStartup(this.autoStartup); adapter.setPhase(this.phase); if (this.errorChannel != null) { adapter.setErrorChannel(this.errorChannel); } if (this.sendTimeout != null) { adapter.setSendTimeout(this.sendTimeout); } if (this.converter != null) { adapter.setConverter(this.converter); } if (this.beanName != null) { adapter.setBeanName(this.beanName); } adapter.afterPropertiesSet(); this.adapter = adapter; return adapter; }</code><technical_language>I is reason push publisher here, if push connectionFactory lines above. else if (this.applicationEventPublisher != null) { enough</technical_language>

Target:
protected SyslogReceivingChannelAdapterSupport createInstance() throws Exception { SyslogReceivingChannelAdapterSupport adapter; if (this.protocol == Protocol.tcp) { adapter = new TcpSyslogReceivingChannelAdapter(); if (this.connectionFactory != null) { Assert.isNull(this.port, "Cannot specify both 'port' and 'connectionFactory'"); ((TcpSyslogReceivingChannelAdapter) adapter).setConnectionFactory(this.connectionFactory); } else if (this.applicationEventPublisher != null) { ((TcpSyslogReceivingChannelAdapter) adapter).setApplicationEventPublisher(this.applicationEventPublisher); } Assert.isNull(this.udpAdapter, "Cannot specifiy 'udp-attributes' when the protocol is 'tcp'"); } else if(this.protocol == Protocol.udp) { adapter = new UdpSyslogReceivingChannelAdapter(); if (this.udpAdapter != null) { Assert.isNull(this.port, "Cannot specify both 'port' and 'udpAdapter'"); ((UdpSyslogReceivingChannelAdapter) adapter).setUdpAdapter(this.udpAdapter); } Assert.isNull(this.connectionFactory, "Cannot specifiy 'connection-factory' unless the protocol is 'tcp'"); } else { throw new IllegalStateException("Unsupported protocol: " + this.protocol.toString()); } if (this.port != null) { adapter.setPort(this.port); } if (this.outputChannel != null) { adapter.setOutputChannel(this.outputChannel); } adapter.setAutoStartup(this.autoStartup); adapter.setPhase(this.phase); if (this.errorChannel != null) { adapter.setErrorChannel(this.errorChannel); } if (this.sendTimeout != null) { adapter.setSendTimeout(this.sendTimeout); } if (this.converter != null) { adapter.setConverter(this.converter); } if (this.beanName != null) { adapter.setBeanName(this.beanName); } adapter.afterPropertiesSet(); this.adapter = adapter; return adapter; }