Skip to content

Commit

Permalink
Revert and use a simple case.
Browse files Browse the repository at this point in the history
  • Loading branch information
ueshin committed Nov 17, 2016
1 parent 2c52d91 commit 43d2693
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,6 @@ case class Invoke(

val (argCode, argString, resultIsNull) = prepareArguments(ctx, ev)

val evaluateArguments = if (arguments.nonEmpty) {
s"""
if (!${obj.isNull}) {
$argCode
${ev.isNull} = $resultIsNull;
}
"""
} else {
""
}

val returnPrimitive = method.isDefined && method.get.getReturnType.isPrimitive
val needTryCatch = method.isDefined && method.get.getExceptionTypes.nonEmpty

Expand Down Expand Up @@ -254,8 +243,10 @@ case class Invoke(

val code = s"""
${obj.code}
boolean ${ev.isNull} = ${obj.isNull};
$evaluateArguments
if (!${obj.isNull}) {
$argCode
}
boolean ${ev.isNull} = ${obj.isNull} || $resultIsNull;
$javaType ${ev.value} = ${ctx.defaultValue(dataType)};
if (!${ev.isNull}) {
$evaluate
Expand Down

0 comments on commit 43d2693

Please sign in to comment.