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

Commit 89d2a82

Browse files
committed
Use generic types in generic @eview and @eviewgroup
1 parent 906c4a3 commit 89d2a82

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • AndroidAnnotations/androidannotations/src/main/java/org/androidannotations/holder

‎AndroidAnnotations/androidannotations/src/main/java/org/androidannotations/holder/EViewHolder.java‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ private void createConstructorAndBuilder() {
8787

8888
JBlock body = copyConstructor.body();
8989
JInvocation superCall = body.invoke("super");
90-
JInvocation newInvocation = JExpr._new(generatedClass);
90+
JClass narrowedGeneratedClass = codeModelHelper.narrowGeneratedClass(generatedClass, getAnnotatedElement().asType(), this);
91+
92+
JInvocation newInvocation = JExpr._new(narrowedGeneratedClass);
9193
for (VariableElement param : userConstructor.getParameters()) {
9294
String paramName = param.getSimpleName().toString();
9395
JClass paramType = codeModelHelper.typeMirrorToJClass(param.asType(), this);
@@ -97,7 +99,7 @@ private void createConstructorAndBuilder() {
9799
newInvocation.arg(JExpr.ref(paramName));
98100
}
99101

100-
JVar newCall = staticHelper.body().decl(generatedClass, "instance", newInvocation);
102+
JVar newCall = staticHelper.body().decl(narrowedGeneratedClass, "instance", newInvocation);
101103
staticHelper.body().invoke(newCall, getOnFinishInflate());
102104
staticHelper.body()._return(newCall);
103105
body.invoke(getInit());

0 commit comments

Comments
 (0)