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 131929 - AssertionError after invoking formatting
Summary: AssertionError after invoking formatting
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords:
: 131437 131931 (view as bug list)
Depends on:
Blocks: 131609
  Show dependency tree
 
Reported: 2008-04-03 13:39 UTC by kozlov
Modified: 2008-04-29 12:34 UTC (History)
0 users

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 kozlov 2008-04-03 13:39:07 UTC
Reproduced in build080402.

Invoke Formatting. 

Exception:

java.lang.AssertionError
	at org.netbeans.modules.editor.structure.formatting.TagBasedLexerFormatter.reformat(TagBasedLexerFormatter.java:185)
	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.html.editor.indent.HtmlIndentTask.reindent(HtmlIndentTask.java:68)
	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.AbstractButton.fireActionPerformed(AbstractButton.java:1882)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:334)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1051)
	at apple.laf.CUIAquaMenuItem.doClick(CUIAquaMenuItem.java:119)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1092)
	at java.awt.Component.processMouseEvent(Component.java:5602)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
	at java.awt.Component.processEvent(Component.java:5367)
	at java.awt.Container.processEvent(Container.java:2010)
	at java.awt.Component.dispatchEventImpl(Component.java:4068)
	at java.awt.Container.dispatchEventImpl(Container.java:2068)
	at java.awt.Component.dispatchEvent(Component.java:3903)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3936)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
	at java.awt.Container.dispatchEventImpl(Container.java:2054)
	at java.awt.Window.dispatchEventImpl(Window.java:1791)
	at java.awt.Component.dispatchEvent(Component.java:3903)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Comment 1 Tomasz Slota 2008-04-04 16:51:33 UTC
*** Issue 131931 has been marked as a duplicate of this issue. ***
Comment 2 Tomasz Slota 2008-04-04 17:02:30 UTC
This problem is caused by the fact that the HTML Formatter expects that other formatters called before it was called are using my internal embedded 
formatting API and it is not the case for the PHP Formatter. A temporary solution will be to use the hack implemented for Ruby: set the HTMLLexerFormatter.HTML_FORMATTER_ACTS_ON_TOP_LEVEL document property for each php document.
Comment 3 Tomasz Slota 2008-04-04 17:13:49 UTC
fixed.

http://hg.netbeans.org/release61/rev/c349dee0ccb5
Comment 4 Tomasz Slota 2008-04-07 12:45:37 UTC
*** Issue 131437 has been marked as a duplicate of this issue. ***
Comment 5 Vitezslav Stejskal 2008-04-07 13:45:50 UTC
Tomasz, I changed the PHP editor to use GSF's Formatter rather then PHPIndentTask. By doing that I think I effectively
nullified your change. I mean the PHPIndentTask source is still there and contains your change, but it's not used
anymore. What should I do to reintroduce your fix in PHPFormatter? Thanks
Comment 6 kozlov 2008-04-08 13:15:25 UTC
Still reproduced in build080407.
Comment 7 Tomasz Slota 2008-04-08 15:18:18 UTC
All the PHP documents must have HTML_FORMATTER_ACTS_ON_TOP_LEVEL document property set before HTML formatter is called, have a look at the 
changeset http://hg.netbeans.org/release61/rev/c349dee0ccb5
Comment 8 Vitezslav Stejskal 2008-04-09 10:34:43 UTC
Ok, I'll fix it. Thanks Tomasz.
Comment 9 Vitezslav Stejskal 2008-04-09 13:52:22 UTC
Should work again. http://hg.netbeans.org/release61/rev/f845337aa197
Comment 10 ghuron 2008-04-10 06:12:54 UTC
Getting exactly the same exception on 20080410
Comment 11 Vitezslav Stejskal 2008-04-10 11:01:16 UTC
Hmm, could you please attach here the file you are trying to format? And describe the exact steps? It's working fine on
files I try in a dev build, but maybe I'm doing something different.
Comment 12 ghuron 2008-04-10 14:28:02 UTC
Ok, I thought new builds are available at http://bits.netbeans.org/download/trunk/nightly/latest/
But today I was told that I should take them directly from hudson http://deadlock.netbeans.org/hudson/job/PHP-build/
I can confirm that there is no exection at latest hudson build
Comment 13 Vitezslav Stejskal 2008-04-11 07:30:43 UTC
I'm sorry. I also might have contributed to the overall confusion, because for some time I wasn't aware of the fact that
the codebase was moved to release61-php repository. Thanks to Honza (jlahoda) all the changesets that I accidentally
pushed to release61 are now transplanted to release61-php. And so the recent hudson builds should have them. Thanks for
patience.
Comment 14 Victoria Zhukovskaya 2008-04-29 12:34:58 UTC
veridfied in NetBeans IDE Dev (Build 20080429082942)