Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace usages of deprecated constructor Integer(String) with Integer.parseInt #1259

Merged
merged 1 commit into from
Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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