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

Support merge keys #32

Merged
merged 1 commit into from
Jun 9, 2017
Merged

Support merge keys #32

merged 1 commit into from
Jun 9, 2017

Conversation

travisbrown
Copy link
Member

As discussed in #31. I'm like 95% sure this use of SafeConstructor is thread-safe, but I'm not very familiar with SnakeYAML so if someone wants to check my work I'd appreciate it.

I can add more specific tests if anyone wants, but this seemed reasonable and keeps us at 100% coverage.

@travisbrown travisbrown requested a review from jeremyrsmith June 8, 2017 21:38
}
}

private[this] val flattener: FlatteningConstructor = new FlatteningConstructor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is threadsafe? SnakeYAML's docs explicitly absolve them of thread safety. It could be that this particular bit of SnakeYAML is threadsafe, but maybe it's best to create a new FlatteningConstructor in the call to parse and pass it through all the yamlToJsons just to be sure? It sure seems like it ought to be safe since you're only using it for flatten, but Constructor does seem to have all kinds of non-threadsafe mutable state, and it wouldn't be trivial to ensure it's impossible for it to get touched by this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, better to be safe than sorry I guess. I'll make this change later.

@codecov-io
Copy link

codecov-io commented Jun 8, 2017

Codecov Report

Merging #32 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #32   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           4      4           
  Lines         102    106    +4     
  Branches        6      5    -1     
=====================================
+ Hits          102    106    +4
Impacted Files Coverage Δ
src/main/scala/io/circe/yaml/parser/package.scala 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a27c48f...c06cdf2. Read the comment docs.

@jeremyrsmith jeremyrsmith merged commit befb2b6 into circe:master Jun 9, 2017
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

Successfully merging this pull request may close these issues.

4 participants