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.
1. create simple java class: package test; import java.awt.Color; import javax.swing.JButton; public class ClassA { public JButton getInstance(String text) { JButton button = new JButton(); button.setText(text); button.setBackground(Color.ORANGE); } } 2. Click the "Add return statement" hint in front of "public JButton getInstance(String text){...}" >> return statement "return null;" has been added I think it may be useful to retur appropriate variable if it exists, in this case it is "return button;" Product Version: NetBeans IDE Dev (Build 201312110002) Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08 Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Could be useful. There are two possibilities: 1/ implement support similar to in-place rename, but oferring a dropdown with choices; offer the neutral value and then possible variables. 2/ offer two fix variants for applicable variables.
(In reply to Svata Dedic from comment #1) > Could be useful. There are two possibilities: > 1/ implement support similar to in-place rename, but oferring a dropdown +1 IMHO That would be better. Such a dropdown could also be used for code templates, where you can define a static set of possible entries. Or for other inplace code completions.