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

W-17463948: Prevent double injection of objects in registry #14066

Merged
merged 8 commits into from
Dec 18, 2024

Conversation

elrodro83
Copy link
Contributor

No description provided.

@elrodro83 elrodro83 force-pushed the chore/double-inject branch 2 times, most recently from caf9295 to f75b66e Compare December 12, 2024 01:46
@elrodro83
Copy link
Contributor Author

--validate

2 similar comments
@elrodro83
Copy link
Contributor Author

--validate

@elrodro83
Copy link
Contributor Author

--validate

@elrodro83
Copy link
Contributor Author

--validate

*/
<T> T inject(T object) throws MuleException;
<T> T inject(T object) throws IllegalDependencyInjectionException;
Copy link
Contributor

Choose a reason for hiding this comment

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

How can we be sure that other components (from other teams or some customer) don't use this method? Implementing it would be also a problem, but we at least have the NoImplement annotation

* @throws MuleException if there is an error initializing
*/
@SuppressWarnings({"unused"})
private void initAfterDeserialisation(MuleContext muleContext) throws MuleException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a test asserting that we aren't breaking something with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

all existing tests that use a persistent object store

@@ -242,7 +245,7 @@ protected InternalEvent setInternalParamsForNotParamResolver(Component component
try {
((ParametersResolverProcessor<?>) component).resolveParameters(builder, (params, context) -> {
resolvedParameters.putAll(params.entrySet().stream()
.collect(toMap(e -> e.getKey(),
.collect(toMap((Function<? super Entry<String, Supplier<Object>>, ? extends String>) Entry::getKey,
Copy link
Contributor

Choose a reason for hiding this comment

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

The older code sounds cleaner in this case

@elrodro83 elrodro83 changed the title Prevent double injection of objects in registry W-17463948: Prevent double injection of objects in registry Dec 18, 2024
@elrodro83 elrodro83 marked this pull request as ready for review December 18, 2024 17:15
@elrodro83 elrodro83 requested a review from a team as a code owner December 18, 2024 17:15
@elrodro83 elrodro83 enabled auto-merge (squash) December 18, 2024 18:33
@elrodro83
Copy link
Contributor Author

--validate

@elrodro83 elrodro83 merged commit 43576d1 into master Dec 18, 2024
7 checks passed
@elrodro83 elrodro83 deleted the chore/double-inject branch December 18, 2024 21:55
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.

2 participants