Skip to content

Commit

Permalink
Merge pull request sdaschner#112 from SerialVelocity/fix/type-erased-…
Browse files Browse the repository at this point in the history
…return-types

Allow for type erased return types since JavaDoc returns type erased return types
  • Loading branch information
sdaschner authored Apr 10, 2017
2 parents d59f9ea + afd3f72 commit e0c4a0b
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ public boolean equals(Object o) {
if (parameters.equals(that.parameters))
return true;

// fallback if signature matches after type erasure -> everything matches except signature
if (parameters.size() == that.parameters.size() && returnType.equals(that.returnType)) {
final List<String> types = parameters.stream().map(JavaUtils::toClassName).collect(Collectors.toList());
final List<String> thatTypes = that.parameters.stream().map(JavaUtils::toClassName).collect(Collectors.toList());
return types.equals(thatTypes);
// fallback if signature matches after type erasure
if (parameters.size() == that.parameters.size()) {
final List<String> erasedTypes = parameters.stream().map(JavaUtils::toClassName).collect(Collectors.toList());
final List<String> erasedThatTypes = that.parameters.stream().map(JavaUtils::toClassName).collect(Collectors.toList());
final String erasedReturnType = JavaUtils.toClassName(returnType);
final String erasedThatReturnType = JavaUtils.toClassName(that.returnType);
return erasedTypes.equals(erasedThatTypes) && erasedReturnType.equals(erasedThatReturnType);
}

return false;
Expand Down

0 comments on commit e0c4a0b

Please sign in to comment.