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,12 +137,10 @@ public class Cell implements HasFields, Jsonizable {
}
}
if (value != null) {
if (type != null) {
if (value != null && type != null) {
if ("date".equals(type)) {
value = ParsingUtilities.stringToDate((String) value);
}
}
return new Cell(value, recon);
} else {
return null;

View File

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

View File

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

View File

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