Program: 34681
Project: 34681
Buggy source:
/** 
 * @param entity
 * @param propNames
 * @param attrs
 * @throws WIMException NOTE: BEHAVIOR CHANGE USING APAR PM46133 Before: Properties having binary data-type were not being parsed and pushed into populated Entity. This method used to iterate every attribute returned by JNDI_CALL and parse them according to their Property-to-Attribute mapping from wimconfig.xml After: Whenever a LDAP returned object(attributes) ;then they'd be returned as DN: CN=myCN1,o=ibm ExtId: E525BE85647D750E882578E300444D6A UniqueName: CN=myCN1,o=ibm Type: PersonAccount Attributes: { dominounid=Attribute ID: dominounid Attribute values: E525BE85647D750E882578E300444D6A ; jpegphoto;binary=Attribute ID: jpegphoto;binary Attribute values: [B@4b3a4b3a ; objectclass=Attribute ID: objectclass Attribute values: inetorgperson,organizationalPerson,person,top ; sn=Attribute ID: sn Attribute values: mySN1 ; cn=Attribute ID: cn Attribute values: myCN1 } all attributes EXCEPT jpegphoto(binary type) are having a common syntax <attrName>=Attribute ID:<attrName> Attribute values:<someValue> Attributes of type binary have added it's type in the attribute name itself; hence method can't find/validate said attribute (jpegphoto;binary); hence fails to retrieve attribute and populate it's value in Entry. PS. These changes are not going to affect original behaviour; New changes will be serving binary dataType attributes too!
 */
private void populateEntity(Entity entity,List<String> propNames,Attributes attrs) throws WIMException {
  if (propNames == null || propNames.size() == 0) {
    return;
  }
  String entityType=entity.getTypeName();
  LdapEntity ldapEntity=iLdapConfigMgr.getLdapEntity(entityType);
  Set<String> allSupportedAttrs=ldapEntity.getAttributes();
  List<String> supportedProps=iLdapConfigMgr.getSupportedProperties(entityType,propNames);
  try {
    List<String> propVisitedList=new ArrayList<String>();
    for (NamingEnumeration<?> neu=attrs.getAll(); neu.hasMore(); ) {
      boolean contain=false;
      Attribute attr=(Attribute)neu.next();
      String attrName=attr.getID();
      int pos=attrName.indexOf(';');
      if (pos > 0) {
        attrName=attrName.substring(0,pos);
      }
      if (allSupportedAttrs.contains(attrName)) {
        contain=true;
      }
 else {
        for (        String curAttr : allSupportedAttrs) {
          if (curAttr.equalsIgnoreCase(attrName)) {
            contain=true;
            break;
          }
        }
      }
      if (!contain) {
        if (LDAP_ATTR_USER_PASSWORD.equalsIgnoreCase(attrName) || LDAP_ATTR_UNICODEPWD.equalsIgnoreCase(attrName))         contain=true;
      }
      Set<String> props=iLdapConfigMgr.getPropertyName(ldapEntity,attrName);
      boolean exclude=false;
      if (props.contains("String_Node_Str") && props.contains("String_Node_Str")) {
        exclude=true;
      }
      if (props.contains("String_Node_Str") && props.contains("String_Node_Str")) {
        exclude=true;
      }
      for (      String propName : props) {
        if (propName.equalsIgnoreCase("String_Node_Str") && exclude) {
          continue;
        }
        if (propName.equalsIgnoreCase("String_Node_Str") && exclude) {
          continue;
        }
        for (int i=0; i < supportedProps.size(); i++) {
          String reqPropName=supportedProps.get(i);
          if ((SchemaConstants.VALUE_ALL_PROPERTIES.equals(reqPropName) && contain) || reqPropName.equalsIgnoreCase(propName)) {
            Object prop=entity.get(propName);
            if ((!propVisitedList.contains(propName) || !attrName.equalsIgnoreCase(propName))) {
              setPropertyValue(entity,attr,propName,iLdapConfigMgr.getLdapAttribute(attrName));
              if (!propVisitedList.contains(propName)) {
                propVisitedList.add(propName);
              }
            }
            break;
          }
        }
      }
    }
  }
 catch (  NamingException e) {
    throw new WIMSystemException(WIMMessageKey.NAMING_EXCEPTION,Tr.formatMessage(tc,WIMMessageKey.NAMING_EXCEPTION,WIMMessageHelper.generateMsgParms(e.toString(true))));
  }
}

