Community
Participate
Working Groups
I20051130-1215 CategorizedProblem's category should be available from markers. Currently, I don't see a way for clients to get the category from an IMarker, since the category is not stored in an attribute. The following section from CategorizedProblem's javadoc has been copied from IProblem - I think it should be updated to tell what's the deal with categories (rather than IDs): * Note: the compiler produces IProblems internally, which are turned into * markers by the JavaBuilder so as to persist problem descriptions. This * explains why there is no API allowing to reach IProblem detected when * compiling. However, the Java problem markers carry equivalent information to * IProblem, in particular their ID (attribute "id") is set to one of the IDs * defined on this interface. It's not yet 100% clear how the categorization API in the Problems view will look like (see bug 119444). If we decide that loading the jdt.ui plug-in for displaying jdt problems is acceptable, then we could also live with an API to get the category name or ID from a problemID.
I did not add the #category API from marker, until we know what is needed to meet requirements. Note that the category can always be determined from the ID, so I would favor a static method on CategorizedProblem#computeCategoryID(int problemID) Would this do the trick ? If a static alternative is preferred, then it would result in an extra slot into the problem marker itself, which is likely fine anyhow. Which way do you prefer ?
Hm, could you add CategorizedProblem#computeCategoryID(int problemID) for now with the risk of having to add the category attribute later? This would allow us to play with the current problems view implementation. The final decision will have to wait for bug 119444.
Java problem markers now have an attribute "categoryId" so as to persist the category they belong to. Marking as FIXED (it was actually released into v_635).
Verified