Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
wegendt-bosch authored Nov 29, 2019
1 parent 492fbf5 commit f39bcb9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ class GeneratorUtils {
val program = EcoreUtil2.getContainerOfType(event, Program);
if(program !== null) {
// count event handlers, so we get unique names
return '''HandleEvery«event.baseName»_«(event.eContainer as Program).eventHandlers.filter[it.event.baseName == event.event.baseName].indexed.filter[it.value === event].head.key + 1»''';
val occurrence = (event.eContainer as Program).eventHandlers.filter[it.event.baseName == event.event.baseName].indexed.filter[it.value === event].head.key + 1;
return '''HandleEvery«event.baseName»_«occurence»''';
}
// if we are somehow not a child of program, default to no numbering
return '''HandleEvery«event.baseName»''';
Expand Down Expand Up @@ -349,7 +350,7 @@ class GeneratorUtils {
}

def dispatch String getBaseName(EventHandlerDeclaration event) {
return '''«event.event.baseName»''';
return event.event.baseName;
}

def dispatch String getBaseName(SystemEventSource event) {
Expand Down

0 comments on commit f39bcb9

Please sign in to comment.