When adding an ActiveRecord (representing a view) to an intent via 'Intent.putParceableArrayListExtra()' the following unmarshaling to retrieve the extra leads to an Exception.
Caused by: java.lang.RuntimeException: bad array lengths
at android.os.Parcel.readBooleanArray(Parcel.java:613)
at [..].db.model.MyTable.<init>(MyTable.java:282)
at [..].db.model.MyTable.<init>(MyTable.java:259)
at [..].db.model.MyTable$2.createFromParcel(MyTable.java:40)
at [..].db.model.MyTable$2.createFromParcel(MyTable.java:1)
at android.os.Parcel.readParcelable(Parcel.java:1981)
at android.os.Parcel.readValue(Parcel.java:1846)
at android.os.Parcel.readListInternal(Parcel.java:2092)
at android.os.Parcel.readArrayList(Parcel.java:1536)
at android.os.Parcel.readValue(Parcel.java:1867)
at android.os.Parcel.readMapInternal(Parcel.java:2083)
at android.os.Bundle.unparcel(Bundle.java:215)
at android.os.Bundle.containsKey(Bundle.java:256)
at android.content.Intent.hasExtra(Intent.java:3576)
at [..]MyActivity.onCreate(PresentationActivity.java:301)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1715)
This is caused because a boolean array of the wrong length is provided at this point in the generated code.
Database File:
package com.example.mysampleproject.db
database SampleDB {
migration {
create table artists (
_id integer primary key autoincrement,
name text
);
create view artists_view as
select
a._id as _id,
a.name as name
from artists as a;
}
}
When adding an ActiveRecord (representing a view) to an intent via 'Intent.putParceableArrayListExtra()' the following unmarshaling to retrieve the extra leads to an Exception.
Sample Project: https://github.com/imhoff/MechanoidIssues/tree/master/issue155
Exception:
This is caused because a boolean array of the wrong length is provided at this point in the generated code.
Database File:
Generated faulty code in
ArtistViewRecord.java
The line
boolean[] dirtyFlags = new boolean[2];
should sayboolean[] dirtyFlags = new boolean[1];