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

Optimize check for missing fields in deserialization #1153

Merged
merged 1 commit into from
Dec 24, 2020

Conversation

shanshin
Copy link
Contributor

No description provided.

@qwwdfsad qwwdfsad removed the request for review from elizarov October 19, 2020 19:51
Copy link
Member

@sandwwraith sandwwraith left a comment

Choose a reason for hiding this comment

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

Do you have any tests for that? I know they would fail on buildserver and pass only locally, but that's ok for now (we can depend on -dev- version of compiler later)

@shanshin
Copy link
Contributor Author

Do you have any tests for that? I know they would fail on buildserver and pass only locally, but that's ok for now (we can depend on -dev- version of compiler later)

Now optimization turned off in compiler plugin to prevent fails. Anyway, the plugin should be improved

Copy link
Member

@sandwwraith sandwwraith left a comment

Choose a reason for hiding this comment

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

LGTM (modulo comments)
Seems that we have to merge this somewhere around after 1.4.20 (so we can raise min version to 30)

SerializationException("Field '$fieldName' is required, but it was missing")
internal class MissingFieldException : SerializationException {
// TODO: add (message, cause) ctor after 1.4.20 for coroutines stacktrace recovery
constructor(fieldName: String) : super("Field '$fieldName' is required, but it was missing")
Copy link
Member

Choose a reason for hiding this comment

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

The error in build is caused by the fact that old plugins can't find primary constructor of this class (because now it has two secondary constructors). In 1.4.20 this problem is fixed, so you may try to bump kotlin version to 1.4.20-M2

@shanshin shanshin force-pushed the optimize-check-fields branch 2 times, most recently from 834dd3b to 5516e6d Compare November 6, 2020 12:54
@shanshin shanshin force-pushed the optimize-check-fields branch 2 times, most recently from 3a13bf6 to 2f8de1f Compare December 23, 2020 17:49
@@ -2,7 +2,7 @@
# Copyright 2017-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
#

mainKotlinVersion=1.4.10
mainKotlinVersion=1.4.30-M1
Copy link
Member

Choose a reason for hiding this comment

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

Don't forget to change mainLibVersion to 1.1.0-SNAPSHOT so your optimizations will be enabled

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.

2 participants