static private ServiceTemplate copyServiceTemplate(ServiceTemplate tmpl){
  Class[] serviceTypes=null;
  Entry[] attributeSetTemplates=null;
  if (tmpl.serviceTypes != null) {
    int len=tmpl.serviceTypes.length;
    serviceTypes=new Class[len];
    System.arraycopy(tmpl.serviceTypes,0,serviceTypes,0,len);
  }
  if (tmpl.attributeSetTemplates != null) {
    int len=tmpl.attributeSetTemplates.length;
    attributeSetTemplates=new Entry[len];
    System.arraycopy(tmpl.attributeSetTemplates,0,attributeSetTemplates,0,len);
  }
  return new ServiceTemplate(tmpl.serviceID,serviceTypes,attributeSetTemplates);
}

static private ServiceTemplate copyServiceTemplate ( ServiceTemplate tmpl ) { Class [ ] serviceTypes = null ; Entry [ ] attributeSetTemplates = null ; if ( tmpl . serviceTypes != null ) { int len = tmpl . serviceTypes . length ; serviceTypes = new Class [ len ] ; System . arraycopy ( tmpl . serviceTypes , 0 , serviceTypes , 0 , len ) ; } if ( tmpl . attributeSetTemplates != null ) { int len = tmpl . attributeSetTemplates . length ; attributeSetTemplates = new Entry [ len ] ; System . arraycopy ( tmpl . attributeSetTemplates , 0 , attributeSetTemplates , 0 , len ) ; } return new ServiceTemplate ( tmpl . serviceID , serviceTypes , attributeSetTemplates ) ; }
returns a " non - shallow " ( not just a clone ) copy of the given template .
