[
https://issues.apache.org/jira/browse/SLIDER-1160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15398804#comment-15398804
]
Gour Saha commented on SLIDER-1160:
-----------------------------------
Aha, that makes sense now. In that case, since the return value is not used,
maybe making this method a void instead of returning an int will make the scans
happy.
> Incorrect expression in AbstractClientProvider.validateInstanceDefinition
> -------------------------------------------------------------------------
>
> Key: SLIDER-1160
> URL: https://issues.apache.org/jira/browse/SLIDER-1160
> Project: Slider
> Issue Type: Bug
> Components: core
> Affects Versions: Slider 0.91
> Reporter: Gour Saha
> Priority: Minor
>
> _*AbstractClientProvider.validateInstanceDefinition*_ has 2 calls to
> _*ProviderUtils.getRoleResourceRequirement*_ which are incorrect expressions.
> The _*getRoleResourceRequirement*_ method does not modify any internal state
> of objects and only makes sense to a caller if they capture the return value.
> However in the below 2 calls the return value is ignored -
> {code}
> 91 providerUtils.getRoleResourceRequirement(ram,
> 92 DEF_YARN_MEMORY,
> 93 Integer.MAX_VALUE);
> 94 providerUtils.getRoleResourceRequirement(cores,
> 95 DEF_YARN_CORES,
> 96 Integer.MAX_VALUE);
> {code}
> Hence these lines of code should be removed or changes made appropriately to
> express the right intention.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)