Skip to content

Commit 4dd78bd

Browse files
committed
Add useful methods to PluginClassHolder and ensures EServiceHolder works correctly.
1 parent 69f4777 commit 4dd78bd

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/holder/EServiceHolder.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ public JBlock getIntentFilterInitializationBlock(IntentFilterData intentFilterDa
105105

106106
@Override
107107
public JBlock getStartLifecycleAfterSuperBlock() {
108+
if (onCreateAfterSuperBlock == null) {
109+
setOnCreate();
110+
}
108111
return onCreateAfterSuperBlock;
109112
}
110113

‎AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/plugin/PluginClassHolder.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* Copyright (C) 2010-2016 eBusiness Information, Excilys Group
3+
* Copyright (C) 2016-2019 the AndroidAnnotations project
34
*
45
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
56
* use this file except in compliance with the License. You may obtain a copy of
@@ -15,10 +16,12 @@
1516
*/
1617
package org.androidannotations.plugin;
1718

19+
import javax.annotation.processing.ProcessingEnvironment;
1820
import javax.lang.model.element.TypeElement;
1921

2022
import org.androidannotations.AndroidAnnotationsEnvironment;
2123
import org.androidannotations.holder.GeneratedClassHolder;
24+
import org.androidannotations.internal.process.ProcessHolder;
2225

2326
import com.helger.jcodemodel.AbstractJClass;
2427
import com.helger.jcodemodel.JCodeModel;
@@ -59,4 +62,13 @@ protected AbstractJClass getJClass(Class<?> clazz) {
5962
protected JCodeModel getCodeModel() {
6063
return environment().getCodeModel();
6164
}
65+
66+
protected ProcessingEnvironment getProcessingEnvironment() {
67+
return environment().getProcessingEnvironment();
68+
}
69+
70+
protected ProcessHolder.Classes getClasses() {
71+
return environment().getClasses();
72+
}
73+
6274
}

0 commit comments

Comments
 (0)