Github user prabathabey commented on a diff in the pull request:
https://github.com/apache/stratos/pull/277#discussion_r27852697
--- Diff:
components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/parser/DefaultApplicationParser.java
---
@@ -438,13 +434,13 @@ private Application
buildCompositeAppStructure(ApplicationContext applicationCon
arrImportMetadata =
importMetadataKeys.toArray(arrImportMetadata);
// Find tenant range of cluster
- String tenantRange = AutoscalerUtil.findTenantRange(tenantId,
cartridgeInfo.getTenantPartitions());
+ String tenantRange = AutoscalerUtil.findTenantRange(tenantId,
cartridge.getTenantPartitions());
Boolean isLB=false;
- if(cartridgeInfo.getCategory().equals("lb")){
+ if(cartridge.getCategory().equals("lb")){
--- End diff --
As a best practice, compare a value assigned to a field against a known
constant whenever possible. This would help avoid redundant null checks, etc
that need to be performed prior to calling equals method upon the variable
values being compared.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---