Home » Modeling » EMF » ArrayIndexOutOfBounds when removing an Adapter from an EObject
| | | |
Re: ArrayIndexOutOfBounds when removing an Adapter from an EObject [message #417616 is a reply to message #417615] |
Tue, 18 March 2008 08:09 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------090502090502000602080209
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Sascha,
I imagine that most of these things are happening on the foreground
thread. What exactly is happening on the other threads? The
transaction framework could be used to deal with issues like this...
Eddi wrote:
> But there are to much places in our code, where the adapterlist will be
> modified : ItemProviderAdapters , Resource while load and unload, our
> GEFeditors , PropertySections. Where is a best place to synchronize the
> adapterlist?
>
> Thanks in advance,
> eddi
> "Sascha Theves" <sascha.theves@innovations.de> schrieb im Newsbeitrag
> news:frm5dv$2bh$1@build.eclipse.org...
>
>> Hi all,
>>
>> we get very often an ArrayIndexOutOfBounds Exception when we try to remove
>> an Adapter from an EObjects adapter list. Is the implementation of
>> EAdapterList not thread-safe? How do we prevent such Exceptions?
>>
>> Thanks in advance,
>>
>> Sascha
>>
>>
>>
>
>
>
--------------090502090502000602080209
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Sascha,<br>
<br>
I imagine that most of these things are happening on the foreground
thread. What exactly is happening on the other threads? The
transaction framework could be used to deal with issues like this...<br>
<br>
<br>
Eddi wrote:
<blockquote cite="mid:frnpq4$u5l$1@build.eclipse.org" type="cite">
<pre wrap="">But there are to much places in our code, where the adapterlist will be
modified : ItemProviderAdapters , Resource while load and unload, our
GEFeditors , PropertySections. Where is a best place to synchronize the
adapterlist?
Thanks in advance,
eddi
"Sascha Theves" <a class="moz-txt-link-rfc2396E" href="mailto:sascha.theves@innovations.de"><sascha.theves@innovations.de></a> schrieb im Newsbeitrag
<a class="moz-txt-link-freetext" href="news:frm5dv$2bh$1@build.eclipse.org">news:frm5dv$2bh$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Hi all,
we get very often an ArrayIndexOutOfBounds Exception when we try to remove
an Adapter from an EObjects adapter list. Is the implementation of
EAdapterList not thread-safe? How do we prevent such Exceptions?
Thanks in advance,
Sascha
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>
--------------090502090502000602080209--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: ArrayIndexOutOfBounds when removing an Adapter from an EObject [message #417621 is a reply to message #417606] |
Tue, 18 March 2008 15:32 |
eddi Messages: 3 Registered: July 2009 |
Junior Member |
|
|
What is wrong here?
If I execute a command quickly serveral times then I get the following
StackTrace:
Thread [main] (Suspended (exception
java.lang.ArrayIndexOutOfBoundsException))
org.eclipse.emf.common.util.BasicEList<E>.remove(int) line: 942
org.eclipse.emf.ecore.util.EObjectContainmentEList<E>(org.eclipse.emf.common
..notify.impl.NotifyingListImpl<E>).doRemove(int) line: 762
org.eclipse.emf.ecore.util.EObjectContainmentEList<E>(org.eclipse.emf.common
..notify.impl.NotifyingListImpl<E>).remove(int) line: 713
org.eclipse.emf.edit.command.RemoveCommand.doExecute() line: 326
org.eclipse.emf.edit.command.RemoveCommand(org.eclipse.emf.e dit.command.Abst
ractOverrideableCommand).execute() line: 129
de.visualrules.model.edit.command.delete.ElementDeleteComman d(org.eclipse.em
f.common.command.CompoundCommand).execute() line: 267
de.visualrules.model.edit.command.move.StatementDragDropLoca lCommand(org.ecl
ipse.emf.common.command.CompoundCommand).execute() line: 267
de.visualrules.model.edit.command.VisualRulesCompoundCommand (org.eclipse.emf
..common.command.CompoundCommand).execute() line: 267
de.visualrules.model.edit.command.VisualRulesCompoundCommand (org.eclipse.emf
..common.command.CompoundCommand).execute() line: 267
org.eclipse.emf.workspace.EMFCommandOperation.doExecute(org. eclipse.core.run
time.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) line: 116
org.eclipse.emf.workspace.EMFCommandOperation(org.eclipse.em f.workspace.Abst
ractEMFOperation).execute(org.eclipse.core.runtime.IProgress Monitor,
org.eclipse.core.runtime.IAdaptable) line: 137
org.eclipse.core.commands.operations.DefaultOperationHistory .execute(org.ecl
ipse.core.commands.operations.IUndoableOperation,
org.eclipse.core.runtime.IProgressMonitor,
org.eclipse.core.runtime.IAdaptable) line: 511
de.visualrules.core.edit.editingdomain.WorkingCommandStack.e xecute(org.eclip
se.emf.workspace.EMFCommandOperation, boolean) line: 353
de.visualrules.core.edit.editingdomain.WorkingCommandStack.e xecute(org.eclip
se.emf.common.command.Command, java.util.Map, boolean) line: 472
de.visualrules.core.edit.editingdomain.WorkingCommandStack.e xecute(org.eclip
se.emf.common.command.Command, java.util.Map) line: 401
de.visualrules.core.edit.editingdomain.WorkingCommandStack(o rg.eclipse.emf.t
ransaction.impl.AbstractTransactionalCommandStack).execute(o rg.eclipse.emf.c
ommon.command.Command) line: 217
de.visualrules.ui.gef.internal.editor.VisualRuleTreeCommandS tack.execute(org
..eclipse.gef.commands.Command) line: 95
de.visualrules.ui.flowrule.internal.action.PasteAction(org.e clipse.gef.ui.ac
tions.WorkbenchPartAction).execute(org.eclipse.gef.commands. Command) line:
76
de.visualrules.ui.flowrule.internal.action.PasteAction.run() line: 239
de.visualrules.ui.flowrule.internal.action.PasteAction(org.e clipse.jface.act
ion.Action).runWithEvent(org.eclipse.swt.widgets.Event) line: 498
org.eclipse.ui.actions.RetargetAction.runWithEvent(org.eclip se.swt.widgets.E
vent) line: 229
org.eclipse.jface.commands.ActionHandler.execute(org.eclipse .core.commands.E
xecutionEvent) line: 119
org.eclipse.core.commands.Command.executeWithChecks(org.ecli pse.core.command
s.ExecutionEvent) line: 475
org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(java.lang.O
bject, java.lang.Object) line: 429
org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(org.eclipse.c
ore.commands.ParameterizedCommand, org.eclipse.swt.widgets.Event) line: 165
org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(org.eclipse.jf
ace.bindings.Binding, org.eclipse.swt.widgets.Event) line: 470
org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(java.ut il.List,
org.eclipse.swt.widgets.Event) line: 821
org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(java.util.Lis
t, org.eclipse.swt.widgets.Event) line: 879
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(org
..eclipse.swt.widgets.Event) line: 568
org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(org. eclipse.ui.inter
nal.keys.WorkbenchKeyboard, org.eclipse.swt.widgets.Event) line: 510
org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(org
..eclipse.swt.widgets.Event) line: 126
org.eclipse.swt.widgets.EventTable.sendEvent(org.eclipse.swt .widgets.Event)
line: 66
org.eclipse.swt.widgets.Display.filterEvent(org.eclipse.swt. widgets.Event)
line: 1141
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendEvent(or
g.eclipse.swt.widgets.Event) line: 937
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendEvent(in
t, org.eclipse.swt.widgets.Event, boolean) line: 962
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendEvent(in
t, org.eclipse.swt.widgets.Event) line: 947
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendKeyEvent
(int, int, int, int, org.eclipse.swt.widgets.Event) line: 975
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendKeyEvent
(int, int, int, int) line: 971
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).wmChar(int,
int, int) line: 1285
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Cont rol).WM_CHAR(int
, int) line: 3772
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Cont rol).windowProc(
int, int, int, int) line: 3672
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Canv as).windowProc(i
nt, int, int, int) line: 291
org.eclipse.swt.widgets.Display.windowProc(int, int, int, int) line: 4351
org.eclipse.swt.internal.win32.OS.DispatchMessageW(org.eclip se.swt.internal.
win32.MSG) line: not available [native method]
org.eclipse.swt.internal.win32.OS.DispatchMessage(org.eclips e.swt.internal.w
in32.MSG) line: 2265
org.eclipse.swt.widgets.Display.readAndDispatch() line: 3291
org.eclipse.ui.internal.Workbench.runEventLoop(org.eclipse.j face.window.Wind
ow$IExceptionHandler, org.eclipse.swt.widgets.Display) line: 2389
org.eclipse.ui.internal.Workbench.runUI() line: 2353
org.eclipse.ui.internal.Workbench.access$4(org.eclipse.ui.in ternal.Workbench
) line: 2219
org.eclipse.ui.internal.Workbench$4.run() line: 466
org.eclipse.core.databinding.observable.Realm.runWithDefault (org.eclipse.cor
e.databinding.observable.Realm, java.lang.Runnable) line: 289
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(org. eclipse.swt.widg
ets.Display, org.eclipse.ui.application.WorkbenchAdvisor) line: 461
org.eclipse.ui.PlatformUI.createAndRunWorkbench(org.eclipse. swt.widgets.Disp
lay, org.eclipse.ui.application.WorkbenchAdvisor) line: 149
org.eclipse.ui.internal.ide.application.IDEApplication.start (org.eclipse.equ
inox.app.IApplicationContext) line: 106
org.eclipse.equinox.internal.app.EclipseAppHandle.run(java.l ang.Object)
line: 169
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(
java.lang.Object) line: 106
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(java.lang
..Object) line: 76
org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lan g.Object) line:
363
org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lan g.String[],
java.lang.Runnable) line: 176
sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.refle ct.Method,
java.lang.Object, java.lang.Object[]) line: not available [native method]
sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object ,
java.lang.Object[]) line: 39
sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Ob ject,
java.lang.Object[]) line: 25
java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...)
line: 585
org.eclipse.equinox.launcher.Main.invokeFramework(java.lang. String[],
java.net.URL[]) line: 508
org.eclipse.equinox.launcher.Main.basicRun(java.lang.String[ ]) line: 447
org.eclipse.equinox.launcher.Main.run(java.lang.String[]) line: 1173
org.eclipse.equinox.launcher.Main.main(java.lang.String[]) line: 1148
"Sascha Theves" <sascha.theves@innovations.de> schrieb im Newsbeitrag
news:frm5dv$2bh$1@build.eclipse.org...
> Hi all,
>
> we get very often an ArrayIndexOutOfBounds Exception when we try to remove
> an Adapter from an EObjects adapter list. Is the implementation of
> EAdapterList not thread-safe? How do we prevent such Exceptions?
>
> Thanks in advance,
>
> Sascha
>
>
|
|
|
Re: ArrayIndexOutOfBounds when removing an Adapter from an EObject [message #417623 is a reply to message #417621] |
Tue, 18 March 2008 17:51 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------050602010000020700050903
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Eddi,
There seems to be a whole stack of framework overrides leading up to
this. It sounds like you're deleting an object that was in the list
when the command was created but is no longer in the list when the
command is executed.
Eddi wrote:
> What is wrong here?
> If I execute a command quickly serveral times then I get the following
> StackTrace:
>
> Thread [main] (Suspended (exception
> java.lang.ArrayIndexOutOfBoundsException))
> org.eclipse.emf.common.util.BasicEList<E>.remove(int) line: 942
>
> org.eclipse.emf.ecore.util.EObjectContainmentEList<E>(org.eclipse.emf.common
> .notify.impl.NotifyingListImpl<E>).doRemove(int) line: 762
>
> org.eclipse.emf.ecore.util.EObjectContainmentEList<E>(org.eclipse.emf.common
> .notify.impl.NotifyingListImpl<E>).remove(int) line: 713
> org.eclipse.emf.edit.command.RemoveCommand.doExecute() line: 326
>
> org.eclipse.emf.edit.command.RemoveCommand(org.eclipse.emf.e dit.command.Abst
> ractOverrideableCommand).execute() line: 129
>
> de.visualrules.model.edit.command.delete.ElementDeleteComman d(org.eclipse.em
> f.common.command.CompoundCommand).execute() line: 267
>
> de.visualrules.model.edit.command.move.StatementDragDropLoca lCommand(org.ecl
> ipse.emf.common.command.CompoundCommand).execute() line: 267
>
> de.visualrules.model.edit.command.VisualRulesCompoundCommand (org.eclipse.emf
> .common.command.CompoundCommand).execute() line: 267
>
> de.visualrules.model.edit.command.VisualRulesCompoundCommand (org.eclipse.emf
> .common.command.CompoundCommand).execute() line: 267
>
> org.eclipse.emf.workspace.EMFCommandOperation.doExecute(org. eclipse.core.run
> time.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) line: 116
>
> org.eclipse.emf.workspace.EMFCommandOperation(org.eclipse.em f.workspace.Abst
> ractEMFOperation).execute(org.eclipse.core.runtime.IProgress Monitor,
> org.eclipse.core.runtime.IAdaptable) line: 137
>
> org.eclipse.core.commands.operations.DefaultOperationHistory .execute(org.ecl
> ipse.core.commands.operations.IUndoableOperation,
> org.eclipse.core.runtime.IProgressMonitor,
> org.eclipse.core.runtime.IAdaptable) line: 511
>
> de.visualrules.core.edit.editingdomain.WorkingCommandStack.e xecute(org.eclip
> se.emf.workspace.EMFCommandOperation, boolean) line: 353
>
> de.visualrules.core.edit.editingdomain.WorkingCommandStack.e xecute(org.eclip
> se.emf.common.command.Command, java.util.Map, boolean) line: 472
>
> de.visualrules.core.edit.editingdomain.WorkingCommandStack.e xecute(org.eclip
> se.emf.common.command.Command, java.util.Map) line: 401
>
> de.visualrules.core.edit.editingdomain.WorkingCommandStack(o rg.eclipse.emf.t
> ransaction.impl.AbstractTransactionalCommandStack).execute(o rg.eclipse.emf.c
> ommon.command.Command) line: 217
>
> de.visualrules.ui.gef.internal.editor.VisualRuleTreeCommandS tack.execute(org
> .eclipse.gef.commands.Command) line: 95
>
> de.visualrules.ui.flowrule.internal.action.PasteAction(org.e clipse.gef.ui.ac
> tions.WorkbenchPartAction).execute(org.eclipse.gef.commands. Command) line:
> 76
> de.visualrules.ui.flowrule.internal.action.PasteAction.run() line: 239
>
> de.visualrules.ui.flowrule.internal.action.PasteAction(org.e clipse.jface.act
> ion.Action).runWithEvent(org.eclipse.swt.widgets.Event) line: 498
>
> org.eclipse.ui.actions.RetargetAction.runWithEvent(org.eclip se.swt.widgets.E
> vent) line: 229
>
> org.eclipse.jface.commands.ActionHandler.execute(org.eclipse .core.commands.E
> xecutionEvent) line: 119
>
> org.eclipse.core.commands.Command.executeWithChecks(org.ecli pse.core.command
> s.ExecutionEvent) line: 475
>
> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(java.lang.O
> bject, java.lang.Object) line: 429
>
> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(org.eclipse.c
> ore.commands.ParameterizedCommand, org.eclipse.swt.widgets.Event) line: 165
>
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(org.eclipse.jf
> ace.bindings.Binding, org.eclipse.swt.widgets.Event) line: 470
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(java.ut il.List,
> org.eclipse.swt.widgets.Event) line: 821
>
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(java.util.Lis
> t, org.eclipse.swt.widgets.Event) line: 879
>
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(org
> .eclipse.swt.widgets.Event) line: 568
>
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(org. eclipse.ui.inter
> nal.keys.WorkbenchKeyboard, org.eclipse.swt.widgets.Event) line: 510
>
> org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(org
> .eclipse.swt.widgets.Event) line: 126
> org.eclipse.swt.widgets.EventTable.sendEvent(org.eclipse.swt .widgets.Event)
> line: 66
> org.eclipse.swt.widgets.Display.filterEvent(org.eclipse.swt. widgets.Event)
> line: 1141
>
> org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendEvent(or
> g.eclipse.swt.widgets.Event) line: 937
>
> org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendEvent(in
> t, org.eclipse.swt.widgets.Event, boolean) line: 962
>
> org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendEvent(in
> t, org.eclipse.swt.widgets.Event) line: 947
>
> org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendKeyEvent
> (int, int, int, int, org.eclipse.swt.widgets.Event) line: 975
>
> org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendKeyEvent
> (int, int, int, int) line: 971
> org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).wmChar(int,
> int, int) line: 1285
>
> org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Cont rol).WM_CHAR(int
> , int) line: 3772
>
> org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Cont rol).windowProc(
> int, int, int, int) line: 3672
>
> org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Canv as).windowProc(i
> nt, int, int, int) line: 291
> org.eclipse.swt.widgets.Display.windowProc(int, int, int, int) line: 4351
>
> org.eclipse.swt.internal.win32.OS.DispatchMessageW(org.eclip se.swt.internal.
> win32.MSG) line: not available [native method]
>
> org.eclipse.swt.internal.win32.OS.DispatchMessage(org.eclips e.swt.internal.w
> in32.MSG) line: 2265
> org.eclipse.swt.widgets.Display.readAndDispatch() line: 3291
>
> org.eclipse.ui.internal.Workbench.runEventLoop(org.eclipse.j face.window.Wind
> ow$IExceptionHandler, org.eclipse.swt.widgets.Display) line: 2389
> org.eclipse.ui.internal.Workbench.runUI() line: 2353
>
> org.eclipse.ui.internal.Workbench.access$4(org.eclipse.ui.in ternal.Workbench
> ) line: 2219
> org.eclipse.ui.internal.Workbench$4.run() line: 466
>
> org.eclipse.core.databinding.observable.Realm.runWithDefault (org.eclipse.cor
> e.databinding.observable.Realm, java.lang.Runnable) line: 289
>
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(org. eclipse.swt.widg
> ets.Display, org.eclipse.ui.application.WorkbenchAdvisor) line: 461
>
> org.eclipse.ui.PlatformUI.createAndRunWorkbench(org.eclipse. swt.widgets.Disp
> lay, org.eclipse.ui.application.WorkbenchAdvisor) line: 149
>
> org.eclipse.ui.internal.ide.application.IDEApplication.start (org.eclipse.equ
> inox.app.IApplicationContext) line: 106
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(java.l ang.Object)
> line: 169
>
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(
> java.lang.Object) line: 106
>
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(java.lang
> .Object) line: 76
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lan g.Object) line:
> 363
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lan g.String[],
> java.lang.Runnable) line: 176
> sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.refle ct.Method,
> java.lang.Object, java.lang.Object[]) line: not available [native method]
> sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object ,
> java.lang.Object[]) line: 39
> sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Ob ject,
> java.lang.Object[]) line: 25
> java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...)
> line: 585
> org.eclipse.equinox.launcher.Main.invokeFramework(java.lang. String[],
> java.net.URL[]) line: 508
> org.eclipse.equinox.launcher.Main.basicRun(java.lang.String[ ]) line: 447
> org.eclipse.equinox.launcher.Main.run(java.lang.String[]) line: 1173
> org.eclipse.equinox.launcher.Main.main(java.lang.String[]) line: 1148
>
>
>
>
>
> "Sascha Theves" <sascha.theves@innovations.de> schrieb im Newsbeitrag
> news:frm5dv$2bh$1@build.eclipse.org...
>
>> Hi all,
>>
>> we get very often an ArrayIndexOutOfBounds Exception when we try to remove
>> an Adapter from an EObjects adapter list. Is the implementation of
>> EAdapterList not thread-safe? How do we prevent such Exceptions?
>>
>> Thanks in advance,
>>
>> Sascha
>>
>>
>>
>
>
>
--------------050602010000020700050903
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Eddi,<br>
<br>
There seems to be a whole stack of framework overrides leading up to
this. It sounds like you're deleting an object that was in the list
when the command was created but is no longer in the list when the
command is executed.<br>
<br>
<br>
Eddi wrote:
<blockquote cite="mid:fronbc$4no$1@build.eclipse.org" type="cite">
<pre wrap="">What is wrong here?
If I execute a command quickly serveral times then I get the following
StackTrace:
Thread [main] (Suspended (exception
java.lang.ArrayIndexOutOfBoundsException))
org.eclipse.emf.common.util.BasicEList<E>.remo ve(int) line: 942
org.eclipse.emf.ecore.util.EObjectContainmentEList<E& amp;gt;(org.eclipse.emf.common
..notify.impl.NotifyingListImpl<E>).doRemove(i nt) line: 762
org.eclipse.emf.ecore.util.EObjectContainmentEList<E& amp;gt;(org.eclipse.emf.common
..notify.impl.NotifyingListImpl<E>).remove(int ) line: 713
org.eclipse.emf.edit.command.RemoveCommand.doExecute() line: 326
org.eclipse.emf.edit.command.RemoveCommand(org.eclipse.emf.e dit.command.Abst
ractOverrideableCommand).execute() line: 129
de.visualrules.model.edit.command.delete.ElementDeleteComman d(org.eclipse.em
f.common.command.CompoundCommand).execute() line: 267
de.visualrules.model.edit.command.move.StatementDragDropLoca lCommand(org.ecl
ipse.emf.common.command.CompoundCommand).execute() line: 267
de.visualrules.model.edit.command.VisualRulesCompoundCommand (org.eclipse.emf
..common.command.CompoundCommand).execute() line: 267
de.visualrules.model.edit.command.VisualRulesCompoundCommand (org.eclipse.emf
..common.command.CompoundCommand).execute() line: 267
org.eclipse.emf.workspace.EMFCommandOperation.doExecute(org. eclipse.core.run
time.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) line: 116
org.eclipse.emf.workspace.EMFCommandOperation(org.eclipse.em f.workspace.Abst
ractEMFOperation).execute(org.eclipse.core.runtime.IProgress Monitor,
org.eclipse.core.runtime.IAdaptable) line: 137
org.eclipse.core.commands.operations.DefaultOperationHistory .execute(org.ecl
ipse.core.commands.operations.IUndoableOperation,
org.eclipse.core.runtime.IProgressMonitor,
org.eclipse.core.runtime.IAdaptable) line: 511
de.visualrules.core.edit.editingdomain.WorkingCommandStack.e xecute(org.eclip
se.emf.workspace.EMFCommandOperation, boolean) line: 353
de.visualrules.core.edit.editingdomain.WorkingCommandStack.e xecute(org.eclip
se.emf.common.command.Command, java.util.Map, boolean) line: 472
de.visualrules.core.edit.editingdomain.WorkingCommandStack.e xecute(org.eclip
se.emf.common.command.Command, java.util.Map) line: 401
de.visualrules.core.edit.editingdomain.WorkingCommandStack(o rg.eclipse.emf.t
ransaction.impl.AbstractTransactionalCommandStack).execute(o rg.eclipse.emf.c
ommon.command.Command) line: 217
de.visualrules.ui.gef.internal.editor.VisualRuleTreeCommandS tack.execute(org
..eclipse.gef.commands.Command) line: 95
de.visualrules.ui.flowrule.internal.action.PasteAction(org.e clipse.gef.ui.ac
tions.WorkbenchPartAction).execute(org.eclipse.gef.commands. Command) line:
76
de.visualrules.ui.flowrule.internal.action.PasteAction.run() line: 239
de.visualrules.ui.flowrule.internal.action.PasteAction(org.e clipse.jface.act
ion.Action).runWithEvent(org.eclipse.swt.widgets.Event) line: 498
org.eclipse.ui.actions.RetargetAction.runWithEvent(org.eclip se.swt.widgets.E
vent) line: 229
org.eclipse.jface.commands.ActionHandler.execute(org.eclipse .core.commands.E
xecutionEvent) line: 119
org.eclipse.core.commands.Command.executeWithChecks(org.ecli pse.core.command
s.ExecutionEvent) line: 475
org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(java.lang.O
bject, java.lang.Object) line: 429
org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(org.eclipse.c
ore.commands.ParameterizedCommand, org.eclipse.swt.widgets.Event) line: 165
org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(org.eclipse.jf
ace.bindings.Binding, org.eclipse.swt.widgets.Event) line: 470
org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(java.ut il.List,
org.eclipse.swt.widgets.Event) line: 821
org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(java.util.Lis
t, org.eclipse.swt.widgets.Event) line: 879
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(org
..eclipse.swt.widgets.Event) line: 568
org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(org. eclipse.ui.inter
nal.keys.WorkbenchKeyboard, org.eclipse.swt.widgets.Event) line: 510
org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(org
..eclipse.swt.widgets.Event) line: 126
org.eclipse.swt.widgets.EventTable.sendEvent(org.eclipse.swt .widgets.Event)
line: 66
org.eclipse.swt.widgets.Display.filterEvent(org.eclipse.swt. widgets.Event)
line: 1141
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendEvent(or
g.eclipse.swt.widgets.Event) line: 937
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendEvent(in
t, org.eclipse.swt.widgets.Event, boolean) line: 962
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendEvent(in
t, org.eclipse.swt.widgets.Event) line: 947
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendKeyEvent
(int, int, int, int, org.eclipse.swt.widgets.Event) line: 975
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).sendKeyEvent
(int, int, int, int) line: 971
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Widg et).wmChar(int,
int, int) line: 1285
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Cont rol).WM_CHAR(int
, int) line: 3772
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Cont rol).windowProc(
int, int, int, int) line: 3672
org.eclipse.draw2d.FigureCanvas(org.eclipse.swt.widgets.Canv as).windowProc(i
nt, int, int, int) line: 291
org.eclipse.swt.widgets.Display.windowProc(int, int, int, int) line: 4351
org.eclipse.swt.internal.win32.OS.DispatchMessageW(org.eclip se.swt.internal.
win32.MSG) line: not available [native method]
org.eclipse.swt.internal.win32.OS.DispatchMessage(org.eclips e.swt.internal.w
in32.MSG) line: 2265
org.eclipse.swt.widgets.Display.readAndDispatch() line: 3291
org.eclipse.ui.internal.Workbench.runEventLoop(org.eclipse.j face.window.Wind
ow$IExceptionHandler, org.eclipse.swt.widgets.Display) line: 2389
org.eclipse.ui.internal.Workbench.runUI() line: 2353
org.eclipse.ui.internal.Workbench.access$4(org.eclipse.ui.in ternal.Workbench
) line: 2219
org.eclipse.ui.internal.Workbench$4.run() line: 466
org.eclipse.core.databinding.observable.Realm.runWithDefault (org.eclipse.cor
e.databinding.observable.Realm, java.lang.Runnable) line: 289
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(org. eclipse.swt.widg
ets.Display, org.eclipse.ui.application.WorkbenchAdvisor) line: 461
org.eclipse.ui.PlatformUI.createAndRunWorkbench(org.eclipse. swt.widgets.Disp
lay, org.eclipse.ui.application.WorkbenchAdvisor) line: 149
org.eclipse.ui.internal.ide.application.IDEApplication.start (org.eclipse.equ
inox.app.IApplicationContext) line: 106
org.eclipse.equinox.internal.app.EclipseAppHandle.run(java.l ang.Object)
line: 169
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(
java.lang.Object) line: 106
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(java.lang
..Object) line: 76
org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lan g.Object) line:
363
org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lan g.String[],
java.lang.Runnable) line: 176
sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.refle ct.Method,
java.lang.Object, java.lang.Object[]) line: not available [native method]
sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object ,
java.lang.Object[]) line: 39
sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Ob ject,
java.lang.Object[]) line: 25
java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...)
line: 585
org.eclipse.equinox.launcher.Main.invokeFramework(java.lang. String[],
java.net.URL[]) line: 508
org.eclipse.equinox.launcher.Main.basicRun(java.lang.String[ ]) line: 447
org.eclipse.equinox.launcher.Main.run(java.lang.String[]) line: 1173
org.eclipse.equinox.launcher.Main.main(java.lang.String[]) line: 1148
"Sascha Theves" <a class="moz-txt-link-rfc2396E" href="mailto:sascha.theves@innovations.de"><sascha.theves@innovations.de></a> schrieb im Newsbeitrag
<a class="moz-txt-link-freetext" href="news:frm5dv$2bh$1@build.eclipse.org">news:frm5dv$2bh$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Hi all,
we get very often an ArrayIndexOutOfBounds Exception when we try to remove
an Adapter from an EObjects adapter list. Is the implementation of
EAdapterList not thread-safe? How do we prevent such Exceptions?
Thanks in advance,
Sascha
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>
--------------050602010000020700050903--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Thu Apr 25 23:42:30 GMT 2024
Powered by FUDForum. Page generated in 0.03387 seconds
|