Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Commit

Permalink
Solves bug on generated code by @rootcontext annotation when used on …
Browse files Browse the repository at this point in the history
…a single method.
  • Loading branch information
smaugho committed Feb 15, 2019
1 parent deadb04 commit 2967f61
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ public void assignValue(JBlock targetBlock, IJAssignmentTarget fieldRef, EBeanHo
} else {
AbstractJClass extendingContextClass = getEnvironment().getJClass(typeQualifiedName);

JConditional cond = getInvocationBlock(holder)._if(holder.getContextRef()._instanceof(extendingContextClass));
cond._then().add(fieldRef.assign(cast(extendingContextClass, holder.getContextRef())));
JConditional cond = targetBlock._if(contextRef._instanceof(extendingContextClass));
cond._then().add(fieldRef.assign(cast(extendingContextClass, contextRef)));

JInvocation warningInvoke = getClasses().LOG.staticInvoke("w");
warningInvoke.arg(logTagForClassHolder(holder));
warningInvoke.arg(lit("Due to Context class ").plus(holder.getContextRef().invoke("getClass").invoke("getSimpleName"))
.plus(lit(", the @RootContext " + extendingContextClass.name() + " won't be populated")));
warningInvoke.arg(
lit("Due to Context class ").plus(contextRef.invoke("getClass").invoke("getSimpleName")).plus(lit(", the @RootContext " + extendingContextClass.name() + " won't be populated")));
cond._else().add(warningInvoke);
}
}
Expand Down

0 comments on commit 2967f61

Please sign in to comment.