samtools / htsjdk

A Java API for high-throughput sequencing data (HTS) formats.
http://samtools.github.io/htsjdk/
283 stars 242 forks source link

VariantContextBuilder : putAttributes fails if Map cannot be modified #1365

Closed lindenb closed 5 years ago

lindenb commented 5 years ago

Subject of the issue

I got an exception with VariantContextBuilder.putAttributes: UnsupportedOperationException

in https://github.com/samtools/htsjdk/blob/master/src/main/java/htsjdk/variant/variantcontext/VariantContextBuilder.java#L273

if this.attributes is not null and was created from public VariantContextBuilder(final VariantContext parent) , as far as I can see this.attributes is unmodifieable.

I could write a PR but I don't really understand this attributesCanBeModified.

Your environment

yfarjoun commented 5 years ago

Thanks @lindenb. I think that this might be related to #1344. I'm adding your usecase as a test to check it. be happy to get your review on that PR if you're interested.