Commit 9b2eb2ff authored by Matija Obreza's avatar Matija Obreza
Browse files

CHECK_PASSED defaults to "OK" instead of null

parent 507be26c
......@@ -55,6 +55,7 @@ import org.slf4j.LoggerFactory;
*/
public class GGTC {
private static final String CHECK_PASSED = "OK";
private static final String HEADER_GENUS = "GENUS";
private static final String HEADER_GENUS_CHECK = "GENUS_check";
......@@ -298,7 +299,7 @@ public class GGTC {
if (LOG.isTraceEnabled())
LOG.trace("GENUS_check: {}", StringUtils.defaultIfBlank(genus_check, "NULL"));
outputLine[outputHeaders.indexOf(HEADER_GENUS_CHECK)] = genus_check;
outputLine[outputHeaders.indexOf(HEADER_GENUS_CHECK)] = StringUtils.equals(genus, genus_check) ? CHECK_PASSED : genus_check;
}
if (outputHeaders.indexOf(HEADER_SPECIES_CHECK) >= 0) {
......@@ -310,7 +311,7 @@ public class GGTC {
if (LOG.isTraceEnabled())
LOG.trace("SPECIES_check: {}", StringUtils.defaultIfBlank(species_check, "NULL"));
outputLine[outputHeaders.indexOf(HEADER_SPECIES_CHECK)] = species_check;
outputLine[outputHeaders.indexOf(HEADER_SPECIES_CHECK)] = StringUtils.equals(species, species_check) ? CHECK_PASSED : species_check;
}
if (outputHeaders.indexOf(HEADER_SPAUTHOR_CHECK) >= 0) {
......@@ -326,7 +327,7 @@ public class GGTC {
if (sourceMapping.get(HEADER_SPAUTHOR) != null) {
String spAuthor = sourceLine[sourceMapping.get(HEADER_SPAUTHOR)];
// System.err.println(spAuthor + " " + spauthor_check);
outputLine[outputHeaders.indexOf(HEADER_SPAUTHOR_CHECK)] = StringUtils.equals(spAuthor, spauthor_check) ? null : spauthor_check;
outputLine[outputHeaders.indexOf(HEADER_SPAUTHOR_CHECK)] = StringUtils.equals(spAuthor, spauthor_check) ? CHECK_PASSED : spauthor_check;
} else {
// System.err.println("Not here " + sourceMapping.get(HEADER_SPAUTHOR) + " " +
// spauthor_check);
......@@ -345,7 +346,7 @@ public class GGTC {
if (LOG.isTraceEnabled())
LOG.trace("SPECIES_check: {}", StringUtils.defaultIfBlank(subtaxa_check, "NULL"));
outputLine[outputHeaders.indexOf(HEADER_SUBTAXA_CHECK)] = StringUtils.equals(subtaxa, subtaxa_check) ? null : subtaxa_check;
outputLine[outputHeaders.indexOf(HEADER_SUBTAXA_CHECK)] = StringUtils.equals(subtaxa, subtaxa_check) ? CHECK_PASSED : subtaxa_check;
}
if (outputHeaders.indexOf(HEADER_SUBTAUTHOR_CHECK) >= 0) {
......@@ -361,7 +362,7 @@ public class GGTC {
// Add if needed
if (sourceMapping.get(HEADER_SUBTAUTHOR) != null) {
String subtauthor = sourceLine[sourceMapping.get(HEADER_SUBTAUTHOR)];
outputLine[outputHeaders.indexOf(HEADER_SUBTAUTHOR_CHECK)] = StringUtils.equals(subtauthor, subtauthor_check) ? null : subtauthor_check;
outputLine[outputHeaders.indexOf(HEADER_SUBTAUTHOR_CHECK)] = StringUtils.equals(subtauthor, subtauthor_check) ? CHECK_PASSED : subtauthor_check;
} else {
outputLine[outputHeaders.indexOf(HEADER_SUBTAUTHOR_CHECK)] = subtauthor_check;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment