Closed
Bug 716811
Opened 13 years ago
Closed 13 years ago
Local DB calls getAsBoolean for IS_FOLDER, schema uses integers, ClassCastException results.
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox11 fixed, firefox12 fixed, fennec11+)
RESOLVED
FIXED
Firefox 12
People
(Reporter: rnewman, Assigned: rnewman)
References
Details
(Whiteboard: [inbound])
Attachments
(1 file)
(deleted),
patch
|
blassey
:
review+
lucasr
:
feedback-
|
Details | Diff | Splinter Review |
01-09 23:09:46.828 E/ContentValues(10750): Cannot cast value for folder to a Boolean: 0
01-09 23:09:46.828 E/ContentValues(10750): java.lang.ClassCastException: java.lang.Integer
01-09 23:09:46.828 E/ContentValues(10750): at android.content.ContentValues.getAsBoolean(ContentValues.java:413)
01-09 23:09:46.828 E/ContentValues(10750): at org.mozilla.fennec_rnewman.db.BrowserProvider.insertInTransaction(BrowserProvider.java:695)
01-09 23:09:46.828 E/ContentValues(10750): at org.mozilla.fennec_rnewman.db.BrowserProvider.insert(BrowserProvider.java:662)
Assignee | ||
Comment 1•13 years ago
|
||
Looks like this is actually a Fennec bug. Pretty high priority; this blocks further testing of bookmarks sync.
(Well, so does "turn on local DB support", but I'm working around that :D)
lucasr, this one for you?
private void createMobileBookmarksFolder(SQLiteDatabase db) {
ContentValues values = new ContentValues();
values.put(Bookmarks.GUID, Bookmarks.MOBILE_FOLDER_GUID);
values.put(Bookmarks.IS_FOLDER, 1);
values.put(Bookmarks.POSITION, 0);
and
db.execSQL("CREATE TABLE " + TABLE_BOOKMARKS + "(" +
Bookmarks._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," +
Bookmarks.TITLE + " TEXT," +
Bookmarks.URL + " TEXT," +
Bookmarks.IS_FOLDER + " INTEGER NOT NULL DEFAULT 0," +
versus the line that fails:
String url = values.getAsString(Bookmarks.URL);
ContentValues imageValues = extractImageValues(values, url);
Boolean isFolder = values.getAsBoolean(Bookmarks.IS_FOLDER);
This should probably be
Boolean isFolder = values.getAsInteger(Bookmarks.IS_FOLDER) == 1;
I don't know if the getAsBoolean version works elsewhere, but apparently it doesn't on Android 2.3.4 on the Galaxy S2.
Assignee: rnewman → nobody
Status: ASSIGNED → NEW
Component: Android Sync → General
Product: Mozilla Services → Fennec Native
QA Contact: android-sync → general
Summary: Bookmarks repository layer uses integers rather than booleans → Local DB calls getAsBoolean for IS_FOLDER, schema uses integers, ClassCastException results.
Assignee | ||
Comment 2•13 years ago
|
||
Haven't tested this yet (blocked on another bug, and it's getting late), but it looks right...!
Attachment #587252 -
Flags: review?(blassey.bugs)
Attachment #587252 -
Flags: feedback?(lucasr.at.mozilla)
Updated•13 years ago
|
Attachment #587252 -
Flags: review?(blassey.bugs) → review+
Assignee | ||
Comment 3•13 years ago
|
||
Inbound:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d33ae3516305
Thanks for the quick turnaround, Brad.
Note to self: flag for Aurora approval when this lands.
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Whiteboard: [inbound]
Comment 4•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 12
Comment 5•13 years ago
|
||
Comment on attachment 587252 [details] [diff] [review]
Proposed patch. v1
Review of attachment 587252 [details] [diff] [review]:
-----------------------------------------------------------------
This patch causes a NullPointerException when adding bookmarks. I submitted a patch in bug 707150 to fix that (given that the patch is already in mozilla-central). I think we should skip this patch from aurora and a slightly different version of my patch in bug 707150 instead.
Attachment #587252 -
Flags: feedback?(lucasr.at.mozilla) → feedback-
Assignee | ||
Comment 6•13 years ago
|
||
(In reply to Lucas Rocha (:lucasr) from comment #5)
> I think we should skip this patch from aurora and a
> slightly different version of my patch in bug 707150 instead.
Agreed!
Comment 7•13 years ago
|
||
If this isn't going to aurora, please mark the whiteboard not-fennec-11
tracking-fennec: --- → 11+
Assignee | ||
Comment 8•13 years ago
|
||
Lucas, did your fix get to Aurora yet?
Comment 9•13 years ago
|
||
This has already been fixed in Aurora:
https://hg.mozilla.org/releases/mozilla-aurora/rev/15bbd03602a4
status-firefox11:
--- → fixed
status-firefox12:
--- → fixed
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•