DESCRIPTION

Bug 494877 - NullPointerException in
SmartImportRootWizardPage.proposalsSelectionChanged

Change-Id: Idee914061ada58664ddd077f7b95bb8faabdb60a
Signed-off-by: Jayvion Booth xxx@xxx.xxx


COMMENTS

author: Jayvion Booth
date: 2016-05-30 08:11:54.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2016-05-30 08:12:00.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9488/

-------------------------------------
author: Brenden Conley
date: 2016-05-30 08:30:19.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9488/ : SUCCESS

-------------------------------------
author: Zaid Mosley
date: 2016-05-30 09:31:28.000000000

Patch Set 1: Code-Review+2 Verified+1

-------------------------------------
author: Isis Velasquez
date: 2016-05-30 09:34:46.000000000

Patch Set 1: Code-Review-1

Although it's not used in the UI, the SmartImportJob is meant to interpret differently an empty set of proposals (client selected nothing to import) and a null one (client didn't specify anything to import, so defaulting to a greedy import).
So I would rather see null handled as a special case rather than defaulting to the behaviour of "client selected nothing to import).

-------------------------------------
author: Jayvion Booth
date: 2016-05-30 09:44:14.000000000

Patch Set 1:

> Although it's not used in the UI, the SmartImportJob is meant to
 > interpret differently an empty set of proposals (client selected
 > nothing to import) and a null one (client didn't specify anything
 > to import, so defaulting to a greedy import).
 > So I would rather see null handled as a special case rather than
 > defaulting to the behaviour of "client selected nothing to import).

But the code never checks for null, see line 669 - 671 (otherwise we would have another NPE there), and the getImportProposals() never returns null.

-------------------------------------
author: Isis Velasquez
date: 2016-05-30 11:09:29.000000000

Patch Set 1: Code-Review+2

I've digged more in the code, and fail at actually getting how tree.getInput() can be != null to get to line 641, but potentialProjects could be null. The logic of the page is that tree.getInput() == potentialProjects (line 691).
I didn't find steps to reproduce.

Patch suggested actually seems good to avoid the NPE. It doesn't explain all about the issue though, but it definitely prevent a bug from happening.

The case of potentialProjects being null is not presented nor used in the wizard anyway. The semantic of potentialProjects == null is only kind of important in the job, not in the UI.

-------------------------------------
author: Sebastian Porter
date: 2016-05-30 14:49:33.000000000

Patch Set 1: Code-Review-1

(1 comment)

Line:192, bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/SmartImportRootWizardPage.java -> Such general initialization should go along with the field declaration, otherwise it gets lost when adding another constructor.

-------------------------------------
author: Jayvion Booth
date: 2016-05-30 17:02:25.000000000

Patch Set 1:

(1 comment)

Line:192, bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/SmartImportRootWizardPage.java -> Done

-------------------------------------
author: Gerrit Code Review
date: 2016-05-30 19:36:08.000000000

Change has been successfully merged into the git repository by Sebastian Porter

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