Bug 221110 - [search] NPE at org.eclipse.jdt.internal.compiler.util.SimpleLookupTable.removeKey
Summary: [search] NPE at org.eclipse.jdt.internal.compiler.util.SimpleLookupTable.remo...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 221785 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-03 04:43 EST by Philippe Coucaud CLA
Modified: 2008-03-26 04:28 EDT (History)
4 users (show)

See Also:


Attachments
stack trace (8.53 KB, text/plain)
2008-03-03 04:43 EST, Philippe Coucaud CLA
no flags Details
Proposed patch (2.65 KB, patch)
2008-03-03 07:23 EST, Philipe Mulet CLA
no flags Details | Diff
Proposed patch + test (4.34 KB, patch)
2008-03-03 09:24 EST, Frederic Fusier CLA
no flags Details | Diff
Proposed patch + tests (5.16 KB, patch)
2008-03-03 10:59 EST, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Coucaud CLA 2008-03-03 04:43:15 EST
Created attachment 91334 [details]
stack trace

Build ID: I20080207-1530 (3.4M5)

While moving a Java file from one plug-in to another (either by using drag'n'drop in the Package Explorer or Refactor > Move) I get an Internal Error (cf attached stack trace) caused by a NPE at org.eclipse.jdt.internal.compiler.util.SimpleLookupTable.removeKey().
Comment 1 Philipe Mulet CLA 2008-03-03 07:17:06 EST
This indicates someone's trying to remove a null key from the lookup table.
Comment 2 Philipe Mulet CLA 2008-03-03 07:23:47 EST
Created attachment 91355 [details]
Proposed patch

Match locator should protect against unbound wildcards.
Comment 3 Frederic Fusier CLA 2008-03-03 09:18:12 EST
Reproduced with small following test case:
    class X<T> {}
    class Y<T extends X<?>> {}

and searching for X references...
Comment 4 Frederic Fusier CLA 2008-03-03 09:24:23 EST
Created attachment 91366 [details]
Proposed patch + test

Added a regression test case
Comment 5 Frederic Fusier CLA 2008-03-03 09:26:35 EST
This regression was unfortunately introduced by the fix of bug 210567 released in 3.4M4 and so is not present in 3.3 stream...
Comment 6 Philipe Mulet CLA 2008-03-03 09:55:32 EST
Frederic - there were 2 places I added null checks in the code, and I see only one testcase... didn't you miss one scenario in your testcase ?
Comment 7 Frederic Fusier CLA 2008-03-03 10:59:20 EST
Created attachment 91380 [details]
Proposed patch + tests

Well spotted, I missed the additional bounds!
Comment 8 Frederic Fusier CLA 2008-03-04 05:54:24 EST
Released for 3.4M6 in HEAD stream.
Comment 9 Frederic Fusier CLA 2008-03-07 03:45:25 EST
*** Bug 221785 has been marked as a duplicate of this bug. ***
Comment 10 Eric Jodet CLA 2008-03-26 04:28:19 EDT
Verified for 3.4M6 using build I20080324-1300