Bug 169995 - Better location for deprecated type warning message
Summary: Better location for deprecated type warning message
Status: CLOSED DUPLICATE of bug 300031
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-09 13:29 EST by Olivier Thomann CLA
Modified: 2010-03-18 14:08 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***