Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0bc528f

Browse files
committed
Code tidy up
1 parent e249ea0 commit 0bc528f

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

library/src/main/java/com/stealthcopter/networktools/IPTools.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public static ArrayList<InetAddress> getLocalIPv4Addresses() {
9090

9191
/**
9292
* Check if the provided ip address refers to the localhost
93-
* <p>
93+
*
9494
* https://stackoverflow.com/a/2406819/315998
9595
*
9696
* @param addr - address to check
@@ -113,7 +113,7 @@ public static boolean isIpAddressLocalhost(InetAddress addr) {
113113

114114
/**
115115
* Check if the provided ip address refers to the localhost
116-
* <p>
116+
*
117117
* https://stackoverflow.com/a/2406819/315998
118118
*
119119
* @param addr - address to check

library/src/main/java/com/stealthcopter/networktools/Ping.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public interface PingListener {
3333

3434
/**
3535
* Set the address to ping
36-
* <p>
36+
*
3737
* Note that a lookup is not performed here so that we do not accidentally perform a network
3838
* request on the UI thread.
3939
*
@@ -128,7 +128,7 @@ public void cancel() {
128128

129129
/**
130130
* Perform a synchronous ping and return a result, will ignore number of times.
131-
* <p>
131+
*
132132
* Note that this should be performed on a background thread as it will perform a network
133133
* request
134134
*

library/src/main/java/com/stealthcopter/networktools/PortScan.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static PortScan onAddress(InetAddress ia) {
7070

7171
/**
7272
* Sets the timeout for each port scanned
73-
* <p>
73+
*
7474
* If you raise the timeout you may want to consider increasing the thread count {@link #setNoThreads(int)} to compensate.
7575
* We can afford to have quite a high thread count as most of the time the thread is just sitting
7676
* idle and waiting for the socket to timeout.

library/src/main/java/com/stealthcopter/networktools/SubnetDevices.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Created by mat on 03/11/17.
1616
*/
1717
public class SubnetDevices {
18-
private int noThreads = 255;
18+
private int noThreads = 100;
1919

2020
private ArrayList<String> addresses;
2121
private ArrayList<Device> devicesFound;

library/src/main/java/com/stealthcopter/networktools/WakeOnLan.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
/**
99
* Created by mat on 09/12/15.
10-
* <p>
10+
*
1111
* Tested this and it wakes my computer up :)
12-
* <p>
12+
*
1313
* Ref: http://www.jibble.org/wake-on-lan/
1414
*/
1515
public class WakeOnLan {

library/src/main/java/com/stealthcopter/networktools/ping/PingNative.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,29 @@ public static PingResult ping(InetAddress host, int timeOutMillis) throws IOExce
6363

6464
/**
6565
* getPingStats interprets the text result of a Linux activity_ping command
66-
* <p>
66+
*
6767
* Set pingError on error and return null
68-
* <p>
68+
*
6969
* http://en.wikipedia.org/wiki/Ping
70-
* <p>
70+
*
7171
* PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
7272
* 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.251 ms
7373
* 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.294 ms
7474
* 64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.295 ms
7575
* 64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.300 ms
76-
* <p>
76+
*
7777
* --- 127.0.0.1 activity_ping statistics ---
7878
* 4 packets transmitted, 4 received, 0% packet loss, time 0ms
7979
* rtt min/avg/max/mdev = 0.251/0.285/0.300/0.019 ms
80-
* <p>
80+
*
8181
* PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.
82-
* <p>
82+
*
8383
* --- 192.168.0.2 activity_ping statistics ---
8484
* 1 packets transmitted, 0 received, 100% packet loss, time 0ms
85-
* <p>
85+
*
8686
* # activity_ping 321321.
8787
* activity_ping: unknown host 321321.
88-
* <p>
88+
*
8989
* 1. Check if output contains 0% packet loss : Branch to success -> Get stats
9090
* 2. Check if output contains 100% packet loss : Branch to fail -> No stats
9191
* 3. Check if output contains 25% packet loss : Branch to partial success -> Get stats

library/src/test/java/com/stealthcopter/networktools/MACToolsTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ public void testInvalidMACAddresses() {
3939
public void testMACGetBytes() {
4040
byte[] bytes = MACTools.getMacBytes("01:02:03:04:05:06");
4141

42-
assertEquals(bytes[0], 0x01);
43-
assertEquals(bytes[1], 0x02);
44-
assertEquals(bytes[2], 0x03);
45-
assertEquals(bytes[3], 0x04);
46-
assertEquals(bytes[4], 0x05);
47-
assertEquals(bytes[5], 0x06);
42+
assertEquals(0x01, bytes[0]);
43+
assertEquals(0x02, bytes[1]);
44+
assertEquals(0x03, bytes[2]);
45+
assertEquals(0x04, bytes[3]);
46+
assertEquals(0x05, bytes[4]);
47+
assertEquals(0x06, bytes[5]);
4848
}
4949

5050

0 commit comments

Comments
 (0)