Bug 494209 - org.eclipse.jdt.core.IType.resolveType(String) could support array types
Summary: org.eclipse.jdt.core.IType.resolveType(String) could support array types
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: Macintosh Mac OS X
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-20 15:45 EDT by Raffi Khatchadourian CLA
Modified: 2016-05-20 16:01 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 Raffi Khatchadourian CLA 2016-05-20 15:45:54 EDT
Suppose B is a resolvable type in type A. Suppose aType is the IType instance for A. Then, aType.resolveType("B") returns non-null. However, aType.resolveType("B[]") returns null. Technically, if B is resolvable in A, then I should be able to declare an array of type B in A. As such, aType.resolveType("B[]") should return a non-null value.

-- Configuration Details --
Product: Eclipse 4.5.2.20160218-0600 (org.eclipse.epp.package.committers.product)
Installed Features:
 org.eclipse.jdt 3.11.2.v20160212-1500
Comment 1 Stephan Herrmann CLA 2016-05-20 16:01:13 EDT
I changed the title to better match the classification as an enhancement, because the contract of IType.resolveType(String) makes no promise about handling array types. "B[]" should not be considered as a type name. "[]" is a type constructor, which, applied to "B", creates a new type.

I don't think that this request fits well into the given API, I can't even see a good way how a resolved type for "B[]" could be answered as String[][].
So you shouldn't hold your breath waiting for this to be implemented.