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 47462 - [40cat] Auto comment uses wrong indent
Summary: [40cat] Auto comment uses wrong indent
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Pavel Flaska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-19 12:53 UTC by gugrim
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The requested source file (1.36 KB, text/plain)
2004-08-23 18:07 UTC, gugrim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gugrim 2004-08-19 12:53:14 UTC
[ BUILD # : 200408171800 ]
[ JDK VERSION : J2SE 1.4.2 ]

After using Auto Comment the method comment is indented two blanks instead of the four I have in my settings.
Comment 1 psuk 2004-08-19 17:24:47 UTC
Could it be caused by src bridge?
Dane?
Comment 2 Martin Matula 2004-08-20 22:44:20 UTC
It is probably caused by the javacore (code generation). Reassigning
to Pavel.
Comment 3 Pavel Flaska 2004-08-23 12:41:58 UTC
Doesn't reproducible on my machine. I suppose you have created new
comment. (Method was not commented before.) Code-generator tries to
find method indentation and then it indents comments to its level.

Your method is probably indented by two 'tab' characters. Can you,
please, provide source file where problem occurs?
(I will fix tab problems, but not sure that it is exactly what you
reported.)
Comment 4 Pavel Flaska 2004-08-23 14:19:57 UTC
Fixed problem with tab characters. If your problem is different,
please, reopen it.

Checking in
src/org/netbeans/modules/javacore/jmiimpl/javamodel/SemiPersistentElement.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/SemiPersistentElement.java,v
 <--  SemiPersistentElement.java
new revision: 1.30; previous revision: 1.29
done
Processing log script arguments...
Mailing the commit message to cvs@java.netbeans.org (from
pflaska@netbeans.org)
Comment 5 gugrim 2004-08-23 18:05:51 UTC
The bug is not fixed. I have not created a new comment and I do not
use two tab characters. Also my tab and indentation settings are as
follows:

Tools->Options->Editing->Java Editor->Tab Size = 4
Tools->Options->Editing->Java Editor->Indent Engine->Expand Tabs To
Spaces = No
Tools->Options->Editing->Java Editor->Indent Engine->Number of spaces = 4

Will attach a small source file. 
Comment 6 gugrim 2004-08-23 18:07:52 UTC
Created attachment 17045 [details]
The requested source file
Comment 7 psuk 2004-08-24 09:00:49 UTC
There is a similar Issue 47712 w/ Refactoring and Tools/Synchronize
Comment 8 Pavel Flaska 2004-08-24 15:17:05 UTC
Hm, probably I misunderstood something. It would be fine if you
provide steps to reproduce.

There are more things which has to be addressed:
1) When 'Expand Tabs To Spaces' options is set to 'No', there were
problem with indenting javadoc. In current trunk build it is fixed,
that is the reason why I closed the issue. - I fixed it yesterday.
2) 'Autocomment tool' is not related with indentation engine.
Code-generator uses method indentation (which is currently
autocommented). Javadoc will be indented as the first line of the
method. Doesn't matter if the method is or not correctly indented. I
think javadoc is related to the feature and that is the reason why it
respect feature indentation, not indentation engine. (If the method
should be indented on 4th column but is indented on 7th column, I
think javadoc added by autocomment tool should respect that it is on
7th column. Still you can use reformat code from pop-up menu.)
3) There is a separate issue as Pavel Suk noted with indentation, it
is definitely a bug.

Now I do not know what is still wrong. Steps how to reproduce the bug
on currect trunk build with expected and achieved results are highly
appreciated.
Comment 9 gugrim 2004-08-25 17:27:24 UTC
Works fine with build 200408231800!
Comment 10 Pavel Flaska 2004-08-26 09:30:11 UTC
Fixed.
Comment 11 Quality Engineering 2007-09-20 09:41:03 UTC
Reorganization of java component