Merge pull request #223 from shatake/shatake_branch
modified Upload on suggest words
This commit is contained in:
commit
2b4d9d8a18
4 changed files with 6 additions and 6 deletions
|
@ -277,7 +277,7 @@ public class SuggestBadWordAction extends BsSuggestBadWordAction {
|
|||
final File oFile = tempFile;
|
||||
try {
|
||||
final String head = new String(b, Constants.UTF_8);
|
||||
if (!head.startsWith("\"SuggestWord\",")) {
|
||||
if (!(head.startsWith("\"BadWord\"") || head.startsWith("BadWord"))) {
|
||||
log.error("Unknown file: "
|
||||
+ suggestBadWordForm.suggestBadWordFile);
|
||||
throw new SSCActionMessagesException(
|
||||
|
|
|
@ -276,7 +276,7 @@ public class SuggestElevateWordAction extends BsSuggestElevateWordAction {
|
|||
final File oFile = tempFile;
|
||||
try {
|
||||
final String head = new String(b, Constants.UTF_8);
|
||||
if (!head.startsWith("\"SuggestWord\",")) {
|
||||
if (!(head.startsWith("\"SuggestWord\"") || head.startsWith("SuggestWord"))) {
|
||||
log.error("Unknown file: "
|
||||
+ suggestElevateWordForm.suggestElevateWordFile);
|
||||
throw new SSCActionMessagesException(
|
||||
|
|
|
@ -178,7 +178,7 @@ public class SuggestBadWordService extends BsSuggestBadWordService implements
|
|||
}
|
||||
|
||||
private static String getValue(final List<String> list, final int index) {
|
||||
if (index < list.size()) {
|
||||
if (index >= list.size()) {
|
||||
return StringUtil.EMPTY;
|
||||
}
|
||||
String item = list.get(index).trim();
|
||||
|
@ -187,7 +187,7 @@ public class SuggestBadWordService extends BsSuggestBadWordService implements
|
|||
}
|
||||
if (item.length() > 1 && item.charAt(0) == '"'
|
||||
&& item.charAt(item.length() - 1) == '"') {
|
||||
item = item.substring(1, item.length() - 2);
|
||||
item = item.substring(1, item.length() - 1);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ public class SuggestElevateWordService extends BsSuggestElevateWordService
|
|||
}
|
||||
|
||||
static String getValue(final List<String> list, final int index) {
|
||||
if (index < list.size()) {
|
||||
if (index >= list.size()) {
|
||||
return StringUtil.EMPTY;
|
||||
}
|
||||
String item = list.get(index).trim();
|
||||
|
@ -213,7 +213,7 @@ public class SuggestElevateWordService extends BsSuggestElevateWordService
|
|||
}
|
||||
if (item.length() > 1 && item.charAt(0) == '"'
|
||||
&& item.charAt(item.length() - 1) == '"') {
|
||||
item = item.substring(1, item.length() - 2);
|
||||
item = item.substring(1, item.length() - 1);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue