Skip to content

Commit 27a7740

Browse files
authored
style: include SLS_SUSPICIOUS_LOOP_SEARCH (#6260)
1 parent e123ca1 commit 27a7740

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

spotbugs-exclude.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,6 @@
195195
<Match>
196196
<Bug pattern="DRE_DECLARED_RUNTIME_EXCEPTION" />
197197
</Match>
198-
<Match>
199-
<Bug pattern="SLS_SUSPICIOUS_LOOP_SEARCH" />
200-
</Match>
201198
<Match>
202199
<Bug pattern="BAS_BLOATED_ASSIGNMENT_SCOPE" />
203200
</Match>

src/main/java/com/thealgorithms/ciphers/AffineCipher.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ static String decryptCipher(String cipher) {
6868
// then i will be the multiplicative inverse of a
6969
if (flag == 1) {
7070
aInv = i;
71+
break;
7172
}
7273
}
7374
for (int i = 0; i < cipher.length(); i++) {
@@ -83,16 +84,4 @@ static String decryptCipher(String cipher) {
8384

8485
return msg.toString();
8586
}
86-
87-
// Driver code
88-
public static void main(String[] args) {
89-
String msg = "AFFINE CIPHER";
90-
91-
// Calling encryption function
92-
String cipherText = encryptMessage(msg.toCharArray());
93-
System.out.println("Encrypted Message is : " + cipherText);
94-
95-
// Calling Decryption function
96-
System.out.println("Decrypted Message is: " + decryptCipher(cipherText));
97-
}
9887
}

0 commit comments

Comments
 (0)