private AttrSet combineOCs(CreationTemplate ct,AttrSet aSet){
  Attr attr=aSet.getAttribute("objectclass");
  Attr defAttr=ct.getAttribute("objectclass");
  Set addOCs=(attr != null) ? CommonUtils.stringArrayToSet(attr.getStringValues()) : new HashSet();
  Set ctOCs=CommonUtils.stringArrayToSet(defAttr.getStringValues());
  Set finalOCs=CommonUtils.combineOCs(addOCs,ctOCs);
  aSet.remove("objectclass");
  Attr finalOCAttr=new Attr("objectclass",(String[])finalOCs.toArray(new String[finalOCs.size()]));
  aSet.add(finalOCAttr);
  return aSet;
}

private AttrSet combineOCs ( CreationTemplate ct , AttrSet aSet ) { Attr attr = aSet . getAttribute ( "objectclass" ) ; Attr defAttr = ct . getAttribute ( "objectclass" ) ; Set addOCs = ( attr != null ) ? CommonUtils . stringArrayToSet ( attr . getStringValues ( ) ) : new HashSet ( ) ; Set ctOCs = CommonUtils . stringArrayToSet ( defAttr . getStringValues ( ) ) ; Set finalOCs = CommonUtils . combineOCs ( addOCs , ctOCs ) ; aSet . remove ( "objectclass" ) ; Attr finalOCAttr = new Attr ( "objectclass" , ( String [ ] ) finalOCs . toArray ( new String [ finalOCs . size ( ) ] ) ) ; aSet . add ( finalOCAttr ) ; return aSet ; }
when an object is being created and attribute sets are being passed ums does not overrid objectclasses in the attribute set , with the ones from creation template . this method takes care of that .
