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 105623 - Indentation settings are not honored by javadoc hints
Summary: Indentation settings are not honored by javadoc hints
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords:
: 100381 112275 115838 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-06-04 18:08 UTC by tprochazka
Modified: 2007-10-05 21:39 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 tprochazka 2007-06-04 18:08:42 UTC
Some projects have their own rules of formating that should be respected by all 
developers. Netbeans (especially new Options -> Java rules). But I missing one 
very importat options: Use tab instead of space for identing.

I'm now working or project when all use Eclipce witch can do it, only I'm not 
be able to use one tab character for identing code.

I think that this is very important thing.
Comment 1 tprochazka 2007-06-05 07:43:59 UTC
I found (thanx to Jiri Prox), that Netbeand can do it.

In advanced options -> Editing -> Editor settings -> Java editor is "Tab size" 
property. When I set it to "4" and unchecked "Expand tab to space" in Basic 
options -> Editor -> Identation, Netbeans automaticaly use one tab instead of 4 
spaces.

But I think that this is to complicated for normal user.
(based on Netbeans 6 M9)
Comment 2 tprochazka 2007-06-12 15:02:00 UTC
For example Eclipse has this setting much better.
It has select box with Tab policy:
- Tabs only
- Spaces only
- mixed

When I selected Tabs only, only Tabs size box is active. All is clearly understandable.
Comment 3 tprochazka 2007-06-21 09:03:16 UTC
I tested new dev version (20070619) and this problem is again here.
This version use new options for indentation (Java Code panel).
I set tab size to 4, indentation size to 4, uncheck Expand Tab to Spaces, but Netbeans still use spaces instead of tab. 
This work correctly before.

Comment 4 Max Sauer 2007-06-21 10:49:16 UTC
This is rather a DEFECT. 'Expand Tab to Spaces' checkbox has no effect, neither inside 'Editor' tab, neither inside
'Java Code' tab. Regression => P2.

---
Product Version: NetBeans IDE Dev (Build 070621) 
Java: 1.5.0_12; Java HotSpot(TM) Client VM 1.5.0_12-b04 
System: Linux version 2.6.12-1.1390_FC4smp running on i386; 
UTF-8; en_US (nb) Userdir: /home/ms159439/.netbeans/dev
Comment 5 tprochazka 2007-06-24 11:25:10 UTC
Note: In fact doesn't work only "Reformat Code" from context menu. It using spaces instead of Tab. 
Comment 6 tprochazka 2007-08-05 09:06:01 UTC
Note: All autogenerated code use spaces instead of tab (for example try catch, new method, etc.)
Comment 7 tprochazka 2007-08-08 10:42:47 UTC
The same problem is for JSP identation.
Comment 8 Petr Hrebejk 2007-08-08 16:14:21 UTC
*** Issue 112275 has been marked as a duplicate of this issue. ***
Comment 9 Dusan Balek 2007-08-09 09:47:12 UTC
Fixed. Reformat action, code generation, and template expansion should respect 'Expand Tab To Spaces' setting.

