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

Add service class & instance to Invocation #3744

Merged

Conversation

efemoney
Copy link
Contributor

@efemoney efemoney commented Jun 1, 2022

Fixes #3730

Comment on lines 62 to 65
public static Invocation of(Method method, List<?> arguments) {
Objects.requireNonNull(method, "method == null");
Objects.requireNonNull(arguments, "arguments == null");
return new Invocation(method, new ArrayList<>(arguments)); // Defensive copy.
return new Invocation(method.getDeclaringClass(), null, method, new ArrayList<>(arguments)); // Defensive copy.
Copy link
Contributor Author

@efemoney efemoney Jun 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to maintain binary compatibility for anyone using this method by approximating the service class as method.declaringClass and instance as null.

Would love to know if this is good enough or if its okay to break compatibility.

}

private final Class<?> service;
@Nullable private final Object instance;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't see another way of maintaining compatibility than making the instance nullable

@efemoney
Copy link
Contributor Author

efemoney commented Sep 6, 2022

Seems CI wasn't triggered on the last push 🤔 Is there something I can do?

@JakeWharton JakeWharton force-pushed the em/service-instance-in-invocation branch from dba8ebd to c216c07 Compare February 21, 2024 04:15
@JakeWharton JakeWharton merged commit 0e45300 into square:trunk Feb 21, 2024
6 checks passed
@efemoney efemoney deleted the em/service-instance-in-invocation branch March 18, 2024 21:48
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.

Add Service instance to Invocation
2 participants