TeamSpeak-3-Java-API: Reconnect Error

Hey, I just used the example of the reconnect strategy. There is the following code:

		// Make stuff run every time the query (re)connects
		config.setConnectionHandler(new ConnectionHandler() {

			@Override
			public void onConnect(TS3Api api) {
				stuffThatNeedsToRunEveryTimeTheQueryConnects(api);
			}

			@Override
			public void onDisconnect(TS3Query ts3Query) {
				// Nothing
			}
		});

I did that in my code, but IntelliJ is giving me this error:

Class ‘Anonymous class derived from ConnectionHandler’ must either be declared abstract or implement abstract method ‘onConnect(TS3Query)’ in 'ConnectionHandler

It says I cant use TS3Api in the onConnect method. Am I just dumb and I dont see the issue by myself? 🤔

Heres my code: https://hastebin.com/unejuduzik.java

About this issue

Most upvoted comments

I added } finally { Thread.currentThread().interrupt(); }

to my Console Try-Catch-Block and finally it works. There even no reconnect attempts and my cpu usage is fine. Thank you guys for your help. Hopefully its my last time commenting on this issue 😄