* @return the verifier (actually a short value)
*/
public static int createXorVerifier1(String password) {
+ if (password == null) {
+ throw new IllegalArgumentException("Password cannot be null");
+ }
+
byte[] arrByteChars = toAnsiPassword(password);
// SET Verifier TO 0x0000
* @see <a href="http://www.aspose.com/blogs/aspose-blogs/vladimir-averkin/archive/2007/08/20/funny-how-the-new-powerful-cryptography-implemented-in-word-2007-turns-it-into-a-perfect-tool-for-document-password-removal.html">Funny: How the new powerful cryptography implemented in Word 2007 turns it into a perfect tool for document password removal.</a>
*/
public static int createXorVerifier2(String password) {
+ if (password == null) {
+ throw new IllegalArgumentException("Password cannot be null");
+ }
+
//Array to hold Key Values
byte[] generatedKey = new byte[4];
package org.apache.poi.ss.formula.eval;
+//import org.checkerframework.checker.nullness.qual.NonNull;
+
import org.apache.poi.ss.formula.ptg.Ptg;
import org.apache.poi.ss.formula.ptg.StringPtg;
public static final StringEval EMPTY_INSTANCE = new StringEval("");
+ //@NotNull
private final String _value;
public StringEval(Ptg ptg) {
}
//if whole part has to go into the numerator
- if (wholePartFormatString.isEmpty()){
+ if (wholePartFormatString == null || wholePartFormatString.isEmpty()){
int trueNum = (fract.getDenominator()*(int)wholePart)+fract.getNumerator();
sb.append(trueNum).append("/").append(fract.getDenominator());
return sb.toString();
String id = el.getAttribute("Id");
if (sourceIds.contains(id)) {
String targetMode = el.getAttribute("TargetMode");
- if (targetMode.isEmpty()) {
+ if (targetMode == null || targetMode.isEmpty()) {
el.setAttribute("TargetMode", "Internal");
}
rsList.put(id, el);
}
// SYMBOL is missing
- if (font == null || !font.isSetTypeface() || font.getTypeface().isEmpty()) {
+ if (font == null || !font.isSetTypeface() || "".equals(font.getTypeface())) {
font = coll.getLatin();
}
}