Remove spurious JSONException in TemplatingExporter
This commit is contained in:
parent
c0d1a39991
commit
0a6b28eb2b
@ -37,8 +37,6 @@ import java.io.IOException;
|
|||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import org.json.JSONException;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.google.refine.browsing.Engine;
|
import com.google.refine.browsing.Engine;
|
||||||
import com.google.refine.browsing.Engine.Mode;
|
import com.google.refine.browsing.Engine.Mode;
|
||||||
@ -117,16 +115,12 @@ public class TemplatingExporter implements WriterExporter {
|
|||||||
RowVisitor visitor = template.getRowVisitor(writer, limit);
|
RowVisitor visitor = template.getRowVisitor(writer, limit);
|
||||||
|
|
||||||
if (sortingJson != null) {
|
if (sortingJson != null) {
|
||||||
try {
|
SortingConfig sorting = SortingConfig.reconstruct(sortingJson);
|
||||||
SortingConfig sorting = SortingConfig.reconstruct(sortingJson);
|
SortingRowVisitor srv = new SortingRowVisitor(visitor);
|
||||||
SortingRowVisitor srv = new SortingRowVisitor(visitor);
|
srv.initializeFromConfig(project, sorting);
|
||||||
srv.initializeFromConfig(project, sorting);
|
|
||||||
|
if (srv.hasCriteria()) {
|
||||||
if (srv.hasCriteria()) {
|
visitor = srv;
|
||||||
visitor = srv;
|
|
||||||
}
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,16 +130,12 @@ public class TemplatingExporter implements WriterExporter {
|
|||||||
RecordVisitor visitor = template.getRecordVisitor(writer, limit);
|
RecordVisitor visitor = template.getRecordVisitor(writer, limit);
|
||||||
|
|
||||||
if (sortingJson != null) {
|
if (sortingJson != null) {
|
||||||
try {
|
SortingConfig sorting = SortingConfig.reconstruct(sortingJson);
|
||||||
SortingConfig sorting = SortingConfig.reconstruct(sortingJson);
|
SortingRecordVisitor srv = new SortingRecordVisitor(visitor);
|
||||||
SortingRecordVisitor srv = new SortingRecordVisitor(visitor);
|
srv.initializeFromConfig(project, sorting);
|
||||||
srv.initializeFromConfig(project, sorting);
|
|
||||||
|
if (srv.hasCriteria()) {
|
||||||
if (srv.hasCriteria()) {
|
visitor = srv;
|
||||||
visitor = srv;
|
|
||||||
}
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user