Bug 90778 - [model] Resolved elements should transparently answer resolved info without populating
Summary: [model] Resolved elements should transparently answer resolved info without p...
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2005-04-08 06:43 EDT by Philipe Mulet CLA
Modified: 2005-04-12 04:25 EDT (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 Philipe Mulet CLA 2005-04-08 06:43:02 EDT
3.1m6

Given some information is cached on certain elements, this info should be
transparently used to answer questions from clients; instead of requiring
clients to check for resolution.

(where it makes sense)
Comment 1 Dirk Baeumer CLA 2005-04-08 07:06:52 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).
Comment 2 Jerome Lanneluc CLA 2005-04-08 07:17:21 EDT
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.
Comment 3 Dirk Baeumer CLA 2005-04-08 10:43:15 EDT
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).
Comment 4 Jerome Lanneluc CLA 2005-04-12 04:25:32 EDT
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.