I'm hitting the stack size limit of the EMF-specific VM in a rather small transformation. There was already a bug filed about the stack size limit. However I think I'm getting into this in some other way however.
The transformation that causes the problem is this one:
-- @atlcompiler atl2010
-- @nsURI ECore=http://www.eclipse.org/emf/2002/Ecore
module convertVertragAttributeToReference;
create output: ECore refining input: ECore;
rule dropVertragAttribute {
from input: ECore!EAttribute (
input.isVertragAttribute()
)
to
drop
}
rule addVertragReference {
from
input: ECore!EClass (
input.requiresVertrag()
)
to
outputClass: ECore!EClass (
eStructuralFeatures <- Sequence{vertragReference}
),
vertragReference: ECore!EReference (
-- causes stackoverflow
eAnnotations <- input.eStructuralFeatures->select(e|e.isVertragAttribute())->collect(e|e.eAnnotations).flatten(),
eType <- thisModule.vertragClassifier,
name <- 'vertrag'
)
}
helper context ECore!EClass def: requiresVertrag(): Boolean =
self.name <> 'Vertrag' and self.eStructuralFeatures -> exists(e | e.
isVertragAttribute());
helper context ECore!EStructuralFeature def: isVertragAttribute(): Boolean =
false;
helper context ECore!EAttribute def: isVertragAttribute(): Boolean =
self.name = 'vertrId';
helper def: dbadm: ECore!EPackage =
ECore!EPackage.allInstances() -> select(e | e.nsURI = 'http://dbadm/1.0').first();
helper def: vertragClassifier: ECore!EClassifier =
thisModule.dbadm.eClassifiers -> select(e | e.name = 'Vertrag').first();
The line below the comment shows the assignment, which causes the stack overflow. If the assignment is removed the transformation runs through.
The reported error is:
org.eclipse.m2m.atl.engine.emfvm.VMException: 100
at __applyRefiningTrace__#47(convertVertragAttributeToReference.atl)
local variables: self=convertVertragAttributeToReference : ASMModule
at main#79(convertVertragAttributeToReference.atl)
local variables: self=convertVertragAttributeToReference : ASMModule
Java Stack:
org.eclipse.m2m.atl.engine.emfvm.VMException: 100
at org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:643)
at org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:388)
at org.eclipse.m2m.atl.engine.emfvm.ASM.run(ASM.java:208)
at org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMLauncher.internalLaunch(EMFVMLauncher.java:170)
at org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMUILauncher.launch(EMFVMUILauncher.java:46)
at org.eclipse.m2m.atl.core.service.LauncherService.launch(LauncherService.java:136)
at org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launchOrDebug(AtlLaunchConfigurationDelegate.java:300)
at org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launch(AtlLaunchConfigurationDelegate.java:234)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 100
at org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:494)
... 12 more
Am I doing something wrong? Should I file this as a bug? Does anybody know a workaround?
Thanks for advice.
Edit:
I'm using Juno with ATL 3.3.1.
The transformation is applied to an ecore model with about 150 classes and 1900 structural features.
[Updated on: Fri, 07 December 2012 09:19]
Report message to a moderator