]
Ilya Buziuk updated ERT-383:
----------------------------
Sprint: devex #125 December 2017 (was: devex #124 December 2017)
JSONEditor: NPE when working with an array of objects [EBZ#497261]
------------------------------------------------------------------
Key: ERT-383
URL:
https://issues.jboss.org/browse/ERT-383
Project: Eclipse Release Train
Issue Type: Task
Components: WTP Source Editing
Reporter: Friendly Jira Robot
Assignee: Victor Rubezhny
Labels: bzira, wst.json
Fix For: Neon.2 (4.6)
I have not been able to reproduce this consistently, but here it goes:
Create a JSON file with following content:
{
"thirdaddition": true,
"name": "JSONEditorTest2",
"secondaddition": 2,
"description": "JSONEditorTest description2",
"version": "1.0.1",
"main": "app.js",
"scripts": {
"start": "node app.js"
},
"array_of_objects": [{"abc": 1234}, {"value": 1234
}]]}}}}}}]}],
"value": "test",
"anothervalue": "1234"
}
When adding and removing (invalid) closing brackets, then modifying the value of the
second array element (value), I tend to see this exception:
java.lang.NullPointerException
at
org.eclipse.wst.json.core.internal.document.JSONModelParser.changeAttrValue(JSONModelParser.java:89)
at
org.eclipse.wst.json.core.internal.document.JSONModelParser.changeRegion(JSONModelParser.java:131)
at
org.eclipse.wst.json.core.internal.document.JSONModelImpl.regionChanged(JSONModelImpl.java:654)
at
org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument._fireEvent(BasicStructuredDocument.java:542)
at
org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.fireStructuredDocumentEvent(BasicStructuredDocument.java:1180)
at
org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1964)
at
org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2423)
at
org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2408)
at
org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.access$2(JobSafeStructuredDocument.java:1)
at
org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument$3.run(JobSafeStructuredDocument.java:141)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.wst.sse.ui.EditorExecutionContext.execute(EditorExecutionContext.java:149)
at
org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.replaceText(JobSafeStructuredDocument.java:144)
at
org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replace(BasicStructuredDocument.java:2368)
at
org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.access$0(JobSafeStructuredDocument.java:1)
at
org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument$1.run(JobSafeStructuredDocument.java:103)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.wst.sse.ui.EditorExecutionContext.execute(EditorExecutionContext.java:149)
at
org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.replace(JobSafeStructuredDocument.java:106)
at
org.eclipse.jface.text.projection.ProjectionTextStore.replace(ProjectionTextStore.java:103)
at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1094)
at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1119)
at
org.eclipse.jface.text.projection.ProjectionDocument.replace(ProjectionDocument.java:625)
at
org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocumentAdapter.java:233)
at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7374)
at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:8225)
at org.eclipse.swt.custom.StyledText.doBackspace(StyledText.java:2334)
at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:7164)
at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:6022)
at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:6049)
at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5733)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4248)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1501)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1524)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1509)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1538)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1534)
at org.eclipse.swt.widgets.Canvas.sendKeyEvent(Canvas.java:515)
at org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:1090)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5817)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
at org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:68)
at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:610)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5727)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:227)
at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2140)
at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2402)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5789)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:5218)
at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5367)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3695)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)