Bug 187232 - NPE in SimpleLookupTable#get(Object) while refactoring
Summary: NPE in SimpleLookupTable#get(Object) while refactoring
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: vm
Depends on:
Blocks:
 
Reported: 2007-05-16 07:31 EDT by Eric Jodet CLA
Modified: 2008-09-15 08:48 EDT (History)
0 users

See Also:


Attachments
[file] stack trace (5.96 KB, text/file)
2007-05-16 07:32 EDT, Eric Jodet CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Jodet CLA 2007-05-16 07:31:26 EDT
eclipse.buildId=I20070516-0010
java.fullversion=J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32 j9vmwi3223-20070201 (JIT enabled)

Test scenario as described in bug 186749.
No CCE anymore while refactoring --> Introduce Indirection

When operation completes, right-click the editor: Undo Introduce Indirection
Then try to re-do the same operation

--> Internal Error due to a NPE (to be attached stack trace)
From this trace, sounds like we invoke the get method with a null key.

Note that I tried and debug this and did not encounter the NPE while debugging.
May be it could be safe to protect the get and getKey methods by testing the passed param.
Comment 1 Eric Jodet CLA 2007-05-16 07:32:01 EDT
Created attachment 67383 [details]
[file] stack trace
Comment 2 Eric Jodet CLA 2007-05-16 07:58:14 EDT
After investigating this one with Frédéric, it sounds like the undo operation is the cause of the issue.

The test case is: 
1-refactor --> introduce indirection 
2 -undo
3-refactor --> introduce indirection
--> error (in fact, we also had a StackOverFlow)

To overcome the issue: open the ASTView and perform a refresh between step 2 and step 3 --> the refactor completes

Moving to JDT UI.
Comment 3 Eric Jodet CLA 2007-05-16 09:04:20 EDT
Back to core for further investigation (we should not have NPE's or StackOverFlow)
Comment 4 Eric Jodet CLA 2007-05-16 10:07:02 EDT
(In reply to comment #3)
1 - This bug does not occur when using a Sun (1.6) JRE
I use: J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32 j9vmwi3223-20070201

2 - No NPE encountered anymore, rather a StackOverFlowError, in a nearly systematic manner
- try and refactor -> Introduce Indirection
- undo
- only select  "quals" in the line  var.equals(1)
- try and re-do the refactoring
--> StackOverFlowError
in HierarchyResolver#resolve(Openable[] , HashSet , IProgressMonitor)
Comment 5 Eric Jodet CLA 2007-05-16 10:30:07 EDT
(In reply to comment #4)
to be more precise:
- when opening this bug, I had a NPE, which I could not reproduce debugging the code
--> as suggested by Olivier, this might be a JIT issue

- the StackOverFlowError is more systematic and can be debugged
Comment 6 Olivier Thomann CLA 2007-05-16 11:10:46 EDT
I got the NPE using a Sun VM 1.6.0_02-ea.
Comment 7 Olivier Thomann CLA 2007-05-16 11:52:46 EDT
I cannot reproduce anymore.
Comment 8 Jerome Lanneluc CLA 2008-08-27 06:45:13 EDT
It looks like it cannot be reproduced. Please reopen if you can reproduce.
Comment 9 Frederic Fusier CLA 2008-09-15 08:48:41 EDT
Verified for 3.5M2 using I20080914-2000.