Skip to content

Commit 0c47bc0

Browse files
committed
Revert check class
1 parent bd8e908 commit 0c47bc0

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/src/main/java/ua/naiksoftware/stomp/Stomp.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,11 @@ public static StompClient over(Class clazz, String uri) {
2929
* @return StompClient for receiving and sending messages. Call #StompClient.connect
3030
*/
3131
public static StompClient over(Class clazz, String uri, Map<String, String> connectHttpHeaders) {
32-
try {
33-
if (Class.forName("org.java_websocket.WebSocket") != null && clazz == WebSocket.class) {
34-
return createStompClient(new WebSocketsConnectionProvider(uri, connectHttpHeaders));
35-
} else {
36-
throw new RuntimeException("Not supported overlay transport: " + clazz.getName());
37-
}
38-
} catch (ClassNotFoundException e) {
39-
throw new RuntimeException("Class for transport " + clazz.getName() + " not included to project", e);
32+
if (clazz == WebSocket.class) {
33+
return createStompClient(new WebSocketsConnectionProvider(uri, connectHttpHeaders));
4034
}
35+
36+
throw new RuntimeException("Not supported overlay transport: " + clazz.getName());
4137
}
4238

4339
private static StompClient createStompClient(ConnectionProvider connectionProvider) {

0 commit comments

Comments
 (0)