Skip to content
Snippets Groups Projects
Commit bf408609 authored by Chrissi's avatar Chrissi
Browse files

modify the creation of add and remove methods for sync process

parent 2cb6b0d6
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,7 @@ class SyncEnhancingVisitor() extends SModelVisitor { ...@@ -36,7 +36,7 @@ class SyncEnhancingVisitor() extends SModelVisitor {
} }
override def visit(sMethod: SMethod): Unit = { override def visit(sMethod: SMethod): Unit = {
extractSetterAttr(sMethod).foreach(attr => sMethod.augmentImplementation(SMethodStatement(s"+this $attr ()"))) extractSetterAttr(sMethod).foreach(attr => sMethod.augmentImplementation(SMethodStatement(s"+this $attr")))
} }
override def visit(sType: SType): Unit = { override def visit(sType: SType): Unit = {
...@@ -60,11 +60,11 @@ class SyncEnhancingVisitor() extends SModelVisitor { ...@@ -60,11 +60,11 @@ class SyncEnhancingVisitor() extends SModelVisitor {
private def extractSetterAttr(sMethod: SMethod): Option[String] = { private def extractSetterAttr(sMethod: SMethod): Option[String] = {
sMethod.getName match { sMethod.getName match {
case SyncEnhancingVisitor.Setter(attrName) => case SyncEnhancingVisitor.Setter(attrName) =>
Option("set" + attrName) Option("set" + attrName + " ()")
case SyncEnhancingVisitor.Adder(attrName) => case SyncEnhancingVisitor.Adder(attrName) =>
Option("add" + attrName) Option("add" + attrName + s" (${attrName.charAt(0).toLower})")
case SyncEnhancingVisitor.Remover(attrName) => case SyncEnhancingVisitor.Remover(attrName) =>
Option("remove" + attrName) Option("remove" + attrName + s" (${attrName.charAt(0).toLower})")
case _ => case _ =>
None None
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment