[15.1] Index out of bounds Exception, when inserting a PI an

<oXygen/> general issues.
SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

[15.1] Index out of bounds Exception, when inserting a PI an

Post by SSC » Tue Oct 15, 2013 6:31 pm

Hello,

Since Oxygen Author version 15.1 we get an java.lang.IllegalArgumentException: Index out of bounds.

This occurs, when I do add a certain PI inside an AuthorNode and then refresh the parent of the AuthorNode:

Code: Select all

   
private void adjustDataToAuthorNode(WSAuthorEditorPage editorPage, AuthorDocumentController documentController,
AuthorNode authorNode, String piValue){
StringBuilder taggingPathBuilder = new StringBuilder();
taggingPathBuilder.append("<?"); //$NON-NLS-1$
taggingPathBuilder.append(getPIName());
taggingPathBuilder.append(" "); //$NON-NLS-1$
taggingPathBuilder.append(piValue);
taggingPathBuilder.append(" ?>"); //$NON-NLS-1$

documentController.insertXMLFragment(taggingPathBuilder.toString(),
authorNode, AuthorConstants.POSITION_INSIDE_FIRST);

editorPage.refresh(authorNode.getParent());
}
Here is the Stacktrace of the error:

Code: Select all



java.lang.IllegalArgumentException: Index out of bounds
at org.eclipse.swt.SWT.error(SWT.java:4263)
at org.eclipse.swt.SWT.error(SWT.java:4197)
at org.eclipse.swt.SWT.error(SWT.java:4168)
at org.eclipse.swt.graphics.TextLayout.getLocation(TextLayout.java:2003)
at com.oxygenxml.editor.editors.xsd.view.c.c(Unknown Source)
at ro.sync.ecss.h.ac.ij(Unknown Source)
at ro.sync.ecss.h.u.ij(Unknown Source)
at ro.sync.ecss.h.mb.ij(Unknown Source)
at ro.sync.ecss.h.rb.ij(Unknown Source)
at ro.sync.ecss.h.e.ij(Unknown Source)
at ro.sync.ecss.h.e.ij(Unknown Source)
at ro.sync.ecss.h.e.ij(Unknown Source)
at ro.sync.ecss.h.e.ij(Unknown Source)
at ro.sync.ecss.h.nb.ij(Unknown Source)
at ro.sync.ecss.component.m.njf(Unknown Source)
at ro.sync.ecss.component.m.relayout(Unknown Source)
at ro.sync.ecss.component.m.invalidateBox(Unknown Source)
at ro.sync.ecss.component.m.jnf(Unknown Source)
at ro.sync.exml.workspace.b.e.b.b.b.refresh(Unknown Source)
at ro.sync.ecss.extensions.h.refresh(Unknown Source)
at de.kgucms.kgu.tps.client.tagging.viewer.dnd.oxygen.OxygenTagDropListener.adjustDataToAuthornNode(Unknown Source)
at de.kgucms.kgu.tps.client.tagging.viewer.dnd.oxygen.OxygenTagDropListener.dropFromEditor(OxygenTagDropListener.java:140)
at de.kgucms.kgu.tps.client.tagging.viewer.dnd.oxygen.OxygenTagDropListener.handleXmlTagDrop(OxygenTagDropListener.java:113)
at de.kgucms.kgu.tps.client.tagging.viewer.dnd.oxygen.OxygenTagDropListener.drop(OxygenTagDropListener.java:102)
at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:90)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:774)
at org.eclipse.swt.dnd.DropTarget.Drop(DropTarget.java:456)
at org.eclipse.swt.dnd.DropTarget$3.method6(DropTarget.java:258)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:119)
at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method)
at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:363)
at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:289)
at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:172)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
The Error occurs, when I refresh the parent AuthorNode like this :
editorPage.refresh(authorNode.getParent());

In 15.0 this error did not occur.

Best regards,

Simon
Simon Scholz
vogella GmbH
http://www.vogella.com

Radu
Posts: 6589
Joined: Fri Jul 09, 2004 5:18 pm

Re: [15.1] Index out of bounds Exception, when inserting a P

Post by Radu » Wed Oct 16, 2013 8:43 am

Hi Simon,

