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 134217 - Indention settings not used when editing JSP files
Summary: Indention settings not used when editing JSP files
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 1 vote (vote)
Assignee: Tomasz Slota
URL:
Keywords:
: 132772 135300 136234 (view as bug list)
Depends on: 90403
Blocks:
  Show dependency tree
 
Reported: 2008-04-30 07:16 UTC by tkellerer
Modified: 2008-11-05 16:06 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 tkellerer 2008-04-30 07:16:10 UTC
In Tools -> Options -> Editor -> Indention I have defined:

Number of spaces per indent: 2
Tab size: 2
Expand tabs to spaces (unchecked)

The JSP editor still displays files with a tab size of 8, even after reformatting the first indent is done with a single
tab that is expanded to 8 characters.

Using 6.1 final, JDK 1.6, Windows XP
I started with a clean userdir to make sure this was not caused by upgrading settings from RC2
Comment 1 janicki 2008-05-02 06:18:59 UTC
Similar problems for me editing shell scripts, with exact same settings as reporter (tkellerer), basically: tab size=2, no expansion to spaces.   Some more 
notes:

1. My files are Bourne shell scripts
2. The file names have no extension, e.g. "install"
3. When opening the file, they may display tab size of 8.  They remain real tabs (not spaces)
4. If I press my tab key, it is inserted as a real tab, and displayed as size 8
5. If I then select all lines, then press SHIFT-TAB until all lines are left-justified, then press tab at the beginning of a line... now two space characters are 
inserted! 

The above illustrates at least two different bugs.

<rant>Netbeans indenting has been buggy for years... drives me crazy.  Can I help?</rant>


Comment 2 tkellerer 2008-05-05 07:48:29 UTC
I noticed that when I try to reformat a wrongly displayed jsp page, I get an exception (tried to upload the exception
report, but the portal seems to be down). Here is the stacktrace:

java.lang.ArrayIndexOutOfBoundsException: 72
	at org.netbeans.modules.editor.indent.api.IndentUtils.cachedOrCreatedIndentString(IndentUtils.java:228)
	at org.netbeans.modules.editor.indent.api.IndentUtils.createIndentString(IndentUtils.java:195)
	at org.netbeans.modules.editor.indent.spi.Context.modifyIndent(Context.java:177)
	at org.netbeans.modules.editor.structure.formatting.TagBasedLexerFormatter.reformat(TagBasedLexerFormatter.java:358)
	at org.netbeans.modules.editor.structure.formatting.TagBasedLexerFormatter.reformat(TagBasedLexerFormatter.java:160)
	at org.netbeans.modules.editor.structure.formatting.TagBasedLexerFormatter.process(TagBasedLexerFormatter.java:155)
	at org.netbeans.modules.web.core.syntax.indent.JspIndentTask.reindent(JspIndentTask.java:52)
	at org.netbeans.modules.editor.indent.TaskHandler$MimeItem.runTask(TaskHandler.java:502)
	at org.netbeans.modules.editor.indent.TaskHandler.runTasks(TaskHandler.java:271)
	at org.netbeans.modules.editor.indent.IndentImpl.reformat(IndentImpl.java:293)
	at org.netbeans.modules.editor.indent.FormatterImpl.reformat(FormatterImpl.java:161)
	at org.netbeans.editor.ActionFactory$FormatAction.actionPerformed(ActionFactory.java:1561)
	at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:290)
	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1636)
	at javax.swing.JComponent.processKeyBinding(JComponent.java:2849)
	at javax.swing.JComponent.processKeyBindings(JComponent.java:2884)
	at javax.swing.JComponent.processKeyEvent(JComponent.java:2812)
	at java.awt.Component.processEvent(Component.java:5876)
	at java.awt.Container.processEvent(Container.java:2058)
	at java.awt.Component.dispatchEventImpl(Component.java:4466)
	at java.awt.Container.dispatchEventImpl(Container.java:2116)
	at java.awt.Component.dispatchEvent(Component.java:4296)
	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:704)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:969)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:841)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:668)
	at java.awt.Component.dispatchEventImpl(Component.java:4338)
	at java.awt.Container.dispatchEventImpl(Container.java:2116)
	at java.awt.Window.dispatchEventImpl(Window.java:2458)
	at java.awt.Component.dispatchEvent(Component.java:4296)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:284)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Comment 3 Vitezslav Stejskal 2008-05-05 11:54:39 UTC
I think I fixed the exception, see http://hg.netbeans.org/main/rev/979ca7bbfe0a. As for the problem with settings I'm
not sure why this is broken for JSP, but for any language based on Schliemann or GSF settings don't work well. There are
defects filed for those frameworks, but they all pretty much depend on issue #90403 (deprecation of BaseOptions), which
I'm currently working on.
Comment 4 tkellerer 2008-05-05 12:03:45 UTC
Well, I went back to 6.0 for developing my web applications...
Comment 5 Quality Engineering 2008-05-05 15:51:47 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #177 build
Changeset: http://hg.netbeans.org/main/rev/979ca7bbfe0a
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #134217: preventing AIOOBE; the array length must be one larger than the max index
Comment 6 kpturvey 2008-05-06 12:57:30 UTC
This is also a problem for standard Java editing.  I can't seem to get NetBeans to use anything but tabs at 8 spaces. 
In addition, expanding tabs to spaces doesn't seem to be working correctly either.  

I'm going back to NetBeans 6.0 for now.  This is a show stopper for me. 
Comment 7 Vitezslav Stejskal 2008-05-19 12:04:54 UTC
*** Issue 135300 has been marked as a duplicate of this issue. ***
Comment 8 Tomasz Slota 2008-06-24 10:07:09 UTC
*** Issue 136234 has been marked as a duplicate of this issue. ***
Comment 9 Vitezslav Stejskal 2008-06-24 18:59:27 UTC
I checked that on .java and .jsp files and it is working fine in a trunk build. I think it was fixed by the recent
changes  done for #90403.
Comment 10 Vitezslav Stejskal 2008-06-24 19:31:26 UTC
*** Issue 132772 has been marked as a duplicate of this issue. ***
Comment 11 martin_zmrhal 2008-11-05 16:06:28 UTC
verified

Product Version: NetBeans IDE Dev (Build 200811050201)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Linux version 2.6.27-7-generic running on i386; UTF-8; en_US (nb)