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

Bug 236220

Summary: [compiler] Missing diagnoses on intermediate types from qualified type references
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: stephan.herrmann
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Philipe Mulet CLA 2008-06-09 05:29:14 EDT
Build 3.4RC4

On following example, some raw type and indirect member accesses diagnoses are missing:

[DeprecatedType.java]================
class Base {
	class Member<U> {
        }
}
@Deprecated
public class DeprecatedType<T> extends Base {
}

[X.java]=============================
public class X {
  DeprecatedType.Member m1; // DeprecatedType and Member are raw + indirect access to Member
  DeprecatedType.Member<String> m2; // DeprecatedType is raw + indirect access to Member
}
Comment 1 Philipe Mulet CLA 2008-06-09 05:31:53 EDT
Currently produces only:

		"----------\n" + 
		"1. WARNING in X.java (at line 2)\n" + 
		"	DeprecatedType.Member m1; // DeprecatedType and Member are raw + indirect access to Member\n" + 
		"	^^^^^^^^^^^^^^^^^^^^^\n" + 
		"The type DeprecatedType<T> is deprecated\n" + 
		"----------\n" + 
		"2. WARNING in X.java (at line 2)\n" + 
		"	DeprecatedType.Member m1; // DeprecatedType and Member are raw + indirect access to Member\n" + 
		"	^^^^^^^^^^^^^^^^^^^^^\n" + 
		"Base.Member is a raw type. References to generic type Base.Member<U> should be parameterized\n" + 
		"----------\n" + 
		"3. WARNING in X.java (at line 3)\n" + 
		"	DeprecatedType.Member<String> m2; // DeprecatedType is raw + indirect access to Member\n" + 
		"	^^^^^^^^^^^^^^\n" + 
		"The type DeprecatedType is deprecated\n" + 
		"----------\n" + 
		"4. ERROR in X.java (at line 4)\n" + 
		"	Zork z;\n" + 
		"	^^^^\n" + 
		"Zork cannot be resolved to a type\n" + 
		"----------\n"

Also note that the error range for problem (1) is suboptimal (should narrow to DeprecatedType exactly)
Comment 2 Philipe Mulet CLA 2008-06-09 05:38:21 EDT
Added GenericTypeTest#test1347
Comment 3 Eclipse Genie CLA 2018-12-16 09:47:12 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.
Comment 4 Stephan Herrmann CLA 2018-12-16 10:07:28 EST
(In reply to Philipe Mulet from comment #1)
> Currently produces only:
> 
> 		"----------\n" + 
> 		"1. WARNING in X.java (at line 2)\n" + 
> 		"	DeprecatedType.Member m1; // DeprecatedType and Member are raw +
> indirect access to Member\n" + 
> 		"	^^^^^^^^^^^^^^^^^^^^^\n" + 
> 		"The type DeprecatedType<T> is deprecated\n" + 
> 		"----------\n" + 
> 		"2. WARNING in X.java (at line 2)\n" + 
> 		"	DeprecatedType.Member m1; // DeprecatedType and Member are raw +
> indirect access to Member\n" + 
> 		"	^^^^^^^^^^^^^^^^^^^^^\n" + 
> 		"Base.Member is a raw type. References to generic type Base.Member<U>
> should be parameterized\n" + 
> 		"----------\n" + 
> 		"3. WARNING in X.java (at line 3)\n" + 
> 		"	DeprecatedType.Member<String> m2; // DeprecatedType is raw + indirect
> access to Member\n" + 
> 		"	^^^^^^^^^^^^^^\n" + 
> 		"The type DeprecatedType is deprecated\n" + 
> 		"----------\n" + 
> 		"4. ERROR in X.java (at line 4)\n" + 
> 		"	Zork z;\n" + 
> 		"	^^^^\n" + 
> 		"Zork cannot be resolved to a type\n" + 
> 		"----------\n"
> 
> Also note that the error range for problem (1) is suboptimal (should narrow
> to DeprecatedType exactly)

Range has been improved via bug 292510. The rest remains unchanged (except for the disruption of https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=bd6803034b95b7e0dd8c0cbcd0aead0a5c726f65 ).