Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

barclay fails to set collection arguments initialized with an immutable collection #4702

Open
droazen opened this issue Apr 24, 2018 · 3 comments
Assignees

Comments

@droazen
Copy link
Contributor

droazen commented Apr 24, 2018

If you have a barclay @Argument field of type List, barclay will fail to set the field value properly when the argument is specified if the List is initialized using an immutable Collection, such as that returned by Collections.emptyList(). Example error:

java.lang.UnsupportedOperationException
	at java.util.AbstractList.add(AbstractList.java:148)
	at java.util.AbstractList.add(AbstractList.java:108)
	at org.broadinstitute.barclay.argparser.CommandLineArgumentParser.setArgument(CommandLineArgumentParser.java:706)
	at org.broadinstitute.barclay.argparser.CommandLineArgumentParser.parseArguments(CommandLineArgumentParser.java:427)
	at org.broadinstitute.hellbender.cmdline.CommandLineProgram.parseArgs(CommandLineProgram.java:220)
	at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:194)
	at org.broadinstitute.hellbender.Main.runCommandLineProgram(Main.java:160)
	at org.broadinstitute.hellbender.Main.mainEntry(Main.java:203)
	at org.broadinstitute.hellbender.Main.main(Main.java:289)

Ideally, barclay should detect immutable collections and replace them with mutable ones when necessary.

@droazen
Copy link
Contributor Author

droazen commented Apr 24, 2018

For @cmnbroad

@magicDGS
Copy link
Contributor

There's a solution here: broadinstitute/barclay#102

droazen added a commit that referenced this issue Apr 24, 2018
…ist arguments

Barclay can't currently handle immutable collections in @argument values due to
#4702

Tests for these arguments are coming in a separate, larger branch, but I
wanted to get the fixes in first since it's such a simple fix.
@magicDGS
Copy link
Contributor

Also, some discussion about what to do with immutable collections in barclay is here: broadinstitute/barclay#100

droazen added a commit that referenced this issue Apr 25, 2018
…ist arguments (#4703)

Barclay can't currently handle immutable collections in @argument values due to
#4702

Tests for these arguments are coming in a separate, larger branch, but I
wanted to get the fixes in first since it's such a simple fix.
cwhelan pushed a commit to cwhelan/gatk-linked-reads that referenced this issue May 25, 2018
…ist arguments (broadinstitute#4703)

Barclay can't currently handle immutable collections in @argument values due to
broadinstitute#4702

Tests for these arguments are coming in a separate, larger branch, but I
wanted to get the fixes in first since it's such a simple fix.
@droazen droazen removed this from the Engine-2Q2018 milestone Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants