Skip to content

Commit 963db60

Browse files
code cleanup
1 parent c9e4c04 commit 963db60

File tree

4 files changed

+10
-47
lines changed

4 files changed

+10
-47
lines changed

src/main/java/com/testingbot/tunnel/App.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ private void startProxies() {
452452

453453
if (!this.noProxy) {
454454
this.httpProxy = new HttpProxy(this);
455-
if (this.getProxy() == null && this.httpProxy.testProxy() == false) {
455+
if (this.getProxy() == null && !this.httpProxy.testProxy()) {
456456
Logger.getLogger(App.class.getName()).log(Level.INFO, "! Tunnel might not work properly, test failed");
457457
}
458458
}
@@ -509,7 +509,7 @@ public void setFreeJettyPort() {
509509
port = serverSocket.getLocalPort();
510510
serverSocket.close();
511511
setJettyPort(port);
512-
} catch (IOException ex) {
512+
} catch (IOException ignored) {
513513
}
514514
}
515515

@@ -685,7 +685,7 @@ public int getSSHPort() {
685685
port = serverSocket.getLocalPort();
686686
serverSocket.close();
687687
sshPort = port;
688-
} catch (IOException ex) {
688+
} catch (IOException ignored) {
689689
}
690690
}
691691
return sshPort;

src/main/java/com/testingbot/tunnel/Statistics.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ public static long getNumberOfRequests() {
1212
return numberOfRequests;
1313
}
1414

15-
/**
16-
* @param aNumberOfRequests the numberOfRequests to set
17-
*/
18-
public static void setNumberOfRequests(long aNumberOfRequests) {
19-
numberOfRequests = aNumberOfRequests;
20-
}
21-
2215
/**
2316
* @return the startTime
2417
*/
@@ -40,13 +33,6 @@ public static long getBytesTransferred() {
4033
return bytesTransferred;
4134
}
4235

43-
/**
44-
* @param aBytesTransferred the bytesTransferred to set
45-
*/
46-
public static void setBytesTransferred(long aBytesTransferred) {
47-
bytesTransferred = aBytesTransferred;
48-
}
49-
5036
public static void addBytesTransferred(long aBytesTransferred) {
5137
bytesTransferred += aBytesTransferred;
5238
}

src/main/java/com/testingbot/tunnel/proxy/CustomAuthentication.java

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/main/java/ssh/TunnelPoller.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,34 @@ public class TunnelPoller {
1616
private final App app;
1717
private final Timer timer;
1818
private final String tunnelID;
19-
19+
2020
public TunnelPoller(App app, String tunnelID) {
2121
this.app = app;
2222
this.tunnelID = tunnelID;
2323
timer = new Timer();
2424
timer.schedule(new PollTask(), 5000, 5000);
2525
}
26-
26+
2727
public void cancel() {
2828
timer.cancel();
2929
}
30-
30+
3131
class PollTask extends TimerTask {
3232
int counter = 0;
33-
33+
3434
@Override
3535
public void run() {
3636
Api api = app.getApi();
3737
JSONObject response;
3838
try {
3939
response = api.pollTunnel(tunnelID);
40-
40+
4141
if (this.counter > 80) {
4242
Logger.getLogger(TunnelPoller.class.getName()).log(Level.SEVERE, "Unable to create tunnel, waited for 400 seconds. Please try again or check https://status.testingbot.com");
4343
timer.cancel();
44+
return;
4445
}
45-
46+
4647
if (response.getString("state").equals("READY")) {
4748
timer.cancel();
4849
app.tunnelReady(response);

0 commit comments

Comments
 (0)