Bug 38729 - [Preferences] NPE PreferencePage isValid
Summary: [Preferences] NPE PreferencePage isValid
Status: CLOSED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 38692
  Show dependency tree
 
Reported: 2003-06-10 15:37 EDT by Sebastian Davids CLA
Modified: 2003-06-20 07:02 EDT (History)
1 user (show)

See Also:


Attachments
fix (731 bytes, patch)
2003-06-10 15:39 EDT, Sebastian Davids CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Davids CLA 2003-06-10 15:37:34 EDT
getContainer may return null
Comment 1 Sebastian Davids CLA 2003-06-10 15:39:05 EDT
Created attachment 5142 [details]
fix
Comment 2 Felipe Heidrich CLA 2003-06-12 11:51:23 EDT
Move this up to the UI Team.
Comment 3 Debbie Wilson CLA 2003-06-12 13:44:27 EDT
Sebastian,
How did you get this NPE?  Can it be reproduced?  Which build were you using?  
What was contained in the .log file when this crash happened?
Comment 4 Sebastian Davids CLA 2003-06-12 15:15:58 EDT
I was working on bug 38692.

I checked out yesterdays org.eclipse.jdt.ui and used the binary plugins of M1 -
Version: 2.1.0 Build id: 200306051737

I embedded the JavadocPreferencePage a dialog.

At that time I could reproduce the NPE.

Unfortunately I cannot reproduce it anymore.

The NPE would always appear the first time the dialog was shown.

@@@@

This code fragement will produce the NPE:

Dialog dialog=new Dialog(shell) {
	protected Control createDialogArea(Composite parent) {
		Composite composite= (Composite) super.createDialogArea(parent);
		PreferencePage page = new PreferencePage() {
			protected Control createContents(Composite parent) {
				new Label(parent, SWT.NONE).setText("Test");
				return parent;
			}
		};
		page.createControl(composite);
		page.setValid(false); //<<<--------
		return composite;
	}
	
};
dialog.open();
Comment 5 Tod Creasey CLA 2003-06-13 11:04:22 EDT
Fix applied in build >20030613 - this is consistent with all other callers of 
getContainer.
Comment 6 Sebastian Davids CLA 2003-06-20 07:02:31 EDT
verified