Bug 292510 - FUP of 292364: Error messages don't identify partial types precisely.
Summary: FUP of 292364: Error messages don't identify partial types precisely.
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M4   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-16 06:24 EDT by Srikanth Sankaran CLA
Modified: 2009-12-08 01:43 EST (History)
2 users (show)

See Also:
Olivier_Thomann: review+


Attachments
proposed fix v0.5 + regression tests (22.29 KB, patch)
2009-10-29 06:39 EDT, Ayushman Jain CLA
no flags Details | Diff
proposed fix with correction + regression tests (22.81 KB, patch)
2009-10-29 14:28 EDT, Ayushman Jain CLA
Olivier_Thomann: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2009-10-16 06:24:33 EDT
HEAD.

org.eclipse.jdt.core.tests.compiler.regression.Deprecated15Test.test002()
org.eclipse.jdt.core.tests.compiler.regression.DeprecatedTest.test015()
org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest.test1347()

are some tests that show that when the compiler wants to report that type
X is deprecated in a type reference of the form:

   X.Inner.InnerMost

We actually identify the full type reference.

i.e instead of saying 

   X.Inner.InnerMost
   ^

we end up saying

   X.Inner.InnerMost
   ^^^^^^^^^^^^^^^^^

See the patch attached to bug#292364 comment#4 for a proposed fix.
(the portions relevant to bug#292364 itself should be ignored)

Also see comment#6 for a test patch that shows the outstanding
issues with that patch. Since this issue of type highlighting is
orthogonal to the original issue bug#292364 intended to address,
it is being spwaned off as a separe issue.

Ayush, please start with the patch in bug#292364 comment#4 and address
concerns raised by bug#292364 comment#6.
Comment 1 Srikanth Sankaran CLA 2009-10-16 06:28:14 EDT
Ayush, please investigate - Thanks!
Comment 2 Ayushman Jain CLA 2009-10-29 06:39:43 EDT
Created attachment 150810 [details]
proposed fix v0.5 + regression tests

a few changes have been carried over from the patch in https://bugs.eclipse.org/bugs/show_bug.cgi?id=292364#c4. These changes fix the problem in the case of deprecated type error reporting. To fix the javadoc side of the same problem, the method ProblemReporter#javadocDeprecatedType is fixed. Regarding the problems reported in comment 6 of bug 292364: 

>- Sometimes instead of reporting IProblem.JavadocUsingDeprecatedType,
>     we incorrectly report IProblem.UsingDeprecatedType

Fixed.

> -IProblem.JavadocUsingDeprecatedType reporting continues to fail to
>     demarcate partial types in messages.

ProblemReporter#javadocDeprecatedType fixed. Added regression test JavadocBugsTest.testBug292510().

>-We also need to inspect the code to see if there are other places
>     we should be using nodeSourceEnd(null, location), instead of
>     location.sourceEnd 

Fixed :
a)ProblemReporter#staticMemberOfParameterizedType
   - GenericTypeTest.test0290(), GenericTypeTest.test0755() remastered to  reflect changes.
b)ProblemReporter#incorrectArityForParameterizedType
   - GenericTypeTest.test1457() remastered to reflect changes.
c)ProblemReporter#parameterizedMemberTypeMissingArguments
   - GenericTypeTest.test0289() remastered to reflect the change.
Comment 3 Olivier Thomann CLA 2009-10-29 13:24:35 EDT
I don't understand why a modifier is used as an index in:
ProblemReporter#public void javadocDeprecatedType(TypeBinding type, ASTNode location, int modifiers) {
I believe we should pass a new int argument that would be the index and keep the modifiers as before.
Could you please clarify that point, Ayushman ?
Thanks.
Comment 4 Ayushman Jain CLA 2009-10-29 14:28:20 EDT
Created attachment 150858 [details]
proposed fix with correction + regression tests

oops! my bad. I passed the index in the modifiers argument. Corrected the fix and created a new method with an added argument.
Comment 5 Olivier Thomann CLA 2009-11-02 15:26:28 EST
I'll release the latest patch as soon as all tests are run.
Comment 6 Olivier Thomann CLA 2009-11-03 10:12:07 EST
Released for 3.6M4.
Regression tests have been updated.

Thanks, Ayushman.
Comment 7 Srikanth Sankaran CLA 2009-12-08 01:43:39 EST
Verified for 3.6M4 using Build id: I20091207-1800