field = (VDBFieldData)e.nextElement(); type = LinkProperties.getType(field); if (type != LinkProperties.VARIABLE_FIELD) { old = field.getValue();
VDBFieldData field = (VDBFieldData)e.nextElement();   String old = field.getValue();
public void fixEPICSOutLinksOnCopy(String prevGroup, String group) {	if (prevGroup.equals(group)) return;		String prefix;	if (group.equals(nullString)) prefix=nullString;	else prefix=group+Constants.GROUP_SEPARATOR;	Enumeration e = recordData.getFieldsV().elements();	String old; 	int type; VDBFieldData field;	while (e.hasMoreElements()) {		field = (VDBFieldData)e.nextElement();		type = LinkProperties.getType(field);		if (type != LinkProperties.VARIABLE_FIELD) {			old = field.getValue();			if (!old.equals(nullString) && !old.startsWith(Constants.HARDWARE_LINK) &&				old.startsWith(prevGroup)) {								LinkProperties lp = new LinkProperties(field);				InLink target = EPICSLinkOut.getTarget(lp, true);				if (target == null)					continue;								// only parent can be selected				Object selectableObject;				if (target instanceof Field)					selectableObject = ((Field)target).getParent();				else					selectableObject = target;													// fix only selected				if (!ViewState.getInstance().isSelected(selectableObject))					continue;								// fix ports...				if (selectableObject instanceof Template) {					Template t = (Template)selectableObject;					field.setValue("$(" + prefix + t.getName() + Constants.FIELD_SEPARATOR + ((TemplateEPICSPort)target).getFieldData().getName()+")");				}				// normal record fields				else if (prevGroup.equals(nullString))					field.setValue(prefix+old);				else					field.setValue(prefix+old.substring(prevGroup.length()+1));			}		}	}}