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

LinkedHashSet #236

Closed
jayashe opened this issue Aug 11, 2014 · 2 comments
Closed

LinkedHashSet #236

jayashe opened this issue Aug 11, 2014 · 2 comments

Comments

@jayashe
Copy link
Contributor

jayashe commented Aug 11, 2014

I'm running into an issue where this JSON

    "widgets" : {
      "description" : "An array of widgets.",
      "type" : "array",
      "minItems" : 0,
      "items" : {
        "$ref" : "widget.json"
      },
      "default" : [],
      "uniqueItems" : true
    }

generates this instance variable

    private Set<Widget> widgets = new LinkedHashSet<Widget>(Arrays.asList());

Arrays.asList() returns a list, which doesn't match the available LinkedHashSet(Collection) constructor, so a compilation error occurs.

Clearly uniqueItems: true is triggering set creation as opposed to list. Is there any reason not to use the default constructor in generating LinkedHashSets here?

@joelittlejohn
Copy link
Owner

Hi Jay, I think you're experiencing the same problem mentioned in #232. Does using 0.4.5 fix your problem?

@jayashe
Copy link
Contributor Author

jayashe commented Aug 11, 2014

Hah, @bitfrost sits around the corner from me.

Yeah I didn't realize the project was still using 0.4.5-SNAPSHOT.

0.4.5 fixed it.

@jayashe jayashe closed this as completed Aug 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants