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 101131

Summary: toArray() code template
Product: java Reporter: _ tboudreau <tboudreau>
Component: EditorAssignee: _ tboudreau <tboudreau>
Status: RESOLVED FIXED    
Severity: blocker Keywords: SIMPLEFIX
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description _ tboudreau 2007-04-16 12:12:14 UTC
I find the following code template extremely useful, and always set it up.  Any
reason not to add it to the default set?

${clazz}[] ${var} = (${clazz}[]) ${coll
instanceof="java.util.Collection"}.toArray (new ${clazz}[${coll}.size()])

I usually bind it to "2arr"

It would be a little nicer if "clazz" could automatically pick up the generic
type, if any, from the collection, but it looks like the template syntax doesn't
support that yet.
Comment 1 _ tboudreau 2008-10-20 23:24:00 UTC
Any chance of this for 7.0?
Comment 2 _ tboudreau 2010-01-21 21:02:34 UTC
Fixed as part of fix for bug 116449
Fixed in main/ 4beffcfd4006
Comment 3 Quality Engineering 2010-01-24 08:44:56 UTC
Integrated into 'main-golden', will be available in build *201001240200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/4beffcfd4006
User: Tim Boudreau <tboudreau@netbeans.org>
Log: #116449, #167824, #108167, #173652, #173851, #101131, #173655 - additional Java editor hints, enhancements to existing ones, addition of module development-specific hints in apisupport.project