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); } Assert.isNull(this.udpAdapter, "Cannot specifiy 'udp-attributes' when the protocol is 'tcp'"); } <START> else { <END> 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'"); } 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>Throw Exception _else_ check explicitly for udp enum. in case add a 3rd enum type, happen...I explicit :-)</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); } 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; }