DESCRIPTION

Bug 478603 - xxx@xxx.xxx for IWorkLeon Ochoach API

Change-Id: Ic111f1bedc59989183698d3b1728db1e516b93af


COMMENTS

author: Teagan Marsh
date: 2016-08-17 14:13:13.000000000

Uploaded patch set 3.

-------------------------------------
author: Zaid Mosley
date: 2016-09-13 07:58:24.000000000

Patch Set 3:

Brian, could you finish this for M3? I would like to build on this and start using non null annotations for org.eclipse.e4.core.commands

-------------------------------------
author: Jayvion Booth
date: 2016-09-13 15:12:07.000000000

Patch Set 3:

(16 comments)

I would like to see this change too, but please check comments.

Line:657, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/menus/MenuHelper.java -> why it is protected, not package protected or private?

Line:46, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/quickaccess/PerspectiveElement.java -> I would use Assert.isNotNull(window) here.

Line:169, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/EditorSiteDragAndDropServiceImpl.java -> I would do Assert.isNotNull(ww) here because you can't do anything meaningful here, and this is will make compiler happy too.

Line:419, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/keys/model/BindingModel.java -> why? Shouldn't this be if(obj == null) return?

Line:163, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/IWorkbenchPart.java -> Same as before.

Line:70, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/IEditorInput.java -> ? xxx@xxx.xxx javadoc says it is OK to return null

Line:81, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/splash/EclipseSplashHandler.java -> Unrelated change?

Line:953, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/statushandlers/InternalDialog.java -> Stricktly speaking this can be null.

Line:69, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/IViewPart.java -> Similar to before.

Line:720, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/util/Util.java -> Return value should be annotated xxx@xxx.xxx

Line:88, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/AbstractSourceProvider.java xxx@xxx.xxx ?

Line:155, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/SaveablesList.java -> Was this needed to make (NP aware) compiler happy?

Line:277, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java -> I would probably prefer Assert.isNotNull(window) here.

Line:83, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/IEditorPart.java -> I would say yes. Just wondering how many false positive warnings will be reported if we turn it on.

Line:337, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java -> is it guaranteed that both getSite() and getWW() return non-null values if isDisposed() is true? Why was the change needed here? The old code looks OK.

Line:202, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/part/StatusPart.java -> in worst case this can be null.

-------------------------------------
author: Teagan Marsh
date: 2016-09-23 03:56:05.000000000

Patch Set 3:

(8 comments)

I'm working my way through these and hope to have a revised patch up next week.

Line:169, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/EditorSiteDragAndDropServiceImpl.java -> I'll fix this by passing in the WorkbenchWindowConfigurer instead.

Line:70, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/IEditorInput.java -> It actually says it isn't ok, but it was done anyways.  Ideally these annotations should flag what is the API.  The developers can choose to ignore it.

I don't feel strongly about this instance so if you'd xxx@xxx.xxx I'm ok with that.

Line:69, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/IViewPart.java -> Done

Line:88, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/AbstractSourceProvider.java -> Done

Line:155, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/SaveablesList.java -> I think it was.  But it seems to recognize Assert now so I'll revert.

Line:277, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java -> Assert is definitely not appropriate: `getActiveWorkbenchWindow()` can and does return null.  Code has to handle this situation.  That said, this code is an anti pattern: it shouldn't be reaching out like this: it should be configured with an IContributionService or an IServiceLocator, or better yet, this should be in WorkbenchPreferenceDialog since IContributionService is a workbench service.  But that's a bigger change

Line:83, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/IEditorPart.java -> Ok.  We can always disable it at a later point.

Line:337, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java -> I'll back this out: I don't remember why I changed it, and I didn't change the later call so it's inconsistent.

-------------------------------------
author: Teagan Marsh
date: 2016-10-21 20:41:53.000000000

Patch Set 3:

(4 comments)

> Brian, could you finish this for M3? I would like to build on this
 > and start using non null annotations for org.eclipse.e4.core.commands

Sorry, I only came back to his now.  I apparently neglected to commit the .settings files and re-enabling them produces dozens of more errors.  I'm going to push this to M4.

Line:657, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/menus/MenuHelper.java -> Done

Line:46, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/quickaccess/PerspectiveElement.java -> Done.

Line:419, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/keys/model/BindingModel.java -> cmd is null, and it's not guarded.
I suppose we could do an Assert.isNotNull(cmd)?

Line:202, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/part/StatusPart.java -> Could you explain this?  Do you mean there's a possible race condition that getActivePage() could return null?

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