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 249736 - Editing yaml files causes an exception
Summary: Editing yaml files causes an exception
Status: RESOLVED WORKSFORME
Alias: None
Product: web
Classification: Unclassified
Component: YAML (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
: 249715 (view as bug list)
Depends on: 249740
Blocks:
  Show dependency tree
 
Reported: 2015-01-11 23:50 UTC by waldermort
Modified: 2015-03-25 17:56 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample file (306 bytes, application/x-yaml)
2015-01-12 07:21 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description waldermort 2015-01-11 23:50:03 UTC
When editing a newly opened/saved .yml file (in a Symfony project) an exception is thrown. This is with version '201501110208'.

To reproduce, open a yaml file and hit enter two times (adding two new lines).

Here are the exception details:

javax.swing.text.BadLocationException: Invalid offset
	at org.netbeans.editor.BaseDocument.getVisColFromPos(BaseDocument.java:2136)
	at org.netbeans.editor.Utilities.getVisualColumn(Utilities.java:588)
[catch] at org.netbeans.modules.languages.yaml.YamlKeystrokeHandler.getLineIndent(YamlKeystrokeHandler.java:282)
	at org.netbeans.modules.languages.yaml.YamlKeystrokeHandler.beforeBreak(YamlKeystrokeHandler.java:192)
	at org.netbeans.modules.csl.core.CslEditorKit$GsfInsertBreakAction.beforeBreak(CslEditorKit.java:347)
	at org.netbeans.editor.BaseKit$InsertBreakAction.performLineBreakInsertion(BaseKit.java:1426)
	at org.netbeans.editor.BaseKit$InsertBreakAction.access$200(BaseKit.java:1318)
	at org.netbeans.editor.BaseKit$InsertBreakAction$1.run(BaseKit.java:1353)
	at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:356)
	at org.netbeans.editor.BaseKit$InsertBreakAction.actionPerformed(BaseKit.java:1344)
	at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:339)
	at javax.swing.SwingUtilities.notifyAction(Unknown Source)
	at javax.swing.JComponent.processKeyBinding(Unknown Source)
	at javax.swing.JComponent.processKeyBindings(Unknown Source)
	at javax.swing.JComponent.processKeyEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$400(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Comment 1 Vladimir Riha 2015-01-12 07:20:01 UTC
Thank you for reporting, reproducible. Reassigning to YAML



Product Version: NetBeans IDE Dev (Build 201501120001)
Java: 1.8.0_25; Java HotSpot(TM) Client VM 25.25-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b17
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)
Comment 2 Vladimir Riha 2015-01-12 07:21:29 UTC
Created attachment 151445 [details]
sample file

To reproduce, please try:
 - open this file in editor
 - place cursor to end of line 12 and press Enter twice
Comment 3 Petr Pisl 2015-01-12 09:02:39 UTC
My guess is that this is a regression after rewriting Editor Document api. I have entered new issue against the Editor Document api. Issue #249740.
Comment 4 Roman Svitanic 2015-03-25 15:28:10 UTC
Not reproducible on the current dev build 20150325.
Comment 5 Roman Svitanic 2015-03-25 15:36:52 UTC
*** Bug 249715 has been marked as a duplicate of this bug. ***
Comment 6 waldermort 2015-03-25 17:56:17 UTC
Fix Confirmed