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

Bug 337327

Summary: NPE in thread "Decay Ant Data Structures"
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: AntAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie, Olivier_Thomann
Version: 3.7   
Target Milestone: 3.7 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
fix none

Description Markus Keller CLA 2011-02-16 10:56:32 EST
HEAD (I20110215-0800)

I worked in a build.xml file, closed the editor, and after a while, this NPE was written to the console:

Exception in thread "Decay Ant Data Structures" java.lang.NullPointerException
	at org.eclipse.ant.internal.ui.editor.TaskDescriptionProvider.reset(TaskDescriptionProvider.java:293)
	at org.eclipse.ant.internal.ui.editor.AntEditorCompletionProcessor.resetCodeCompletionDataStructures(AntEditorCompletionProcessor.java:1824)
	at org.eclipse.ant.internal.ui.editor.DecayCodeCompletionDataStructuresThread.run(DecayCodeCompletionDataStructuresThread.java:53)
Comment 1 Michael Rennie CLA 2011-02-16 11:51:58 EST
Steps:

1. open the following build file

<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="default">
    <target name="default" description="description">
        <property name="xml" value="C:\use\xml/"/>
        <apitooling.apiuse
            report="${xml}"
            scopepattern=".*"
            considerapi="true"
            location="C:\eclipse\eclipse\"
            apipatterns=".*"
            internalpatterns=".*"
            debug="true"
        />
    </target>
</project>
2. activate content assist immediately following apitooling in the <apitooling.apiuse line
3. close the build file and wait a minute or so
4. reopen the build file
5. close it again and wait about a minute - NPE

The problem is that we dispose held proposal infos after the last build file editor has been closed + a delay. It can happen that the proposal infos were not populated again after the editor was reopened even though the proposal computer is active - we do this intentionally to avoid reading a large XML unless we have to.
Comment 2 Michael Rennie CLA 2011-02-16 11:56:22 EST
Created attachment 189116 [details]
fix

patch checks if the description provider has been initialized prior to trying to reset it - a null check.
Comment 3 Michael Rennie CLA 2011-02-16 11:57:27 EST
applied to HEAD
Comment 4 Michael Rennie CLA 2011-02-24 09:46:50 EST
*** Bug 338037 has been marked as a duplicate of this bug. ***