Fixed possible logic problem

This commit is contained in:
2022-01-09 18:47:47 -05:00
parent 21fbfd4152
commit ccc525e912

View File

@@ -1,7 +1,7 @@
//CipherStreamJava/src/main/java/com/mattrixwv/CipherStreamJava/monoSubstitution/BaseX.java //CipherStreamJava/src/main/java/com/mattrixwv/CipherStreamJava/monoSubstitution/BaseX.java
//Mattrixwv //Mattrixwv
// Created: 01-08-22 // Created: 01-08-22
//Modified: 01-08-22 //Modified: 01-09-22
package com.mattrixwv.CipherStreamJava.monoSubstitution; package com.mattrixwv.CipherStreamJava.monoSubstitution;
@@ -25,7 +25,7 @@ public class BaseX{
validNumbers.append(Integer.toString(cnt, base).toUpperCase()); validNumbers.append(Integer.toString(cnt, base).toUpperCase());
} }
this.inputString = inputString.replaceAll("[^" + validNumbers.toString() + "\\s]", ""); this.inputString = inputString.replaceAll("[^" + validNumbers.toString() + "\\s]", "");
if(this.inputString != inputString){ if(!this.inputString.equals(inputString)){
throw new InvalidCharacterException("inputString cannot contain anything except numbers 0-" + Integer.toString(base - 1, base) + ", and whitespace"); throw new InvalidCharacterException("inputString cannot contain anything except numbers 0-" + Integer.toString(base - 1, base) + ", and whitespace");
} }
} }