diff --git a/CHANGES.txt b/CHANGES.txt index 25d812cca..c5add9122 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,7 +3,8 @@ Ongoing Fixes: - Issue 34: "Behavior of Text Filter is unpredictable when "regular expression" mode is enabled." Regex was not compiled with case insensitivity flag. - +- Issue 4: "Match All bug with ZIP code". Numeric values in cells were not stringified first + before comparison. 1.0.1 Release (May 12, 2010) diff --git a/src/main/java/com/metaweb/gridworks/operations/ReconJudgeSimilarCellsOperation.java b/src/main/java/com/metaweb/gridworks/operations/ReconJudgeSimilarCellsOperation.java index d100174b4..ae05767f1 100644 --- a/src/main/java/com/metaweb/gridworks/operations/ReconJudgeSimilarCellsOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/ReconJudgeSimilarCellsOperation.java @@ -164,59 +164,61 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper public boolean visit(Project project, int rowIndex, Row row, boolean includeContextual, boolean includeDependent) { Cell cell = row.getCell(_cellIndex); - if (cell != null && - ExpressionUtils.isNonBlankData(cell.value) && - _similarValue.equals(cell.value)) { - - Recon recon = null; - if (_judgment == Judgment.New && _shareNewTopics) { - if (_sharedNewRecon == null) { - _sharedNewRecon = new Recon(_historyEntryID); - _sharedNewRecon.judgment = Judgment.New; - _sharedNewRecon.judgmentBatchSize = 0; - _sharedNewRecon.judgmentAction = "similar"; - } - _sharedNewRecon.judgmentBatchSize++; - - recon = _sharedNewRecon; - } else { - if (_dupReconMap.containsKey(cell.recon.id)) { - recon = _dupReconMap.get(cell.recon.id); - recon.judgmentBatchSize++; - } else { - recon = cell.recon.dup(_historyEntryID); - recon.judgmentBatchSize = 1; - recon.matchRank = -1; - recon.judgmentAction = "similar"; - - if (_judgment == Judgment.Matched) { - recon.judgment = Recon.Judgment.Matched; - recon.match = _match; - - if (recon.candidates != null) { - for (int m = 0; m < recon.candidates.size(); m++) { - if (recon.candidates.get(m).topicGUID.equals(_match.topicGUID)) { - recon.matchRank = m; - break; - } - } - } - } else if (_judgment == Judgment.New) { - recon.judgment = Recon.Judgment.New; - recon.match = null; - } else if (_judgment == Judgment.None) { - recon.judgment = Recon.Judgment.None; - recon.match = null; - } - - _dupReconMap.put(cell.recon.id, recon); - } + if (cell != null && ExpressionUtils.isNonBlankData(cell.value)) { + String value = cell.value instanceof String ? + ((String) cell.value) : cell.value.toString(); + + if (_similarValue.equals(value)) { + Recon recon = null; + if (_judgment == Judgment.New && _shareNewTopics) { + if (_sharedNewRecon == null) { + _sharedNewRecon = new Recon(_historyEntryID); + _sharedNewRecon.judgment = Judgment.New; + _sharedNewRecon.judgmentBatchSize = 0; + _sharedNewRecon.judgmentAction = "similar"; + } + _sharedNewRecon.judgmentBatchSize++; + + recon = _sharedNewRecon; + } else { + if (_dupReconMap.containsKey(cell.recon.id)) { + recon = _dupReconMap.get(cell.recon.id); + recon.judgmentBatchSize++; + } else { + recon = cell.recon.dup(_historyEntryID); + recon.judgmentBatchSize = 1; + recon.matchRank = -1; + recon.judgmentAction = "similar"; + + if (_judgment == Judgment.Matched) { + recon.judgment = Recon.Judgment.Matched; + recon.match = _match; + + if (recon.candidates != null) { + for (int m = 0; m < recon.candidates.size(); m++) { + if (recon.candidates.get(m).topicGUID.equals(_match.topicGUID)) { + recon.matchRank = m; + break; + } + } + } + } else if (_judgment == Judgment.New) { + recon.judgment = Recon.Judgment.New; + recon.match = null; + } else if (_judgment == Judgment.None) { + recon.judgment = Recon.Judgment.None; + recon.match = null; + } + + _dupReconMap.put(cell.recon.id, recon); + } + } + + Cell newCell = new Cell(cell.value, recon); + + CellChange cellChange = new CellChange(rowIndex, _cellIndex, cell, newCell); + _cellChanges.add(cellChange); } - - Cell newCell = new Cell(cell.value, recon); - - CellChange cellChange = new CellChange(rowIndex, _cellIndex, cell, newCell); - _cellChanges.add(cellChange); } return false; }