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 19178 - Method indentation wrong in "New Wizard" generated classes
Summary: Method indentation wrong in "New Wizard" generated classes
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
: 19175 (view as bug list)
Depends on: 9955
Blocks:
  Show dependency tree
 
Reported: 2002-01-09 01:47 UTC by hallorant
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hallorant 2002-01-09 01:47:49 UTC
When using the "New Wizard - Class" dialog the methods that are part of 
generated classes do not follow the users preferences for indentation (e.g. 
using 2 spaces verses 4) the generated code uses constent 4 space indentation 
for all methods.  You can fix the code by running "Reformat Code", but this 
behavior is a bug -- I think.

Below is an example where my setting was for 2 space indentation:
/*
 * Junk.java
 *
 * Created on January 8, 2002, 8:39 PM
 */

package thinking.c04;

/**
 *
 * @author  timothy
 */
public class Junk {

  private int field0;
  
  private int field1;
  
  private int field2;
  
  /** Creates a new instance of Junk */
    public Junk() {
    }

    void method0() {
    }
    
    void method1() {
    }
    
    void method2() {
    }
    
    void method3() {
    }
    
}
Comment 1 Svata Dedic 2002-01-09 09:00:07 UTC
Editor maintainers - do you know about this ? We're funneling the
generated code through the Indentation engine :-)
Comment 2 Rochelle Raccah 2002-01-09 15:50:42 UTC
I filed issue 9955 ages ago.  They sound the same to me.
Comment 3 Svata Dedic 2002-01-10 15:25:13 UTC
We tried not to indent everything which is literally copied from the
template, only the places where the macro expansion may change the
code layout. But the unformatted constructor code (and particularly
the closing curly brace) confuses the indentation engine.
If we pass all the stuff through the Indent Engine, custom formatting,
which may be present in the template will be lost.
Comment 4 Svata Dedic 2002-01-10 16:56:25 UTC
Rochelle, thanks for reminding me of that other issue.
Comment 5 Svata Dedic 2002-01-10 17:01:35 UTC
It's OK now (IMHO)
Comment 6 Svata Dedic 2002-01-10 17:01:44 UTC
*** Issue 19175 has been marked as a duplicate of this issue. ***
Comment 7 hallorant 2002-01-11 18:34:34 UTC
The CVS trunk, as of 11 Jan 02 still has this problem...am I missing
something
Comment 8 Svata Dedic 2002-01-14 10:10:24 UTC
Yes, you are missing the patch from 3.3 branch :-) Sorry - it's merged
now.
Comment 9 hallorant 2002-01-16 15:24:41 UTC
Yes, it works fine now...Thanks
Comment 10 Jan Becicka 2002-06-27 12:36:38 UTC
VERIFIED
Comment 11 Quality Engineering 2003-07-01 13:17:53 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.