Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 130751

Summary: NPE creating build.xml file
Product: [Eclipse Project] Platform Reporter: Sonia Dimitrov <sonia_dimitrov>
Component: AntAssignee: Kevin Barnes <cocoakevin>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: Darin_Swanson
Version: 3.2   
Target Milestone: 3.2 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Sonia Dimitrov CLA 2006-03-07 11:40:56 EST
With build I20060307-0920, I am unable to close any editors without an error dialog opening with the message "Error notifying a preference change listener.  Check the log for details".

I can also reproduce on a fresh install and workspace by creating a new project, then a new build.xml file.

The .log contains the following:

!ENTRY org.eclipse.ui.workbench 4 2 2006-03-07 11:30:00.484
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.ant.internal.ui.editor.AntEditor.affectsTextPresentation(AntEditor.java:807)
	at org.eclipse.ant.internal.ui.editor.AntEditor.handlePreferenceStoreChanged(AntEditor.java:862)
	at org.eclipse.ui.texteditor.AbstractTextEditor$PropertyChangeListener.propertyChange(AbstractTextEditor.java:597)
	at org.eclipse.ui.texteditor.ChainedPreferenceStore.firePropertyChangeEvent(ChainedPreferenceStore.java:164)
	at org.eclipse.ui.texteditor.ChainedPreferenceStore.firePropertyChangeEvent(ChainedPreferenceStore.java:153)
	at org.eclipse.ui.texteditor.ChainedPreferenceStore.handlePropertyChangeEvent(ChainedPreferenceStore.java:482)
	at org.eclipse.ui.texteditor.ChainedPreferenceStore.access$0(ChainedPreferenceStore.java:408)
	at org.eclipse.ui.texteditor.ChainedPreferenceStore$PropertyChangeListener.propertyChange(ChainedPreferenceStore.java:69)
	at org.eclipse.ui.preferences.ScopedPreferenceStore$3.run(ScopedPreferenceStore.java:372)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.ui.preferences.ScopedPreferenceStore.firePropertyChangeEvent(ScopedPreferenceStore.java:369)
	at org.eclipse.ui.preferences.ScopedPreferenceStore.setToDefault(ScopedPreferenceStore.java:663)
	at org.eclipse.ui.texteditor.MarkerAnnotationPreferences.useAnnotationsPreferencePage(MarkerAnnotationPreferences.java:119)
	at org.eclipse.ui.editors.text.EditorsUI.useAnnotationsPreferencePage(EditorsUI.java:97)
	at org.eclipse.ant.internal.ui.AntUIPreferenceInitializer.initializeDefaultPreferences(AntUIPreferenceInitializer.java:40)
	at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.runInitializer(PreferenceServiceRegistryHelper.java:274)
	at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.applyRuntimeDefaults(PreferenceServiceRegistryHelper.java:123)
	at org.eclipse.core.internal.preferences.PreferencesService.applyRuntimeDefaults(PreferencesService.java:337)
	at org.eclipse.core.internal.preferences.DefaultPreferences.applyRuntimeDefaults(DefaultPreferences.java:161)
	at org.eclipse.core.internal.preferences.DefaultPreferences.loadDefaults(DefaultPreferences.java:230)
	at org.eclipse.core.internal.preferences.DefaultPreferences.load(DefaultPreferences.java:226)
	at org.eclipse.core.internal.preferences.EclipsePreferences.create(EclipsePreferences.java:307)
	at org.eclipse.core.internal.preferences.EclipsePreferences.internalNode(EclipsePreferences.java:543)
	at org.eclipse.core.internal.preferences.EclipsePreferences.node(EclipsePreferences.java:662)
	at org.eclipse.core.internal.preferences.AbstractScope.getNode(AbstractScope.java:38)
	at org.eclipse.core.runtime.preferences.DefaultScope.getNode(DefaultScope.java:67)
	at org.eclipse.ui.preferences.ScopedPreferenceStore.getDefaultPreferences(ScopedPreferenceStore.java:248)
	at org.eclipse.ui.preferences.ScopedPreferenceStore.getPreferenceNodes(ScopedPreferenceStore.java:282)
	at org.eclipse.ui.preferences.ScopedPreferenceStore.contains(ScopedPreferenceStore.java:348)
	at org.eclipse.ui.texteditor.ChainedPreferenceStore.getVisibleStore(ChainedPreferenceStore.java:529)
	at org.eclipse.ui.texteditor.ChainedPreferenceStore.getBoolean(ChainedPreferenceStore.java:171)
	at org.eclipse.ant.internal.ui.editor.AntEditor.initializeEditor(AntEditor.java:673)
	at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.<init>(AbstractDecoratedTextEditor.java:245)
	at org.eclipse.ui.editors.text.TextEditor.<init>(TextEditor.java:66)
	at org.eclipse.ant.internal.ui.editor.AntEditor.<init>(AntEditor.java:619)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
	at java.lang.Class.newInstance0(Class.java:350)
	at java.lang.Class.newInstance(Class.java:303)
Comment 1 Darin Swanson CLA 2006-03-07 11:50:42 EST
Investigating...very strange as we made really no changes for this build :-(
Comment 2 Darin Swanson CLA 2006-03-07 12:18:15 EST
The ordering of notification of preference changes on editor creation must have changed. We were not correctly handling getting preference change notifications during creation of the editor (before we had a source viewer configuration).
Comment 3 Darin Swanson CLA 2006-03-07 12:19:49 EST
Kevin please verify the changes to the AntEditor.
Comment 4 DJ Houghton CLA 2006-03-07 12:56:23 EST
Darin, this looks to be related to the fix for bug 130248.
Comment 5 Kevin Barnes CLA 2006-03-09 12:11:08 EST
verified