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 198838

Summary: Code template for pre-creation of return type code
Product: java Reporter: pekarna <pekarna>
Component: EditorAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal CC: markiewb
Priority: P3    
Version: 7.0   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:

Description pekarna 2011-05-23 23:56:28 UTC
When you write

   public List<Message> getMessages( ... ){

then you're most probably going to create a List<Message> and return it at the end of the method.

I suggest to implement a "wizard" which would guide you through it:

   public List<Message> getMessages( ... ){
      List<Message> [list] = new [ArrayList]();

      return list;
   }

with these points to be filled by user:

  1) name of the variable
  2) if return type is an interface, offer classes which implement it

As with all wizards, it's always easier to delete a line than write it, for the cases when user does not want to have it.

Thanks for considering.