protected Reference createReference(Reference reference) { Reference newReference; try { newReference = (Reference)reference.clone(); } catch (CloneNotSupportedException e) { throw new AssertionError(e); // should not ever happen } return newReference; }
protected Reference createReference(Reference reference, InterfaceContract interfaze) { Reference newReference; try { newReference = (Reference)reference.clone(); if (newReference.getInterfaceContract() == null) newReference.setInterfaceContract(interfaze); } catch (CloneNotSupportedException e) { throw new AssertionError(e); // should not ever happen } return newReference; }
@Override public Object clone() throws CloneNotSupportedException { ComponentTypeImpl clone = (ComponentTypeImpl)super.clone(); clone.services = new ArrayList<Service>(); for (Service service : getServices()) { clone.services.add((Service)service.clone()); } clone.references = new ArrayList<Reference>(); for (Reference reference : getReferences()) { clone.references.add((Reference)reference.clone()); } clone.properties = new ArrayList<Property>(); for (Property property : getProperties()) { clone.properties.add((Property)property.clone()); } clone.requiredIntents = new ArrayList<Intent>(requiredIntents); clone.policySets = new ArrayList<PolicySet>(policySets); return clone; }
@Override public Object clone() throws CloneNotSupportedException { ComponentTypeImpl clone = (ComponentTypeImpl)super.clone(); clone.services = new ArrayList<Service>(); for (Service service : getServices()) { clone.services.add((Service)service.clone()); } clone.references = new ArrayList<Reference>(); for (Reference reference : getReferences()) { clone.references.add((Reference)reference.clone()); } clone.properties = new ArrayList<Property>(); for (Property property : getProperties()) { clone.properties.add((Property)property.clone()); } clone.requiredIntents = new ArrayList<Intent>(requiredIntents); clone.policySets = new ArrayList<PolicySet>(policySets); return clone; }