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.
Given the code below, there is exactly one error: the method at line D has not been defined. However, if you change the first constructor in a way that the parser is re-run, the second constructor displays a second warning at line B or line C: "Call to super must be first statement in constructor" How the file is changed seems to determine whether the error is reported at B or C. If I delete the semicolon at line A, then add it back, line C is flagged. If I put the cursor after A and type <CR>serr<TAB>, line B is flagged. Making another change will cause the error to disappear. Even switching to anoter application and back will cause the error to disappear. import javax.swing.Icon; import javax.swing.JButton; public class A extends JButton { public A(Icon icon) { super(icon); // A } public A(String text) { // B super(text); // C someMethod(text); // D } }
Reproducible. Thanks for your report.
Dusane, could you please have a look on this? Mentioned inappropriate 'Call to super must be first statement in constructor' is provided by CompilationInfo.getDiagnostics(), phase is 'resolved'. Thanks.
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/b74592f0bce5 changeset 710fd67c9280 in main/nb-javac details: http://hg.netbeans.org/main/nb-javac?cmd=changeset;node=710fd67c9280
Integrated into 'main-golden', will be available in build *200908120201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b74592f0bce5 User: Dusan Balek <dbalek@netbeans.org> Log: Issue #169998: Misleading, transient error annotations re: super calls - fixed.
*** Issue 164716 has been marked as a duplicate of this issue. ***