mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-07 01:35:16 +08:00
style: include SLS_SUSPICIOUS_LOOP_SEARCH
(#6260)
This commit is contained in:
@ -195,9 +195,6 @@
|
|||||||
<Match>
|
<Match>
|
||||||
<Bug pattern="DRE_DECLARED_RUNTIME_EXCEPTION" />
|
<Bug pattern="DRE_DECLARED_RUNTIME_EXCEPTION" />
|
||||||
</Match>
|
</Match>
|
||||||
<Match>
|
|
||||||
<Bug pattern="SLS_SUSPICIOUS_LOOP_SEARCH" />
|
|
||||||
</Match>
|
|
||||||
<Match>
|
<Match>
|
||||||
<Bug pattern="BAS_BLOATED_ASSIGNMENT_SCOPE" />
|
<Bug pattern="BAS_BLOATED_ASSIGNMENT_SCOPE" />
|
||||||
</Match>
|
</Match>
|
||||||
|
@ -68,6 +68,7 @@ final class AffineCipher {
|
|||||||
// then i will be the multiplicative inverse of a
|
// then i will be the multiplicative inverse of a
|
||||||
if (flag == 1) {
|
if (flag == 1) {
|
||||||
aInv = i;
|
aInv = i;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = 0; i < cipher.length(); i++) {
|
for (int i = 0; i < cipher.length(); i++) {
|
||||||
@ -83,16 +84,4 @@ final class AffineCipher {
|
|||||||
|
|
||||||
return msg.toString();
|
return msg.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Driver code
|
|
||||||
public static void main(String[] args) {
|
|
||||||
String msg = "AFFINE CIPHER";
|
|
||||||
|
|
||||||
// Calling encryption function
|
|
||||||
String cipherText = encryptMessage(msg.toCharArray());
|
|
||||||
System.out.println("Encrypted Message is : " + cipherText);
|
|
||||||
|
|
||||||
// Calling Decryption function
|
|
||||||
System.out.println("Decrypted Message is: " + decryptCipher(cipherText));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user