Bug 363716 - IProblem#UndefinedType should not be reused for different problem cases
Summary: IProblem#UndefinedType should not be reused for different problem cases
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks: 363459
  Show dependency tree
 
Reported: 2011-11-14 11:10 EST by Markus Keller CLA
Modified: 2022-11-16 03:16 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-11-14 11:10:26 EST
IProblem#UndefinedType is currently reused for completely different problem cases:

class A
{
    private string string;

    public void m1() {
        String temp= string;
    }

    public void m2() {
        string= "Hello World";
    }

    public String m3() {
        return string; // quick fix here
    }
}

In the first occurrence, it's for an undefined type (good). In the other cases it's for a variable whose type is undefined. The two situations should use different problem ids.

For methods, a similar situation already produces IProblem.MissingTypeInMethod:

    public string m4() {
        return m4();
    }

For fields, I'd expect a new IProblem.MissingTypeInField.
Comment 1 Ayushman Jain CLA 2011-11-14 12:21:41 EST
Makes sense.
We should introduce a new message
"The field {1} from the type {1} refers to the missing type {2}"
Comment 2 Deepak Azad CLA 2011-11-14 12:29:12 EST
Aren't we forgetting the local variable case? Or is that covered somewhere?
Comment 3 Ayushman Jain CLA 2011-11-14 12:31:05 EST
(In reply to comment #2)
> Aren't we forgetting the local variable case? Or is that covered somewhere?

Thats covered. We only complain for local variable once at declaration site. (SingleNameReference line 962)
Comment 4 Eclipse Genie CLA 2020-09-03 09:31:30 EDT
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 5 Eclipse Genie CLA 2022-11-16 03:16:45 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.