Minor bug: blank maxColumns param caused SplitColumnCommand to throw an exception.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@587 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-05-04 16:14:13 +00:00
parent 4eab5a68c8
commit 883fc65304

View File

@ -21,6 +21,8 @@ public class SplitColumnCommand extends EngineDependentCommand {
boolean removeOriginalColumn = Boolean.parseBoolean(request.getParameter("removeOriginalColumn")); boolean removeOriginalColumn = Boolean.parseBoolean(request.getParameter("removeOriginalColumn"));
String mode = request.getParameter("mode"); String mode = request.getParameter("mode");
if ("separator".equals(mode)) { if ("separator".equals(mode)) {
String maxColumns = request.getParameter("maxColumns");
return new ColumnSplitOperation( return new ColumnSplitOperation(
engineConfig, engineConfig,
columnName, columnName,
@ -28,7 +30,7 @@ public class SplitColumnCommand extends EngineDependentCommand {
removeOriginalColumn, removeOriginalColumn,
request.getParameter("separator"), request.getParameter("separator"),
Boolean.parseBoolean(request.getParameter("regex")), Boolean.parseBoolean(request.getParameter("regex")),
Integer.parseInt(request.getParameter("maxColumns")) maxColumns != null && maxColumns.length() > 0 ? Integer.parseInt(maxColumns) : 0
); );
} else { } else {
String s = request.getParameter("fieldLengths"); String s = request.getParameter("fieldLengths");