Skip to content

Commit

Permalink
Fix: Add missing case when retrieving name of aspected classes
Browse files Browse the repository at this point in the history
  • Loading branch information
fcoulon committed Jun 15, 2015
1 parent 6e34e8c commit 85b1bcd
Showing 1 changed file with 11 additions and 1 deletion.
Expand Up @@ -35,6 +35,8 @@ import fr.inria.diverse.melange.metamodel.melange.Slice
import fr.inria.diverse.melange.metamodel.melange.Merge
import fr.inria.diverse.melange.utils.AspectCopier
import org.eclipse.xtext.xbase.jvmmodel.JvmTypeReferenceBuilder
import org.eclipse.emf.ecore.util.EObjectResolvingEList
import org.eclipse.xtext.xbase.XFeatureCall

class MetamodelExtensions
{
Expand Down Expand Up @@ -119,7 +121,15 @@ class MetamodelExtensions
val aspClassName = aspAnn?.values?.findFirst[valueName == "className"]
val aspVal = switch aspClassName {
JvmTypeAnnotationValue: aspClassName.values?.head?.simpleName
JvmCustomAnnotationValue: aspClassName.values?.head?.toString
JvmCustomAnnotationValue: {
val headValue = aspClassName.values?.head
if(headValue instanceof XFeatureCall){
(headValue as XFeatureCall).feature.simpleName
}
else{
aspClassName.values?.head?.toString
}
}
}

// Xtext 2.8+
Expand Down

0 comments on commit 85b1bcd

Please sign in to comment.