Remove restErrorHandler field in rest service if not necessary by yDelouis · Pull Request #894 · androidannotations/androidannotations · GitHub
Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ private void implementSetErrorHandler(List<ExecutableElement> methods) {
JMethod setErrorHandlerMethod = codeModelHelper.implementMethod(this, methods, "setRestErrorHandler", TypeKind.VOID.toString(), RestErrorHandler.class.getName());

if (setErrorHandlerMethod != null) {
setRestErrorHandlerField();
setErrorHandlerMethod.body().assign(_this().ref(getRestErrorHandlerField()), setErrorHandlerMethod.params().get(0));
}
}
Expand Down Expand Up @@ -256,9 +257,7 @@ private void setAuthenticationField() {
}

public JFieldVar getRestErrorHandlerField() {
if (restErrorHandlerField == null) {
setRestErrorHandlerField();
}
// restErrorHandlerField is created only if the method setRestErrorHandler is implemented
return restErrorHandlerField;
}

Expand Down