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

Remove Arc dead code #5146

Merged
merged 1 commit into from Nov 4, 2019
Merged

Conversation

gwenneg
Copy link
Member

@gwenneg gwenneg commented Nov 3, 2019

No description provided.

@gwenneg gwenneg added the area/arc Issue related to ARC (dependency injection) label Nov 3, 2019
@gwenneg gwenneg requested a review from mkouba November 3, 2019 19:55
Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

Looks good to me but I'll let @mkouba decide.

@@ -228,7 +228,7 @@ public InjectableContext getActiveContext(Class<? extends Annotation> scopeType)
public <T> InstanceHandle<T> instance(InjectableBean<T> bean) {
Objects.requireNonNull(bean);
requireRunning();
return bean != null ? (InstanceHandle<T>) beanInstanceHandle(bean, null) : InstanceHandleImpl.unavailable();
return (InstanceHandle<T>) beanInstanceHandle(bean, null);
Copy link
Member

Choose a reason for hiding this comment

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

Not exactly dead code but yes looks like the underlying method does the work for us.

Copy link
Member Author

@gwenneg gwenneg Nov 3, 2019

Choose a reason for hiding this comment

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

The removed condition always evaluated to true because of Objects.requireNonNull(bean); at the beginning of the method. That's why the removed code looks kind of dead to me :)

Copy link
Member

Choose a reason for hiding this comment

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

Ah yes, sure, missed it. In any case beanInstanceHandle also deals with the null value so we are extra safe.

@Sanne Sanne merged commit 85d0d3f into quarkusio:master Nov 4, 2019
@Sanne Sanne added this to the 0.29.0 milestone Nov 4, 2019
@gwenneg gwenneg deleted the arccontainerimpl-unused-test branch November 4, 2019 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants