Community
Participate
Working Groups
Build Identifier: I20110603-0909 I have updated to 2.1.0.v201110201825 and when I now try to open a xtend file i get the following error: java.lang.StackOverflowError at com.google.common.collect.ForwardingMap.get(ForwardingMap.java:68) at org.eclipse.xtext.common.types.util.TypeArgumentContext.getBoundArgument(TypeArgumentContext.java:64) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:93) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitParameterizedTypeReference(TypeArgumentContext.java:190) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmParameterizedTypeReferenceImplCustom.accept(JvmParameterizedTypeReferenceImplCustom.java:59) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitWildcardTypeReference(TypeArgumentContext.java:251) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitWildcardTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmWildcardTypeReferenceImplCustom.accept(JvmWildcardTypeReferenceImplCustom.java:60) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:106) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitParameterizedTypeReference(TypeArgumentContext.java:190) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmParameterizedTypeReferenceImplCustom.accept(JvmParameterizedTypeReferenceImplCustom.java:59) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:99) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitParameterizedTypeReference(TypeArgumentContext.java:190) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmParameterizedTypeReferenceImplCustom.accept(JvmParameterizedTypeReferenceImplCustom.java:59) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitWildcardTypeReference(TypeArgumentContext.java:251) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitWildcardTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmWildcardTypeReferenceImplCustom.accept(JvmWildcardTypeReferenceImplCustom.java:60) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:106) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitParameterizedTypeReference(TypeArgumentContext.java:190) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmParameterizedTypeReferenceImplCustom.accept(JvmParameterizedTypeReferenceImplCustom.java:59) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:99) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitParameterizedTypeReference(TypeArgumentContext.java:190) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmParameterizedTypeReferenceImplCustom.accept(JvmParameterizedTypeReferenceImplCustom.java:59) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitWildcardTypeReference(TypeArgumentContext.java:251) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitWildcardTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmWildcardTypeReferenceImplCustom.accept(JvmWildcardTypeReferenceImplCustom.java:60) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:106) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitParameterizedTypeReference(TypeArgumentContext.java:190) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmParameterizedTypeReferenceImplCustom.accept(JvmParameterizedTypeReferenceImplCustom.java:59) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) eclipse.buildId=I20110603-0909 java.version=1.6.0_24 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE Framework arguments: -product org.eclipse.epp.package.modeling.product -showlocation Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.modeling.product -showlocation The xtend file is quite big. Any ideas? Reproducible: Always
Please attach an example that reproduces the issue.
(In reply to comment #1) > Please attach an example that reproduces the issue. Any chance to get a repro?
(In reply to comment #2) > (In reply to comment #1) > > Please attach an example that reproduces the issue. > > Any chance to get a repro? Sorry for the late reply. I was on a business trip. Anyway I have outcomment'ed all code in a text editor and then slowly added the methods back in the xtend editor. It came to an error in code like this: /* * Returns all attributes referencing an entity or a valueobject * def allAttributesOfTypeValueObject (ComplexDataType x) { x.allAttributesOfComplexType( true, false, false ) } def allAttributesOfTypeEntity (ComplexDataType x) { x.allAttributesOfComplexType( false, true, false ) } def allAttributesOfTypeDto (ComplexDataType x) { x.allAttributesOfComplexType( false, false, true ) } /**/ def allAttributesOfComplexType (ComplexDataType x, boolean vo, boolean entity, boolean dto) { x.allAttributes.select( e | (vo && e.isRealValueObject) // and no dtos! || (entity && e.isEntity) || (dto && e.isDto) ) } Unfortunately the file is very big and has too many dependencies to our model. But the error changed a little bit. Maybe it will say you anything: An internal error occurred during: "Xtext validation". java.lang.StackOverflowError at org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:709) at org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:696) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitWildcardTypeReference(TypeArgumentContext.java:207) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitWildcardTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmWildcardTypeReferenceImplCustom.accept(JvmWildcardTypeReferenceImplCustom.java:60) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:106) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitParameterizedTypeReference(TypeArgumentContext.java:190) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmParameterizedTypeReferenceImplCustom.accept(JvmParameterizedTypeReferenceImplCustom.java:59) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:99) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitParameterizedTypeReference(TypeArgumentContext.java:190) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmParameterizedTypeReferenceImplCustom.accept(JvmParameterizedTypeReferenceImplCustom.java:59) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitWildcardTypeReference(TypeArgumentContext.java:251) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitWildcardTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmWildcardTypeReferenceImplCustom.accept(JvmWildcardTypeReferenceImplCustom.java:60) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:106) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitParameterizedTypeReference(TypeArgumentContext.java:190) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:1) at org.eclipse.xtext.common.types.impl.JvmParameterizedTypeReferenceImplCustom.accept(JvmParameterizedTypeReferenceImplCustom.java:59) at org.eclipse.xtext.common.types.util.AbstractTypeReferenceVisitorWithParameter.visit(AbstractTypeReferenceVisitorWithParameter.java:32) at org.eclipse.xtext.common.types.util.TypeArgumentContext$CopyingTypeReferenceVisitor.doVisitParameterizedTypeReference(TypeArgumentContext.java:99) at org.eclipse.xtext.common.types.util.TypeArgumentContext$1.doVisitParameterizedTypeReference(TypeArgumentContext.java:190)
I forgot to say that the first of themethod gives the error. Very strange as the first three are almost the same...
I'll try to reproduce as soon as possible. Thanks for coming back to this one.
I adopted the code for the domainmodell example. Unfortunately it will be ok there: /* * Returns all attributes referencing an entity or a valueobject */ def Iterable<Feature> allAttributesOfTypeValueObject (Entity x) { x.allAttributesOfComplexType( true, false, false ) } def Iterable<Feature> allAttributesOfTypeEntity (Entity x) { x.allAttributesOfComplexType( false, true, false ) } def Iterable<Feature> allAttributesOfTypeDto (Entity x) { x.allAttributesOfComplexType( false, false, true ) } def Iterable<Feature> allAttributesOfComplexType (Entity x, boolean vo, boolean entity, boolean dto) { x.features.filter( e | (vo && e.isRealValueObject) // and no dtos! || (entity && e.isEntity) || (dto && e.isDto) ) } def boolean isRealValueObject (Feature x) { true } def boolean isEntity (Feature x) { true } def boolean isDto (Feature x) { true }
Sorry for the many post here. I was wrong, the error depends also on some other methods. In my domainmodel example I was successfull in reproducing the error with the following code: /* * All cdts which are in the attribute tree of the given one. */ def Iterable<Entity> allRelatedComplexTypes (Entity x) { val directEntities = newArrayList( x ).union( x.allComplexTypesFromAttributes( false, x.isEntity, x.isDto ) ) val extendingEntities = directEntities.map( e | e.allExtenders ).flatten directEntities.union( extendingEntities ) .filter( e | !e.abstract ) } /* * Returns all attributes referencing an valueobject in a recursive way. */ def allValueObjectsFromAttributes (Entity x) { x.allComplexTypesFromAttributes( true, false, false ) } def allComplexTypesFromAttributes (Entity x, boolean vo, boolean entity, boolean dto) { x.internal_allComplexTypesFromAttributes( newArrayList, vo, entity, dto ) .filter( e | e != null ).toSet.toList } def internal_allComplexTypesFromAttributes (Entity x, List<Entity> visited, boolean vo, boolean entity, boolean dto) { if (!visited.contains( x )) { visited.add( x ) val vos = x.allAttributesOfTypeValueObject.map( e | e.complexType ) vos.union( vos.map( e | e.internal_allComplexTypesFromAttributes( visited, vo, entity, dto ) ).flatten ) } } /* * Returns all attributes referencing an entity or a valueobject */ def Iterable<Feature> allAttributesOfTypeValueObject (Entity x) { x.allAttributesOfComplexType( true, false, false ) } def Iterable<Feature> allAttributesOfTypeEntity (Entity x) { x.allAttributesOfComplexType( false, true, false ) } def Iterable<Feature> allAttributesOfTypeDto (Entity x) { x.allAttributesOfComplexType( false, false, true ) } def Iterable<Feature> allAttributesOfComplexType (Entity x, boolean vo, boolean entity, boolean dto) { x.features.filter( e | (vo && e.isRealValueObject) // and no dtos! || (entity && e.isEntity) || (dto && e.isDto) ) } def boolean isValueObject (Entity x) { true } def boolean isEntity (Entity x) { true } def boolean isDto (Entity x) { true } def boolean isAbstract (Entity x) { true } def boolean isRealValueObject (Feature x) { true } def boolean isEntity (Feature x) { true } def boolean isDto (Feature x) { true } def Entity getComplexType (Feature x) { null } def <T> Iterable<T> union (Iterable<T> a, Iterable<T> b) { Iterables::concat( a, b ) }
Thanks a lot, I can reproduce the problem.
Pushed to master. Thanks for your help, Ingo.
Closing all bugs that were set to RESOLVED before Neon.0