Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349624 - improve context from stack trace population heuristic
Summary: improve context from stack trace population heuristic
Status: CLOSED MOVED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 354184 354185
Blocks:
  Show dependency tree
 
Reported: 2011-06-16 16:05 EDT by Steffen Pingel CLA
Modified: 2013-03-14 16:45 EDT (History)
4 users (show)

See Also:


Attachments
mylyn/context/zip (2.09 KB, application/octet-stream)
2011-06-19 22:17 EDT, David Green CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2011-06-16 16:05:46 EDT
The strategy for creating contexts from stack traces that was initially implemented iterates over the stack trace and generates an artificial selection event for each identified Java element. A basic filter that excludes known system name spaces such as java or junit.framework helps to reduce the number of irrelevant elements. 

Still, this strategy can lead to large contexts with elements that have little relevance to investigation the problem captured in the stack trace. This task is intended for discussing improvements.
Comment 1 Steffen Pingel CLA 2011-06-16 16:07:18 EDT
One idea that was suggested on the call today was to assign a high interest to the top element and linearly decrease interest processing the stack trace top to bottom.
Comment 2 Sam Davis CLA 2011-06-16 16:17:01 EDT
How do you access this feature??

The linear decrease makes sense for a lot of cases, but there are other cases where the interesting stuff is somewhere in the middle of the stack trace.
Comment 3 Steffen Pingel CLA 2011-06-16 16:31:17 EDT
If you activate a task with an empty context that has a stack trace in the description or in the new comment the context is automatically generated.
Comment 4 Sam Davis CLA 2011-06-16 17:56:36 EDT
Cool, I never noticed that. It would be useful to also auto-populate the call hierarchy view based on the stack trace.
Comment 5 Sam Davis CLA 2011-06-16 18:02:12 EDT
In fact if we did that, we might not want to auto-populate the context at all.
Comment 6 David Green CLA 2011-06-16 20:00:21 EDT
(In reply to comment #1)
> One idea that was suggested on the call today was to assign a high interest to
> the top element and linearly decrease interest processing the stack trace top to
> bottom.

It might be useful to provide framework-aware filters.  For example, common frameworks (Such as Spring Framework, Java EE containers such as JBoss, etc.) apply aspect oriented filters to method calls in order to apply transactional semantics, security, logging, etc.  Unless you're specifically working on these frameworks, these items are usually irrelevant within the context of an application development task.

For such filters to work, awareness of package namespaces and fully qualified class names is needed.  Some profilers use this approach to filter unwanted classes/methods from profiling data.

We could get smart and filter packages for which there is no source in the workspace.
Comment 7 David Green CLA 2011-06-16 20:14:04 EDT
(In reply to comment #5)
> In fact if we did that, we might not want to auto-populate the context at all.

-1 In my opinion, the task context is much more powerful and it's orthogonal to the view you're using (it can apply to any view that supports filtering by context).
Comment 8 Sam Davis CLA 2011-06-16 20:29:25 EDT
(In reply to comment #7)
> (In reply to comment #5)
> > In fact if we did that, we might not want to auto-populate the context at all.
> 
> -1 In my opinion, the task context is much more powerful and it's orthogonal to
> the view you're using (it can apply to any view that supports filtering by
> context).

The problem is that currently the whole stack trace goes into your context. I would like to be able to select specific methods in the trace or call hierarchy and have only those in my context. The current approach is a bit like have the context for a new task contain everything instead of nothing.
Comment 9 Sam Davis CLA 2011-06-16 20:31:32 EDT
...but I do see your point that context population is powerful. The trick is to have an intelligent way of limiting what goes into it; I like your suggestions above but don't know if that will limit it enough.
Comment 10 David Green CLA 2011-06-19 22:17:15 EDT
(In reply to comment #8)
> The problem is that currently the whole stack trace goes into your context.

The current implementation adds the top 10 elements from the stack trace, since stack traces can be very large.

> I would like to be able to select specific methods in the trace or call hierarchy
> and have only those in my context. The current approach is a bit like have the
> context for a new task contain everything instead of nothing.

Yes, this would be useful.  An advantage of the current implementation is that no user interaction is required.  To get specific methods in the context, you can click on them in the task editor (they're hyperlinked).  Also the context can be pruned and landamarks created using the normal affordances.
Comment 11 David Green CLA 2011-06-19 22:17:19 EDT
Created attachment 198238 [details]
mylyn/context/zip
Comment 12 Sam Davis CLA 2011-08-08 14:30:02 EDT
The current strategy has some bugs. When activating a task with no context, it was prepopulated with classes named Plugin, Product, Severity, and Date, and methods named error, because these words appear somewhere in a comment with a stack trace. Also, when populating with classes that are in the plugin dependencies of multiple projects, the choice of projects to add to the context seems to be arbitrary, and multiple projects were added for different dependencies, even though they could all have been found under the same project.
Comment 13 David Green CLA 2011-08-08 16:25:39 EDT
(In reply to comment #12)
> The current strategy has some bugs. 

Sam, please file a separate defect for problems associated with the current implementation.  If you can, include the stack trace that is problematic.
Comment 14 Sam Davis CLA 2011-08-08 16:36:26 EDT
I've created the following:

354184: context from stack trace population includes irrelevant items
https://bugs.eclipse.org/bugs/show_bug.cgi?id=354184

354185: context from stack trace population should minimize the number of projects added to context when adding plugin dependencies
https://bugs.eclipse.org/bugs/show_bug.cgi?id=354185
Comment 15 Sam Davis CLA 2013-03-14 16:45:08 EDT
(In reply to comment #10)
> The current implementation adds the top 10 elements from the stack trace, since
> stack traces can be very large.

For a stack trace that begins with the following, this is exactly the wrong approach!

java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
	at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:275)
	at org.eclipse.ui.internal.progress.ProgressManager$5.run(ProgressManager.java:960)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:995)
	at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:970)
	at org.eclipse.ui.internal.progress.ProgressManager.run(ProgressManager.java:1166)
Comment 16 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn