Program: 131896
Project: 131896
Buggy source:
@Override public Object executeTransform(final Object input){
  ODocument doc;
  if (!(input instanceof OIdentifiable)) {
    log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str");
    return null;
  }
  doc=((OIdentifiable)input).getRecord();
  Object joinRuntimeValue=null;
  if (joinFieldName != null)   joinRuntimeValue=doc.field(joinFieldName);
 else   if (joinValue != null)   joinRuntimeValue=resolve(joinValue);
  Object result;
  if (OMultiValue.isMultiValue(joinRuntimeValue)) {
    result=new ArrayList<Object>();
    for (    Object o : OMultiValue.getMultiValueIterable(joinRuntimeValue)) {
      final Object r=lookup(o);
      ((List<Object>)result).add(r);
    }
  }
 else   result=lookup(joinRuntimeValue);
  log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",joinRuntimeValue,result);
  if (result != null) {
    if (linkFieldType != null) {
      if (linkFieldType == OType.LINK) {
        if (result instanceof Collection<?>) {
          if (!((Collection)result).isEmpty())           result=((Collection)result).iterator().next();
 else           result=null;
        }
      }
 else       if (linkFieldType == OType.LINKSET) {
        if (!(result instanceof Collection)) {
          final Set<OIdentifiable> res=new HashSet<OIdentifiable>();
          res.add((OIdentifiable)result);
          result=res;
        }
      }
 else       if (linkFieldType == OType.LINKLIST) {
        if (!(result instanceof Collection)) {
          final List<OIdentifiable> res=new ArrayList<OIdentifiable>();
          res.add((OIdentifiable)result);
          result=res;
        }
      }
    }
    if (result == null) {
switch (unresolvedLinkAction) {
case CREATE:
        if (lookup != null) {
          final String[] lookupParts=lookup.split("String_Node_Str");
          final ODocument linkedDoc=new ODocument(lookupParts[0]);
          linkedDoc.field(lookupParts[1],joinRuntimeValue);
          linkedDoc.save();
          log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",linkedDoc.getRecord());
          result=linkedDoc;
        }
 else         throw new OConfigurationException("String_Node_Str");
      break;
case ERROR:
    processor.getStats().incrementErrors();
  log(OETLProcessor.LOG_LEVELS.ERROR,"String_Node_Str",getName(),joinRuntimeValue);
break;
case WARNING:
processor.getStats().incrementWarnings();
log(OETLProcessor.LOG_LEVELS.INFO,"String_Node_Str",getName(),joinRuntimeValue);
break;
case SKIP:
return null;
case HALT:
throw new OETLProcessHaltedException("String_Node_Str" + joinRuntimeValue + "String_Node_Str");
}
}
}
doc.field(linkFieldName,result);
log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",linkFieldName,result,input);
return input;
}

Fixed version (ground truth):
@Override public Object executeTransform(final Object input){
  ODocument doc;
  if (!(input instanceof OIdentifiable)) {
    log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",input.getClass());
    return null;
  }
  doc=((OIdentifiable)input).getRecord();
  Object joinRuntimeValue=null;
  if (joinFieldName != null)   joinRuntimeValue=doc.field(joinFieldName);
 else   if (joinValue != null)   joinRuntimeValue=resolve(joinValue);
  Object result;
  if (OMultiValue.isMultiValue(joinRuntimeValue)) {
    result=new ArrayList<Object>();
    for (    Object o : OMultiValue.getMultiValueIterable(joinRuntimeValue)) {
      final Object r=lookup(o);
      ((List<Object>)result).add(r);
    }
  }
 else   result=lookup(joinRuntimeValue);
  log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",joinRuntimeValue,result);
  if (result != null) {
    if (linkFieldType != null) {
      if (linkFieldType == OType.LINK) {
        if (result instanceof Collection<?>) {
          if (!((Collection)result).isEmpty())           result=((Collection)result).iterator().next();
 else           result=null;
        }
      }
 else       if (linkFieldType == OType.LINKSET) {
        if (!(result instanceof Collection)) {
          final Set<OIdentifiable> res=new HashSet<OIdentifiable>();
          res.add((OIdentifiable)result);
          result=res;
        }
      }
 else       if (linkFieldType == OType.LINKLIST) {
        if (!(result instanceof Collection)) {
          final List<OIdentifiable> res=new ArrayList<OIdentifiable>();
          res.add((OIdentifiable)result);
          result=res;
        }
      }
    }
    if (result == null) {
switch (unresolvedLinkAction) {
case CREATE:
        if (lookup != null) {
          final String[] lookupParts=lookup.split("String_Node_Str");
          final ODocument linkedDoc=new ODocument(lookupParts[0]);
          linkedDoc.field(lookupParts[1],joinRuntimeValue);
          linkedDoc.save();
          log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",linkedDoc.getRecord());
          result=linkedDoc;
        }
 else         throw new OConfigurationException("String_Node_Str");
      break;
case ERROR:
    processor.getStats().incrementErrors();
  log(OETLProcessor.LOG_LEVELS.ERROR,"String_Node_Str",getName(),joinRuntimeValue);
break;
case WARNING:
processor.getStats().incrementWarnings();
log(OETLProcessor.LOG_LEVELS.INFO,"String_Node_Str",getName(),joinRuntimeValue);
break;
case SKIP:
return null;
case HALT:
throw new OETLProcessHaltedException("String_Node_Str" + joinRuntimeValue + "String_Node_Str");
}
}
}
doc.field(linkFieldName,result);
log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",linkFieldName,result,input);
return input;
}