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.
For the last few months, the Implement Abstract Methods hint has generated "return null;" inside methods whose return type is "void". I thought this was an obvious bug that would be fixed quickly, but it appears it has not. To reproduce: Define an interface public interface Foo { void foo(); } and an implementation public class FooImpl implements Foo { } Accept the hint on the class declaration line and you get public class FooImpl implements Foo { public void foo() { return null; } } which is completely unusable. How much do you trust the IDE if you have to fix many such methods? A // TODO comment would make sense; a throw UnsupportedOperationException() is ugly but would make sense; the current behavior is 100% guaranteed to be wrong for everybody.
Sorry, but not for me. For me, it generates: @Override public void test() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } Could you please check what you have in Tools/Templates/Java/Code Snippets/Generated Method Body? The default content is available here: http://hg.netbeans.org/releases/file/release73/java.source/src/org/netbeans/modules/java/source/resources/OverriddenMethodBody.template Thanks.
Really strange - I have never edited this template. But it is a userdir I have been using for a very long time, so something may have touched it...