Fix annotation processor builder setter detection

Update TypeElementMembers to correctly detect builder style setters.
The previous logic could fail because of the crazy way that TypeMirror
implements its equals() method.

Fixes gh-1859
See gh-1854
This commit is contained in:
Phillip Webb
2014-11-10 23:03:32 -08:00
parent 143a62b6bf
commit e902f6b91d

View File

@@ -95,8 +95,9 @@ class TypeElementMembers {
}
private boolean isSetterReturnType(ExecutableElement method) {
return (TypeKind.VOID == method.getReturnType().getKind() || method
.getEnclosingElement().asType().equals(method.getReturnType()));
return (TypeKind.VOID == method.getReturnType().getKind() || this.env
.getTypeUtils().isSameType(method.getEnclosingElement().asType(),
method.getReturnType()));
}
private String getAccessorName(String methodName) {