Bug 31820 - Null revision no causes org.apache.slide.store.impl.rdbms.CommonRDBMSAdapter.revokePermission() to fail
Summary: Null revision no causes org.apache.slide.store.impl.rdbms.CommonRDBMSAdapter....
Status: RESOLVED FIXED
Alias: None
Product: Slide
Classification: Unclassified
Component: Stores (show other bugs)
Version: 2.1
Hardware: PC All
: P3 major (vote)
Target Milestone: ---
Assignee: Slide Developer List
URL:
Keywords:
Depends on:
Blocks: 34501
  Show dependency tree
 
Reported: 2004-10-21 03:43 UTC by Gao Jun
Modified: 2005-04-18 06:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gao Jun 2004-10-21 03:43:11 UTC
When deleting a folder with certain permissions assigned, NullpointerException
will be thrown.

I did some debug and found the error is in 
org.apache.slide.store.impl.rdbms.CommonRDBMSAdapter.revokePermission(
Connection connection, Uri uri, NodePermission permission)

when executing statement.setString(4, revisionNumber.toString(), it found 
revisionNumber is null.

I don't understand why permission has a revision no and I found in the table
PERMISSIONS all records' VERSION_NO(I assume this is the revision no) columns 
are having "null" values. I think this is a bug.
Comment 1 James Mason 2004-10-21 06:07:25 UTC
I have a patch for this at work. I'll take care of it tomorrow.
Comment 2 Oliver Zeigermann 2004-10-21 19:56:45 UTC
Why not just doing this:

            statement.setString(4, revisionNumber == null ? null :
revisionNumber.toString());
Comment 3 Unico Hommes 2004-10-22 11:01:41 UTC
I fixed this issue in StandardRDBMSAdapter some time ago like so:
http://article.gmane.org/gmane.comp.jakarta.slide.devel/9797/
Comment 4 Unico Hommes 2004-10-30 16:07:53 UTC
I've committed the fix I mentioned above. Please cross-check and close.