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 187894 - Generate - Constructor no longer invokes corresponding super constructor
Summary: Generate - Constructor no longer invokes corresponding super constructor
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 189555 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-21 14:39 UTC by aekold
Modified: 2010-10-27 15:18 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log file, as requested (49.44 KB, text/plain)
2010-06-22 09:01 UTC, aekold
Details
last lines from messages.log with logging enabled (2.21 KB, text/plain)
2010-06-22 14:36 UTC, aekold
Details
Patched java.source module (3.06 MB, application/octet-stream)
2010-06-23 09:37 UTC, Dusan Balek
Details
messages.log with more logging (34.79 KB, text/plain)
2010-06-23 11:53 UTC, aekold
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aekold 2010-06-21 14:39:37 UTC
Steps to reproduce:

1. Create new project.
2. Create new class.
3. add "extends Exception"
4. Press Alt+Insert and choose "Constructor" in generate dialog.
5. Tick all 4 checkboxes.
6. Take a look at the generated code.

NetBeans 6.8 generated corresponding invocations to super, like super(message). NetBeans 6.9 leaves empty constructors.
Comment 1 Dusan Balek 2010-06-21 18:53:07 UTC
Unfortunately, I cannot reproduce the problem. Could you please attach your messages.log file? Thanks
Comment 2 aekold 2010-06-22 09:01:28 UTC
Created attachment 100310 [details]
messages.log file, as requested

Here is my messages.log. Just started NetBeans, reproduced the problem, and closed NetBeans again.
Comment 3 aekold 2010-06-22 09:37:56 UTC
Just performed more experiments and found magic combination. The same worked with NetBeans 6.8 but broken in 6.9.

Details:
1. # mkdir ~/temp/netbeans69
2. # /opt/netbeans-6.9/bin/netbeans --userdir /home/user/temp/netbeans69
3. Do not import settings from previous installation
4. New project - Java Application, Finish.
5. Create new class BaseException.
6. Close netbeans.
7. # /opt/netbeans-6.9/bin/netbeans --userdir /home/user/temp/netbeans69
8. write "extends Exception " just before { in BaseException class.
9. move the cursor just after { on the same line as "public class BaseException extends Exception".
10. Press Alt+Insert.
11. Constructor.
12. Tick all 4 checkboxes.
13. Press enter.

You'll see 4 absolutely empty constructors, without super(...) invocations. Reproducable every time for me.
Comment 4 aekold 2010-06-22 09:40:32 UTC
More system configuration details:

OpenSUSE 11.2 x86_64, KDE4 installation, Sun Java installed into /opt/jdk1.6.0_20.
# java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
Comment 5 Dusan Balek 2010-06-22 13:55:50 UTC
Unfortunately, I still cannot reproduce it. Is the problem reproducible on your side even without restarting NetBeans (steps 6 nad 7 in your scenario)? Thanks.
Comment 6 Dusan Balek 2010-06-22 14:22:55 UTC
Could you also run your NetBeans with -J-Dorg.netbeans.api.java.source.ElementHandle.level=FINE and check the log file for any suspicious messages?
Comment 7 aekold 2010-06-22 14:36:16 UTC
Created attachment 100327 [details]
last lines from messages.log with logging enabled
Comment 8 aekold 2010-06-22 14:42:19 UTC
No, the bug is not reproducable if NetBeans was not restarted after project was created.
Comment 9 Dusan Balek 2010-06-23 09:37:23 UTC
Created attachment 100354 [details]
Patched java.source module
Comment 10 Dusan Balek 2010-06-23 09:42:25 UTC
I have added some additional logging into the java.source module. Could you please download attached jar file, save it into the java/modules subdirectory of your NB installation directory, reproduce the issue and attach the new messages.log to the issue? Thanks.
Comment 11 aekold 2010-06-23 11:53:54 UTC
Created attachment 100359 [details]
messages.log with more logging

Done. In logs it looks fine, but in editor - completely another story. Maybe I'll try to capture a video-screenshot?
Comment 12 Dusan Balek 2010-06-23 14:40:46 UTC
When running under debugger I managed to reproduce the issue. The problem is in "random" setting of the newly created trees start positions.

Should be fixed in current dev build together with issue #185967.
Comment 13 aekold 2010-06-23 15:30:34 UTC
Thank you!
Comment 14 Dusan Balek 2010-10-27 15:18:25 UTC
*** Bug 189555 has been marked as a duplicate of this bug. ***