DESCRIPTION

Bug 515394 - Remove unnecessary null checks


Change-Id: I422cde5ed69551b46618599c05746d5a8f0bfd62
Signed-off-by: Nevaeh Wu Ellison xxx@xxx.xxx

COMMENTS

author: Nevaeh Wu Ellison
date: 2017-04-19 10:15:24.000000000

Uploaded patch set 4.

-------------------------------------
author: Brenden Conley
date: 2017-04-19 10:57:25.000000000

Patch Set 4:

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

-------------------------------------
author: Jayvion Booth
date: 2017-04-19 11:25:36.000000000

Patch Set 4: Code-Review-1

(1 comment)

I highly recommend this book: https://martinfowler.com/books/refactoring.html

Even a smallest code change can lead to changed behavior and to the regression. Please carefully check what the code does before starting such "optimizations".

Line:305, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkingSetSelectionDialog.java -> The code now has changed the behavior. The caller before probably checked for null, now this will be never the case. Please check the caller code and remove the null checks. Please add javadoc to the method that it will never return null now.

-------------------------------------
author: Jayvion Booth
date: 2017-04-19 11:43:41.000000000

Patch Set 4:

(1 comment)

Line:305, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkingSetSelectionDialog.java -> I've checked the code in SDK, the previous code returned null was a bug.

Since nothing was documented on the interface, null was not expected return value but there was two places which de-referenced this (OK from the API point of view, bad for actual implementation) and one place which actually checked for null (now not needed anymore).

So please remove null check in org.eclipse.ui.internal.dialogs.AbstractWorkingSetDialog.updateButtonAvailability()

-------------------------------------
author: Brenden Conley
date: 2017-04-19 11:53:32.000000000

Patch Set 4: Verified+1

Build Successful 

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

-------------------------------------
author: Zaid Mosley
date: 2017-04-19 13:12:21.000000000

Patch Set 4:

> Please add javadoc to the method that it will never return null now.

Javadoc contract in platform is that if the method does not specify that it can return null, it is not allowed to return null.

-------------------------------------
author: Gerrit Code Review
date: 2017-04-19 14:24:20.000000000

Change has been successfully merged into the git repository by Zaid Mosley

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