Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357044 - [Commands] NullPointerException after Editing several XML files
Summary: [Commands] NullPointerException after Editing several XML files
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 369575 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-08 04:51 EDT by Stefan Drzazga CLA
Modified: 2020-01-21 10:37 EST (History)
3 users (show)

See Also:


Attachments
Stacktrace (3.77 KB, text/plain)
2011-09-08 04:53 EDT, Stefan Drzazga CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Drzazga CLA 2011-09-08 04:51:48 EDT
Build Identifier: I20110906-2000

I've made some modification to a bunch of XML files. All of sudden an error message with a NPE was shown. After this, I was not able to save or make any modification to any file.
After restarting Eclipse it worked fine.

Reproducible: Sometimes

Steps to Reproduce:
1. Open, modify, save and close a few XML files
Comment 1 Stefan Drzazga CLA 2011-09-08 04:53:08 EDT
Created attachment 202975 [details]
Stacktrace
Comment 2 Remy Suen CLA 2011-09-08 09:00:38 EDT
It is possible for getDefaultVariable() to return null as spec'd in the API so it seems like we should guard against this in AdaptExpression.
Comment 3 Remy Suen CLA 2011-11-18 16:10:02 EST
Paul, getDefaultVariable() is spec'd to return null. However, do we expect this to happen while evaluating expressions?
Comment 4 Paul Webster CLA 2011-11-21 10:07:25 EST
(In reply to comment #3)
> Paul, getDefaultVariable() is spec'd to return null. However, do we expect this
> to happen while evaluating expressions?

Not for any variables provided by the workbench.  We set IEvaluationContext.UNDEFINED_VARIABLE any time we don't have a value.  But that's because we used to get CoreExceptions when evaluating a variable that didn't exist (returned null).  Shouldn't the <iterate/> element have died if the default variable was null?

PW
Comment 5 Remy Suen CLA 2012-01-24 14:36:26 EST
*** Bug 369575 has been marked as a duplicate of this bug. ***
Comment 6 Remy Suen CLA 2012-01-24 14:40:05 EST
If anyone knows how to reliably reproduce this problem, please let us know.
Comment 7 Remy Suen CLA 2012-01-24 14:40:35 EST
Note that this is also broken in 4.x per bug 369575.
Comment 8 Remy Suen CLA 2012-01-24 14:46:17 EST
I guess this problem would happen if someone had an IStructuredSelection that contained a null element?
Comment 9 Eclipse Genie CLA 2020-01-21 10:37:08 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.