Issue Details (XML | Word | Printable)

Key: NUCRDBMS-598
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Danny van Leiden
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Plugin subclasses of DelegatedExpression in can't access 'delegate' in OSGi

Created: 12/Jun/12 10:58 AM   Updated: 09/Jul/12 12:39 PM   Resolved: 06/Jul/12 09:36 AM
Component/s: None
Affects Version/s: 3.0.8, 3.0.9, 3.1.0.m1, 3.1.0.m2, 3.1.0.m3
Fix Version/s: 3.1.0.m4

File Attachments: 1. Text File DelegatedExpression.java.patch (0.7 kB)

Environment: OSGi (Equinox)

Datastore: PostgreSQL


 Description  « Hide
org.datanucleus.store.rdbms.sql.expression.DelegatedExpression#delegate is inaccessible by subclasses in plugins if running in an OSGi environment: the field is package private and thus can only be accessed by classes in the same package AND which are loaded by the same classloader. In OSGi, plugins are bundles which use their own classloaders.

Subclasses in plugins (e.g. org.datanucleus.store.rdbms.sql.expression.JodaDateTimeLiteral) try to access this field, which results in an IllegalAccessError.

My suggestion would be to make the field protected, since it only appears to be accessed by subclasses.

Sort Order: Ascending order - Click to sort in descending order
Danny van Leiden added a comment - 12/Jun/12 11:00 AM
Patch to make the field protected instead of package private.

Andy Jefferson added a comment - 06/Jul/12 09:36 AM
Was done in previous release, but then I don't see why OSGi has a problem with package level access.

Danny van Leiden added a comment - 06/Jul/12 10:02 AM
Thanks. The problem with OSGi and package level access is that package-private class members are only accessible within the same classloader.

I came across the following blog post which hopefully clarifies the issue somewhat better:
http://nirmalsasidharan.wordpress.com/2010/09/02/split-packages-an-osgi-nightmare/