Bug 107820 - [osgi] ServiceRegistrationImpl$Properties.cloneValue(..) throws IllegalAccessError
Summary: [osgi] ServiceRegistrationImpl$Properties.cloneValue(..) throws IllegalAccess...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.1   Edit
Hardware: Other other
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: Thomas Watson CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-24 05:10 EDT by Bernhard Dorninger CLA Friend
Modified: 2005-09-01 15:22 EDT (History)
0 users

See Also:


Attachments
log of IllegalAccessError (8.45 KB, text/plain)
2005-08-26 06:24 EDT, Bernhard Dorninger CLA Friend
no flags Details
Proposed fix (3.56 KB, patch)
2005-08-26 10:26 EDT, Thomas Watson CLA Friend
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Dorninger CLA Friend 2005-08-24 05:10:16 EDT
Under Open VMS 7.3+ (Platform DECAlpha, VM: HP FastVM 1.4.2-4p2, which "should"
be comliant to Sun's 1.4.2_05) the system bundle crashes with an
IllegalAccessError when trying to clone a String[]. Obviously the HP VM offers
no public clone method for this type.
Since the relevant portion of Eclipse does not wrap the clone operations in a
try-catch, Eclipse is not starting (we are using OSGI+Runtime only).
Of course this may be considered as a bug in the HP VM, since the Java Spec
requires Arrays to be cloneable. But on the other hand it's not a great deal to
make cloneValue() failsafe. 
Copying arrays the way cloneValue does it is imho worth a discussion. Why not
use System.arraycopy?

PS: Yes, I know that OpenVMS is NOT a target system. But running Eclipse on VMS
would do no harm either
Comment 1 Thomas Watson CLA Friend 2005-08-25 15:24:52 EDT
Can you provide us with some error logs or stacktraces when it fails? Thanks.
Comment 2 Bernhard Dorninger CLA Friend 2005-08-26 06:24:22 EDT
Created attachment 26524 [details]
log of IllegalAccessError
Comment 3 Bernhard Dorninger CLA Friend 2005-08-26 06:28:19 EDT
The above log was faked on a windows machine. (exchanged the header though).
We have altered the cloneValue method so that is fails on exactly the same
location it fails under OpenVMS.
The reason is that we fixed the issue ourselves and already deployed the fix to
our VMS testing system, so we cannot reproduce the error there.

PS: I have filed a bug report to HP as well.
Comment 4 Thomas Watson CLA Friend 2005-08-26 10:26:14 EDT
Created attachment 26529 [details]
Proposed fix

The original framework code base was designed to run on a very small J2ME
profile which apparently did not have java.lang.reflect package!!  That is the
reason we did not use the java.lang.reflect.Array class to copy arrays.  

Well now our minimum profile is the OSGi minimum execution environment which
does have this package.  Here is a patch to fix this problem.  This makes the
method much smaller :)
Comment 5 Thomas Watson CLA Friend 2005-08-26 10:28:33 EDT
Maybe consider for 3.1.1?

I'm reducing the severity because this is a VM bug and you have a fix for 
yourself.
Comment 6 Thomas Watson CLA Friend 2005-08-26 11:18:35 EDT
I released the fix in HEAD for 3.2.

Leaving defect open for consideration in 3.1.1
Comment 7 Pascal Rapicault CLA Friend 2005-09-01 13:38:59 EDT
patch reviewed, good to go
Comment 8 Thomas Watson CLA Friend 2005-09-01 15:22:24 EDT
Fixed for 3.1.1.