Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[Dltk-dev] IProblem ID breaking change proposal

Hello and Happy New Year!

At the moment problem ID is int.

Drawbacks:
- no type safety (=not object-oriented way)
- inconvenient to define constants as (base + N)
- if problem IDs are define in several places it requires additional efforts to be sure there are no conflicts

Proposal:

1. define problem ID as "interface IProblemIdentifier { ... }"
2. implement it using enum:
enum MyProblemId implements IProblemIdentifier {
UNKNOWN_VAR, UNKNOWN_TYPE, UNKNOWN_METHOD;
}
3. persist problem ID to markers as string, e.g. "com.mycompany.myproduct.MyProblemId#UNKNOWN_VAR"

Also, it makes sense to change org.eclipse.dltk.compiler.problem.ProblemSeverities to enum at the same time.

Thoughts? Other ideas? Objections?

Regards,
Alex


Back to the top