Migrate SplitMultiValueCellsCommand to Jackson
This commit is contained in:
parent
d311810c2c
commit
b88fd2b895
@ -40,8 +40,7 @@ import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.google.refine.commands.Command;
|
||||
import com.google.refine.model.AbstractOperation;
|
||||
import com.google.refine.model.Project;
|
||||
@ -74,12 +73,7 @@ public class SplitMultiValueCellsCommand extends Command {
|
||||
} else {
|
||||
String s = request.getParameter("fieldLengths");
|
||||
|
||||
JSONArray a = ParsingUtilities.evaluateJsonStringToArray(s);
|
||||
int[] fieldLengths = new int[a.length()];
|
||||
|
||||
for (int i = 0; i < fieldLengths.length; i++) {
|
||||
fieldLengths[i] = a.getInt(i);
|
||||
}
|
||||
int[] fieldLengths = ParsingUtilities.mapper.readValue(s, new TypeReference<int[]>() {});
|
||||
|
||||
AbstractOperation op = new MultiValuedCellSplitOperation(columnName,
|
||||
keyColumnName,
|
||||
|
Loading…
Reference in New Issue
Block a user