Bug 169995

Summary: Better location for deprecated type warning message
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, jerome_lanneluc, philippe_mulet
Version: 3.3   
Target Milestone: 3.6 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Olivier Thomann CLA 2007-01-09 13:29:08 EST
We should improve the highlighted range in case of deprecated type errors/warnings:

public void deprecatedType(TypeBinding type, ASTNode location) {
if (location == null) return; // 1G828DN - no type ref for synthetic arguments
int severity = computeSeverity(IProblem.UsingDeprecatedType);
if (severity == ProblemSeverities.Ignore) return;
type = type.leafComponentType();
this.handle(
IProblem.UsingDeprecatedType,
new String[] {new String(type.readableName())},
new String[] {new String(type.shortReadableName())},
severity,
location.sourceStart,
nodeSourceEnd(null, location));
} 

nodeSourceEnd should pass in the type binding and a nodeSourceStart should be used.
We need to improve the case of qualified references:
e.g. aaa.bbb.Deprecated.Member.Member2
Comment 1 Dani Megert CLA 2007-11-19 10:35:20 EST
This is a duplicate of bug 132677 which originally only asked to improve the deprecation problem range and then got generalized.

I would like to see this (the deprecation case) fixed because we could then go ahead and improve Javadoc hovers: currently we show the problem message for deprecated code. Unfortunately the problem text isn't a big help i.e. doesn't tell you what to do. I would like to show the Javadoc of the deprecated element in this case. This is currently hard because the problem range is too big. If the range would be reduced to the name range (so that it matches codeSelect behavior) I could make this happen.
Comment 2 Dani Megert CLA 2007-11-19 11:43:27 EST
See also bug 36754.
Comment 3 Olivier Thomann CLA 2010-03-18 14:08:57 EDT
I know that I should close them the other way around, but bug 300031 is already in the buildnotes.

*** This bug has been marked as a duplicate of bug 300031 ***