Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
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 @@ -34,6 +34,7 @@ public abstract class EComponentHolder extends BaseGeneratedClassHolder {

protected IJExpression contextRef;
protected JMethod init;
private JBlock initBodyBeforeInjectionBlock;
private JBlock initBodyInjectionBlock;
private JBlock initBodyAfterInjectionBlock;
private JVar resourcesRef;
Expand Down Expand Up @@ -81,7 +82,16 @@ public JBlock getInitBodyAfterInjectionBlock() {
return initBodyAfterInjectionBlock;
}

public JBlock getInitBodyBeforeInjectionBlock() {
if (initBodyBeforeInjectionBlock == null) {
setInitBodyBlocks();
}

return initBodyBeforeInjectionBlock;
}

private void setInitBodyBlocks() {
initBodyBeforeInjectionBlock = getInitBody().blockVirtual();
initBodyInjectionBlock = getInitBody().blockVirtual();
initBodyAfterInjectionBlock = getInitBody().blockVirtual();
}
Expand All @@ -94,7 +104,7 @@ public JVar getResourcesRef() {
}

private void setResourcesRef() {
resourcesRef = getInitBodyInjectionBlock().decl(getClasses().RESOURCES, "resources" + generationSuffix(), getContextRef().invoke("getResources"));
resourcesRef = getInitBodyBeforeInjectionBlock().decl(getClasses().RESOURCES, "resources" + generationSuffix(), getContextRef().invoke("getResources"));
}

public JFieldVar getPowerManagerRef() {
Expand Down