Checking in java/source/src/org/netbeans/modules/java/source/save/Reformatter.java;
/cvs/java/source/src/org/netbeans/modules/java/source/save/Reformatter.java,v  <--  Reformatter.java
new revision: 1.9; previous revision: 1.8
done
Checking in editor/options/src/org/netbeans/modules/options/indentation/IndentationModel.java;
/cvs/editor/options/src/org/netbeans/modules/options/indentation/IndentationModel.java,v  <--  IndentationModel.java
new revision: 1.11; previous revision: 1.10
done
Checking in editor/options/src/org/netbeans/modules/options/indentation/Bundle.properties;
/cvs/editor/options/src/org/netbeans/modules/options/indentation/Bundle.properties,v  <--  Bundle.properties
new revision: 1.10; previous revision: 1.9
done
Checking in editor/options/src/org/netbeans/modules/options/indentation/IndentationPanel.java;
/cvs/editor/options/src/org/netbeans/modules/options/indentation/IndentationPanel.java,v  <--  IndentationPanel.java
new revision: 1.29; previous revision: 1.28
done
Checking in editor/options/src/org/netbeans/modules/options/indentation/IndentationPanel.form;
/cvs/editor/options/src/org/netbeans/modules/options/indentation/IndentationPanel.form,v  <--  IndentationPanel.form
new revision: 1.5; previous revision: 1.4
done
Checking in java/source/nbproject/project.xml;
/cvs/java/source/nbproject/project.xml,v  <--  project.xml
new revision: 1.24; previous revision: 1.23
done
Checking in java/source/src/org/netbeans/modules/java/ui/FmtTabsIndents.java;
/cvs/java/source/src/org/netbeans/modules/java/ui/FmtTabsIndents.java,v  <--  FmtTabsIndents.java
new revision: 1.7; previous revision: 1.6
done
Checking in java/source/src/org/netbeans/modules/java/ui/Bundle.properties;
/cvs/java/source/src/org/netbeans/modules/java/ui/Bundle.properties,v  <--  Bundle.properties
new revision: 1.10; previous revision: 1.9
done
Checking in java/source/src/org/netbeans/modules/java/ui/FmtOptions.java;
/cvs/java/source/src/org/netbeans/modules/java/ui/FmtOptions.java,v  <--  FmtOptions.java
new revision: 1.11; previous revision: 1.10
done
Checking in java/source/src/org/netbeans/modules/java/ui/FmtTabsIndents.form;
/cvs/java/source/src/org/netbeans/modules/java/ui/FmtTabsIndents.form,v  <--  FmtTabsIndents.form
new revision: 1.4; previous revision: 1.3
done
Checking in java/source/src/org/netbeans/modules/java/source/pretty/CharBuffer.java;
/cvs/java/source/src/org/netbeans/modules/java/source/pretty/CharBuffer.java,v  <--  CharBuffer.java
new revision: 1.5; previous revision: 1.4
done
Checking in java/source/src/org/netbeans/modules/java/source/pretty/VeryPretty.java;
/cvs/java/source/src/org/netbeans/modules/java/source/pretty/VeryPretty.java,v  <--  VeryPretty.java
new revision: 1.54; previous revision: 1.53
done
Checking in java/source/src/org/netbeans/api/java/source/CodeStyle.java;
/cvs/java/source/src/org/netbeans/api/java/source/CodeStyle.java,v  <--  CodeStyle.java
new revision: 1.7; previous revision: 1.6
done
Comment 10 tkellerer 2007-08-10 18:41:55 UTC
This is not fixed with the 20070810 build. During editing (e.g. hitting the enter ENTER key after an opening bracket)
the editor still inserts spaces (and not the correct number as well).

The Tab key on an empty line will also not honor these settings. 
Comment 11 Dusan Balek 2007-08-10 23:50:20 UTC
Reassigning to fix the mentioned cases.
Comment 12 Vitezslav Stejskal 2007-08-21 17:05:09 UTC
Should already be fixed with #112005.
Comment 13 tprochazka 2007-09-02 12:26:03 UTC
When I use 'Add throws java.lang.Exception tag' to javadoc, NB add this:
  * @throws java.lang.Exception 
with two spaces instead of tab space.

Try this example:

	/**
	 * Text
	 * @param a
	 */
	public void method(String a) throws Exception {
		new Exception();
	}

And also try it in this form:

	/**
	 * Text
	 */
	public void method2() throws Exception {
		new Exception();
	}

Comment 14 Vitezslav Stejskal 2007-09-12 11:24:08 UTC
Maybe this should go to javadoc module, CCing Honza. The last comment from tprochazka explains what the problem is now.
Comment 15 Jan Lahoda 2007-09-12 11:39:34 UTC
Honza please take a look.
Comment 16 Jan Pokorsky 2007-09-12 13:00:27 UTC
Unfortunately javadoc hints work around missing or broken comments support of our generator (see issue #90302 and issue
#114024). I will try to improve it to reuse the existing indentation.
Comment 17 Jan Pokorsky 2007-09-13 12:20:11 UTC
fixed in

/cvs/javadoc/src/org/netbeans/modules/javadoc/hints/JavadocGenerator.java,v  <--  JavadocGenerator.java
new revision: 1.7; previous revision: 1.6
Comment 18 Jan Pokorsky 2007-09-19 16:52:25 UTC
*** Issue 115838 has been marked as a duplicate of this issue. ***
Comment 19 Dusan Balek 2007-10-05 21:39:25 UTC
*** Issue 100381 has been marked as a duplicate of this issue. ***