DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Danny van Leiden
Votes: 0
Watchers: 0

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 (0.7 kB)

Environment: OSGi (Equinox)

Datastore: PostgreSQL

 Description  « Hide 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. 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.

Danny van Leiden added a comment - 12/Jun/12 11:00 AM
Patch to make the field protected instead of package private.

Danny van Leiden made changes - 12/Jun/12 11:00 AM
Field Original Value New Value
Attachment [ 11663 ]
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.

Andy Jefferson made changes - 06/Jul/12 09:36 AM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.1.0.m4 [ 11565 ]
Resolution Fixed [ 1 ]
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:

Andy Jefferson made changes - 09/Jul/12 12:39 PM
Status Resolved [ 5 ] Closed [ 6 ]