This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 6706a0fd7f75daed147ff6553a9167fd9fe59a58 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri Dec 21 16:03:07 2018 +0100 CAMEL-13028: camel-undertow - When using SSL with rest-dsl and api-doc then you can get a port already bound exception --- .../apache/camel/component/undertow/UndertowHostKey.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHostKey.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHostKey.java index be64d09..8f09a18 100644 --- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHostKey.java +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHostKey.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,6 +24,8 @@ import javax.net.ssl.SSLContext; public final class UndertowHostKey { private final String host; private final int port; + + // SSLContext should not be part of the equals/hashCode contract private final SSLContext sslContext; public UndertowHostKey(String host, int port, SSLContext ssl) { @@ -49,12 +51,8 @@ public final class UndertowHostKey { if (!(target instanceof UndertowHostKey)) { return false; } - UndertowHostKey targetKey = (UndertowHostKey)target; + UndertowHostKey targetKey = (UndertowHostKey) target; boolean answer = true; - if (this.sslContext != null || targetKey.sslContext != null) { - answer = this.sslContext != null && targetKey.sslContext != null - && this.sslContext.equals(targetKey.sslContext); - } return answer && this.host != null && targetKey.host != null && this.host.equals(targetKey.host) && this.port == targetKey.port; } @@ -63,6 +61,6 @@ public final class UndertowHostKey { public int hashCode() { int answer = host.hashCode(); answer = answer * 31 + Integer.hashCode(port); - return answer * 31 + (sslContext != null ? sslContext.hashCode() : 0); + return answer; } } \ No newline at end of file