Summary: | [model] Resolved elements should transparently answer resolved info without populating | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Philipe Mulet <philippe_mulet> |
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> |
Status: | RESOLVED WONTFIX | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | dirk_baeumer, tobias_widmer |
Version: | 3.1 | Keywords: | performance |
Target Milestone: | 3.1 M7 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Philipe Mulet
2005-04-08 06:43:02 EDT
if (getFlag(flags, T_TYPE_PARAMETERS)) { BindingKey key= new BindingKey(type.getKey()); if (getFlag(flags, USE_RESOLVED) && type.isResolved() && key.isParameterizedType()) { String[] typeArguments= key.getTypeArguments(); getTypeArgumentSignaturesLabel(typeArguments, flags, buf); } else { try { getTypeParametersLabel(type.getTypeParameters(), flags, buf); } catch (JavaModelException e) { // ignore } } } Here is a code snippet how we would then render ITypes. One additional question I have is: what would isResolved answer in the case where the key has only information "identical" to the type itself (e.g. no type argument information). Re your code snippet: it looks weird to me that if you ask for type parameters, your return type arguments. Once this bug is fixed, you should be able to ask for IType#getTypeArguments() without opening the type (if the type is resolved). If the key has has only information "identical" to the type itself, it would answer true anyway, but getTypeParameters() would return an empty array. Agree that T_TYPE_PARAMETERS is misleading. What the constant means is type parameters for generic types and type arguments for parameterized types. We don't distinguish between them in the UI (rendering wise). The information in the binding key becomes obsolete as soon as the underlying source changes. If we transparently use this binding key, we will return obsolete information. A client that is aware of the binding key can use it to get the resolved information (using the BindingKey's helper methods). Other clients should not be affected and see the updated information. |