Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit afc23fbda873bf19c761bc0f124c99ff4b1a99e9
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Oct 22 15:25:27 2018
Generate correct code for a no argument Kotlin default DAO function.
Kotlin default functions takes 'this' as first parameter and Room
was generating code that passed it but also added a comma thinking
more parameters where to be appended, but on a no arg function, the
comma was kept followed by a closing parenthesis causing wrong code
to be generated.
This change fixes the issue by removing the comma when appending 'this',
but always prefixing a comma on all parameters if the call type is
DEFAULT_KOTLIN.
Bug: 117527454
Test: ./gradlew :room:integration-tests:kotlintestapp:cC
Change-Id: I5792280b85c66f90da3485767e480300ee72bda5
M room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
https://android-review.googlesource.com/798412
https://goto.google.com/android-sha1/afc23fbda873bf19c761bc0f124c99ff4b1a99e9
Branch: androidx-master-dev
commit afc23fbda873bf19c761bc0f124c99ff4b1a99e9
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Oct 22 15:25:27 2018
Generate correct code for a no argument Kotlin default DAO function.
Kotlin default functions takes 'this' as first parameter and Room
was generating code that passed it but also added a comma thinking
more parameters where to be appended, but on a no arg function, the
comma was kept followed by a closing parenthesis causing wrong code
to be generated.
This change fixes the issue by removing the comma when appending 'this',
but always prefixing a comma on all parameters if the call type is
DEFAULT_KOTLIN.
Bug: 117527454
Test: ./gradlew :room:integration-tests:kotlintestapp:cC
Change-Id: I5792280b85c66f90da3485767e480300ee72bda5
M room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
gm...@gmail.com <gm...@gmail.com> #3
A fox for this issue will be available in Room 2.1.0-alpha02
ap...@google.com <ap...@google.com> #6
delete
da...@google.com <da...@google.com>
ph...@gmail.com <ph...@gmail.com> #8
Run
ph...@gmail.com <ph...@gmail.com> #9
Run
ph...@gmail.com <ph...@gmail.com> #10
Run
Description
Version used: 2.0.0
Devices/Android versions reproduced on:
Nexus 4 (Android 5.1.1)
Nexus 5 (Android 6.0.1)
Subscribing & unsubscribing causes StrictModeDiskReadViolation & StrictModeDiskWriteViolation.
This is very strange, given that "If you’re worried about threads, Room keeps you at ease and ensures that observable queries are done off the main thread." (from
Sample project attached.