Skip to main content

alphaWorks  >  Forums  >  ConcurrentTesting - Advanced Testing for Multi-Threaded Applications  >  developerWorks

Bad access to protected data    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is not answered.

Permlink Replies: 3 - Pages: 1 - Last Post: Jun 23, 2009 3:27 AM Last Post By: Yarden Threads: [ Previous | Next ]
Allan1

Posts: 1
Registered: Apr 23, 2009 09:48:44 AM
Bad access to protected data
Posted: Apr 23, 2009 10:43:52 AM
 
Click to report abuse...   Click to reply to this thread Reply
When using ConTest with on-the-fly instrumentation, I'm getting a "Bad access to protected data" error. Here is the situation:

Jar A:

package foo;
 
class MySuperClass {
    protected myMethod() {};
}


Jar B:

package bar;
 
class MySubClass extends MySuperClass {
    protected myMethod() {};
}




Is the error because the ConTest java agent causes MySuperClass and MySubClass to be loaded with different classloaders?

Is there any way to work around this problem (preferably without using static instrumentation)?
Yarden

Posts: 38
Registered: Sep 20, 2005 06:05:47 AM
Re: Bad access to protected data
Posted: May 06, 2009 07:48:48 AM   in response to: Allan1 in response to: Allan1's post
 
Click to report abuse...   Click to reply to this thread Reply
Allan,

I could not recreate the problem. Can you contact me at yarden@il.ibm.com, so I can query you for more details?

Regards,
Yarden Nir-Buchbinder,
ConTest development team
IBM Haifa Research Lab
Yarden

Posts: 38
Registered: Sep 20, 2005 06:05:47 AM
Re: Bad access to protected data
Posted: Jun 09, 2009 03:10:08 AM   in response to: Allan1 in response to: Allan1's post
 
Click to report abuse...   Click to reply to this thread Reply
I recreated a bug which is possibly the one Allan encountered. It happens when a class accesses a protected field in a superclass which is in another package. The exception is seen regardless of JVM, but, interestingly, not in classes generated by IBM's javac - I saw it in classes generated by Sun's compiler. The two compilers generate different bytecode for this pattern, and Sun's is unfortunate for ConTest...

I hope to publish a fix soon.

Yarden Nir-Buchbinder
Software Testing, Verification and Review Methodologies
IBM Haifa Research Lab
Tel. 972-4-8296010
Yarden

Posts: 38
Registered: Sep 20, 2005 06:05:47 AM
Re: Bad access to protected data
Posted: Jun 23, 2009 03:27:01 AM   in response to: Yarden in response to: Yarden's post
 
Click to report abuse...   Click to reply to this thread Reply
Version 3.5.2.1, now in this site, fixes this bug.

Yarden Nir-Buchbinder
Software Testing, Verification and Review Methodologies
IBM Haifa Research Lab
Tel. 972-4-8296010

Point your RSS reader here for a feed of the latest messages in all forums