Promotion to . for variable numbers of arguments

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3773 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
depristo 2010-07-12 22:53:53 +00:00
parent 297f15a60c
commit 2e445262f2
2 changed files with 16 additions and 2 deletions

View File

@ -54,6 +54,9 @@ public abstract class VCFCompoundHeaderLine extends VCFHeaderLine implements VCF
public String getDescription() { return description; }
public VCFHeaderLineType getType() { return type; }
//
public void setNumberToUnbounded() { this.count = UNBOUNDED; }
// our type of line, i.e. format, info, etc
private final SupportedHeaderLineType lineType;

View File

@ -165,8 +165,19 @@ public class VCFUtils {
VCFCompoundHeaderLine compOther = (VCFCompoundHeaderLine)other;
// if the names are the same, but the values are different, we need to quit
if (! (compLine).equalsExcludingDescription(compOther) )
throw new IllegalStateException("Incompatible header types, collision between these two types: " + line + " " + other );
if (! (compLine).equalsExcludingDescription(compOther) ) {
if ( compLine.getType().equals(compOther.getType()) ) {
// The Number entry is an Integer that describes the number of values that can be
// included with the INFO field. For example, if the INFO field contains a single
// number, then this value should be 1. However, if the INFO field describes a pair
// of numbers, then this value should be 2 and so on. If the number of possible
// values varies, is unknown, or is unbounded, then this value should be '.'.
logger.warn("Promoting header field Number to . due to number differences in header lines: " + line + " " + other);
compOther.setNumberToUnbounded();
} else {
throw new IllegalStateException("Incompatible header types, collision between these two types: " + line + " " + other );
}
}
if ( ! compLine.getDescription().equals(compOther) )
if ( logger != null ) logger.warn(String.format("Allowing unequal description fields through: keeping " + compOther + " excluding " + compLine));
} else {