Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Jacoco causes a crash #3

Open
xgleich1 opened this issue Jun 6, 2017 · 3 comments
Open

Jacoco causes a crash #3

xgleich1 opened this issue Jun 6, 2017 · 3 comments

Comments

@xgleich1
Copy link

xgleich1 commented Jun 6, 2017

First of all a huge thanks for your library!

I was trying to use it and ran into a rather strange bug. The put operation always threw a exception:

java.lang.ClassCastException: boolean[] cannot be cast to java.lang.Object[]
at com.github.florent37.androidnosql.NoSql$Node.write(NoSql.java:475)

Further digging with the LogDataServer revealed this:

nodes: /user/florent/cars/0/$jacocoData/ -> []

For some very strange reason the db tries to save coverage data associated with the jacoco plugin.

I could also replicate it in your example app when I added:

apply plugin: 'jacoco'

android {
buildTypes {
debug {
testCoverageEnabled = true
}
}
}

in the build.gradle file of the app module.

I hope this helps while debugging the issue!

@florent37
Copy link
Owner

florent37 commented Jun 7, 2017 via email

@xgleich1
Copy link
Author

xgleich1 commented Jun 7, 2017

Primitive types seem to cause problems in general. I just added a primitive boolean as another (last one) member variable to the user class and it ran into an endless loop which produces this log in repeat:

D/LogDataSaver: nodes: /user/florent/flag/FALSE/FALSE/FALSE/FALSE/FALSE/FALSE/FALSE/FALSE/FALSE

For another note, you probable don't support this, but if I use types in kotlin (Int, Long) which correspond to primitive types in java there is also a exception thrown.

For the cast thing this seems to be the case, you cannot cast primitive types to their boxes and vice versa :/

@florent37
Copy link
Owner

oh :/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants