Skip to content

Commit

Permalink
Fixing member injector visibility issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemures committed Jun 23, 2016
1 parent cce7cfe commit 7275441
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Expand Up @@ -62,10 +62,8 @@ public String brewJava() {
private void emitSuperMemberInjectorFieldIfNeeded(TypeSpec.Builder scopeMemberTypeSpec) {
if (superClassThatNeedsInjection != null) {
ClassName superTypeThatNeedsInjection = ClassName.get(superClassThatNeedsInjection);
ParameterizedTypeName memberInjectorSuperParameterizedTypeName =
ParameterizedTypeName.get(ClassName.get(MemberInjector.class), superTypeThatNeedsInjection);
FieldSpec.Builder superMemberInjectorField =
FieldSpec.builder(memberInjectorSuperParameterizedTypeName, "superMemberInjector", Modifier.PRIVATE)
FieldSpec.builder(MemberInjector.class, "superMemberInjector", Modifier.PRIVATE)
//TODO use proper typing here
.initializer("new $L$$$$MemberInjector()", superTypeThatNeedsInjection);
scopeMemberTypeSpec.addField(superMemberInjectorField.build());
Expand Down
Expand Up @@ -450,7 +450,7 @@ public void testMemberInjection_shouldInjectAsAnInstanceOfSuperClass_whenSuperCl
"import toothpick.Scope;", //
"", //
"public final class TestMemberInjection$$MemberInjector implements MemberInjector<TestMemberInjection> {", //
" private MemberInjector<TestMemberInjectionParent> superMemberInjector " + "= new test.TestMemberInjectionParent$$MemberInjector();",
" private MemberInjector superMemberInjector " + "= new test.TestMemberInjectionParent$$MemberInjector();",
//
" @Override", //
" public void inject(TestMemberInjection target, Scope scope) {", //
Expand Down
Expand Up @@ -92,7 +92,7 @@ public void testOverrideMethodInjection() {
"public final class TestMethodInjectionParent$TestMethodInjection$$MemberInjector "
+ "implements MemberInjector<TestMethodInjectionParent.TestMethodInjection> {",
//
" private MemberInjector<TestMethodInjectionParent> superMemberInjector = new test.TestMethodInjectionParent$$MemberInjector();\n", //
" private MemberInjector superMemberInjector = new test.TestMethodInjectionParent$$MemberInjector();\n", //
" @Override", //
" public void inject(TestMethodInjectionParent.TestMethodInjection target, Scope scope) {", //
" superMemberInjector.inject(target, scope);", //
Expand Down

0 comments on commit 7275441

Please sign in to comment.