Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 200058

Summary: Problem with saving changed java profiling options using PI agent
Product: z_Archived Reporter: Kendric Wang <kendricw>
Component: TPTPAssignee: Jonathan West <jgwest>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: ewchan, jgwest, jkubasta, paulslau, samwai
Version: unspecifiedKeywords: plan
Target Milestone: ---Flags: ewchan: review+
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 196480    
Attachments:
Description Flags
Patch to DataCollectorTreeContentProvider none

Description Kendric Wang CLA 2007-08-15 11:54:51 EDT
Build ID: I20070625-1500

Steps To Reproduce:
1. Install and configure the RAC to run without security. Start the ACServer.
2. From the workbench, Run -> Profile
3. Create a new "External Java Application" profile
4. Under the Host tab, select "localhost" and test connection. Click Apply.
5. Under the Main tab, specify the Class path for the external classes (which can be checked out of CVS from test-results -> platform -> org.eclipse.tptp.ac.testautomation\automation-files\external_classes) Specify "CpuTime" as the Class name. Click Apply.
6. Under the "Monitor" tab, select "Execution Time Analysis". See that the Apply button is greyed. Click Profile.

The workbench will process for a few seconds, but no profile information will appear in the "Profiling Monitor" view. The "Apply" button not being available is an intermittent bug that occurs frequently for me, so you may have to try a few times. (Make sure that there's only one profile saved in the profile dialog)

In general, if changes are made to the java profiling options, and the 'Profile' button is clicked when the 'Apply' button shows up as being unavailable, the old test profile will run. This suggests that any changes to the java profiling options are not being saved, if the 'Apply' button is greyed out.


More information:
- Windows XP
- Eclipse SDK 3.3 w/ EMF-SDK 2.2.4
- JRE 1.4.2 SR8
- TPTP AC (200708100100 Build)
Comment 1 Jonathan West CLA 2007-11-22 09:53:46 EST
Created attachment 83535 [details]
Patch to DataCollectorTreeContentProvider
Comment 2 Jonathan West CLA 2007-11-22 09:55:45 EST
The problem was a race condition in DataCollectorTreeContentProvider. The JobChangeListener was added to the Job _after_ the Job was scheduled to have started, so often the Job would complete before the listener was added. The listener caused the preferences page to be initialized, so in the failing case, the preferences page would never be initialized. 
Comment 3 Samson Wai CLA 2007-11-29 16:13:28 EST
I don't have the appropriate knowledge to review the patch since this is Eclipse UI related.
Comment 4 Jonathan West CLA 2007-12-10 13:16:02 EST
Paul, can you review my patch when you have the chance? Thanks!

Change is simple: Moved ExtendedDeferredContentManager to the end of the class file (w/ no modifications), and swapped the order of the "updateJob.schedule();" and "updateJob.addJobChangeListener(new JobChangeAdapter()..." statements in that class, so that the task is scheduled to run AFTER the job change listener is added.
Comment 5 Paul Slauenwhite CLA 2007-12-10 13:29:35 EST
(In reply to comment #4)
> Paul, can you review my patch when you have the chance? Thanks!

I am going to delegate to Eugene who knows the code best.
Comment 6 Eugene Chan CLA 2007-12-14 10:45:31 EST
I have reviewed the patch and it looks safe to me to be checked in.

Thanks Jonathan.
Comment 7 jkubasta CLA 2008-01-09 11:41:29 EST
Resolved by fix for defect 200533
Comment 8 Joel Cayne CLA 2008-07-31 16:40:50 EDT
Closing.