Bug 549648 - new NullPointerException all over our code
Summary: new NullPointerException all over our code
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.13   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.13 M3   Edit
Assignee: Alexander Fedorov CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2019-07-30 00:54 EDT by Christian Dietrich CLA
Modified: 2019-07-30 04:09 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Dietrich CLA 2019-07-30 00:54:11 EDT
with the latest Platform I Build we have tons of NPSs in our tests.
they look like

Caused by: java.lang.NullPointerException
	at org.eclipse.ui.part.WorkbenchPart.setTitleImage(WorkbenchPart.java:294)
	at org.eclipse.ui.texteditor.AbstractTextEditor.initializeTitle(AbstractTextEditor.java:4084)
	at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4189)
	at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:260)
	at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1478)
	at org.eclipse.ui.editors.text.TextEditor.doSetInput(TextEditor.java:153)
	at org.eclipse.xtext.ui.editor.XtextEditor.doSetInput(XtextEditor.java:248)
	at org.eclipse.ui.texteditor.AbstractTextEditor.lambda$1(AbstractTextEditor.java:3154)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:436)

do you have pointers to recent changes that could cause this issue?
Comment 1 Christian Dietrich CLA 2019-07-30 00:57:58 EDT
i see org.eclipse.ui.part.WorkbenchPart.setTitleImage(Image)
called but org.eclipse.ui.part.WorkbenchPart.setInitializationData(IConfigurationElement, String, Object)
not called
Comment 2 Christian Dietrich CLA 2019-07-30 01:02:37 EDT
correction: we return early in org.eclipse.ui.part.WorkbenchPart.setInitializationData(IConfigurationElement, String, Object)
since there is no icon.
Comment 3 Christian Dietrich CLA 2019-07-30 01:14:55 EDT
the old version of setTitleImage looks like

		if (imageDescriptor != null) {
			JFaceResources.getResources().destroyImage(imageDescriptor);
			imageDescriptor = null;
		}

and thus guards against this behaviour.

i wonder how many editors exist out there with no image specified
and if the field should be initialized with optional.empty
Comment 4 Christian Dietrich CLA 2019-07-30 01:17:47 EDT
seems to be caused by the fix for #548799 in commit ad46c70748d4d89aa16e36f1177f9c4f732735bb
Comment 5 Eclipse Genie CLA 2019-07-30 02:55:57 EDT
New Gerrit change created: https://git.eclipse.org/r/146766
Comment 7 Alexander Fedorov CLA 2019-07-30 03:38:51 EDT
Added the field initialization with Optional.empty() ,
thanks for reporting and sorry for this defect.
Comment 8 Andrey Loskutov CLA 2019-07-30 04:09:25 EDT
For the record: commit ad46c70748d4d89aa16e36f1177f9c4f732735bb also caused SDK tests to fail, see https://download.eclipse.org/eclipse/downloads/drops4/I20190729-1800/testresults/html/org.eclipse.team.tests.core_ep413I-unit-cen64-gtk3-java8_linux.gtk.x86_64_8.0.html

With the patch above the test is green again.