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 120288 - code formatting/highlighting problems in NB 6.0
Summary: code formatting/highlighting problems in NB 6.0
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Rastislav Komara
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-28 13:26 UTC by sulthan
Modified: 2009-02-03 10:55 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sulthan 2007-10-28 13:26:38 UTC
Hello, today I installed NB 6.0 beta 2. I tried to setup the rules for automatic formatting of java sources and I 
found several issues:
1/ JavaExample in Fonts&Colors->Syntax is too simple. There should be fields (static & non-static), method calls 
(again static & non-static, constructors, public/protected/private members etc. The user cannot see how the code would 
look with the changes he has made. The only possibility is to save changes, close a file and open it again (no 
automatic update!)
2/ Java Code - blank lines cannot be used well. There are no settings for comments (blank line after/before), but the 
main problem for me is that it cannot be turned off. With blank lines formatting I cannot achieve code like this:

[code]
public static final int CONSTANT1 = 0;
public static final int CONSTANT2 = 1;
public static final int CONSTANT3 = 2;
   //after reformatting, this line is missing
private int attribute;
[/code]

3/ Formatting of inline classes declaration - If I declare a class like this:
[code]
  container.add(new Canvas() {
      public void paint(Graphics g) {
        //...
      }
  });
[/code]
The code is not indented properly. 
4/ Two variable declarations on the same line - I was trying to write this code:
[code]
  int i, j;
[/code]
after reformatting it becomes:
[code]
  int i,
   j;
[/code]
I didn't find a settings to change this behaviour.

With these issuses, I cannot use NB 6.0 and I have to stay with NB 5.5
Comment 1 Rastislav Komara 2009-02-03 10:55:54 UTC
Overtake.