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

Mark case classes final #2118

Merged
merged 1 commit into from Sep 26, 2018
Merged

Mark case classes final #2118

merged 1 commit into from Sep 26, 2018

Conversation

@richashworth
Copy link
Contributor

@richashworth richashworth commented Sep 25, 2018

Co-authored-by: Andrea Magnorsky roundcrisis@gmail.com

Adds the final modifier to case classes that are not already final or sealed abstract. Exceptions listed below:

  • TimedMatcher in /testing/src/main/scala/org/http4s/testing/RunTimedMatchers.scala
  • Anything under a src/test path

Adding the final or sealed abstract modifiers to the following case classes fails to compile, so these have also been excluded from this refactor:

  • /core/src/main/scala/org/http4s/parser/StrictTransportSecurityParser.scala: private case class StrictTransportSecurityParser(override val input: ParserInput)
  • ./examples/blaze/src/main/scala/com/example/http4s/blaze/demo/server/endpoints/JsonXmlHttpEndpoint.scala: case class Person(name: String, age: Int)

Fixes #2074

Co-authored-by: Andrea Magnorsky <roundcrisis@gmail.com>
@rossabaker
Copy link
Member

@rossabaker rossabaker commented Sep 25, 2018

Wonderful, thank you! Do you happen to remember the nature of the compile errors on the others? If not, I can reproduce easily enough.

Copy link
Member

@rossabaker rossabaker left a comment

The StrictTransportSecurityParser is an old scalac bug, and the solution if a linter complains is to seal it.

👍

@rossabaker rossabaker added this to the 0.19.0-M3 milestone Sep 25, 2018
@aeons aeons merged commit b34ce01 into http4s:master Sep 26, 2018
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.