Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 161123 - Filtering criteria is not computed properly when the profile shortcut is used
Summary: Filtering criteria is not computed properly when the profile shortcut is used
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Eugene Chan CLA
QA Contact:
URL:
Whiteboard: closed460
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-16 15:37 EDT by amehrega CLA
Modified: 2016-05-05 10:44 EDT (History)
2 users (show)

See Also:


Attachments
The properties dialog (33.66 KB, image/png)
2006-10-16 15:37 EDT, amehrega CLA
no flags Details
Here's the proposed fix (14.38 KB, patch)
2006-10-17 11:24 EDT, Alexander Simbirtsev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description amehrega CLA 2006-10-16 15:37:11 EDT
- In the Java perspective, create the sample HelloWorld plug-in:

File > New > Project > Plug-in Project > Next > Specify "org.eclipse.my.sample.plugin" as the name > Next > Next > Select "Hello, World" > Finish

- Select the plug-in under the package explorer view
- Drop down the profile toolbar button and select Profile As > Eclipse Applicaiton
- Double click Execution time analysis and select the graphical details option
- Check execution time analysis and click OK
- Click "yes" if prompted to change perspectives
- Right click the agent and select properties

Notice that the filtering criteria is not computed properly.  See the attached screen shot.  I don't notice this problem when I use the profile launch configuration to create a launch item of type "Eclipse Application".
Comment 1 amehrega CLA 2006-10-16 15:37:41 EDT
Created attachment 52069 [details]
The properties dialog
Comment 2 amehrega CLA 2006-10-16 15:39:43 EDT
The expected filtering criteria should be:

org.eclipse.my.sample.plugin* * INCLUDE
org.eclipse.my.sample.plugin.actions* * INCLUDE
* * EXCLUDE

Which is what I get when I manually create the launch item as opposed to using the profile shortcut.
Comment 3 Alexander Simbirtsev CLA 2006-10-17 11:17:06 EDT
The source of the problem is following:

When manually creating launch item, tabs for launch configuration are created using CreateLaunchConfigurationAction.performAction() method which contains the following code:

tabGroup.createTabs(dialog, dialog.getMode());
ILaunchConfigurationTab[] tabs = tabGroup.getTabs();
for (int i = 0; i < tabs.length; i++) {
    ILaunchConfigurationTab tab = tabs[i];
    tab.setLaunchConfigurationDialog(dialog);
}
tabGroup.setDefaults(wc);
tabGroup.dispose();
wc.doSave();

where the most important for this problem is tabGroup.setDefaults(wc) and wc.doSave();

At the same time, when creating launch configuration using shortcutLaunchConfigurationTabGroupViewer.createGroup() method is used which contains only: 

tabGroup.createTabs(getLaunchConfigurationDialog(), getLaunchConfigurationDialog().getMode());
ILaunchConfigurationTab[] tabs = tabGroup.getTabs();
for (int i = 0; i < tabs.length; i++) {
    tabs[i].setLaunchConfigurationDialog(getLaunchConfigurationDialog());
}

so defaults are not set properly.

I suppose this is not an Eclipse bug, but just an issue in our recent implementation.

I'll create a patch to workaround this(I mean to workaround this eclipse beahvior and to really fix our problem)
Comment 4 Alexander Simbirtsev CLA 2006-10-17 11:24:20 EDT
Created attachment 52130 [details]
Here's the proposed fix

This patch fixes the problem for all launch shortcuts types as mentioned behavior could be seen on all of them.
It was tested only for "Java Application" and "Eclipse Application", but should be safe for all of the types.
Comment 5 amehrega CLA 2006-10-17 14:29:44 EDT
I've verified that the patch functions correctly for:
- Java Application
- Eclipse Application
- Java Applet
- JUnit

Thanks Alexander for the quick reply.
This should probably be targeted to 4.3i3.
Comment 6 Guru Nagarajan CLA 2006-10-20 09:19:47 EDT
Targetted to i3
Comment 7 Guru Nagarajan CLA 2006-11-06 18:08:52 EST
Eugene, 
 The patch for this is in the Trace Project and I do not have the CVS commit permissions. Please apply this patch. We have the pre-approval for this.
Comment 8 Eugene Chan CLA 2006-11-06 18:28:25 EST
patch submitted to HEAD
Comment 9 Paul Slauenwhite CLA 2009-06-30 13:43:55 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.