clearing PMD warnings

git-svn-id: http://google-refine.googlecode.com/svn/trunk@600 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Stefano Mazzocchi 2010-05-05 01:42:08 +00:00
parent e6d36710ff
commit c32899aea6
4 changed files with 15 additions and 22 deletions

View File

@ -137,11 +137,9 @@ public class Cell implements HasFields, Jsonizable {
} }
} }
if (value != null) { if (value != null && type != null) {
if (type != null) { if ("date".equals(type)) {
if ("date".equals(type)) { value = ParsingUtilities.stringToDate((String) value);
value = ParsingUtilities.stringToDate((String) value);
}
} }
return new Cell(value, recon); return new Cell(value, recon);
} else { } else {

View File

@ -310,15 +310,11 @@ public class HeuristicReconConfig extends ReconConfig {
for (String typeID : candidate.typeIDs) { for (String typeID : candidate.typeIDs) {
if (this.typeID.equals(typeID)) { if (this.typeID.equals(typeID)) {
recon.setFeature(Recon.Feature_typeMatch, true); recon.setFeature(Recon.Feature_typeMatch, true);
if (autoMatch && candidate.score >= 100) { if (autoMatch && candidate.score >= 100 && (count == 1 || candidate.score / recon.candidates.get(1).score >= 1.5)) {
if (count == 1 || recon.match = candidate;
candidate.score / recon.candidates.get(1).score >= 1.5) { recon.matchRank = 0;
recon.judgment = Judgment.Matched;
recon.match = candidate; recon.judgmentAction = "auto";
recon.matchRank = 0;
recon.judgment = Judgment.Matched;
recon.judgmentAction = "auto";
}
} }
break; break;
} }

View File

@ -153,7 +153,7 @@ public class ColumnSplitOperation extends EngineDependentOperation {
FilteredRows filteredRows = engine.getAllFilteredRows(false); FilteredRows filteredRows = engine.getAllFilteredRows(false);
RowVisitor rowVisitor; RowVisitor rowVisitor;
if ("lengths".equals(_mode)) { if ("lengths".equals(_mode)) {
rowVisitor = new ColumnSplitRowVisitor(project, column.getCellIndex(), columnNames, rowIndices, tuples) { rowVisitor = new ColumnSplitRowVisitor(column.getCellIndex(), columnNames, rowIndices, tuples) {
protected java.util.List<Serializable> split(String s) { protected java.util.List<Serializable> split(String s) {
List<Serializable> results = new ArrayList<Serializable>(_fieldLengths.length + 1); List<Serializable> results = new ArrayList<Serializable>(_fieldLengths.length + 1);
@ -174,7 +174,7 @@ public class ColumnSplitOperation extends EngineDependentOperation {
} else if (_regex) { } else if (_regex) {
Pattern pattern = Pattern.compile(_separator); Pattern pattern = Pattern.compile(_separator);
rowVisitor = new ColumnSplitRowVisitor(project, column.getCellIndex(), columnNames, rowIndices, tuples) { rowVisitor = new ColumnSplitRowVisitor(column.getCellIndex(), columnNames, rowIndices, tuples) {
Pattern _pattern; Pattern _pattern;
protected java.util.List<Serializable> split(String s) { protected java.util.List<Serializable> split(String s) {
@ -187,7 +187,7 @@ public class ColumnSplitOperation extends EngineDependentOperation {
} }
}.init(pattern); }.init(pattern);
} else { } else {
rowVisitor = new ColumnSplitRowVisitor(project, column.getCellIndex(), columnNames, rowIndices, tuples) { rowVisitor = new ColumnSplitRowVisitor(column.getCellIndex(), columnNames, rowIndices, tuples) {
protected java.util.List<Serializable> split(String s) { protected java.util.List<Serializable> split(String s) {
return stringArrayToValueList( return stringArrayToValueList(
StringUtils.splitByWholeSeparatorPreserveAllTokens(s, _separator, _maxColumns)); StringUtils.splitByWholeSeparatorPreserveAllTokens(s, _separator, _maxColumns));
@ -225,7 +225,6 @@ public class ColumnSplitOperation extends EngineDependentOperation {
int columnNameIndex = 1; int columnNameIndex = 1;
ColumnSplitRowVisitor( ColumnSplitRowVisitor(
Project project,
int cellIndex, int cellIndex,
List<String> columnNames, List<String> columnNames,
List<Integer> rowIndices, List<Integer> rowIndices,

View File

@ -82,8 +82,8 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
JSONObject.quote((String) object) : object.toString(); JSONObject.quote((String) object) : object.toString();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("{ \"s\" : \""); sb.append(subject); sb.append("\""); sb.append("{ \"s\" : \""); sb.append(subject); sb.append('"');
sb.append(", \"p\" : \""); sb.append(predicate); sb.append("\""); sb.append(", \"p\" : \""); sb.append(predicate); sb.append('"');
sb.append(", \"o\" : "); sb.append(s); sb.append(", \"o\" : "); sb.append(s);
if (subjectCell != null || objectCell != null) { if (subjectCell != null || objectCell != null) {
sb.append(", \"meta\" : { "); sb.append(", \"meta\" : { ");
@ -114,8 +114,8 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
JSONObject.quote((String) object) : object.toString(); JSONObject.quote((String) object) : object.toString();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("{ \"s\" : \""); sb.append(subject); sb.append("\""); sb.append("{ \"s\" : \""); sb.append(subject); sb.append('"');
sb.append(", \"p\" : \""); sb.append(predicate); sb.append("\""); sb.append(", \"p\" : \""); sb.append(predicate); sb.append('"');
sb.append(", \"o\" : "); sb.append(s); sb.append(", \"o\" : "); sb.append(s);
sb.append(", \"lang\" : "); sb.append(lang); sb.append(", \"lang\" : "); sb.append(lang);