nus-yam/ex-repair huggingface dataset:
Program: 65380
Project: 65380
Buggy source:
public IDataSetResultSet loadDataSetData(IResultClass targetResultClass,IOrderedIntSet preFilteredRowIds,Map<String,StringTable> stringTableMap,Map index,boolean includeInnerID,Map appContext) throws DataException {
  if (!streamManager.hasInStream(DataEngineContext.DATASET_DATA_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE))   return null;
  if (targetResultClass == null)   targetResultClass=this.loadResultClass(includeInnerID);
  IDataSetReader reader=DataSetStore.createReader(streamManager,targetResultClass,appContext);
  if (reader != null)   return reader.load(preFilteredRowIds == null ? null : preFilteredRowIds);
  if (!streamManager.hasInStream(DataEngineContext.DATASET_DATA_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE))   return null;
  RAInputStream stream=streamManager.getInStream(DataEngineContext.DATASET_DATA_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  RAInputStream lensStream=null;
  if (version >= VersionManager.VERSION_2_2_1_3)   lensStream=streamManager.getInStream(DataEngineContext.DATASET_DATA_LEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  int adjustedVersion=resolveVersionConflict();
  return new DataSetResultSet(stream,lensStream,this.loadResultClass(),preFilteredRowIds,stringTableMap,index,adjustedVersion,includeInnerID);
}

Fixed version (ground truth):
public IDataSetResultSet loadDataSetData(IResultClass targetResultClass,IOrderedIntSet preFilteredRowIds,Map<String,StringTable> stringTableMap,Map index,boolean includeInnerID,Map appContext) throws DataException {
  if (targetResultClass == null)   targetResultClass=this.loadResultClass(includeInnerID);
  IDataSetReader reader=DataSetStore.createReader(streamManager,targetResultClass,appContext);
  if (reader != null)   return reader.load(preFilteredRowIds == null ? null : preFilteredRowIds);
  if (!streamManager.hasInStream(DataEngineContext.DATASET_DATA_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE))   return null;
  RAInputStream stream=streamManager.getInStream(DataEngineContext.DATASET_DATA_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  RAInputStream lensStream=null;
  if (version >= VersionManager.VERSION_2_2_1_3)   lensStream=streamManager.getInStream(DataEngineContext.DATASET_DATA_LEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.BASE_SCOPE);
  int adjustedVersion=resolveVersionConflict();
  return new DataSetResultSet(stream,lensStream,this.loadResultClass(),preFilteredRowIds,stringTableMap,index,adjustedVersion,includeInnerID);
}
Program: 65382
Project: 65382
Buggy source:
ControlPanel(DataChartsViewer dcv){
  this.dcv=dcv;
  setLayout(new GridLayout(0,1,0,0));
  JPanel jp=new JPanel();
  jp.setLayout(new FlowLayout(FlowLayout.LEFT,3,3));
  JLabel choose=new JLabel("String_Node_Str");
  choose.setDisplayedMnemonic('c');
  jp.add(choose);
  jcbModels=new JComboBox<String>();
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.setSelectedIndex(0);
  choose.setLabelFor(jcbModels);
  jp.add(jcbModels);
  jbUpdate=new JButton("String_Node_Str");
  jbUpdate.setMnemonic('u');
  jbUpdate.setToolTipText("String_Node_Str");
  jbUpdate.addActionListener(this);
  jp.add(jbUpdate);
  add(jp);
}

Fixed version (ground truth):
ControlPanel(DataChartsViewer dcv){
  this.dcv=dcv;
  setLayout(new GridLayout(0,1,0,0));
  JPanel jp=new JPanel();
  jp.setLayout(new FlowLayout(FlowLayout.LEFT,3,3));
  JLabel choose=new JLabel("String_Node_Str");
  choose.setDisplayedMnemonic('c');
  jp.add(choose);
  jcbModels=new JComboBox();
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.setSelectedIndex(0);
  choose.setLabelFor(jcbModels);
  jp.add(jcbModels);
  jbUpdate=new JButton("String_Node_Str");
  jbUpdate.setMnemonic('u');
  jbUpdate.setToolTipText("String_Node_Str");
  jbUpdate.addActionListener(this);
  jp.add(jbUpdate);
  add(jp);
}
Program: 65383
Project: 65383
Buggy source:
ControlPanel(SwingInteractivityViewer siv){
  this.siv=siv;
  setLayout(new GridLayout(0,1,0,0));
  JPanel jp=new JPanel();
  jp.setLayout(new FlowLayout(FlowLayout.LEFT,3,3));
  JLabel choose=new JLabel("String_Node_Str");
  choose.setDisplayedMnemonic('c');
  jp.add(choose);
  jcbModels=new JComboBox<String>();
  choose.setLabelFor(jcbModels);
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.setSelectedIndex(0);
  jp.add(jcbModels);
  jbUpdate=new JButton("String_Node_Str");
  jbUpdate.setMnemonic('u');
  jbUpdate.addActionListener(this);
  jbUpdate.setToolTipText("String_Node_Str");
  jp.add(jbUpdate);
  add(jp);
}

Fixed version (ground truth):
ControlPanel(SwingInteractivityViewer siv){
  this.siv=siv;
  setLayout(new GridLayout(0,1,0,0));
  JPanel jp=new JPanel();
  jp.setLayout(new FlowLayout(FlowLayout.LEFT,3,3));
  JLabel choose=new JLabel("String_Node_Str");
  choose.setDisplayedMnemonic('c');
  jp.add(choose);
  jcbModels=new JComboBox();
  choose.setLabelFor(jcbModels);
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.addItem("String_Node_Str");
  jcbModels.setSelectedIndex(0);
  jp.add(jcbModels);
  jbUpdate=new JButton("String_Node_Str");
  jbUpdate.setMnemonic('u');
  jbUpdate.addActionListener(this);
  jbUpdate.setToolTipText("String_Node_Str");
  jp.add(jbUpdate);
  add(jp);
}
Program: 65384
Project: 65384
Buggy source:
protected void setUp() throws Exception {
  super.setUp();
  ThreadResources.setLocale(ULocale.ENGLISH);
  MetaDataDictionary.reset();
  try {
    MetaDataReader.read(ReportDesign.class.getResourceAsStream(ROM_DEF_NAME));
  }
 catch (  MetaDataParserException e) {
    super.fail();
  }
}

Fixed version (ground truth):
protected void setUp() throws Exception {
  super.setUp();
  ThreadResources.setLocale(ULocale.ENGLISH);
}
Program: 65385
Project: 65385
Buggy source:
public void test_regression_76874() throws DesignFileException, SemanticException {
  openDesign(filename);
  LabelHandle label=(LabelHandle)designHandle.findElement("String_Node_Str");
  label.setProperty(Style.FONT_SIZE_PROP,"String_Node_Str");
  assertEquals("String_Node_Str",label.getProperty(Style.FONT_SIZE_PROP));
}

Fixed version (ground truth):
public void test_regression_76874() throws DesignFileException, SemanticException {
  openDesign(filename);
  LabelHandle label=(LabelHandle)designHandle.findElement("String_Node_Str");
  label.setProperty(Style.FONT_SIZE_PROP,"String_Node_Str");
  assertEquals("String_Node_Str",label.getProperty(Style.FONT_SIZE_PROP).toString());
}
Program: 65386
Project: 65386
Buggy source:
public void makeUniqueName(int namespaceId,DesignElement element){
  if (element == null)   return;
  String name=getUniqueName(namespaceId,element);
  if (name == null)   return;
  NameSpace nameSpace=getCachedNameSpace(namespaceId);
  String validName=name;
  if (element instanceof StyleElement)   validName=validName.toLowerCase();
  DesignElement cachedElement=nameSpace.getElement(validName);
  if (cachedElement == null) {
    element.setName(name.trim());
    nameSpace.insert(element);
  }
}

Fixed version (ground truth):
public void makeUniqueName(int namespaceId,DesignElement element,String prefix){
  if (element == null)   return;
  String name=getUniqueName(namespaceId,element,prefix);
  if (name == null)   return;
  NameSpace nameSpace=getCachedNameSpace(namespaceId);
  String validName=name;
  if (element instanceof StyleElement)   validName=validName.toLowerCase();
  DesignElement cachedElement=nameSpace.getElement(validName);
  if (cachedElement == null) {
    element.setName(name.trim());
    nameSpace.insert(element);
  }
}
Program: 65387
Project: 65387
Buggy source:
public void makeUniqueName(int namespaceId,DesignElement element);

Fixed version (ground truth):
/** 
 * make the unique name of element with the given name prefix
 * @param namespaceId the name space id
 * @param element the design element.
 * @param prefix the name prefix
 */
public void makeUniqueName(int namespaceId,DesignElement element,String prefix);
Program: 65388
Project: 65388
Buggy source:
public void makeUniqueName(String prefix){
  if (focus instanceof GroupElement) {
    makeUniqueGroupName((GroupElement)focus,prefix);
    return;
  }
  if (nameHelper != null) {
    nameHelper.makeUniqueName(namespaceId,focus);
  }
}

Fixed version (ground truth):
public void makeUniqueName(String prefix){
  if (focus instanceof GroupElement) {
    makeUniqueGroupName((GroupElement)focus,prefix);
    return;
  }
  if (nameHelper != null) {
    nameHelper.makeUniqueName(namespaceId,focus,prefix);
  }
}
Program: 65389
Project: 65389
Buggy source:
public void makeUniqueName(int namespaceId,DesignElement element){
  if (element == null)   return;
  String name=getUniqueName(namespaceId,element);
  if (name == null)   return;
  NameSpace nameSpace=getCachedNameSpace(namespaceId);
  String validName=name;
  if (element instanceof StyleElement)   validName=validName.toLowerCase();
  DesignElement cachedElement=nameSpace.getElement(validName);
  if (cachedElement == null) {
    element.setName(name.trim());
    nameSpace.insert(element);
  }
}

Fixed version (ground truth):
public void makeUniqueName(int namespaceId,DesignElement element,String prefix){
  if (element == null)   return;
  String name=getUniqueName(namespaceId,element,prefix);
  if (name == null)   return;
  NameSpace nameSpace=getCachedNameSpace(namespaceId);
  String validName=name;
  if (element instanceof StyleElement)   validName=validName.toLowerCase();
  DesignElement cachedElement=nameSpace.getElement(validName);
  if (cachedElement == null) {
    element.setName(name.trim());
    nameSpace.insert(element);
  }
}
Program: 65390
Project: 65390
Buggy source:
public void makeUniqueName(String prefix){
  if (focus instanceof GroupElement) {
    makeUniqueGroupName((GroupElement)focus,prefix);
    return;
  }
  if (nameHelper != null) {
    nameHelper.makeUniqueName(namespaceId,focus);
  }
}

Fixed version (ground truth):
public void makeUniqueName(String prefix){
  if (focus instanceof GroupElement) {
    makeUniqueGroupName((GroupElement)focus,prefix);
    return;
  }
  if (nameHelper != null) {
    nameHelper.makeUniqueName(namespaceId,focus,prefix);
  }
}
Program: 65392
Project: 65392
Buggy source:
/** 
 * @param dataExpr
 * @param cx
 * @param isRow true:row["xxx"]; false:dataSetRow["xxx"]
 * @return
 * @throws BirtException
 */
private String extractDirectColumn(IBaseExpression dataExpr,ScriptContext cx,boolean isRow) throws BirtException {
  if (dataExpr instanceof IScriptExpression) {
    String exprText=((IScriptExpression)dataExpr).getText();
    if (isRow) {
      return exprHelper.getColumnBindingName(exprText);
    }
 else {
      return exprHelper.getColumnName(exprText);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param dataExpr
 * @param cx
 * @param isRow true:row["xxx"]; false:dataSetRow["xxx"]
 * @return
 * @throws BirtException
 */
private String extractDirectColumn(IBaseExpression dataExpr,ScriptContext cx,boolean isRow) throws BirtException {
  if (dataExpr instanceof IScriptExpression && !BaseExpression.constantId.equals(dataExpr.getScriptId())) {
    String exprText=((IScriptExpression)dataExpr).getText();
    if (isRow) {
      return exprHelper.getColumnBindingName(exprText);
    }
 else {
      return exprHelper.getColumnName(exprText);
    }
  }
  return null;
}
Program: 65393
Project: 65393
Buggy source:
/** 
 * Check whether there is columnReferenceExpression in aggregation. If so, return true. else return false;
 * @return
 */
public static boolean hasAggregationInExpr(IBaseExpression expression){
  if (expression == null)   return false;
  if (expression instanceof IScriptExpression) {
    String text=((IScriptExpression)expression).getText();
    return ExpressionUtil.hasAggregation(text);
  }
 else   if (expression instanceof IConditionalExpression) {
    return hasAggregationInExpr(((IConditionalExpression)expression).getExpression()) || hasAggregationInExpr(((IConditionalExpression)expression).getOperand1()) || hasAggregationInExpr(((IConditionalExpression)expression).getOperand2());
  }
 else   if (expression instanceof IExpressionCollection) {
    Object[] text=((IExpressionCollection)expression).getExpressions().toArray();
    for (int i=0; i < text.length; i++) {
      if (hasAggregationInExpr((IBaseExpression)text[i]))       return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Check whether there is columnReferenceExpression in aggregation. If so, return true. else return false;
 * @return
 */
public static boolean hasAggregationInExpr(IBaseExpression expression){
  if (expression == null || BaseExpression.constantId.equals(expression.getScriptId()))   return false;
  if (expression instanceof IScriptExpression) {
    String text=((IScriptExpression)expression).getText();
    return ExpressionUtil.hasAggregation(text);
  }
 else   if (expression instanceof IConditionalExpression) {
    return hasAggregationInExpr(((IConditionalExpression)expression).getExpression()) || hasAggregationInExpr(((IConditionalExpression)expression).getOperand1()) || hasAggregationInExpr(((IConditionalExpression)expression).getOperand2());
  }
 else   if (expression instanceof IExpressionCollection) {
    Object[] text=((IExpressionCollection)expression).getExpressions().toArray();
    for (int i=0; i < text.length; i++) {
      if (hasAggregationInExpr((IBaseExpression)text[i]))       return true;
    }
  }
  return false;
}
Program: 65394
Project: 65394
Buggy source:
/** 
 * Check whether filter in query contains aggregation. If aggregation is TOPN,BOTTOMN,TOPPERCENT,BOTTMEPERCENT return true. else return false;
 * @return
 * @throws DataException 
 */
public static boolean isValidExpressionInQueryFilter(IBaseExpression expression,ScriptContext context) throws DataException {
  if (expression instanceof IScriptExpression) {
    String text=((IScriptExpression)expression).getText();
    if (text == null || text.trim().length() == 0)     return true;
    AggregateRegistry aggrReg=new AggregateRegistry(){
      public int register(      AggregateExpression aggregationExpr){
        return -1;
      }
    }
;
    ExpressionCompiler expressionCompiler=new ExpressionCompiler();
    CompiledExpression expr=expressionCompiler.compile(text,aggrReg,context);
    return flattenFilterExpression(expr);
  }
 else   if (expression instanceof IConditionalExpression) {
    IScriptExpression expr=((IConditionalExpression)expression).getExpression();
    IBaseExpression oprand1=((IConditionalExpression)expression).getOperand1();
    IBaseExpression oprand2=((IConditionalExpression)expression).getOperand2();
    return isValidExpressionInQueryFilter(expr,context) && isValidExpressionInQueryFilter(oprand1,context) && isValidExpressionInQueryFilter(oprand2,context);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Check whether filter in query contains aggregation. If aggregation is TOPN,BOTTOMN,TOPPERCENT,BOTTMEPERCENT return true. else return false;
 * @return
 * @throws DataException 
 */
public static boolean isValidExpressionInQueryFilter(IBaseExpression expression,ScriptContext context) throws DataException {
  if (expression instanceof IScriptExpression) {
    String text=((IScriptExpression)expression).getText();
    if (text == null || text.trim().length() == 0 || BaseExpression.constantId.equals(expression.getScriptId()))     return true;
    AggregateRegistry aggrReg=new AggregateRegistry(){
      public int register(      AggregateExpression aggregationExpr){
        return -1;
      }
    }
;
    ExpressionCompiler expressionCompiler=new ExpressionCompiler();
    CompiledExpression expr=expressionCompiler.compile(text,aggrReg,context);
    return flattenFilterExpression(expr);
  }
 else   if (expression instanceof IConditionalExpression) {
    IScriptExpression expr=((IConditionalExpression)expression).getExpression();
    IBaseExpression oprand1=((IConditionalExpression)expression).getOperand1();
    IBaseExpression oprand2=((IConditionalExpression)expression).getOperand2();
    return isValidExpressionInQueryFilter(expr,context) && isValidExpressionInQueryFilter(oprand1,context) && isValidExpressionInQueryFilter(oprand2,context);
  }
  return true;
}
Program: 65395
Project: 65395
Buggy source:
/** 
 * @param list
 * @param expression
 * @throws DataException
 */
private static void populateColumnList(List list,IBaseExpression expression,String indicator) throws DataException {
  if (expression != null) {
    List l=new ArrayList();
    try {
      if (expression instanceof IScriptExpression)       l=ExpressionUtil.extractColumnExpressions(((IScriptExpression)expression).getText(),indicator);
    }
 catch (    BirtException e) {
      throw DataException.wrap(e);
    }
    for (int i=0; i < l.size(); i++) {
      IColumnBinding cb=(IColumnBinding)l.get(i);
      if (!list.contains(cb.getResultSetColumnName()) && cb.getOuterLevel() == 0)       list.add(cb.getResultSetColumnName());
    }
  }
}

Fixed version (ground truth):
/** 
 * @param list
 * @param expression
 * @throws DataException
 */
private static void populateColumnList(List list,IBaseExpression expression,String indicator) throws DataException {
  if (expression != null) {
    List l=new ArrayList();
    try {
      if (expression instanceof IScriptExpression && !(BaseExpression.constantId.equals(expression.getScriptId())))       l=ExpressionUtil.extractColumnExpressions(((IScriptExpression)expression).getText(),indicator);
    }
 catch (    BirtException e) {
      throw DataException.wrap(e);
    }
    for (int i=0; i < l.size(); i++) {
      IColumnBinding cb=(IColumnBinding)l.get(i);
      if (!list.contains(cb.getResultSetColumnName()) && cb.getOuterLevel() == 0)       list.add(cb.getResultSetColumnName());
    }
  }
}
Program: 65396
Project: 65396
Buggy source:
/** 
 * To create all the rational measures for CubeQueryDefinition according to the expression
 * @param queryDefn, expression
 * @return List
 * @throws DataException 
 */
private static List createRelationalMeasures(ICubeQueryDefinition queryDefn,IBaseExpression expression,ScriptContext cx) throws DataException {
  List measures=new ArrayList();
  List exprTextList=getExprTextList(expression);
  for (int i=0; i < exprTextList.size(); i++) {
    String exprText=(String)exprTextList.get(i);
    String measureName=OlapExpressionCompiler.getReferencedScriptObject(exprText,ScriptConstants.MEASURE_SCRIPTABLE);
    if (measureName != null && measureName.trim().length() > 0) {
      List existMeasures=queryDefn.getMeasures();
      boolean exist=false;
      for (int j=0; j < existMeasures.size(); j++) {
        if (((IMeasureDefinition)existMeasures.get(j)).getName().equals(measureName)) {
          exist=true;
          break;
        }
      }
      if (!exist) {
        measures.add(queryDefn.createMeasure(measureName));
      }
    }
  }
  return measures;
}

Fixed version (ground truth):
/** 
 * To create all the rational measures for CubeQueryDefinition according to the expression
 * @param queryDefn, expression
 * @return List
 * @throws DataException 
 */
private static List createRelationalMeasures(ICubeQueryDefinition queryDefn,IBaseExpression expression,ScriptContext cx) throws DataException {
  List<IMeasureDefinition> measures=new ArrayList<IMeasureDefinition>();
  List<IScriptExpression> exprTextList=getExprTextList(expression);
  for (int i=0; i < exprTextList.size(); i++) {
    IScriptExpression exprText=(IScriptExpression)exprTextList.get(i);
    String measureName=OlapExpressionCompiler.getReferencedScriptObject(exprText,ScriptConstants.MEASURE_SCRIPTABLE);
    if (measureName != null && measureName.trim().length() > 0) {
      List existMeasures=queryDefn.getMeasures();
      boolean exist=false;
      for (int j=0; j < existMeasures.size(); j++) {
        if (((IMeasureDefinition)existMeasures.get(j)).getName().equals(measureName)) {
          exist=true;
          break;
        }
      }
      if (!exist) {
        measures.add(queryDefn.createMeasure(measureName));
      }
    }
  }
  return measures;
}
Program: 65397
Project: 65397
Buggy source:
/** 
 * To get all the sub expressions' text list of the given expression
 * @param queryDefn, expression
 * @return List
 */
private static List getExprTextList(IBaseExpression expression){
  List textList=new ArrayList();
  if (expression instanceof IScriptExpression) {
    textList.add(((IScriptExpression)expression).getText());
  }
 else   if (expression instanceof IExpressionCollection) {
    List exprList=(List)((IExpressionCollection)expression).getExpressions();
    for (int i=0; i < exprList.size(); i++) {
      IBaseExpression baseExpr=(IBaseExpression)exprList.get(i);
      textList.addAll(getExprTextList(baseExpr));
    }
  }
 else   if (expression instanceof IConditionalExpression) {
    textList.add(((IScriptExpression)((IConditionalExpression)expression).getExpression()).getText());
    textList.addAll(getExprTextList(((IConditionalExpression)expression).getOperand1()));
    textList.addAll(getExprTextList(((IConditionalExpression)expression).getOperand2()));
  }
  return textList;
}

Fixed version (ground truth):
/** 
 * To get all the sub expressions' text list of the given expression
 * @param queryDefn, expression
 * @return List
 */
private static List<IScriptExpression> getExprTextList(IBaseExpression expression){
  List<IScriptExpression> textList=new ArrayList<IScriptExpression>();
  if (expression instanceof IScriptExpression) {
    textList.add((IScriptExpression)expression);
  }
 else   if (expression instanceof IExpressionCollection) {
    List exprList=(List)((IExpressionCollection)expression).getExpressions();
    for (int i=0; i < exprList.size(); i++) {
      IBaseExpression baseExpr=(IBaseExpression)exprList.get(i);
      textList.addAll(getExprTextList(baseExpr));
    }
  }
 else   if (expression instanceof IConditionalExpression) {
    textList.add(((IScriptExpression)((IConditionalExpression)expression).getExpression()));
    textList.addAll(getExprTextList(((IConditionalExpression)expression).getOperand1()));
    textList.addAll(getExprTextList(((IConditionalExpression)expression).getOperand2()));
  }
  return textList;
}
Program: 65398
Project: 65398
Buggy source:
/** 
 * @param expr
 * @param objectName
 * @return
 */
public static String getReferencedScriptObject(String expr,String objectName){
  if (expr == null)   return null;
  try {
    Context cx=Context.enter();
    CompilerEnvirons ce=new CompilerEnvirons();
    Parser p=new Parser(ce,cx.getErrorReporter());
    ScriptOrFnNode tree=p.parse(expr,null,0);
    return getScriptObjectName(tree,objectName);
  }
  finally {
    Context.exit();
  }
}

Fixed version (ground truth):
/** 
 * @param expr
 * @param objectName
 * @return
 */
public static String getReferencedScriptObject(String expr,String objectName){
  if (expr == null)   return null;
  try {
    Context cx=Context.enter();
    CompilerEnvirons ce=new CompilerEnvirons();
    Parser p=new Parser(ce,cx.getErrorReporter());
    ScriptOrFnNode tree=p.parse(expr,null,0);
    return getScriptObjectName(tree,objectName);
  }
 catch (  Exception ex) {
    return null;
  }
 finally {
    Context.exit();
  }
}
Program: 65399
Project: 65399
Buggy source:
/** 
 * @param expr
 * @param bindings
 * @param onlyFromDirectReferenceExpr
 * @return
 * @throws DataException
 */
private static Set getReferencedDimLevel(IScriptExpression expr,List bindings,boolean onlyFromDirectReferenceExpr) throws DataException {
  if (expr == null || expr.getText() == null || expr.getText().length() == 0)   return new HashSet();
  try {
    Set result=new HashSet();
    Context cx=Context.enter();
    CompilerEnvirons ce=new CompilerEnvirons();
    Parser p=new Parser(ce,cx.getErrorReporter());
    ScriptOrFnNode tree=p.parse(expr.getText(),null,0);
    populateDimLevels(null,tree,result,bindings,onlyFromDirectReferenceExpr);
    return result;
  }
  finally {
    Context.exit();
  }
}

Fixed version (ground truth):
/** 
 * @param expr
 * @param bindings
 * @param onlyFromDirectReferenceExpr
 * @return
 * @throws DataException
 */
private static Set getReferencedDimLevel(IScriptExpression expr,List bindings,boolean onlyFromDirectReferenceExpr) throws DataException {
  if (expr == null || expr.getText() == null || expr.getText().length() == 0 || BaseExpression.constantId.equals(expr.getScriptId()))   return new HashSet();
  try {
    Set result=new HashSet();
    Context cx=Context.enter();
    CompilerEnvirons ce=new CompilerEnvirons();
    Parser p=new Parser(ce,cx.getErrorReporter());
    ScriptOrFnNode tree=p.parse(expr.getText(),null,0);
    populateDimLevels(null,tree,result,bindings,onlyFromDirectReferenceExpr);
    return result;
  }
  finally {
    Context.exit();
  }
}
Program: 65401
Project: 65401
Buggy source:
/** 
 * @param expr
 * @param objectName
 * @return
 */
public static Set<String> getReferencedMeasure(String expr){
  if (expr == null)   return Collections.EMPTY_SET;
  try {
    Set<String> result=new LinkedHashSet<String>();
    Context cx=Context.enter();
    CompilerEnvirons ce=new CompilerEnvirons();
    Parser p=new Parser(ce,cx.getErrorReporter());
    ScriptOrFnNode tree=p.parse(expr,null,0);
    getScriptObjectName(tree,"String_Node_Str",result);
    return result;
  }
  finally {
    Context.exit();
  }
}

Fixed version (ground truth):
/** 
 * @param expr
 * @param objectName
 * @return
 */
public static Set<String> getReferencedMeasure(String expr){
  if (expr == null)   return Collections.EMPTY_SET;
  try {
    Set<String> result=new LinkedHashSet<String>();
    Context cx=Context.enter();
    CompilerEnvirons ce=new CompilerEnvirons();
    Parser p=new Parser(ce,cx.getErrorReporter());
    ScriptOrFnNode tree=p.parse(expr,null,0);
    getScriptObjectName(tree,"String_Node_Str",result);
    return result;
  }
 catch (  Exception e) {
    return Collections.EMPTY_SET;
  }
 finally {
    Context.exit();
  }
}
Program: 65402
Project: 65402
Buggy source:
/** 
 * @param expr
 * @param bindings
 * @param onlyFromDirectReferenceExpr
 * @return
 * @throws DataException
 */
public static Set<IDimLevel> getReferencedDimLevel(String expr) throws CoreException {
  if (expr == null)   return new HashSet<IDimLevel>();
  try {
    Set<IDimLevel> result=new HashSet<IDimLevel>();
    Context cx=Context.enter();
    CompilerEnvirons ce=new CompilerEnvirons();
    Parser p=new Parser(ce,cx.getErrorReporter());
    ScriptOrFnNode tree=p.parse(expr,null,0);
    populateDimLevels(null,tree,result);
    return result;
  }
  finally {
    Context.exit();
  }
}

Fixed version (ground truth):
/** 
 * @param expr
 * @param bindings
 * @param onlyFromDirectReferenceExpr
 * @return
 * @throws DataException
 */
public static Set<IDimLevel> getReferencedDimLevel(String expr) throws CoreException {
  if (expr == null)   return new HashSet<IDimLevel>();
  try {
    Set<IDimLevel> result=new HashSet<IDimLevel>();
    Context cx=Context.enter();
    CompilerEnvirons ce=new CompilerEnvirons();
    Parser p=new Parser(ce,cx.getErrorReporter());
    ScriptOrFnNode tree=p.parse(expr,null,0);
    populateDimLevels(null,tree,result);
    return result;
  }
 catch (  Exception e) {
    return Collections.EMPTY_SET;
  }
 finally {
    Context.exit();
  }
}
Program: 65403
Project: 65403
Buggy source:
/** 
 * @param expr
 * @return
 * @throws DataException
 */
private static Set<String> getBindingNamesFromScriptExpr(IScriptExpression expr) throws DataException {
  try {
    List<IColumnBinding> referedList=ExpressionUtil.extractColumnExpressions(expr.getText());
    Set<String> newList=new HashSet<String>();
    for (int j=0; j < referedList.size(); j++) {
      IColumnBinding binding=referedList.get(j);
      String name=binding.getResultSetColumnName();
      newList.add(name);
    }
    return newList;
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
/** 
 * @param expr
 * @return
 * @throws DataException
 */
private static Set<String> getBindingNamesFromScriptExpr(IScriptExpression expr) throws DataException {
  if (BaseExpression.constantId.equals(expr.getScriptId()))   return Collections.EMPTY_SET;
  try {
    List<IColumnBinding> referedList=ExpressionUtil.extractColumnExpressions(expr.getText());
    Set<String> newList=new HashSet<String>();
    for (int j=0; j < referedList.size(); j++) {
      IColumnBinding binding=referedList.get(j);
      String name=binding.getResultSetColumnName();
      newList.add(name);
    }
    return newList;
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 65404
Project: 65404
Buggy source:
/** 
 * @param expr
 * @return
 * @throws BirtException
 * @throws DataException
 */
private boolean hasRowNumRefExpr(IScriptExpression expr) throws DataException {
  try {
    if (expr == null || expr.getText() == null)     return false;
    if (expr.getText().matches("String_Node_Str"))     return true;
    return findRowNumReferenceInBindings(ExpressionUtil.extractColumnExpressions(expr.getText()));
  }
 catch (  BirtException e) {
    throw new DataException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * @param expr
 * @return
 * @throws BirtException
 * @throws DataException
 */
private boolean hasRowNumRefExpr(IScriptExpression expr) throws DataException {
  try {
    if (expr == null || expr.getText() == null || BaseExpression.constantId.equals(expr.getScriptId()))     return false;
    if (expr.getText().matches("String_Node_Str"))     return true;
    return findRowNumReferenceInBindings(ExpressionUtil.extractColumnExpressions(expr.getText()));
  }
 catch (  BirtException e) {
    throw new DataException(e.getLocalizedMessage());
  }
}
Program: 65405
Project: 65405
Buggy source:
@Override public void close() throws IOException {
  RAFolderOutputStream outputStream=null;
  DataOutputStream data=null;
  try {
    File file=new File(folderName + "String_Node_Str" + METEDATA);
    outputStream=new RAFolderOutputStream(null,file);
    data=new DataOutputStream(outputStream);
    IOUtil.writeMap(data,this.properties);
  }
  finally {
    if (data != null) {
      data.close();
    }
    if (outputStream != null) {
      outputStream.close();
    }
  }
  IOException exception=null;
synchronized (outputStreams) {
    ArrayList<RAFolderOutputStream> outputs=new ArrayList<RAFolderOutputStream>(outputStreams);
    for (    RAFolderOutputStream output : outputs) {
      try {
        output.close();
      }
 catch (      IOException ex) {
        logger.log(Level.SEVERE,ex.getMessage(),ex);
        if (exception != null) {
          exception=ex;
        }
      }
    }
    outputStreams.clear();
  }
synchronized (inputStreams) {
    ArrayList<RAFolderInputStream> inputs=new ArrayList<RAFolderInputStream>(inputStreams);
    for (    RAFolderInputStream input : inputs) {
      try {
        input.close();
      }
 catch (      IOException ex) {
        logger.log(Level.SEVERE,ex.getMessage(),ex);
        if (exception != null) {
          exception=ex;
        }
      }
    }
    inputStreams.clear();
  }
  if (exception != null) {
    throw exception;
  }
}

Fixed version (ground truth):
public void close() throws IOException {
  RAFolderOutputStream outputStream=null;
  DataOutputStream data=null;
  try {
    File file=new File(folderName + "String_Node_Str" + METEDATA);
    outputStream=new RAFolderOutputStream(null,file);
    data=new DataOutputStream(outputStream);
    IOUtil.writeMap(data,this.properties);
  }
  finally {
    if (data != null) {
      data.close();
    }
    if (outputStream != null) {
      outputStream.close();
    }
  }
  IOException exception=null;
synchronized (outputStreams) {
    ArrayList<RAFolderOutputStream> outputs=new ArrayList<RAFolderOutputStream>(outputStreams);
    for (    RAFolderOutputStream output : outputs) {
      try {
        output.close();
      }
 catch (      IOException ex) {
        logger.log(Level.SEVERE,ex.getMessage(),ex);
        if (exception != null) {
          exception=ex;
        }
      }
    }
    outputStreams.clear();
  }
synchronized (inputStreams) {
    ArrayList<RAFolderInputStream> inputs=new ArrayList<RAFolderInputStream>(inputStreams);
    for (    RAFolderInputStream input : inputs) {
      try {
        input.close();
      }
 catch (      IOException ex) {
        logger.log(Level.SEVERE,ex.getMessage(),ex);
        if (exception != null) {
          exception=ex;
        }
      }
    }
    inputStreams.clear();
  }
  if (exception != null) {
    throw exception;
  }
}
Program: 65407
Project: 65407
Buggy source:
private void virifyClassName(){
  String name=txtPojoDataSetClass.getText().trim();
  setMessage(Messages.getString("String_Node_Str"));
  if (name.isEmpty()) {
    setMessage(Messages.getString("String_Node_Str"),ERROR);
    setPageComplete(false);
  }
  setPageComplete(true);
}

Fixed version (ground truth):
private void virifyClassName(){
  String name=txtPojoDataSetClass.getText().trim();
  setMessage(Messages.getString("String_Node_Str"));
  if (name.trim().length() == 0) {
    setMessage(Messages.getString("String_Node_Str"),ERROR);
    setPageComplete(false);
  }
  setPageComplete(true);
}
Program: 65409
Project: 65409
Buggy source:
private boolean updateHideRule(DesignElementHandle element,String format,boolean checked,Expression expression) throws Exception {
  if (checked) {
    HideRuleHandle hideHandle=getHideRuleHandle(element,format);
    if (hideHandle == null) {
      try {
        createHideRuleHandle(element,format,expression);
      }
 catch (      SemanticException e) {
        ExceptionUtil.handle(e);
      }
    }
 else {
      hideHandle.setExpressionProperty(HideRule.VALUE_EXPR_MEMBER,expression);
    }
  }
 else {
    Iterator visibilities=visibilityRulesIterator(element);
    if (visibilities == null) {
      return true;
    }
    while (visibilities.hasNext()) {
      HideRuleHandle handle=(HideRuleHandle)visibilities.next();
      if (format.equalsIgnoreCase(handle.getFormat())) {
        try {
          getVisibilityPropertyHandle(element).removeItem(handle.getStructure());
        }
 catch (        PropertyValueException e) {
          ExceptionUtil.handle(e);
        }
        return true;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean updateHideRule(DesignElementHandle element,String format,boolean checked,Expression expression) throws Exception {
  if (checked) {
    HideRuleHandle hideHandle=getHideRuleHandle(element,format);
    if (hideHandle == null) {
      try {
        createHideRuleHandle(element,format,expression);
      }
 catch (      SemanticException e) {
        ExceptionUtil.handle(e);
      }
    }
 else {
      hideHandle.setExpressionProperty(HideRule.VALUE_EXPR_MEMBER,expression);
    }
  }
 else {
    Iterator visibilities=visibilityRulesIterator(element);
    if (visibilities == null) {
      return true;
    }
    while (visibilities.hasNext()) {
      HideRuleHandle handle=(HideRuleHandle)visibilities.next();
      if (format.equalsIgnoreCase(handle.getFormat())) {
        try {
          if (DEUtil.getMultiSelectionHandle((List)input).isExtendedElements()) {
            PropertyHandle propertyHandle=getVisibilityPropertyHandle(element);
            propertyHandle.getItems().clear();
          }
 else {
            getVisibilityPropertyHandle(element).removeItem(handle.getStructure());
          }
        }
 catch (        PropertyValueException e) {
          ExceptionUtil.handle(e);
        }
        return true;
      }
    }
  }
  return true;
}
Program: 65410
Project: 65410
Buggy source:
/** 
 * @return
 */
public static long computeMemoryBufferSize(Map appContext){
  if (true)   return 128 * 1024 * 1024;
  if (appContext == null)   return 0;
  if (appContext.get(TEST_MEM_BUFFER_SIZE) != null) {
    return populateMemBufferSize(appContext.get(TEST_MEM_BUFFER_SIZE));
  }
  return populateMemBufferSize(appContext.get(DataEngine.MEMORY_BUFFER_SIZE)) * 1024 * 1024;
}

Fixed version (ground truth):
/** 
 * @return
 */
public static long computeMemoryBufferSize(Map appContext){
  if (appContext == null)   return 0;
  if (appContext.get(TEST_MEM_BUFFER_SIZE) != null) {
    return populateMemBufferSize(appContext.get(TEST_MEM_BUFFER_SIZE));
  }
  return populateMemBufferSize(appContext.get(DataEngine.MEMORY_BUFFER_SIZE)) * 1024 * 1024;
}
Program: 65411
Project: 65411
Buggy source:
@Override public int canDrop(Object transfer,Object target,int operation,DNDLocation location){
  int result=DNDService.LOGIC_UNKNOW;
  if (transfer.equals(DesignerPaletteFactory.TIMEPERIOD_TEMPLATE) && target instanceof TableCellEditPart) {
    CellHandle cellHandle=(CellHandle)((TableCellEditPart)target).getModel();
    if (DEUtil.getBindingHolder(cellHandle) instanceof TableHandle) {
      TableHandle tableHandle=(TableHandle)(DEUtil.getBindingHolder(cellHandle));
      if (tableHandle.getLinkedDataModel() != null) {
        result=DNDService.LOGIC_TRUE;
      }
    }
  }
  return result;
}

Fixed version (ground truth):
public int canDrop(Object transfer,Object target,int operation,DNDLocation location){
  int result=DNDService.LOGIC_UNKNOW;
  if (transfer.equals(DesignerPaletteFactory.TIMEPERIOD_TEMPLATE) && target instanceof TableCellEditPart) {
    CellHandle cellHandle=(CellHandle)((TableCellEditPart)target).getModel();
    if (DEUtil.getBindingHolder(cellHandle) instanceof TableHandle) {
      result=DNDService.LOGIC_TRUE;
    }
  }
  return result;
}
Program: 65412
Project: 65412
Buggy source:
@Override public boolean performDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (target instanceof TableCellEditPart) {
    TableCellEditPart editPart=(TableCellEditPart)target;
    CommandStack stack=SessionHandleAdapter.getInstance().getCommandStack();
    if (DesignerPaletteFactory.TIMEPERIOD_TEMPLATE.equals(transfer)) {
      stack.startTrans("String_Node_Str");
    }
    DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(null);
    try {
      DesignElementHandle targetElement=null;
      if (target instanceof TableCellEditPart) {
        CellHandle cellHandle=(CellHandle)((TableCellEditPart)target).getModel();
        cellHandle.addElement(dataHandle,CellHandle.CONTENT_SLOT);
        targetElement=cellHandle;
      }
      DataColumnBindingDialog dialog=new DataColumnBindingDialog(true);
      dialog.setLinkedModelTimePeriod(true);
      dialog.setInput(dataHandle,null,targetElement);
      dialog.setAggreate(true);
      dialog.setTimePeriod(true);
      if (dialog.open() == Window.OK) {
        dataHandle.setResultSetColumn(dialog.getBindingColumn().getName());
        stack.commit();
      }
 else {
        stack.rollback();
      }
    }
 catch (    Exception e) {
      stack.rollback();
      ExceptionHandler.handle(e);
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean performDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (target instanceof TableCellEditPart) {
    TableCellEditPart editPart=(TableCellEditPart)target;
    CommandStack stack=SessionHandleAdapter.getInstance().getCommandStack();
    if (DesignerPaletteFactory.TIMEPERIOD_TEMPLATE.equals(transfer)) {
      stack.startTrans("String_Node_Str");
    }
    DataItemHandle dataHandle=DesignElementFactory.getInstance().newDataItem(null);
    try {
      DesignElementHandle targetElement=null;
      if (target instanceof TableCellEditPart) {
        CellHandle cellHandle=(CellHandle)((TableCellEditPart)target).getModel();
        cellHandle.addElement(dataHandle,CellHandle.CONTENT_SLOT);
        targetElement=cellHandle;
      }
      DataColumnBindingDialog dialog=new DataColumnBindingDialog(true);
      dialog.setLinkedModelTimePeriod(true);
      dialog.setInput(dataHandle,null,targetElement);
      dialog.setAggreate(true);
      dialog.setTimePeriod(true);
      if (dialog.open() == Window.OK) {
        dataHandle.setResultSetColumn(dialog.getBindingColumn().getName());
        stack.commit();
      }
 else {
        stack.rollback();
      }
    }
 catch (    Exception e) {
      stack.rollback();
      ExceptionHandler.handle(e);
    }
  }
  return true;
}
Program: 65413
Project: 65413
Buggy source:
protected boolean fromCache() throws DataException {
  if (queryDefn.isSummaryQuery() && queryDefn.getQueryExecutionHints().enablePushDown()) {
    if (querySpec != null && querySpec.getResultSetSpecification() != null && !querySpec.getResultSetSpecification().isEmpty()) {
      if (appContext.get(DataEngine.QUERY_EXECUTION_SESSION_ID) == null) {
        dataEngine.getSession().getDataSetCacheManager().clearCache(dataEngine.getDataSourceDesign(this.dataSet.getDesign().getDataSourceName()),this.dataSet.getDesign());
      }
    }
  }
  return super.fromCache();
}

Fixed version (ground truth):
protected boolean fromCache() throws DataException {
  if (queryDefn.getQueryExecutionHints().enablePushDown()) {
    if (querySpec != null && querySpec.getResultSetSpecification() != null && !querySpec.getResultSetSpecification().isEmpty()) {
      if (appContext.get(DataEngine.QUERY_EXECUTION_SESSION_ID) == null) {
        dataEngine.getSession().getDataSetCacheManager().clearCache(dataEngine.getDataSourceDesign(this.dataSet.getDesign().getDataSourceName()),this.dataSet.getDesign());
      }
    }
  }
  return super.fromCache();
}
Program: 65415
Project: 65415
Buggy source:
public void widgetSelected(SelectionEvent event){
  if (event.item.getData() instanceof DataSourceHandle) {
    dataSetTypeChooser.getCombo().setEnabled(true);
    if (parent == null || parent != ((TreeItem)event.item).getParentItem()) {
      parent=((TreeItem)event.item).getParentItem();
      doDataSourceSelectionChanged(parent.getData());
    }
    setPageComplete(!hasWizard() && (getMessageType() != ERROR));
  }
 else {
    dataSetTypeChooser.getCombo().clearSelection();
    dataSetTypeChooser.getCombo().setEnabled(false);
    setPageComplete(false);
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent event){
  if (event.item.getData() instanceof DataSourceHandle) {
    dataSetTypeChooser.getCombo().setEnabled(true);
    if (parent == null || parent != ((TreeItem)event.item).getParentItem()) {
      parent=((TreeItem)event.item).getParentItem();
      doDataSourceSelectionChanged(parent.getData());
    }
    setPageComplete(!hasWizard() && (getMessageType() != ERROR));
  }
 else {
    dataSetTypeChooser.getCombo().clearSelection();
    dataSetTypeChooser.getCombo().setEnabled(false);
    setPageComplete(false);
  }
  dataSourceFilteredTree.getViewer().getTree().setFocus();
}
Program: 65418
Project: 65418
Buggy source:
/** 
 * Constructs a Javascript expression
 * @param text Javascript expression text
 * @param dataType Return data type of the expression
 */
public ScriptExpression(String text,int dataType){
  super(dataType);
  this.exprText=text;
}

Fixed version (ground truth):
/** 
 * Constructs a script expression, it could be a Constant expression or javascript expression with tag of  BaseExpression.javaScriptId or BaseExpression.constantId.
 * @param text  expression text
 * @param dataType Return data type of the expression
 */
public ScriptExpression(String text,int dataType){
  super(dataType);
  this.exprText=text;
}
Program: 65419
Project: 65419
Buggy source:
/** 
 * Sets the Javascript expression text
 */
public void setText(String text){
  exprText=text;
}

Fixed version (ground truth):
/** 
 * Sets the expression text
 */
public void setText(String text){
  exprText=text;
}
Program: 65420
Project: 65420
Buggy source:
/** 
 * Utility method to create java script expression
 * @param expr
 * @return
 */
public static IScriptExpression createJavaScriptExpression(String jsExppression){
  ScriptExpression scriptExpression=new ScriptExpression(jsExppression);
  return scriptExpression;
}

Fixed version (ground truth):
/** 
 * Utility method to create java script expression
 * @param expr
 * @return
 */
public static IScriptExpression createJavaScriptExpression(String jsExppression){
  ScriptExpression scriptExpression=new ScriptExpression(jsExppression);
  scriptExpression.setScriptId(BaseExpression.javaScriptId);
  return scriptExpression;
}
Program: 65421
Project: 65421
Buggy source:
/** 
 * Utility method to create constant expression
 * @param expr
 * @return
 */
public static IScriptExpression createConstantExpression(String constantExpr){
  ScriptExpression scriptExpression=new ScriptExpression(JavascriptEvalUtil.transformToJsExpression(constantExpr));
  scriptExpression.setScriptId(BaseExpression.constantId);
  scriptExpression.setHandle(constantExpr);
  return scriptExpression;
}

Fixed version (ground truth):
/** 
 * Utility method to create constant expression
 * @param expr
 * @return
 */
public static IScriptExpression createConstantExpression(String constantExpr){
  ScriptExpression scriptExpression=new ScriptExpression(constantExpr);
  scriptExpression.setScriptId(BaseExpression.constantId);
  scriptExpression.setHandle(constantExpr);
  return scriptExpression;
}
Program: 65423
Project: 65423
Buggy source:
public ScriptExpression adaptExpression(Expression expr,ExpressionLocation el){
  if (expr == null)   return null;
  ScriptExpression jsExpr=null;
  if (ExpressionType.CONSTANT.equals(expr.getType())) {
    jsExpr=new ScriptExpression(JavascriptEvalUtil.transformToJsExpression(expr.getStringExpression()));
    jsExpr.setScriptId(BaseExpression.constantId);
    jsExpr.setHandle(expr.getExpression());
    return jsExpr;
  }
 else   if ("String_Node_Str".equals(expr.getType())) {
    return null;
  }
 else {
    if (expr.getStringExpression() == null)     return null;
    jsExpr=new ExpressionAdapter(expr,el);
  }
  return jsExpr;
}

Fixed version (ground truth):
public ScriptExpression adaptExpression(Expression expr,ExpressionLocation el){
  if (expr == null)   return null;
  ScriptExpression jsExpr=null;
  if (ExpressionType.CONSTANT.equals(expr.getType())) {
    jsExpr=new ScriptExpression(expr.getStringExpression());
    jsExpr.setScriptId(BaseExpression.constantId);
    jsExpr.setHandle(expr.getExpression());
    return jsExpr;
  }
 else   if ("String_Node_Str".equals(expr.getType())) {
    return null;
  }
 else {
    if (expr.getStringExpression() == null)     return null;
    jsExpr=new ExpressionAdapter(expr,el);
  }
  return jsExpr;
}
Program: 65424
Project: 65424
Buggy source:
private IScriptExpression adapterExpression(Expression expr){
  if (expr instanceof Expression.Script && "String_Node_Str".equals(((Expression.Script)expr).getLanguage())) {
    ScriptExpression scriptExpr=null;
    try {
      scriptExpr=getModelAdapter().adaptJSExpression(expr.getScriptText(),((Expression.Script)expr).getLanguage());
      return new ScriptExpression(scriptExpr.getText());
    }
 catch (    Exception ex) {
    }
  }
 else {
    if (expr.getType() == Expression.CONSTANT) {
      ScriptExpression jsExpr=new ScriptExpression(JavascriptEvalUtil.transformToJsExpression(expr.getScriptText()));
      jsExpr.setScriptId(BaseExpression.constantId);
      jsExpr.setHandle(expr.getScriptText());
      return jsExpr;
    }
  }
  return new ScriptExpression(expr.getScriptText());
}

Fixed version (ground truth):
private IScriptExpression adapterExpression(Expression expr){
  if (expr instanceof Expression.Script && "String_Node_Str".equals(((Expression.Script)expr).getLanguage())) {
    ScriptExpression scriptExpr=null;
    try {
      scriptExpr=getModelAdapter().adaptJSExpression(expr.getScriptText(),((Expression.Script)expr).getLanguage());
      return new ScriptExpression(scriptExpr.getText());
    }
 catch (    Exception ex) {
    }
  }
 else {
    if (expr.getType() == Expression.CONSTANT) {
      ScriptExpression jsExpr=new ScriptExpression(expr.getScriptText());
      jsExpr.setScriptId(BaseExpression.constantId);
      jsExpr.setHandle(expr.getScriptText());
      return jsExpr;
    }
  }
  return new ScriptExpression(expr.getScriptText());
}