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 72980

Summary: Project template generation and strange variable
Product: apisupport Reporter: cris_malinescu <cris_malinescu>
Component: TemplatesAssignee: rmatous <rmatous>
Status: RESOLVED FIXED    
Severity: blocker CC: cris_malinescu
Priority: P4    
Version: 5.x   
Hardware: All   
OS: All   
URL: http://www.dyadem.com
Issue Type: DEFECT Exception Reporter:

Description cris_malinescu 2006-02-23 17:43:22 UTC
Hello,
I found that the wizard used for generating a new project template using an 
existing project structure generates a java class file containing a member 

public class XYZPanelVisual extends JPanel implements DocumentListener { ...

private int type;

//which is never referred or used in the class, but redundantly/no effect 
initialized in the generated constructor like: 

public XYZPanelVisual(XYZWizardPanel panel) {
  initComponents();
  this.panel = panel;
  
  //-> 
  this.type = type; 
  //<-
  
  // Register listener on the textFields to make the automatic updates
  projectNameTextField.getDocument().addDocumentListener(this);
  projectLocationTextField.getDocument().addDocumentListener(this);
 }

... 
}

What's the purpose of this variable and the redundant/no effect assignment?

Regards,
Cris
Comment 1 rmatous 2006-02-24 08:18:09 UTC
Fixed in trunk(5.0u2):
/cvs/apisupport/project/src/org/netbeans/modules/apisupport/project/ui/wizard/project/templatePanelVisual.javx,v
 new revision: 1.11; previous revision: 1.10

Fixed in 50.u1:
/cvs/apisupport/project/src/org/netbeans/modules/apisupport/project/ui/wizard/project/templatePanelVisual.javx,v
 new revision: 1.10.6.1; previous revision: 1.10