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.

Bug 96336

Summary: Provide method for resolving parameterized ElementHandle
Product: java Reporter: Martin Adamek <madamek>
Component: SourceAssignee: Rastislav Komara <moonko>
Status: NEW ---    
Severity: blocker CC: jtulach
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Martin Adamek 2007-02-22 16:55:28 UTC
Please consider providing method similar to ElementHandle.asTyped in following
example on line 4. 

<code>
 1| public static ElementHandle<TypeElement> getTypeElementHandle() {
 2|   ElementHandle<? extends Element> elementHandle = getElementHandle();
 3|   if (ElementKind.CLASS == elementHandle.getKind()) {
 4|     return elementHandle.asTyped(TypeElement.class);
 5|   }
 6|   return null;
 7| }
</code>

It would be useful for API user to get parameterized TypeElement without
unchecked cast, which is now only option. I have to use this unchecked cast on
line 4:
<code>
return (ElementHandle<TypeElement>) elementHandle;
</code>
Comment 1 Rastislav Komara 2009-02-03 10:57:38 UTC
Overtake.