diff --git a/main/src/com/google/refine/expr/functions/Cross.java b/main/src/com/google/refine/expr/functions/Cross.java index 4dd05b146..2c16a5294 100644 --- a/main/src/com/google/refine/expr/functions/Cross.java +++ b/main/src/com/google/refine/expr/functions/Cross.java @@ -62,11 +62,11 @@ public class Cross implements Function { toColumnName != null && toColumnName instanceof String) { ProjectJoin join = ProjectManager.singleton.getInterProjectModel().getJoin( - ProjectManager.singleton.getProjectMetadata( - ((Project) bindings.get("project")).id).getName(), - ((WrappedCell) wrappedCell).columnName, - (String) toProjectName, - (String) toColumnName + ProjectManager.singleton.getProjectMetadata( + ((Project) bindings.get("project")).id).getName(), + ((WrappedCell) wrappedCell).columnName, + (String) toProjectName, + (String) toColumnName ); return join.getRows(((WrappedCell) wrappedCell).cell.value); diff --git a/main/src/com/google/refine/expr/functions/ToString.java b/main/src/com/google/refine/expr/functions/ToString.java index f10c9b240..f7ff6ba3d 100644 --- a/main/src/com/google/refine/expr/functions/ToString.java +++ b/main/src/com/google/refine/expr/functions/ToString.java @@ -54,10 +54,10 @@ public class ToString implements Function { if (o1 instanceof Calendar || o1 instanceof Date) { DateFormat formatter = null; if (args.length == 2) { - Object o2 = args[1]; - if (o2 != null && o2 instanceof String) { - formatter = new SimpleDateFormat((String) o2); - } + Object o2 = args[1]; + if (o2 != null && o2 instanceof String) { + formatter = new SimpleDateFormat((String) o2); + } } if (formatter == null) { formatter = DateFormat.getDateInstance(); diff --git a/main/src/com/google/refine/io/ProjectUtilities.java b/main/src/com/google/refine/io/ProjectUtilities.java index 2e0149923..62210df23 100644 --- a/main/src/com/google/refine/io/ProjectUtilities.java +++ b/main/src/com/google/refine/io/ProjectUtilities.java @@ -140,22 +140,22 @@ public class ProjectUtilities { static protected Project loadFromFile( File file, long id - ) throws Exception { - ZipFile zipFile = new ZipFile(file); - try { - Pool pool = new Pool(); - ZipEntry poolEntry = zipFile.getEntry("pool.txt"); - if (poolEntry != null) { - pool.load(zipFile.getInputStream(poolEntry)); - } // else, it's a legacy project file + ) throws Exception { + ZipFile zipFile = new ZipFile(file); + try { + Pool pool = new Pool(); + ZipEntry poolEntry = zipFile.getEntry("pool.txt"); + if (poolEntry != null) { + pool.load(zipFile.getInputStream(poolEntry)); + } // else, it's a legacy project file - return Project.loadFromInputStream( + return Project.loadFromInputStream( zipFile.getInputStream(zipFile.getEntry("data.txt")), id, pool - ); - } finally { - zipFile.close(); - } + ); + } finally { + zipFile.close(); } + } } diff --git a/main/src/com/google/refine/operations/cell/MultiValuedCellSplitOperation.java b/main/src/com/google/refine/operations/cell/MultiValuedCellSplitOperation.java index 9f5a1ad06..3a100e562 100644 --- a/main/src/com/google/refine/operations/cell/MultiValuedCellSplitOperation.java +++ b/main/src/com/google/refine/operations/cell/MultiValuedCellSplitOperation.java @@ -78,18 +78,18 @@ public class MultiValuedCellSplitOperation extends AbstractOperation { _mode = mode; } - @Override -public void write(JSONWriter writer, Properties options) - throws JSONException { - - writer.object(); - writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); - writer.key("description"); writer.value("Split multi-valued cells in column " + _columnName); - writer.key("columnName"); writer.value(_columnName); - writer.key("keyColumnName"); writer.value(_keyColumnName); - writer.key("separator"); writer.value(_separator); - writer.key("mode"); writer.value(_mode); - writer.endObject(); + @Override + public void write(JSONWriter writer, Properties options) + throws JSONException { + + writer.object(); + writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); + writer.key("description"); writer.value("Split multi-valued cells in column " + _columnName); + writer.key("columnName"); writer.value(_columnName); + writer.key("keyColumnName"); writer.value(_keyColumnName); + writer.key("separator"); writer.value(_separator); + writer.key("mode"); writer.value(_mode); + writer.endObject(); } @Override diff --git a/main/src/com/google/refine/operations/cell/TransposeColumnsIntoRowsOperation.java b/main/src/com/google/refine/operations/cell/TransposeColumnsIntoRowsOperation.java index 2ff30995c..3d4ce8938 100644 --- a/main/src/com/google/refine/operations/cell/TransposeColumnsIntoRowsOperation.java +++ b/main/src/com/google/refine/operations/cell/TransposeColumnsIntoRowsOperation.java @@ -85,20 +85,20 @@ public class TransposeColumnsIntoRowsOperation extends AbstractOperation { _ignoreBlankCells = ignoreBlankCells; } - @Override -public void write(JSONWriter writer, Properties options) - throws JSONException { - - writer.object(); - writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); - writer.key("description"); writer.value("Transpose cells in " + _columnCount + " column(s) starting with " + _startColumnName + " into rows"); - writer.key("startColumnName"); writer.value(_startColumnName); - writer.key("columnCount"); writer.value(_columnCount); - writer.key("combinedColumnName"); writer.value(_combinedColumnName); - writer.key("prependColumnName"); writer.value(_prependColumnName); - writer.key("separator"); writer.value(_separator); - writer.key("ignoreBlankCells"); writer.value(_ignoreBlankCells); - writer.endObject(); + @Override + public void write(JSONWriter writer, Properties options) + throws JSONException { + + writer.object(); + writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); + writer.key("description"); writer.value("Transpose cells in " + _columnCount + " column(s) starting with " + _startColumnName + " into rows"); + writer.key("startColumnName"); writer.value(_startColumnName); + writer.key("columnCount"); writer.value(_columnCount); + writer.key("combinedColumnName"); writer.value(_combinedColumnName); + writer.key("prependColumnName"); writer.value(_prependColumnName); + writer.key("separator"); writer.value(_separator); + writer.key("ignoreBlankCells"); writer.value(_ignoreBlankCells); + writer.endObject(); } @Override diff --git a/main/src/com/google/refine/operations/cell/TransposeRowsIntoColumnsOperation.java b/main/src/com/google/refine/operations/cell/TransposeRowsIntoColumnsOperation.java index 5470fd1ca..0782c70b0 100644 --- a/main/src/com/google/refine/operations/cell/TransposeRowsIntoColumnsOperation.java +++ b/main/src/com/google/refine/operations/cell/TransposeRowsIntoColumnsOperation.java @@ -69,16 +69,16 @@ public class TransposeRowsIntoColumnsOperation extends AbstractOperation { _rowCount = rowCount; } - @Override -public void write(JSONWriter writer, Properties options) - throws JSONException { - - writer.object(); - writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); - writer.key("description"); writer.value("Transpose every " + _rowCount + " cells in column " + _columnName + " into separate columns"); - writer.key("columnName"); writer.value(_columnName); - writer.key("rowCount"); writer.value(_rowCount); - writer.endObject(); + @Override + public void write(JSONWriter writer, Properties options) + throws JSONException { + + writer.object(); + writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); + writer.key("description"); writer.value("Transpose every " + _rowCount + " cells in column " + _columnName + " into separate columns"); + writer.key("columnName"); writer.value(_columnName); + writer.key("rowCount"); writer.value(_rowCount); + writer.endObject(); } @Override diff --git a/main/src/com/google/refine/operations/column/ColumnMoveOperation.java b/main/src/com/google/refine/operations/column/ColumnMoveOperation.java index 615fac945..2471870a8 100644 --- a/main/src/com/google/refine/operations/column/ColumnMoveOperation.java +++ b/main/src/com/google/refine/operations/column/ColumnMoveOperation.java @@ -65,16 +65,16 @@ public class ColumnMoveOperation extends AbstractOperation { _index = index; } - @Override -public void write(JSONWriter writer, Properties options) - throws JSONException { + @Override + public void write(JSONWriter writer, Properties options) + throws JSONException { - writer.object(); - writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); - writer.key("description"); writer.value("Move column " + _columnName + " to position " + _index); - writer.key("columnName"); writer.value(_columnName); - writer.key("index"); writer.value(_index); - writer.endObject(); + writer.object(); + writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); + writer.key("description"); writer.value("Move column " + _columnName + " to position " + _index); + writer.key("columnName"); writer.value(_columnName); + writer.key("index"); writer.value(_index); + writer.endObject(); } diff --git a/main/src/com/google/refine/operations/column/ColumnRemovalOperation.java b/main/src/com/google/refine/operations/column/ColumnRemovalOperation.java index c9b68a701..54fb8116a 100644 --- a/main/src/com/google/refine/operations/column/ColumnRemovalOperation.java +++ b/main/src/com/google/refine/operations/column/ColumnRemovalOperation.java @@ -62,15 +62,15 @@ public class ColumnRemovalOperation extends AbstractOperation { _columnName = columnName; } - @Override -public void write(JSONWriter writer, Properties options) + @Override + public void write(JSONWriter writer, Properties options) throws JSONException { - writer.object(); - writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); - writer.key("description"); writer.value("Remove column " + _columnName); - writer.key("columnName"); writer.value(_columnName); - writer.endObject(); + writer.object(); + writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); + writer.key("description"); writer.value("Remove column " + _columnName); + writer.key("columnName"); writer.value(_columnName); + writer.endObject(); } diff --git a/main/src/com/google/refine/operations/column/ColumnRenameOperation.java b/main/src/com/google/refine/operations/column/ColumnRenameOperation.java index 1913bbacc..846f66fbc 100644 --- a/main/src/com/google/refine/operations/column/ColumnRenameOperation.java +++ b/main/src/com/google/refine/operations/column/ColumnRenameOperation.java @@ -65,16 +65,16 @@ public class ColumnRenameOperation extends AbstractOperation { _newColumnName = newColumnName; } - @Override -public void write(JSONWriter writer, Properties options) - throws JSONException { - - writer.object(); - writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); - writer.key("description"); writer.value("Rename column " + _oldColumnName + " to " + _newColumnName); - writer.key("oldColumnName"); writer.value(_oldColumnName); - writer.key("newColumnName"); writer.value(_newColumnName); - writer.endObject(); + @Override + public void write(JSONWriter writer, Properties options) + throws JSONException { + + writer.object(); + writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); + writer.key("description"); writer.value("Rename column " + _oldColumnName + " to " + _newColumnName); + writer.key("oldColumnName"); writer.value(_oldColumnName); + writer.key("newColumnName"); writer.value(_newColumnName); + writer.endObject(); } diff --git a/main/src/com/google/refine/operations/row/DenormalizeOperation.java b/main/src/com/google/refine/operations/row/DenormalizeOperation.java index 80b70a91b..605654ed7 100644 --- a/main/src/com/google/refine/operations/row/DenormalizeOperation.java +++ b/main/src/com/google/refine/operations/row/DenormalizeOperation.java @@ -59,14 +59,14 @@ public class DenormalizeOperation extends AbstractOperation { public DenormalizeOperation() { } - @Override -public void write(JSONWriter writer, Properties options) - throws JSONException { - - writer.object(); - writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); - writer.key("description"); writer.value("Denormalize"); - writer.endObject(); + @Override + public void write(JSONWriter writer, Properties options) + throws JSONException { + + writer.object(); + writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); + writer.key("description"); writer.value("Denormalize"); + writer.endObject(); } diff --git a/main/src/com/google/refine/operations/row/RowReorderOperation.java b/main/src/com/google/refine/operations/row/RowReorderOperation.java index 00d4b62cf..6df761943 100644 --- a/main/src/com/google/refine/operations/row/RowReorderOperation.java +++ b/main/src/com/google/refine/operations/row/RowReorderOperation.java @@ -89,11 +89,11 @@ public class RowReorderOperation extends AbstractOperation { return "Reorder rows"; } - @Override -protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { + @Override + protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = new Engine(project); engine.setMode(_mode); - + List rowIndices = new ArrayList(); if (_mode == Mode.RowBased) { RowVisitor visitor = new IndexingVisitor(rowIndices); @@ -117,10 +117,10 @@ protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) visitor = srv; } } - + engine.getAllRecords().accept(project, visitor); } - + return new HistoryEntry( historyEntryID, project, @@ -128,35 +128,35 @@ protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) this, new RowReorderChange(rowIndices) ); - } + } - static protected class IndexingVisitor implements RowVisitor, RecordVisitor { - List _indices; + static protected class IndexingVisitor implements RowVisitor, RecordVisitor { + List _indices; - IndexingVisitor(List indices) { - _indices = indices; - } + IndexingVisitor(List indices) { + _indices = indices; + } - @Override - public void start(Project project) { - } + @Override + public void start(Project project) { + } - @Override - public void end(Project project) { - } + @Override + public void end(Project project) { + } - @Override - public boolean visit(Project project, int rowIndex, Row row) { - _indices.add(rowIndex); - return false; - } + @Override + public boolean visit(Project project, int rowIndex, Row row) { + _indices.add(rowIndex); + return false; + } - @Override - public boolean visit(Project project, Record record) { - for (int r = record.fromRowIndex; r < record.toRowIndex; r++) { - _indices.add(r); - } - return false; - } - } + @Override + public boolean visit(Project project, Record record) { + for (int r = record.fromRowIndex; r < record.toRowIndex; r++) { + _indices.add(r); + } + return false; + } + } } diff --git a/server/src/com/google/refine/Refine.java b/server/src/com/google/refine/Refine.java index 87a282184..55dc991ee 100644 --- a/server/src/com/google/refine/Refine.java +++ b/server/src/com/google/refine/Refine.java @@ -474,10 +474,10 @@ class RefineClient extends JFrame implements ActionListener { @Override public void actionPerformed(ActionEvent e) { - String item = e.getActionCommand(); - if (item.startsWith("Open")) { - openBrowser(); - } + String item = e.getActionCommand(); + if (item.startsWith("Open")) { + openBrowser(); + } } private void openBrowser() {