Thanks, we'll look into it and try to fix the issue in the next 15.1 minor bug fix release usually announced here:

http://www.oxygenxml.com/rssBuildID.xml

If we cannot reproduce the issue on our side I will request more details from you.
I will also update this thread when the issue is fixed.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Radu
Posts: 6589
Joined: Fri Jul 09, 2004 5:18 pm

Re: [15.1] Index out of bounds Exception, when inserting a P

Post by Radu » Wed Oct 16, 2013 10:16 am

Hi Simon,

I cannot yet reproduce the issue on our side.
This happened during a drag and drop, correct?
Do you use the final 15.1 Oxygen plugin or an intermediate build I gave you?
Do the processing instructions display in the Author mode for your type of XML documents ? Because they are usually hidden by default.
What are the custom CSS styles you added for rendering those processing instructions?
Could you give us an example of the target and data parts of such a processing instruction?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Re: [15.1] Index out of bounds Exception, when inserting a P

Post by SSC » Wed Oct 16, 2013 11:16 am

Radu wrote: This happened during a drag and drop, correct?
Yes, but the drag is from the editor onto an object on our side.(so it has nothing to do with an com.oxygenxml.editor.editors.author.AuthorDnDListener)
This means that we turn tags on in the Author View and drag AuthorNodes out of the editor.
Radu wrote: Do you use the final 15.1 Oxygen plugin or an intermediate build I gave you?
It is the final 15.1 Oxygen plugin
Radu wrote: Do the processing instructions display in the Author mode for your type of XML documents ? Because they are usually hidden by default.
In our case those processing instructions are hidden too, but they are read by a custom ro.sync.ecss.extensions.api.StylesFilter and the content is shown via :BEFORE content to the user.
Radu wrote: What are the custom CSS styles you added for rendering those processing instructions?
The styles are all set by a custom Stylesfilter.
I will send you our StylesFilter via Mail, because it happens quite a lot inside the StylesFilter, and this should not be exposed to others.
Radu wrote: Could you give us an example of the target and data parts of such a processing instruction?
<?tag TT00053@A.1/2/4/5 ?>

It is inserted like that:

Code: Select all


        StringBuilder taggingPathBuilder = new StringBuilder();
taggingPathBuilder.append("<?"); //$NON-NLS-1$
taggingPathBuilder.append(getTaggingPIName());
taggingPathBuilder.append(" "); //$NON-NLS-1$
taggingPathBuilder.append(taggingPath);
taggingPathBuilder.append(" ?>"); //$NON-NLS-1$

documentController.insertXMLFragment(taggingPathBuilder.toString(),
authorNode, AuthorConstants.POSITION_INSIDE_FIRST);
The authorNode, where the insert takes place is the one, which is dropped on our Object.

As an aside, the pi is correctly inserted and also correctly styled.
So it works as expected, but then the error occurs and is rethrown a couple of times even if I just click into the editor and just move the cursor.

Best regards,

Simon
Simon Scholz
vogella GmbH
http://www.vogella.com

Radu
Posts: 6589
Joined: Fri Jul 09, 2004 5:18 pm

Re: [15.1] Index out of bounds Exception, when inserting a P

Post by Radu » Thu Oct 17, 2013 3:01 pm

Hi,

Just to update the thread:
Simon provided us with samples, we reproduced the issue on our side and we'll try to come up with a fix in one of the Oxygen 15.1 minor bug fix releases.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

ionela
Posts: 300
Joined: Mon Dec 05, 2011 6:08 pm

Re: [15.1] Index out of bounds Exception, when inserting a P

Post by ionela » Tue Nov 12, 2013 5:46 pm

Hello,

I just wanted to let you know that this problem has been resolved in the latest maintenance build of Oxygen 15.1, 2013110816 (released on November 11th):
> Author mode: Keyboard navigation did not work on a line that started with fixed content (via CSS) followed by a hidden element (via CSS)
You can download it from our web site:
http://www.oxygenxml.com/download.html

The list of bug-fixes can be found here:
http://www.oxygenxml.com/build_history.html#2013110816

You can follow the release/build RSS feed here:
http://www.oxygenxml.com/rssBuildID.xml

Let us know if you encounter further problems with this new build.

Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support

Post Reply