Program: 65293
Project: 65293
Buggy source:
private void updateScriptContext(DesignElementHandle handle,String method){
  List args=DEUtil.getDesignElementMethodArgumentsInfo(handle,method);
  JSSyntaxContext context=scriptEditor.getContext();
  context.clear();
  for (Iterator iter=args.iterator(); iter.hasNext(); ) {
    IArgumentInfo element=(IArgumentInfo)iter.next();
    String name=element.getName();
    String type=element.getType();
    if (!context.setVariable(name,type)) {
      context.setVariable(name,element.getClassType());
    }
  }
  Object[] adapters=ElementAdapterManager.getAdapters(handle,IScriptContextProvider.class);
  updateExtensionScriptContext(adapters,context,method,null);
  if (handle instanceof ExtendedItemHandle) {
    ExtendedItemHandle exHandle=(ExtendedItemHandle)handle;
    List mtds=exHandle.getMethods(method);
    if (mtds != null && mtds.size() > 0) {
      for (int i=0; i < mtds.size(); i++) {
        IMethodInfo mi=(IMethodInfo)mtds.get(i);
        for (Iterator itr=mi.argumentListIterator(); itr.hasNext(); ) {
          IArgumentInfoList ailist=(IArgumentInfoList)itr.next();
          for (Iterator argItr=ailist.argumentsIterator(); argItr.hasNext(); ) {
            IArgumentInfo aiinfo=(IArgumentInfo)argItr.next();
            String argName=aiinfo.getName();
            IClassInfo ci=aiinfo.getClassType();
            if (argName == null || argName.length() == 0) {
              argName=convertToParameterName(ci.getName());
            }
            context.setVariable(argName,ci);
          }
        }
        if (mi.getName() != null) {
          updateExtensionScriptContext(adapters,context,method,mi.getName());
        }
      }
    }
  }
}

Fixed version (ground truth):
private void updateScriptContext(DesignElementHandle handle,String method){
  List args=DEUtil.getDesignElementMethodArgumentsInfo(handle,method);
  JSSyntaxContext context=scriptEditor.getContext();
  context.clear();
  for (Iterator iter=args.iterator(); iter.hasNext(); ) {
    IArgumentInfo element=(IArgumentInfo)iter.next();
    String name=element.getName();
    String type=element.getType();
    if (!context.setVariable(name,type)) {
      context.setVariable(name,element.getClassType());
    }
  }
  Object[] adapters=ElementAdapterManager.getAdapters(handle,IScriptContextProvider.class);
  updateExtensionScriptContext(adapters,context,method,null);
  if (handle instanceof ExtendedItemHandle) {
    ExtendedItemHandle exHandle=(ExtendedItemHandle)handle;
    List mtds=exHandle.getMethods(method);
    if (mtds != null && mtds.size() > 0) {
      for (int i=0; i < mtds.size(); i++) {
        IMethodInfo mi=(IMethodInfo)mtds.get(i);
        for (Iterator<IArgumentInfoList> itr=mi.argumentListIterator(); itr.hasNext(); ) {
          IArgumentInfoList ailist=itr.next();
          for (Iterator<IArgumentInfo> argItr=ailist.argumentsIterator(); argItr.hasNext(); ) {
            IArgumentInfo aiinfo=argItr.next();
            String argName=aiinfo.getName();
            IClassInfo ci=aiinfo.getClassType();
            if (argName == null || argName.length() == 0) {
              argName=convertToParameterName(ci.getName());
            }
            context.setVariable(argName,ci);
          }
        }
        if (mi.getName() != null) {
          updateExtensionScriptContext(adapters,context,method,mi.getName());
        }
      }
    }
  }
}