Skip to content

java.lang.UnsupportedOperationException FieldDefinition.Builder.inputValueDefinition #2099

Closed

Description

@dfa1

Describe the bug
In our codebase we are using FieldDefinition.Builder like:

builder.inputValueDefinition(inputValueDefinition);

with current master (2020-11-10T10-26-00-07ca7ee, commit 07ca7ee) we have:

java.lang.UnsupportedOperationException
at graphql.com.google.common.collect.ImmutableCollection.add(ImmutableCollection.java:246)
at graphql.language.FieldDefinition$Builder.inputValueDefinition(FieldDefinition.java:210)

IMHO the cause is that in the copy constructor we have this:

this.inputValueDefinitions = existing.getInputValueDefinitions();

whereas should be like this:

this.inputValueDefinitions = new ArrayList<>(existing.getInputValueDefinitions());

because it is a builder and it is supposed to be mutable.

To Reproduce

Use of FieldDefinition.Builder.

Activity

  1. changed the title [-]java.lang.UnsupportedOperationException after using last commit of master [/-] [+]java.lang.UnsupportedOperationException after using last commit of master (07ca7ee)[/+] on Nov 10, 2020
  2. changed the title [-]java.lang.UnsupportedOperationException after using last commit of master (07ca7ee)[/-] [+]java.lang.UnsupportedOperationException after using last commit of master [/+] on Nov 10, 2020
  3. andimarek commented on Nov 10, 2020

    @andimarek
    Member

    thanks a lot @dfa1 ... we will have a look

  4. added this to the 16.0 milestone on Nov 10, 2020
  5. changed the title [-]java.lang.UnsupportedOperationException after using last commit of master [/-] [+]java.lang.UnsupportedOperationException FieldDefinition.Builder.inputValueDefinition[/+] on Nov 14, 2020
  6. dfa1 commented on Nov 16, 2020

    @dfa1
    ContributorAuthor

    fixed by last merge on master, thanks!

    NB: found few new breaking changes in the public API (do you need a separate ticket?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions