Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337327 - NPE in thread "Decay Ant Data Structures"
Summary: NPE in thread "Decay Ant Data Structures"
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 338037 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-16 10:56 EST by Markus Keller CLA
Modified: 2011-02-24 09:46 EST (History)
2 users (show)

See Also:


Attachments
fix (21.64 KB, patch)
2011-02-16 11:56 EST, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***