DESCRIPTION

Fix initialization problems.

If host is null this is local project so initzialization should happen.
Check configSubTabs length in addition to 0-index element.

Change-Id: Icb2f4e9792fc936f73e2e68876b293b908e1b24b


COMMENTS

author: Kaylin Maxwell
date: 2012-07-20 16:21:54.000000000

Patch Set 1: (1 inline comment)



Line:194, oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/configuration/OprofileEventConfigTab.java -> Can you elaborate?  According to surrounding comments, this is meant to be done the first time or if the host changes.  That logic should be correct without your change.  So, why does it always need to be done for a local project?  Is there a flaw with the logic that assumes the old controls can be reused or is there an issue you have found whereby the test fails to trigger on the first time or a host switch for a local project?

-------------------------------------
author: Kaylin Maxwell
date: 2012-07-20 16:27:12.000000000

Patch Set 1: IP review completed



-------------------------------------
author: Erick Ross
date: 2012-07-20 17:47:07.000000000

Patch Set 1: (1 inline comment)



Line:194, oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/configuration/OprofileEventConfigTab.java -> So on the very first run for local project we have previousHost == null and host == null because project.getLocationURI().getHost() returns null for file:// uris and this makes previousHost== host (both are null) .

-------------------------------------
author: Kaylin Maxwell
date: 2012-07-20 18:51:47.000000000

Patch Set 1: (1 inline comment)



Line:194, oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/configuration/OprofileEventConfigTab.java -> But shouldn't previousProject be null and allow the test to succeed?

-------------------------------------
author: Erick Ross
date: 2012-07-24 15:08:48.000000000

Patch Set 1: (1 inline comment)



Line:194, oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/configuration/OprofileEventConfigTab.java -> Well, OprofileProject is static and if you had run oprofile for e.g. project A, previous project would not be null even though this is the first time you run it for project B.

-------------------------------------
author: Kaylin Maxwell
date: 2012-07-24 16:13:22.000000000

Patch Set 1: (1 inline comment)



Line:194, oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/configuration/OprofileEventConfigTab.java -> I believe the solution should be to add a check for previousProject != project in addition to previousProject != null.  That should fix your problem.  The comment should be updated to say "if host or project has changed or if they have never been created".

-------------------------------------
author: Callum Holloway
date: 2012-07-24 19:45:44.000000000

Patch Set 1: Looks good to me, but someone else must approve

Looks like a good solution for now, but in the long run we should consider replacing the static OprofileProject, since it causes many similar issues.

-------------------------------------
