fix miss assigning replaceAll return value.

This commit is contained in:
CCTV-1
2020-02-16 13:44:22 +08:00
parent 95a5ba10a7
commit f2c0b0423f

View File

@@ -144,12 +144,12 @@ public abstract class DeckBase implements Serializable, Comparable<DeckBase>, In
*/ */
public final String getBestFileName() { public final String getBestFileName() {
//string operator hard to guarantee filename legal,only replace some not allowed as file names characters //string operator hard to guarantee filename legal,only replace some not allowed as file names characters
name.replaceAll("[\\/:*?\"<>|]",""); final String result = name.replaceAll("[\\/:*?\"<>|]","");
if (name == "") { if (result == "") {
//"getBestFileName" sha1 value //"getBestFileName" sha1 value
return "bc2b4ac6bf8dd84112c79e4c733b0b5bd8f057b3"; return "bc2b4ac6bf8dd84112c79e4c733b0b5bd8f057b3";
} }
return name; return result;
} }
public abstract boolean isEmpty(); public abstract boolean isEmpty();