Final minor fix to contract

This commit is contained in:
Mark DePristo 2011-11-18 14:49:06 -05:00
parent a2e79fbe8a
commit c7f2d5c7c7
2 changed files with 4 additions and 4 deletions

View File

@ -213,7 +213,6 @@ public class GenotypesContext implements List<Genotype> {
* @param toCopy the collection of genotypes
* @return an mutable GenotypeContext containing genotypes
*/
@Requires({"toCopy != null"})
@Ensures({"result != null"})
public static final GenotypesContext copy(final Collection<Genotype> toCopy) {
return toCopy == null ? NO_GENOTYPES : create(new ArrayList<Genotype>(toCopy));

View File

@ -24,7 +24,7 @@
package org.broadinstitute.sting.utils.variantcontext;
import com.google.java.contract.Requires;
import com.google.java.contract.*;
import org.broad.tribble.Feature;
import org.broad.tribble.TribbleException;
import org.broad.tribble.util.ParsingUtils;
@ -158,10 +158,11 @@ public class VariantContextBuilder {
* @return
*/
@Requires({"key != null"})
@Ensures({"this.attributes.size() == old(this.attributes.size()) || this.attributes.size() == old(this.attributes.size()+1)"})
public VariantContextBuilder attribute(final String key, final Object value) {
if ( ! attributesCanBeModified ) {
this.attributesCanBeModified = true;
this.attributes = new HashMap<String, Object>();
this.attributes = new HashMap<String, Object>(attributes);
}
attributes.put(key, value);
return this;
@ -282,7 +283,7 @@ public class VariantContextBuilder {
* @param negLog10PError
* @return
*/
@Requires("negLog10PError <= 0 || negLog10PError == VariantContext.NO_NEG_LOG_10PERROR")
@Requires("negLog10PError >= 0 || negLog10PError == VariantContext.NO_NEG_LOG_10PERROR")
public VariantContextBuilder negLog10PError(final double negLog10PError) {
this.negLog10PError = negLog10PError;
return this;