Skip to content

Commit

Permalink
Fix support for wildcards in private epoxyattributes (#451)
Browse files Browse the repository at this point in the history
* Fix support for wildcards in private epoxyattributes

* fix imports

* remove old tests
  • Loading branch information
elihart authored Jun 18, 2018
1 parent c338f41 commit bcfecc8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.airbnb.epoxy.EpoxyAttribute.Option;
import com.squareup.javapoet.AnnotationSpec;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.TypeName;

import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
Expand Down Expand Up @@ -146,8 +145,7 @@ private void findGetterAndSetterForPrivateField(ErrorLogger errorLogger) {
|| (methodName.equals(fieldName) && startsWithIs(fieldName)))
&& !method.getModifiers().contains(PRIVATE)
&& !method.getModifiers().contains(STATIC)
&& method.getParameters().isEmpty()
&& TypeName.get(method.getReturnType()).equals(getTypeName())) {
&& method.getParameters().isEmpty()) {
getterMethodName = methodName;
}
// check if it is a valid setter
Expand All @@ -156,8 +154,7 @@ private void findGetterAndSetterForPrivateField(ErrorLogger errorLogger) {
fieldName.substring(2, fieldName.length())))))
&& !method.getModifiers().contains(PRIVATE)
&& !method.getModifiers().contains(STATIC)
&& method.getParameters().size() == 1
&& TypeName.get(method.getParameters().get(0).asType()).equals(getTypeName())) {
&& method.getParameters().size() == 1) {
setterMethodName = methodName;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,6 @@ public void testModelWithPrivateAttributeWithGetterWithParamsFails() {
"private fields without proper getter and setter");
}

@Test
public void testModelWithPrivateAttributeWithGetterWithWrongReturnTypeFails() {
assertGenerationError("ModelWithPrivateFieldWithGetterWithWrongReturnType.java",
"private fields without proper getter and setter");
}

@Test
public void testModelWithPrivateAttributeWithPrivateSetterFails() {
assertGenerationError("ModelWithPrivateFieldWithPrivateSetter.java",
Expand All @@ -332,12 +326,6 @@ public void testModelWithPrivateAttributeWithGetterWithoutParamsFails() {
"private fields without proper getter and setter");
}

@Test
public void testModelWithPrivateAttributeWithSetterWithWrongReturnTypeFails() {
assertGenerationError("ModelWithPrivateFieldWithSetterWithWrongParamType.java",
"private fields without proper getter and setter");
}

@Test
public void testModelWithAllPrivateFieldTypes() {
assertGeneration("ModelWithAllPrivateFieldTypes.java", "ModelWithAllPrivateFieldTypes_.java");
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit bcfecc8

Please sign in to comment.