Fixed version (ground truth):
/** 
 * @param entity
 * @param propNames
 * @param attrs
 * @throws WIMException NOTE: BEHAVIOR CHANGE USING APAR PM46133 Before: Properties having binary data-type were not being parsed and pushed into populated Entity. This method used to iterate every attribute returned by JNDI_CALL and parse them according to their Property-to-Attribute mapping from wimconfig.xml After: Whenever a LDAP returned object(attributes) ;then they'd be returned as DN: CN=myCN1,o=ibm ExtId: E525BE85647D750E882578E300444D6A UniqueName: CN=myCN1,o=ibm Type: PersonAccount Attributes: { dominounid=Attribute ID: dominounid Attribute values: E525BE85647D750E882578E300444D6A ; jpegphoto;binary=Attribute ID: jpegphoto;binary Attribute values: [B@4b3a4b3a ; objectclass=Attribute ID: objectclass Attribute values: inetorgperson,organizationalPerson,person,top ; sn=Attribute ID: sn Attribute values: mySN1 ; cn=Attribute ID: cn Attribute values: myCN1 } all attributes EXCEPT jpegphoto(binary type) are having a common syntax <attrName>=Attribute ID:<attrName> Attribute values:<someValue> Attributes of type binary have added it's type in the attribute name itself; hence method can't find/validate said attribute (jpegphoto;binary); hence fails to retrieve attribute and populate it's value in Entry. PS. These changes are not going to affect original behaviour; New changes will be serving binary dataType attributes too!
 */
private void populateEntity(Entity entity,List<String> propNames,Attributes attrs) throws WIMException {
  if (propNames == null || propNames.size() == 0 || attrs == null) {
    return;
  }
  String entityType=entity.getTypeName();
  LdapEntity ldapEntity=iLdapConfigMgr.getLdapEntity(entityType);
  Set<String> allSupportedAttrs=ldapEntity.getAttributes();
  List<String> supportedProps=iLdapConfigMgr.getSupportedProperties(entityType,propNames);
  try {
    List<String> propVisitedList=new ArrayList<String>();
    for (NamingEnumeration<?> neu=attrs.getAll(); neu.hasMore(); ) {
      boolean contain=false;
      Attribute attr=(Attribute)neu.next();
      String attrName=attr.getID();
      int pos=attrName.indexOf(';');
      if (pos > 0) {
        attrName=attrName.substring(0,pos);
      }
      if (allSupportedAttrs.contains(attrName)) {
        contain=true;
      }
 else {
        for (        String curAttr : allSupportedAttrs) {
          if (curAttr.equalsIgnoreCase(attrName)) {
            contain=true;
            break;
          }
        }
      }
      if (!contain) {
        if (LDAP_ATTR_USER_PASSWORD.equalsIgnoreCase(attrName) || LDAP_ATTR_UNICODEPWD.equalsIgnoreCase(attrName))         contain=true;
      }
      Set<String> props=iLdapConfigMgr.getPropertyName(ldapEntity,attrName);
      boolean exclude=false;
      if (props.contains("String_Node_Str") && props.contains("String_Node_Str")) {
        exclude=true;
      }
      if (props.contains("String_Node_Str") && props.contains("String_Node_Str")) {
        exclude=true;
      }
      for (      String propName : props) {
        if (propName.equalsIgnoreCase("String_Node_Str") && exclude) {
          continue;
        }
        if (propName.equalsIgnoreCase("String_Node_Str") && exclude) {
          continue;
        }
        for (int i=0; i < supportedProps.size(); i++) {
          String reqPropName=supportedProps.get(i);
          if ((SchemaConstants.VALUE_ALL_PROPERTIES.equals(reqPropName) && contain) || reqPropName.equalsIgnoreCase(propName)) {
            Object prop=entity.get(propName);
            if ((!propVisitedList.contains(propName) || !attrName.equalsIgnoreCase(propName))) {
              setPropertyValue(entity,attr,propName,iLdapConfigMgr.getLdapAttribute(attrName));
              if (!propVisitedList.contains(propName)) {
                propVisitedList.add(propName);
              }
            }
            break;
          }
        }
      }
    }
  }
 catch (  NamingException e) {
    throw new WIMSystemException(WIMMessageKey.NAMING_EXCEPTION,Tr.formatMessage(tc,WIMMessageKey.NAMING_EXCEPTION,WIMMessageHelper.generateMsgParms(e.toString(true))));
  }
}