if ( referralsHandlingMethod == ReferralHandlingMethod.MANAGE )
{
if ( currentControls == null )
{
localControls = new Control[]
{ new ManageReferralControl( false ) };
}
else
{
boolean manageDsaItControlAlreadyContained = false;
for ( Control control : currentControls )
{
if ( ManageReferralControl.OID.equals( control.getID() ) )
{
manageDsaItControlAlreadyContained = true;
break;
}
}
if ( !manageDsaItControlAlreadyContained )
{
localControls = new Control[currentControls.length + 1];
System.arraycopy( currentControls, 0, localControls, 0, currentControls.length );
localControls[localControls.length - 1] = new ManageReferralControl( false );
}
}
}
return localControls;
}