Bug 241399 - "Missing code implementation in the compiler" initializting static generic type
Summary: "Missing code implementation in the compiler" initializting static generic type
Status: VERIFIED DUPLICATE of bug 239439
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.5 M1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-18 10:02 EDT by Ary Borenszweig CLA
Modified: 2008-08-06 13:01 EDT (History)
2 users (show)

See Also:


Attachments
proposed patch with simple test (2.73 KB, patch)
2008-07-23 18:10 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ary Borenszweig CLA 2008-07-18 10:02:04 EDT
Build ID: I20080617-2000

Steps To Reproduce:
1. Create a new Class in package foo.bar
2. Write this in the editor:

---
package foo.bar;

public class Test {
	
	private static Map<String, String> var;
	static {
		var= new HashMap<String, String>();
	}

}
---

(note that there are no import statements)

Hovering over "var" in the assignment gives you "Missing code implementation in the compiler" problem message.

More information:
The same thing happens without the "static" keywords being there.
Comment 1 Stephan Herrmann CLA 2008-07-23 18:10:02 EDT
Created attachment 108276 [details]
proposed patch with simple test

A ParameterizedTypeBinding whose 'type' is missing is marked with
HasMissingType, yet it's problemId() was reported as NoError.
-> ProblemReporter.invalidType() was trying to report "NoError".
Since a ParameterizedTypeBinding cannot have a relevant
problemReason delegating to the type should be safe, right?

Are there more situations like this? ArrayBinding already implements
the same strategy. Others?
Comment 2 Olivier Thomann CLA 2008-07-24 08:42:33 EDT

*** This bug has been marked as a duplicate of bug 239439 ***
Comment 3 Olivier Thomann CLA 2008-07-24 08:45:54 EDT
(In reply to comment #1)
> Are there more situations like this? ArrayBinding already implements
> the same strategy. Others?
I ended up with a similar fix for bug 239439. I don't think we need to check for null as the inner type cannot be null by construction.
Comment 4 Olivier Thomann CLA 2008-07-24 08:57:08 EDT
Stephan, thanks for your time and the patch.
Comment 5 Stephan Herrmann CLA 2008-07-24 09:01:14 EDT
(In reply to comment #3)
> I ended up with a similar fix for bug 239439. 

;-)

> I don't think we need to check
> for null as the inner type cannot be null by construction.

I fully agree. 

Do your tests for bug 239439 also detect the bogus error message
("Missing code implementation")? Perhaps you can still use the test
from my patch for that purpose, if you like.
Comment 6 Olivier Thomann CLA 2008-07-24 09:08:57 EDT
(In reply to comment #5)
> Do your tests for bug 239439 also detect the bogus error message
> ("Missing code implementation")? Perhaps you can still use the test
> from my patch for that purpose, if you like.
This is exactly what I did. See the released version of the GenericTests. 

Comment 7 Kent Johnson CLA 2008-08-06 13:01:37 EDT
Verified for 3.5M1 using I20080805-1307