Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for @HystrixCommand to be used on parameterized return type #347

Merged
merged 2 commits into from
Dec 11, 2014

Conversation

sawano
Copy link
Contributor

@sawano sawano commented Nov 27, 2014

The current implementation of hystrix-javanica doesn't work with methods that have a parameterized method return type. I.e. the following (somewhat silly example) would not work:

@HystrixCommand
public <T> T echo(T value) {
    return value;
}

This is because the code that determines the execution type from the method return type incorrectly matches Object to Future and then marks it for asynchronous execution. This leads to an exception at runtime. E.g.:

final String answer = echo("hello");

would cause a class cast exception.

Correcting the logic for determining the execution type fixes this issue.

@cloudbees-pull-request-builder

Hystrix-pull-requests #172 FAILURE
Looks like there's a problem with this pull request

@sawano
Copy link
Contributor Author

sawano commented Nov 27, 2014

This build seems to inherit a test failure from previous builds.

benjchristensen added a commit that referenced this pull request Dec 11, 2014
Allow for @HystrixCommand to be used on parameterized return type
@benjchristensen benjchristensen merged commit 20b81dc into Netflix:master Dec 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants