Final minor fix to contract
This commit is contained in:
parent
a2e79fbe8a
commit
c7f2d5c7c7
|
|
@ -213,7 +213,6 @@ public class GenotypesContext implements List<Genotype> {
|
||||||
* @param toCopy the collection of genotypes
|
* @param toCopy the collection of genotypes
|
||||||
* @return an mutable GenotypeContext containing genotypes
|
* @return an mutable GenotypeContext containing genotypes
|
||||||
*/
|
*/
|
||||||
@Requires({"toCopy != null"})
|
|
||||||
@Ensures({"result != null"})
|
@Ensures({"result != null"})
|
||||||
public static final GenotypesContext copy(final Collection<Genotype> toCopy) {
|
public static final GenotypesContext copy(final Collection<Genotype> toCopy) {
|
||||||
return toCopy == null ? NO_GENOTYPES : create(new ArrayList<Genotype>(toCopy));
|
return toCopy == null ? NO_GENOTYPES : create(new ArrayList<Genotype>(toCopy));
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
package org.broadinstitute.sting.utils.variantcontext;
|
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.Feature;
|
||||||
import org.broad.tribble.TribbleException;
|
import org.broad.tribble.TribbleException;
|
||||||
import org.broad.tribble.util.ParsingUtils;
|
import org.broad.tribble.util.ParsingUtils;
|
||||||
|
|
@ -158,10 +158,11 @@ public class VariantContextBuilder {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Requires({"key != null"})
|
@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) {
|
public VariantContextBuilder attribute(final String key, final Object value) {
|
||||||
if ( ! attributesCanBeModified ) {
|
if ( ! attributesCanBeModified ) {
|
||||||
this.attributesCanBeModified = true;
|
this.attributesCanBeModified = true;
|
||||||
this.attributes = new HashMap<String, Object>();
|
this.attributes = new HashMap<String, Object>(attributes);
|
||||||
}
|
}
|
||||||
attributes.put(key, value);
|
attributes.put(key, value);
|
||||||
return this;
|
return this;
|
||||||
|
|
@ -282,7 +283,7 @@ public class VariantContextBuilder {
|
||||||
* @param negLog10PError
|
* @param negLog10PError
|
||||||
* @return
|
* @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) {
|
public VariantContextBuilder negLog10PError(final double negLog10PError) {
|
||||||
this.negLog10PError = negLog10PError;
|
this.negLog10PError = negLog10PError;
|
||||||
return this;
|
return this;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue