Skip to content

Commit

Permalink
Replace usages of deprecated constructor Integer(String) with Integer…
Browse files Browse the repository at this point in the history
….parseInt
  • Loading branch information
PhilipRoman committed Jul 4, 2022
1 parent bdf928b commit 5d4d527
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/java_websocket/drafts/Draft.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ int readVersion(Handshakedata handshakedata) {
if (vers.length() > 0) {
int v;
try {
v = new Integer(vers.trim());
v = Integer.parseInt(vers.trim());
return v;
} catch (NumberFormatException e) {
return -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public static void main(String[] args) {
String[] spl = line.split(" ");
if (line.startsWith("r")) {
if (spl.length == 3) {
start = new Integer(spl[1]);
end = new Integer(spl[2]);
start = Integer.parseInt(spl[1]);
end = Integer.parseInt(spl[2]);
}
if (start != null && end != null) {
if (start > end) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void onMessage(WebSocket conn, ByteBuffer blob) {
public static void main(String[] args) throws UnknownHostException {
int port;
try {
port = new Integer(args[0]);
port = Integer.parseInt(args[0]);
} catch (Exception e) {
System.out.println("No port specified. Defaulting to 9003");
port = 9003;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ public void onMessage(WebSocket conn, ByteBuffer blob) {
public static void main(String[] args) throws UnknownHostException {
int port, limit;
try {
port = new Integer(args[0]);
port = Integer.parseInt(args[0]);
} catch (Exception e) {
System.out.println("No port specified. Defaulting to 9003");
port = 9003;
}
try {
limit = new Integer(args[1]);
limit = Integer.parseInt(args[1]);
} catch (Exception e) {
System.out.println("No limit specified. Defaulting to MaxInteger");
limit = Integer.MAX_VALUE;
Expand Down

0 comments on commit 5d4d527

Please sign in to comment.