Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 134190 - [JFace] NPE in StatusLine class
Summary: [JFace] NPE in StatusLine class
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P5 normal (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-30 19:18 EST by Alex Chapiro CLA
Modified: 2009-06-03 14:10 EDT (History)
0 users

See Also:


Attachments
One Line fix for NPE in #subTask(String) (709 bytes, patch)
2008-09-17 10:11 EDT, Dan Heidinga CLA
Kevin_McGuire: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Chapiro CLA 2006-03-30 19:18:17 EST
In class org.eclipse.jface.action.StatusLine, method SubTask(String name) NPE.

StatusLine.subTask(String) line: 552
StatusLineManager$1.subTask(String) line: 205
EventLoopProgressMonitor(ProgressMonitorWrapper).subTask(String) line: 154
EventLoopProgressMonitor.subTask(String) line: 171
SBModelManager.saveModelState(IProject, IProgressMonitor) line: 175

It happens if beginTask method was never called before. I think it is better to check fTaskName.
Comment 1 Susan McCourt CLA 2007-07-02 19:51:52 EDT
changing prio and status per platform ui bug guidelines
Comment 2 Dan Heidinga CLA 2008-09-17 10:11:01 EDT
Created attachment 112768 [details]
One Line fix for NPE in #subTask(String)

This is still a problem in 3.4  (build I20080617-2000).

It can be reproduced by calling StatusLine#subTask(String) before calling something that sets the task name (ie: #beginTask(String,int)).

The fix to bug 162140 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=162140) got most of the cases for setting fTaskName to null, but missed this check.

java.lang.NullPointerException
at org.eclipse.jface.action.StatusLine.subTask(StatusLine.java:619)
at org.eclipse.jface.action.StatusLineManager$1.subTask(StatusLineManager.java:207)
at com.ibm.wrath.progress.WalkbackProgressMonitor.subTask(WalkbackProgressMonitor.java:89)
at com.ibm.wrath.progress.WrathProgressMonitor.handleUpdateProgress(WrathProgressMonitor.java:51)
at com.ibm.wrath.progress.WrathProgressEventHandler.handleRequest(WrathProgressEventHandler.java:75)
at com.ibm.wrath.communication.client.WrathAsyncListener$HandleJob.run(WrathAsyncListener.java:198)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 3 Susan McCourt CLA 2008-09-17 16:39:39 EDT
thanks for the patch, marking for M3.
Comment 4 Susan McCourt CLA 2008-10-24 16:04:58 EDT
committed patch to HEAD >20081024
Comment 5 Susan McCourt CLA 2008-10-28 15:18:03 EDT
verified WinXP, Build id: I20081027-1800
using local snippet ApplicationWindowProgressTest