Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 103642 - Broken rewrite of ClassTree
Broken rewrite of ClassTree
Product: java
Classification: Unclassified
Component: Source
PC Linux
: P3 (vote)
: 6.x
Assigned To: Pavel Flaska
Depends on:
Blocks: 76502
  Show dependency treegraph
Reported: 2007-05-10 13:05 UTC by Jan Pokorsky
Modified: 2007-11-01 21:41 UTC (History)
0 users

See Also:
Issue Type: DEFECT

NPE (1.16 KB, application/octet-stream)
2007-10-31 14:57 UTC, Pavel Flaska

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Pokorsky 2007-05-10 13:05:20 UTC
Having class A

class A extends B {
    A(int a) {
    void m() {

and class B

class B {
    B(int a) {

if I run Extract Superclass refactoring, with method m() selected for
extraction, the new extracted class contains wrong members.

public class NewClass extends B {
    NewClass(int a) {
    NewClass() { // <-- here should be method m()

In debugger, the new ClassTree passed to WorkingCopy.rewrite looks OK.

You can find code creating NewClass in
Comment 1 Pavel Flaska 2007-07-13 15:06:54 UTC
Works correctly in current trunk build.
Comment 2 Jan Pokorsky 2007-08-30 20:08:23 UTC
Still broken. Now it ignores super(...) statement.

public class NewClass extends B {
    NewClass(int a) {
        // <-- here should be method super(a);
    void m() {

Comment 3 Pavel Flaska 2007-10-31 14:57:20 UTC
Created attachment 52126 [details]
Comment 4 Pavel Flaska 2007-10-31 15:02:02 UTC
When I tried to reproduce the current behavior, I got the exception above.

Although, I expect once the exception will be fixed, the issue will come back to java/source. 

Perhaps I will remove guess if the super is synthetic or not and will move responsibility to API clients. Once NPE will
be fixed, please, reassign it back.

Comment 5 Jan Pokorsky 2007-11-01 17:36:34 UTC
The NPE seems to be fixed. Reassigning back.
Comment 6 Pavel Flaska 2007-11-01 21:41:57 UTC
Checking in src/org/netbeans/modules/java/source/pretty/;
/cvs/java/source/src/org/netbeans/modules/java/source/pretty/,v  <--
new revision: 1.71; previous revision: 1.70

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo