This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | not possible to get FQN of TypeMirror | ||
---|---|---|---|
Product: | java | Reporter: | Tomas Mysik <tmysik> |
Component: | Source | Assignee: | apireviews <apireviews> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | abadea, jbecicka, jlahoda |
Priority: | P3 | Keywords: | API, API_REVIEW_FAST |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Proposed API change. |
Description
Tomas Mysik
2007-05-17 16:26:04 UTC
I would not say it is not possible - check for kind (TypeMirror.getKind()). If kind is DECLARED, do: ((TypeElement) ((DeclaredType) tm).asElement()).getQualifiedName().toString() I agree that this could be simpler - and leaving open as an enhancement to cover this - but it is possible to get the FQN (whatever definition of FQN is appropriate in a given context). Actually, reasonable definition of FQN is probably hardest part of creating utility to get FQN from a TypeMirror. It's not that simple, take for example java.util.Map<String, java.util.List<String>> Admittedly the method has a bit unclear semantics, one might want imports to be taken into account (to generate simple names when possible). But still: the API is incomplete, thus I consider this a defect. Will resolve later NetBeans.org Migration: changing resolution from LATER to WONTFIX Created attachment 100482 [details]
Proposed API change.
I would like to add method org.netbeans.api.java.source.TypeUtilities.getTypeName(TypeMirror, TypeNameOptions...), please review the change. Thanks. Thanks for the review. http://hg.netbeans.org/jet-main/rev/03bafe62dfb8 Integrated into 'main-golden', will be available in build *201007140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/03bafe62dfb8 User: Jan Lahoda <jlahoda@netbeans.org> Log: #104194: introducing TypeUtilities.getTypeName. |