Skip to content
Permalink
Browse files

check if beforeInjection is not null

  • Loading branch information...
gublan24 committed Oct 30, 2019
1 parent b1d4d78 commit bc8b33776a1624eb9d01748dcd70c50d29e946f7
Showing with 8 additions and 5 deletions.
  1. +8 −5 UmpleToJava/UmpleTLTemplates/class_MethodDeclaration.ump
@@ -95,12 +95,15 @@ class UmpleToJava {
// End
String customBeforeInjectionCode = GeneratorHelper.toCode(uClass.getApplicableCodeInjectionsCustomMethod("before", aMethod.getName(), aMethod.getMethodParameters()));
String customAfterInjectionCode = GeneratorHelper.toCode(uClass.getApplicableCodeInjectionsCustomMethod("after", aMethod.getName(), aMethod.getMethodParameters()));
if( customBeforeInjectionCode.contains("around_proceed:") && (customAfterInjectionCode == null) )
if( (customBeforeInjectionCode != null) && (customAfterInjectionCode == null) )
{
String[] codeToInjectArray = customBeforeInjectionCode.split("around_proceed:");
customBeforeInjectionCode = codeToInjectArray[0];
customAfterInjectionCode = ""+codeToInjectArray[1];
// customAfterInjectionCode = customAfterInjectionCode.replace("END OF UMPLE BEFORE INJECTION","END OF UMPLE AROUND INJECTION");
if(customBeforeInjectionCode.contains("around_proceed:"))
{
String[] codeToInjectArray = customBeforeInjectionCode.split("around_proceed:");
customBeforeInjectionCode = codeToInjectArray[0];
customAfterInjectionCode = ""+codeToInjectArray[1];
customAfterInjectionCode = customAfterInjectionCode.replace("END OF UMPLE BEFORE INJECTION","END OF UMPLE AROUND INJECTION");
}
}

String customPreconditionCode = GeneratorHelper.toCode(uClass.getApplicableCodeInjections("before", aMethod.getName()+"Precondition"));

0 comments on commit bc8b337

Please sign in to comment.
You can’t perform that action at this time.