Github user imesh commented on a diff in the pull request:

    https://github.com/apache/stratos/pull/277#discussion_r27019215
  
    --- Diff: 
components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ApplicationUtils.java
 ---
    @@ -207,31 +207,35 @@ public static PayloadData createPayload(String appId, 
String groupName, Cartridg
                     cartridgeInfo.getType(), basicPayloadData);
     
             // get the payload parameters defined in the cartridgeInfo 
definition file for this cartridgeInfo type
    -        if (cartridgeInfo.getProperties() != null && 
cartridgeInfo.getProperties().length != 0) {
    -
    -            org.apache.stratos.common.Properties cartridgeProps = 
AutoscalerUtil.toCommonProperties(cartridgeInfo.getProperties());
    -            
    -            if (cartridgeProps != null) {
    -
    -                for (Property propertyEntry : 
cartridgeProps.getProperties()) {
    -                    // check if a property is related to the payload. 
Currently
    -                    // this is done by checking if the
    -                    // property name starts with 'payload_parameter.' 
suffix. If
    -                    // so the payload param name will
    -                    // be taken as the substring from the index of '.' to 
the
    -                    // end of the property name.
    -                    if 
(propertyEntry.getName().startsWith("payload_parameter.")) {
    -                        String payloadParamName = propertyEntry.getName();
    -                        String payloadParamSubstring = 
payloadParamName.substring(payloadParamName.indexOf(".") + 1);
    -                        if ("DEPLOYMENT".equals(payloadParamSubstring)) {
    -                            
payloadData.getBasicPayloadData().setDeployment(payloadParamSubstring);
    -                            continue;
    +
    +        if (cartridgeInfo.getProperties() != null) {
    +            if (cartridgeInfo.getProperties().getProperties() != null && 
cartridgeInfo.getProperties().getProperties().length != 0) {
    +
    +                org.apache.stratos.common.Properties cartridgeProps = 
AutoscalerUtil.toCommonProperties(cartridgeInfo.getProperties().getProperties());
    +
    +                if (cartridgeProps != null) {
    +
    +                    for (Property propertyEntry : 
cartridgeProps.getProperties()) {
    +                        // check if a property is related to the payload. 
Currently
    +                        // this is done by checking if the
    +                        // property name starts with 'payload_parameter.' 
suffix. If
    +                        // so the payload param name will
    +                        // be taken as the substring from the index of '.' 
to the
    +                        // end of the property name.
    +                        if 
(propertyEntry.getName().startsWith("payload_parameter.")) {
    +                            String payloadParamName = 
propertyEntry.getName();
    +                            String payloadParamSubstring = 
payloadParamName.substring(payloadParamName.indexOf(".") + 1);
    --- End diff --
    
    IMO payloadParamSubstring variable is not self explanatory. Shall we rename 
this variable to something meaningful?
    Thanks


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to