Program: 138683
Project: 138683
Buggy source:
/** 
 * DOC mzhao feature 11128, If the execute engine and by the same time Java User Defined Indicator is also defined, then compute via Java UDI, here convert common udi to a Java UDI.
 * @param udi
 * @return
 * @throws Exception
 */
public static Indicator adaptToJavaUDI(Indicator indicator) throws Throwable {
  UserDefIndicator adaptedUDI=null;
  if (userDefIndSwitch.doSwitch(indicator) != null) {
    EList<TaggedValue> taggedValues=indicator.getIndicatorDefinition().getTaggedValue();
    String userJavaClassName=null;
    String jarPath=null;
    for (    TaggedValue tv : taggedValues) {
      if (tv.getTag().equals(PluginConstant.CLASS_NAME_TEXT)) {
        userJavaClassName=tv.getValue();
        continue;
      }
      if (tv.getTag().equals(PluginConstant.JAR_FILE_PATH)) {
        jarPath=tv.getValue();
      }
    }
    if (validateJavaUDI(userJavaClassName,jarPath)) {
      File file=new File(jarPath);
      TalendURLClassLoader cl;
      cl=new TalendURLClassLoader(new URL[]{file.toURL()});
      Class<?> clazz=cl.findClass(userJavaClassName);
      if (clazz != null) {
        UserDefIndicator judi=(UserDefIndicator)clazz.newInstance();
        judi.setIndicatorDefinition(indicator.getIndicatorDefinition());
        if (indicator instanceof JavaUserDefIndicator) {
          ((JavaUserDefIndicator)indicator).setJavaUserDefObject(judi);
        }
 else {
          JavaUserDefIndicator judiTemplate=IndicatorSqlFactory.eINSTANCE.createJavaUserDefIndicator();
          judiTemplate.setJavaUserDefObject(judi);
          judiTemplate.setIndicatorDefinition(indicator.getIndicatorDefinition());
          judiTemplate.setAnalyzedElement(indicator.getAnalyzedElement());
          adaptedUDI=judiTemplate;
        }
      }
    }
  }
  return adaptedUDI;
}

Fixed version (ground truth):
/** 
 * DOC mzhao feature 11128, If the execute engine and by the same time Java User Defined Indicator is also defined, then compute via Java UDI, here convert common udi to a Java UDI.
 * @param udi
 * @return
 * @throws Exception
 */
public static Indicator adaptToJavaUDI(Indicator indicator) throws Throwable {
  UserDefIndicator adaptedUDI=null;
  if (userDefIndSwitch.doSwitch(indicator) != null) {
    EList<TaggedValue> taggedValues=indicator.getIndicatorDefinition().getTaggedValue();
    String userJavaClassName=null;
    String jarPath=null;
    for (    TaggedValue tv : taggedValues) {
      if (tv.getTag().equals(PluginConstant.CLASS_NAME_TEXT)) {
        userJavaClassName=tv.getValue();
        continue;
      }
      if (tv.getTag().equals(PluginConstant.JAR_FILE_PATH)) {
        jarPath=tv.getValue();
      }
    }
    if (validateJavaUDI(userJavaClassName,jarPath)) {
      File file=new File(jarPath);
      TalendURLClassLoader cl;
      cl=new TalendURLClassLoader(new URL[]{file.toURI().toURL()});
      Class<?> clazz=cl.findClass(userJavaClassName);
      if (clazz != null) {
        UserDefIndicator judi=(UserDefIndicator)clazz.newInstance();
        judi.setIndicatorDefinition(indicator.getIndicatorDefinition());
        if (indicator instanceof JavaUserDefIndicator) {
          ((JavaUserDefIndicator)indicator).setJavaUserDefObject(judi);
        }
 else {
          JavaUserDefIndicator judiTemplate=IndicatorSqlFactory.eINSTANCE.createJavaUserDefIndicator();
          judiTemplate.setJavaUserDefObject(judi);
          judiTemplate.setIndicatorDefinition(indicator.getIndicatorDefinition());
          judiTemplate.setAnalyzedElement(indicator.getAnalyzedElement());
          adaptedUDI=judiTemplate;
        }
      }
    }
  }
  return adaptedUDI;
}