Skip to content

Commit

Permalink
style: do not suppress try (#5167)
Browse files Browse the repository at this point in the history
  • Loading branch information
vil02 committed May 26, 2024
1 parent 37c2a96 commit ea4dc15
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 15 deletions.
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
<arg>-Xlint:all</arg>
<arg>-Xlint:-auxiliaryclass</arg>
<arg>-Xlint:-rawtypes</arg>
<arg>-Xlint:-try</arg>
<arg>-Xlint:-unchecked</arg>
<arg>-Xlint:-lossy-conversions</arg>
<arg>-Werror</arg>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/thealgorithms/ciphers/ProductCipher.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public static void main(String[] args) {

System.out.println("Plaintext: ");
System.out.println(plaintext);
sc.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public void go() { // shows distance to all vertices // Interactive run for unde
System.out.println();
}
}
sc.close();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public static void main(String[] args) {
for (i = 0; i < n; i++) {
stack.push(sc.nextInt());
}
sc.close();
reverseStack(stack);
System.out.println("The reversed stack is:");
while (!stack.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ public static void main(String[] args) {
arr[i] = sc.nextInt();
}

try {
sc.close();
} catch (Exception e) {
System.out.println("Unable to close scanner" + e);
}

// Find XOR of the 2 non repeating elements
for (i = 0; i < n; i++) {
res ^= arr[i];
Expand All @@ -55,7 +49,6 @@ public static void main(String[] args) {
}

System.out.println("The two non repeating elements are " + num1 + " and " + num2);
sc.close();
}
}
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public static void main(String[] args) {
for (i = 0; i < size2 - 1; i++) {
System.out.println(b[i]);
}
s.close();
}
}
}
3 changes: 0 additions & 3 deletions src/main/java/com/thealgorithms/sorts/LinkListSort.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
package com.thealgorithms.sorts;

import java.util.Arrays;
import java.util.Scanner;

public class LinkListSort {

public static boolean isSorted(int[] p, int option) {
try (Scanner sc = new Scanner(System.in)) {
}
int[] a = p;
// Array is taken as input from test class
int[] b = p;
Expand Down

0 comments on commit ea4dc15

Please sign in to comment.