Open in IDE ends up in wrong Eclipse project

Questions about YourKit Java Profiler
Post Reply
pebl
Posts: 35
Joined: Tue Sep 12, 2006 12:55 pm

Open in IDE ends up in wrong Eclipse project

Post by pebl »

I have a number of branches checked out from the same project in Eclipse.
E.g Project_2009, Project_2015, Project_2016.

When I profile something in Project_2016, and press Open in IDE,
my impression is that the source I see is from the first
lexicography checkout that contains that file.
In my case a branch from 2009, which is way old.

Sometimes that file has not changed and I continue to follow
references in eclipse, only to at one point find out it was
the wrong project to start with. Really annoying.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Open in IDE ends up in wrong Eclipse project

Post by Anton Katilin »

We'll fix this by opening a symbol in all opened projects where it is available. This is exactly how it works now in all other IDEs except Eclipse.
pebl
Posts: 35
Joined: Tue Sep 12, 2006 12:55 pm

Re: Open in IDE ends up in wrong Eclipse project

Post by pebl »

I have 9 feature branches open in eclipse.
Would that mean Yourkit would open 9 editors/files? (given in the file is common in all 9).
That would be really annoying too.
It is clearly possible to this correct, as I never have this problem when using jprofiler.
pebl
Posts: 35
Joined: Tue Sep 12, 2006 12:55 pm

Re: Open in IDE ends up in wrong Eclipse project

Post by pebl »

I think a manual solution would be ok too;
Make is so that I can give yourkit gui a project name/string.
Use that to decide which project to open.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Open in IDE ends up in wrong Eclipse project

Post by Anton Katilin »

I understand your concern.

Passing the project name will clearly solve the issue. However, this approach is only applicable if the profiled application is launched from within Eclipse, thus we can attribute the running JVM and its snapshots with the project name. This won't work for standalone applications, or for snapshots received from other users or machines.

The manual approach when the user is explicitly asked to choose the project to open when doing "Open in IDE" will cover both cases.

Do you use the "Profile" action for different projects/branches? If you constantly switch between them, the manual approach may be error prone.
pebl
Posts: 35
Joined: Tue Sep 12, 2006 12:55 pm

Re: Open in IDE ends up in wrong Eclipse project

Post by pebl »

Anton Katilin wrote:The manual approach when the user is explicitly asked to choose the project to open when doing "Open in IDE" will cover both cases.
I think this is also ok.
Anton Katilin wrote: Do you use the "Profile" action for different projects/branches? If you constantly switch between them, the manual approach may be error prone.
I typical switches between profiling 2 projects; base, and a feature branch.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Open in IDE ends up in wrong Eclipse project

Post by Anton Katilin »

We've finally decided to implement the proposed change such that the target project will be selected automatically on "Open in IDE", by using the project name associated with the profiling results. This will work without any additional user input for profiled applications started from within Eclipse, as well as for their snapshots thus supporting team work.

The change is relatively big thus it will go to the next major version, and will not be backported to v2016.02.

When the first EAP build of the next version is published, please give it a try. If we find that the proposed automatic solution is not enough, we'll reconsider other additional options such as providing users with means for manual project selection.
pebl
Posts: 35
Joined: Tue Sep 12, 2006 12:55 pm

Re: Open in IDE ends up in wrong Eclipse project

Post by pebl »

Ok, thank you.
Would you mind to write to this thread when AE starts,
as I would probably not notice it without a notification?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Open in IDE ends up in wrong Eclipse project

Post by Anton Katilin »

Sure, I'll notify you.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Open in IDE ends up in wrong Eclipse project

Post by Anton Katilin »

Hi,

The EAP has started.

To apply the fix discussed above:

1. Download and install the profiler: http://www.yourkit.com/eap
2. Start it and run the IDE integration wizard
3. Please install the latest plugin by using the repository URL http://www.yourkit.com/download/yjp2016_06_for_eclipse/

Best regards,
Anton
pebl
Posts: 35
Joined: Tue Sep 12, 2006 12:55 pm

Re: Open in IDE ends up in wrong Eclipse project

Post by pebl »

I have tested, and it works. (eclipse Version: Mars.2 Release (4.5.2))

Without updating to the latest plugin, the behavior was as before.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Open in IDE ends up in wrong Eclipse project

Post by Anton Katilin »

Thank you for testing and providing the feedback.
Post Reply