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.
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)
*** Issue 131931 has been marked as a duplicate of this issue. ***
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.
fixed. http://hg.netbeans.org/release61/rev/c349dee0ccb5
*** Issue 131437 has been marked as a duplicate of this issue. ***
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
Still reproduced in build080407.
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
Ok, I'll fix it. Thanks Tomasz.
Should work again. http://hg.netbeans.org/release61/rev/f845337aa197
Getting exactly the same exception on 20080410
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.
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
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.
veridfied in NetBeans IDE Dev (Build 20080429082942)