Instead of hiding a default for that switch up at comic,
let's name all the legal values for that enum, yell in the one wacky case that shouldn't be possible, and let the compiler yell at us if we ever add more things to CurseFilter.Mode and forget them in that switch git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5837 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -95,7 +95,7 @@ public abstract class CurseFilter implements ChatFilter
|
||||
case DROP:
|
||||
return null;
|
||||
|
||||
case COMIC: default:
|
||||
case COMIC:
|
||||
m.appendReplacement(outbuf,
|
||||
StringUtil.replace(_replacements[ii], " ", comicChars(_comicLength[ii])));
|
||||
break;
|
||||
@@ -110,6 +110,14 @@ public abstract class CurseFilter implements ChatFilter
|
||||
m.appendReplacement(outbuf,
|
||||
StringUtil.replace(_replacements[ii], " ", vernacular));
|
||||
break;
|
||||
|
||||
case UNFILTERED:
|
||||
// We returned the msg unadulterated above in this case, so it should be
|
||||
// impossible to wind up here, but let's enumerate it so we can let the compiler
|
||||
// scream about missing enum values in a switch
|
||||
log.warning("Omg? We're trying to filter chat even though we're unfiltered?");
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
if (outbuf.length() == 0) {
|
||||
|
||||
Reference in New Issue
Block a user