Throw a narrower exception

This commit is contained in:
Tom Morris 2013-06-22 16:26:45 -04:00
parent 43b2d89703
commit 6e88d068ee
7 changed files with 8 additions and 7 deletions

View File

@ -172,7 +172,7 @@ public class Engine implements Jsonizable {
throw new InternalError("This method should not be called when the engine is not in record mode."); throw new InternalError("This method should not be called when the engine is not in record mode.");
} }
public void initializeFromJSON(JSONObject o) throws Exception { public void initializeFromJSON(JSONObject o) throws JSONException {
if (o == null) { if (o == null) {
return; return;
} }

View File

@ -33,6 +33,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package com.google.refine.browsing.facets; package com.google.refine.browsing.facets;
import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import com.google.refine.Jsonizable; import com.google.refine.Jsonizable;
@ -54,5 +55,5 @@ public interface Facet extends Jsonizable {
public void computeChoices(Project project, FilteredRecords filteredRecords); public void computeChoices(Project project, FilteredRecords filteredRecords);
public void initializeFromJSON(Project project, JSONObject o) throws Exception; public void initializeFromJSON(Project project, JSONObject o) throws JSONException;
} }

View File

@ -152,7 +152,7 @@ public class ListFacet implements Facet {
} }
@Override @Override
public void initializeFromJSON(Project project, JSONObject o) throws Exception { public void initializeFromJSON(Project project, JSONObject o) throws JSONException {
_name = o.getString("name"); _name = o.getString("name");
_expression = o.getString("expression"); _expression = o.getString("expression");
_columnName = o.getString("columnName"); _columnName = o.getString("columnName");

View File

@ -159,7 +159,7 @@ public class RangeFacet implements Facet {
} }
@Override @Override
public void initializeFromJSON(Project project, JSONObject o) throws Exception { public void initializeFromJSON(Project project, JSONObject o) throws JSONException {
_name = o.getString("name"); _name = o.getString("name");
_expression = o.getString("expression"); _expression = o.getString("expression");
_columnName = o.getString("columnName"); _columnName = o.getString("columnName");

View File

@ -206,7 +206,7 @@ public class ScatterplotFacet implements Facet {
} }
@Override @Override
public void initializeFromJSON(Project project, JSONObject o) throws Exception { public void initializeFromJSON(Project project, JSONObject o) throws JSONException {
name = o.getString(NAME); name = o.getString(NAME);
l = size = (o.has(SIZE)) ? o.getInt(SIZE) : 100; l = size = (o.has(SIZE)) ? o.getInt(SIZE) : 100;
dot = (o.has(DOT)) ? o.getInt(DOT) : 0.5d; dot = (o.has(DOT)) ? o.getInt(DOT) : 0.5d;

View File

@ -84,7 +84,7 @@ public class TextSearchFacet implements Facet {
} }
@Override @Override
public void initializeFromJSON(Project project, JSONObject o) throws Exception { public void initializeFromJSON(Project project, JSONObject o) throws JSONException {
_name = o.getString("name"); _name = o.getString("name");
_columnName = o.getString("columnName"); _columnName = o.getString("columnName");

View File

@ -111,7 +111,7 @@ public class TimeRangeFacet extends RangeFacet {
} }
@Override @Override
public void initializeFromJSON(Project project, JSONObject o) throws Exception { public void initializeFromJSON(Project project, JSONObject o) throws JSONException {
_name = o.getString("name"); _name = o.getString("name");
_expression = o.getString("expression"); _expression = o.getString("expression");
_columnName = o.getString("columnName"); _columnName = o.getString("columnName");