Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 110587

Summary: [infer type arguments] compile error if referenced CU is not in scope
Product: [Eclipse Project] JDT Reporter: Benno Baumgartner <benno.baumgartner>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P4    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Benno Baumgartner CLA 2005-09-26 09:28:09 EDT
I20050923-1000

Given the two classes:

public class F {
	private List fList= new ArrayList();
	public List elements() {
		return fList;
	}
}

public class E {
	public void foo() {
		F f= new F();
		f.elements().add(new E());
		E e= (E) f.elements().get(0);
	}
}

Now executing Infer Generic Type Arguments on E.java results in

...
		E e= f.elements().get(0);
...

without any changes to F.java and therefore introducing a type missmatch compile
time error.
Comment 1 Markus Keller CLA 2006-07-05 10:31:40 EDT
Works fine if both CUs are in scope. Should block claculation of updates in referenced types that are out of scope.
Comment 2 Eclipse Genie CLA 2020-01-13 14:51:06 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.

If you have further information on the current state of the bug, please add it. 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.