nus-yam/ex-repair huggingface dataset:
Program: 17007
Project: 17007
Buggy source:
@Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
  TypeSpaceMgr mgr=TypeSpaceMgr.getInstance();
  try {
    TypeSpaceTracer.loadReloadEvent(mgr);
    mgr.reload(new EclipseTypeLoadMonitor(monitor),null);
  }
 catch (  Exception e) {
    DLTKCore.error(e.getMessage(),e);
  }
  return Status.OK_STATUS;
}

Fixed version (ground truth):
@Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
  TypeSpaceMgr mgr=TypeSpaceMgr.getInstance();
  try {
    TypeSpaceTracer.loadReloadEvent(mgr);
    if (m_project != null) {
      mgr.reloadGroup(new EclipseTypeLoadMonitor(monitor),m_project.getName(),null);
      m_project.build(IncrementalProjectBuilder.FULL_BUILD,new SubProgressMonitor(monitor,1));
    }
 else {
      mgr.reload(new EclipseTypeLoadMonitor(monitor),null);
    }
  }
 catch (  Exception e) {
    DLTKCore.error(e.getMessage(),e);
  }
  return Status.OK_STATUS;
}
Program: 17008
Project: 17008
Buggy source:
public IJstType resolve(String key,String[] args){
  List<ITypeResolver> resolverList=m_resolvers.get(key);
  if (resolverList == null) {
    return null;
  }
  for (int i=0; i < resolverList.size(); i++) {
    ITypeResolver resolver=resolverList.get(i);
    String typeName=resolver.resolve(args);
    if (typeName.contains("String_Node_Str")) {
      return null;
    }
    if (typeName.contains("String_Node_Str")) {
      return null;
    }
    try {
      final JsCommentMeta commentMeta=VjComment.parse("String_Node_Str" + typeName);
      ;
      final JsTypingMeta typingMeta=commentMeta.getTyping();
      IFindTypeSupport findSupport=new IFindTypeSupport(){
        @Override public char[] getOriginalSource(){
          return null;
        }
        @Override public ILineInfoProvider getLineInfoProvider(){
          return null;
        }
        @Override public ErrorReporter getErrorReporter(){
          return null;
        }
        @Override public IJstType getCurrentType(){
          return null;
        }
        @Override public IJstType findTypeByName(        String name){
          return null;
        }
      }
;
      ;
      ;
      return TranslateHelper.findType(findSupport,typingMeta,commentMeta);
    }
 catch (    ParseException e) {
      e.printStackTrace();
    }
  }
  return null;
}

Fixed version (ground truth):
public IJstType resolve(String key,String[] args){
  List<ITypeResolver> resolverList=m_resolvers.get(key);
  if (resolverList == null) {
    return null;
  }
  for (int i=0; i < resolverList.size(); i++) {
    ITypeResolver resolver=resolverList.get(i);
    String typeName=resolver.resolve(args);
    if (typeName.equals("String_Node_Str")) {
      return null;
    }
    if (typeName.contains("String_Node_Str")) {
      return null;
    }
    try {
      final JsCommentMeta commentMeta=VjComment.parse("String_Node_Str" + typeName);
      ;
      final JsTypingMeta typingMeta=commentMeta.getTyping();
      IFindTypeSupport findSupport=new IFindTypeSupport(){
        @Override public char[] getOriginalSource(){
          return null;
        }
        @Override public ILineInfoProvider getLineInfoProvider(){
          return null;
        }
        @Override public ErrorReporter getErrorReporter(){
          return null;
        }
        @Override public IJstType getCurrentType(){
          return null;
        }
        @Override public IJstType findTypeByName(        String name){
          return null;
        }
      }
;
      ;
      ;
      return TranslateHelper.findType(findSupport,typingMeta,commentMeta);
    }
 catch (    ParseException e) {
      e.printStackTrace();
    }
  }
  return null;
}
Program: 17010
Project: 17010
Buggy source:
@Before public void setUp(){
  expectProblems.clear();
  expectProblems.add(createNewProblem(TypeProbIds.IncompatibleTypesInEqualityOperator,13,0));
  expectProblems.add(createNewProblem(TypeProbIds.IncompatibleTypesInEqualityOperator,14,0));
  expectProblems.add(createNewProblem(TypeProbIds.IncompatibleTypesInEqualityOperator,27,0));
  expectProblems.add(createNewProblem(TypeProbIds.IncompatibleTypesInEqualityOperator,28,0));
  expectProblems.add(createNewProblem(TypeProbIds.IncompatibleTypesInEqualityOperator,36,0));
  expectProblems.add(createNewProblem(TypeProbIds.IncompatibleTypesInEqualityOperator,37,0));
}

Fixed version (ground truth):
@Before public void setUp(){
  expectProblems.clear();
}
Program: 17013
Project: 17013
Buggy source:
/** 
 * @param mie
 * @param mtdKey
 * @param class1
 */
private void constructType(MtdInvocationExpr mie,IExpr lhs,String mtdKey,Class<? extends IExpr> class1){
  TypeConstructorRegistry tcr=TypeConstructorRegistry.getInstance();
  if (tcr.hasResolver(mtdKey)) {
    List<IExpr> exprs=mie.getArgs();
    ITypeConstructContext constrCtx=new TypeConstructContext(mie,lhs,exprs,null,class1);
    tcr.resolve(mtdKey,constrCtx);
    if (constrCtx.getTypes().size() > 0) {
      setCurrentType(constrCtx.getTypes().get(0));
      setTypeConstructedDuringLink(true);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param mie
 * @param mtdKey
 * @param class1
 */
private void constructType(MtdInvocationExpr mie,IExpr lhs,String mtdKey,Class<? extends IExpr> class1){
  TypeConstructorRegistry tcr=TypeConstructorRegistry.getInstance();
  if (tcr.hasResolver(mtdKey)) {
    List<IExpr> exprs=mie.getArgs();
    ITypeConstructContext constrCtx=new TypeConstructContext(mie,lhs,exprs,null,class1,m_groupInfo.getGroupName());
    tcr.resolve(mtdKey,constrCtx);
    if (constrCtx.getTypes().size() > 0) {
      setCurrentType(constrCtx.getTypes().get(0));
      setTypeConstructedDuringLink(true);
    }
  }
}
Program: 17014
Project: 17014
Buggy source:
public TypeConstructContext(IExpr inputExpr,IExpr lhsExpr,List<IExpr> argsExprList,IJstCompletion jstCompletion,Class<? extends IExpr> class1){
  this.inputExpr=inputExpr;
  this.lhsExpr=lhsExpr;
  this.argsExprList=argsExprList;
  this.jstCompletion=jstCompletion;
  this.exprClass=class1;
  resolvedJstTypes=new ArrayList<IJstType>();
}

Fixed version (ground truth):
public TypeConstructContext(IExpr inputExpr,IExpr lhsExpr,List<IExpr> argsExprList,IJstCompletion jstCompletion,Class<? extends IExpr> class1,String groupName){
  this.inputExpr=inputExpr;
  this.lhsExpr=lhsExpr;
  this.argsExprList=argsExprList;
  this.jstCompletion=jstCompletion;
  this.exprClass=class1;
  resolvedJstTypes=new ArrayList<IJstType>();
  this.setGroupName(groupName);
}
Program: 17015
Project: 17015
Buggy source:
private List<IJstProperty> handleMixedType(JstMixedType calledType){
  List<IJstProperty> props=new ArrayList<IJstProperty>();
  for (  IJstType type : calledType.getMixedTypes()) {
    if (type instanceof JstAttributedType) {
      JstAttributedType atype=((JstAttributedType)type);
      IJstOType otype=atype.getOType(atype.getAttributeName());
      props.addAll(getTypeProperties(otype));
    }
  }
  return props;
}

Fixed version (ground truth):
private List<IJstProperty> handleMixedType(JstMixedType calledType){
  List<IJstProperty> props=new ArrayList<IJstProperty>();
  for (  IJstType type : calledType.getMixedTypes()) {
    if (type instanceof JstAttributedType) {
      JstAttributedType atype=((JstAttributedType)type);
      IJstOType otype=atype.getOType(atype.getAttributeName());
      props.addAll(getTypeProperties(otype));
    }
    if (type instanceof JstObjectLiteralType) {
      JstObjectLiteralType otype=((JstObjectLiteralType)type);
      props.addAll(getTypeProperties(otype));
    }
  }
  return props;
}
Program: 17017
Project: 17017
Buggy source:
@Test @Category({P3,FAST,UNIT}) @Description("String_Node_Str") public void testMethodsWithSameName_2() throws Exception {
  expectProblems.clear();
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,7,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,10,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,13,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,7,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,10,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,13,0));
  actualProblems=getVjoSemanticProblem("String_Node_Str","String_Node_Str",this.getClass());
  assertProblemEquals(expectProblems,actualProblems);
}

Fixed version (ground truth):
@Test @Category({P3,FAST,UNIT}) @Description("String_Node_Str") public void testMethodsWithSameName_2() throws Exception {
  expectProblems.clear();
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,7,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,10,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,13,0));
  actualProblems=getVjoSemanticProblem("String_Node_Str","String_Node_Str",this.getClass());
  assertProblemEquals(expectProblems,actualProblems);
}
Program: 17018
Project: 17018
Buggy source:
@Test @Category({P3,FAST,UNIT}) @Description("String_Node_Str") public void testMethodsWithSameName_3() throws Exception {
  expectProblems.clear();
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,8,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,12,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,16,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,25,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,29,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,33,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,25,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,29,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,33,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,8,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,12,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,16,0));
  actualProblems=getVjoSemanticProblem("String_Node_Str","String_Node_Str",this.getClass());
  assertProblemEquals(expectProblems,actualProblems);
}

Fixed version (ground truth):
@Test @Category({P3,FAST,UNIT}) @Description("String_Node_Str") public void testMethodsWithSameName_3() throws Exception {
  expectProblems.clear();
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,25,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,29,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,33,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,8,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,12,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,16,0));
  actualProblems=getVjoSemanticProblem("String_Node_Str","String_Node_Str",this.getClass());
  assertProblemEquals(expectProblems,actualProblems);
}
Program: 17019
Project: 17019
Buggy source:
@Test @Category({P3,FAST,UNIT}) @Description("String_Node_Str") public void testMethodsWithSameName_1() throws Exception {
  expectProblems.clear();
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,8,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,12,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,16,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,25,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,29,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,33,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,25,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,29,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,33,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,8,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,12,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,16,0));
  actualProblems=getVjoSemanticProblem("String_Node_Str","String_Node_Str",this.getClass());
  assertProblemEquals(expectProblems,actualProblems);
}

Fixed version (ground truth):
@Test @Category({P3,FAST,UNIT}) @Description("String_Node_Str") public void testMethodsWithSameName_1() throws Exception {
  expectProblems.clear();
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,25,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,29,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,33,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,8,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,12,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,16,0));
  actualProblems=getVjoSemanticProblem("String_Node_Str","String_Node_Str",this.getClass());
  assertProblemEquals(expectProblems,actualProblems);
}
Program: 17020
Project: 17020
Buggy source:
@Test @Category({P3,FAST,UNIT}) @Description("String_Node_Str") public void testMethodsWithSameName_4() throws Exception {
  expectProblems.clear();
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,32,0));
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,32,0));
  actualProblems=getVjoSemanticProblem("String_Node_Str","String_Node_Str",this.getClass());
  assertProblemEquals(expectProblems,actualProblems);
}

Fixed version (ground truth):
@Test @Category({P3,FAST,UNIT}) @Description("String_Node_Str") public void testMethodsWithSameName_4() throws Exception {
  expectProblems.clear();
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,32,0));
  actualProblems=getVjoSemanticProblem("String_Node_Str","String_Node_Str",this.getClass());
  assertProblemEquals(expectProblems,actualProblems);
}
Program: 17021
Project: 17021
Buggy source:
@Test @Category({P1,FAST,UNIT}) @Description("String_Node_Str") public void testBug8878error() throws Exception {
  expectProblems.clear();
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,9,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,9,0));
  final List<VjoSemanticProblem> actualProblems=getVjoSemanticProblem("String_Node_Str","String_Node_Str",this.getClass());
  assertProblemEquals(expectProblems,actualProblems);
}

Fixed version (ground truth):
@Test @Category({P1,FAST,UNIT}) @Description("String_Node_Str") public void testBug8878error() throws Exception {
  expectProblems.clear();
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,9,0));
  final List<VjoSemanticProblem> actualProblems=getVjoSemanticProblem("String_Node_Str","String_Node_Str",this.getClass());
  assertProblemEquals(expectProblems,actualProblems);
}
Program: 17022
Project: 17022
Buggy source:
@Test @Category({P1,FAST,UNIT}) @Description("String_Node_Str") public void testBug8714Error() throws Exception {
  expectProblems.clear();
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,11,0));
  expectProblems.add(createNewProblem(FieldProbIds.DuplicateField,11,0));
  final List<VjoSemanticProblem> actualProblems=getVjoSemanticProblem("String_Node_Str","String_Node_Str",this.getClass());
  assertProblemEquals(expectProblems,actualProblems);
}

Fixed version (ground truth):
@Test @Category({P1,FAST,UNIT}) @Description("String_Node_Str") public void testBug8714Error() throws Exception {
  expectProblems.clear();
  expectProblems.add(createNewProblem(MethodProbIds.AmbiguousMethod,11,0));
  final List<VjoSemanticProblem> actualProblems=getVjoSemanticProblem("String_Node_Str","String_Node_Str",this.getClass());
  assertProblemEquals(expectProblems,actualProblems);
}
Program: 17023
Project: 17023
Buggy source:
@Override protected Object doTranslate(ObjectLiteralField astObjectliteralField){
  int completionPos=m_ctx.getCompletionPos();
  try {
    NV nv=new NV();
    if (astObjectliteralField.initializer instanceof ObjectLiteral) {
      m_ctx.enterBlock(ScopeIds.PROPERTY);
    }
    List<IJsCommentMeta> metaArr=getCommentMeta(astObjectliteralField);
    IExpr value=(IExpr)getTranslatorAndTranslate(astObjectliteralField.initializer);
    value=TranslateHelper.getCastable(value,metaArr,m_ctx);
    final JstIdentifier id=createId(astObjectliteralField);
    bindObjLiteralId(astObjectliteralField,id,value,nv);
    nv.setName(id);
    nv.setValue(value);
    nv.setComments(m_ctx.getCommentCollector().getCommentNonMeta(astObjectliteralField.sourceStart()));
    int start=id.getSource().getStartOffSet();
    if (value != null && value.getSource() != null) {
      int end=value.getSource().getEndOffSet();
      int length=end - start;
      nv.setSource(TranslateHelper.createJstSource(m_ctx.getSourceUtil(),length,start,end));
    }
    if (astObjectliteralField.initializer instanceof ObjectLiteral) {
      m_ctx.exitBlock();
    }
    m_result=nv;
    return nv;
  }
  finally {
    m_ctx.setCompletionPos(completionPos);
  }
}

Fixed version (ground truth):
@Override protected Object doTranslate(ObjectLiteralField astObjectliteralField){
  int completionPos=m_ctx.getCompletionPos();
  try {
    NV nv=new NV();
    if (astObjectliteralField.initializer instanceof ObjectLiteral) {
      m_ctx.enterBlock(ScopeIds.PROPERTY);
    }
    IExpr value=(IExpr)getTranslatorAndTranslate(astObjectliteralField.initializer);
    final JstIdentifier id=createId(astObjectliteralField);
    bindObjLiteralId(astObjectliteralField,id,value,nv);
    nv.setName(id);
    nv.setValue(value);
    nv.setComments(m_ctx.getCommentCollector().getCommentNonMeta(astObjectliteralField.sourceStart()));
    int start=id.getSource().getStartOffSet();
    if (value != null && value.getSource() != null) {
      int end=value.getSource().getEndOffSet();
      int length=end - start;
      nv.setSource(TranslateHelper.createJstSource(m_ctx.getSourceUtil(),length,start,end));
    }
    if (astObjectliteralField.initializer instanceof ObjectLiteral) {
      m_ctx.exitBlock();
    }
    m_result=nv;
    return nv;
  }
  finally {
    m_ctx.setCompletionPos(completionPos);
  }
}
Program: 17024
Project: 17024
Buggy source:
private void bindObjLiteralId(ObjectLiteralField astObjectliteralField,final JstIdentifier id,IExpr value,NV nv){
  if (value instanceof FuncExpr) {
    final TranslateHelper.RenameableSynthJstProxyMethod mtdBinding=new TranslateHelper.RenameableSynthJstProxyMethod(((FuncExpr)value).getFunc(),id.getName());
    id.setJstBinding(mtdBinding);
    id.setType(new JstFuncType(mtdBinding));
  }
  final List<IJsCommentMeta> metaArr=getCommentMeta(astObjectliteralField);
  if (metaArr != null && metaArr.size() > 0) {
    final IJsCommentMeta meta=metaArr.get(0);
    nv.setOptional(meta.getTyping().isOptional());
    final IJstType metaDefinedType=TranslateHelper.findType(m_ctx,meta.getTyping(),meta);
    if (metaDefinedType != null) {
      id.setType(metaDefinedType);
      if (metaDefinedType instanceof JstFuncType) {
        final IJstMethod replacement=TranslateHelper.MethodTranslateHelper.createJstSynthesizedMethod(metaArr,m_ctx,id.getName());
        if (replacement != null) {
          TranslateHelper.replaceSynthesizedMethodBinding(id,replacement);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void bindObjLiteralId(ObjectLiteralField astObjectliteralField,final JstIdentifier id,IExpr value,NV nv){
  if (value instanceof FuncExpr) {
    final TranslateHelper.RenameableSynthJstProxyMethod mtdBinding=new TranslateHelper.RenameableSynthJstProxyMethod(((FuncExpr)value).getFunc(),id.getName());
    id.setJstBinding(mtdBinding);
    id.setType(new JstFuncType(mtdBinding));
  }
  final List<IJsCommentMeta> metaArr=getCommentMeta(astObjectliteralField);
  if (metaArr != null && metaArr.size() > 0) {
    final IJsCommentMeta meta=metaArr.get(0);
    if (meta.getTyping() != null) {
      nv.setOptional(meta.getTyping().isOptional());
      final IJstType metaDefinedType=TranslateHelper.findType(m_ctx,meta.getTyping(),meta);
      if (metaDefinedType != null) {
        id.setType(metaDefinedType);
        if (metaDefinedType instanceof JstFuncType) {
          final IJstMethod replacement=TranslateHelper.MethodTranslateHelper.createJstSynthesizedMethod(metaArr,m_ctx,id.getName());
          if (replacement != null) {
            TranslateHelper.replaceSynthesizedMethodBinding(id,replacement);
          }
        }
      }
    }
  }
}
Program: 17025
Project: 17025
Buggy source:
@Override public void onPostAllChildrenEvent(final IVjoValidationVisitorEvent event){
  final VjoValidationCtx ctx=event.getValidationCtx();
  final IJstNode jstNode=event.getVisitNode();
  if (!(jstNode instanceof ObjLiteral)) {
    return;
  }
  final ObjLiteral objLiteral=(ObjLiteral)jstNode;
  final Set<String> nameSet=new HashSet<String>();
  for (  NV nv : objLiteral.getNVs()) {
    if (nameSet.contains(nv.getName())) {
      String[] arguments=new String[2];
      arguments[0]=nv.getName() != null ? nv.getName() : "String_Node_Str";
      arguments[1]=objLiteral.toExprText();
      final BaseVjoSemanticRuleCtx ruleCtx=new BaseVjoSemanticRuleCtx(objLiteral,ctx.getGroupId(),arguments);
      satisfyRule(ctx,VjoSemanticRuleRepo.getInstance().OBJECT_LITERAL_SHOULD_HAVE_UNIQUE_KEY,ruleCtx);
    }
    nameSet.add(nv.getName());
    if (isJavaKeyword(nv.getName())) {
      final BaseVjoSemanticRuleCtx ruleCtx=new BaseVjoSemanticRuleCtx(nv,ctx.getGroupId(),new String[]{nv.getName(),nv.getName()});
      satisfyRule(ctx,VjoSemanticRuleRepo.getInstance().VJO_SYNTAX_CORRECTNESS,ruleCtx);
    }
    final JstIdentifier name=nv.getIdentifier();
    final IExpr value=nv.getValue();
    validateNVTypes(ctx,nv,name,value);
  }
  validateComplexType(ctx,objLiteral,objLiteral.toExprText(),objLiteral.getResultType());
}

Fixed version (ground truth):
@Override public void onPostAllChildrenEvent(final IVjoValidationVisitorEvent event){
  final VjoValidationCtx ctx=event.getValidationCtx();
  final IJstNode jstNode=event.getVisitNode();
  if (!(jstNode instanceof ObjLiteral)) {
    return;
  }
  final ObjLiteral objLiteral=(ObjLiteral)jstNode;
  final Set<String> nameSet=new HashSet<String>();
  for (  NV nv : objLiteral.getNVs()) {
    if (nameSet.contains(nv.getName())) {
      String[] arguments=new String[2];
      arguments[0]=nv.getName() != null ? nv.getName() : "String_Node_Str";
      arguments[1]=objLiteral.toExprText();
      final BaseVjoSemanticRuleCtx ruleCtx=new BaseVjoSemanticRuleCtx(nv.getIdentifier(),ctx.getGroupId(),arguments);
      satisfyRule(ctx,VjoSemanticRuleRepo.getInstance().OBJECT_LITERAL_SHOULD_HAVE_UNIQUE_KEY,ruleCtx);
    }
    nameSet.add(nv.getName());
    if (isJavaKeyword(nv.getName())) {
      final BaseVjoSemanticRuleCtx ruleCtx=new BaseVjoSemanticRuleCtx(nv,ctx.getGroupId(),new String[]{nv.getName(),nv.getName()});
      satisfyRule(ctx,VjoSemanticRuleRepo.getInstance().VJO_SYNTAX_CORRECTNESS,ruleCtx);
    }
    final JstIdentifier name=nv.getIdentifier();
    final IExpr value=nv.getValue();
    validateNVTypes(ctx,nv,name,value);
  }
  validateComplexType(ctx,objLiteral,objLiteral.toExprText(),objLiteral.getResultType());
}
Program: 17026
Project: 17026
Buggy source:
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  if (isPublic()) {
    sb.append(S_PUBLIC_COMMA);
  }
  if (isProtected()) {
    sb.append(S_PROTECTED_COMMA);
  }
  if (isPrivate()) {
    sb.append(S_PRIVATE_COMMA);
  }
  if (isStatic()) {
    sb.append(S_STATIC_COMMA);
  }
  if (isFinal()) {
    sb.append(S_FINAL_COMMA);
  }
  if (isAbstract()) {
    sb.append(S_ABSTRACT_COMMA);
  }
  if (isDynamic()) {
    sb.append(S_DYNAMIC_COMMA);
  }
  if (isOptional()) {
    sb.append(S_OPTIONAL_COMMA);
  }
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  if (isPublic()) {
    sb.append(S_PUBLIC_COMMA);
  }
  if (isProtected()) {
    sb.append(S_PROTECTED_COMMA);
  }
  if (isPrivate()) {
    sb.append(S_PRIVATE_COMMA);
  }
  if (isStatic()) {
    sb.append(S_STATIC_COMMA);
  }
  if (isFinal()) {
    sb.append(S_FINAL_COMMA);
  }
  if (isAbstract()) {
    sb.append(S_ABSTRACT_COMMA);
  }
  if (isDynamic()) {
    sb.append(S_DYNAMIC_COMMA);
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 17028
Project: 17028
Buggy source:
private static void doObjLiteralAndOTypeBindings(ObjLiteral objLiteral,final SynthOlType synthOlType,IJstType otype,final IJstVisitor revisitor){
  OTypeResolverRegistry otypeResolver=OTypeResolverRegistry.getInstance();
  if (objLiteral.getNVs().size() > 0) {
    NV firstPosition=objLiteral.getNVs().get(0);
    String key=firstPosition.getName();
    if (otypeResolver.hasResolver(key)) {
      otype=otypeResolver.resolve(key,firstPosition);
      if (otype instanceof JstAttributedType) {
        JstAttributedType atype=(JstAttributedType)otype;
        final String attributeName=atype.getAttributeName();
        if (atype.isOType()) {
          final IJstType objLiteralOrFunctionRefType=atype.getOType(attributeName);
          if (objLiteralOrFunctionRefType != null) {
            otype=objLiteralOrFunctionRefType;
          }
        }
      }
    }
  }
  if (otype != null && (otype instanceof SynthOlType)) {
    objLiteral.setJstType(otype);
  }
 else   if (otype != null && (otype instanceof JstObjectLiteralType)) {
    synthOlType.addResolvedOType(otype);
  }
 else {
  }
  for (  NV nv : objLiteral.getNVs()) {
    final JstIdentifier id=nv.getIdentifier();
    final String name=id.getName();
    doObjLiteralNameBinding(otype,id,name);
    final IExpr valueExpr=nv.getValue();
    if (valueExpr != null) {
      doObjLiteralValueBinding(otype,revisitor,name,valueExpr);
    }
  }
}

Fixed version (ground truth):
static void doObjLiteralAndOTypeBindings(ObjLiteral objLiteral,final SynthOlType synthOlType,IJstType otype,final IJstVisitor revisitor){
  OTypeResolverRegistry otypeResolver=OTypeResolverRegistry.getInstance();
  if (objLiteral.getNVs().size() > 0) {
    NV firstPosition=objLiteral.getNVs().get(0);
    String key=firstPosition.getName();
    if (otypeResolver.hasResolver(key)) {
      otype=otypeResolver.resolve(key,firstPosition);
      if (otype instanceof JstAttributedType) {
        JstAttributedType atype=(JstAttributedType)otype;
        final String attributeName=atype.getAttributeName();
        if (atype.isOType()) {
          final IJstType objLiteralOrFunctionRefType=atype.getOType(attributeName);
          if (objLiteralOrFunctionRefType != null) {
            otype=objLiteralOrFunctionRefType;
          }
        }
      }
    }
  }
  if (otype != null && (otype instanceof SynthOlType)) {
    objLiteral.setJstType(otype);
  }
 else   if (otype != null && (otype instanceof JstObjectLiteralType)) {
    synthOlType.addResolvedOType(otype);
  }
 else {
    return;
  }
  for (  NV nv : objLiteral.getNVs()) {
    final JstIdentifier id=nv.getIdentifier();
    final String name=id.getName();
    doObjLiteralNameBinding(otype,id,name);
    final IExpr valueExpr=nv.getValue();
    if (valueExpr != null) {
      doObjLiteralValueBinding(otype,revisitor,name,valueExpr);
    }
  }
}
Program: 17029
Project: 17029
Buggy source:
private void processObjLiteralDef(JstType jstType,String name,BaseJstNode value){
  JstObjectLiteralType otype=new JstObjectLiteralType(name);
  otype.setPackage(new JstPackage(jstType.getName()));
  JstCache.getInstance().addOType(otype);
  jstType.addProperty(new JstProperty(otype,name));
  jstType.addOType(otype);
}

Fixed version (ground truth):
private void processObjLiteralDef(JstType jstType,String name,BaseJstNode value,NV field){
  if (value instanceof FieldAccessExpr) {
    FieldAccessExpr fieldAccessExpr=(FieldAccessExpr)value;
    IJstType type=fieldAccessExpr.getType();
    IJstType fnType=JstCache.getInstance().getType("String_Node_Str");
    if (fnType != null && fnType.equals(type)) {
      processFunction(jstType,name,fieldAccessExpr,field);
    }
  }
 else {
    JstObjectLiteralType otype=new JstObjectLiteralType(name);
    otype.setPackage(new JstPackage(jstType.getName()));
    JstCache.getInstance().addOType(otype);
    jstType.addProperty(new JstProperty(otype,name));
    jstType.addOType(otype);
  }
}
Program: 17030
Project: 17030
Buggy source:
private JstProperty createPropertyFromNV(NV nv){
  IExpr value=nv.getValue();
  if ((nv.getName() != null) && (nv.getName().length() > 0) && (value instanceof JstLiteral)) {
    JstLiteral literal=(JstLiteral)value;
    List<IJsCommentMeta> commentMeta=TranslateHelper.findMetaFromExpr(literal);
    IJsCommentMeta meta=null;
    if (commentMeta != null) {
      meta=commentMeta.get(0);
    }
    IJstType jstType=null;
    if (meta != null) {
      jstType=TranslateHelper.findType(m_ctx,meta.getTyping(),meta);
    }
    if (jstType == null) {
      jstType=value.getResultType();
    }
    if (jstType == null) {
      jstType=JstCache.getInstance().getType("String_Node_Str");
    }
    JstProperty jstProperty=new JstProperty(jstType,nv.getName(),(JstLiteral)value,new JstModifiers());
    jstProperty.setSource(nv.getSource());
    jstProperty.setComments(nv.getComments());
    return jstProperty;
  }
  return null;
}

Fixed version (ground truth):
private JstProperty createPropertyFromNV(NV nv){
  IExpr value=nv.getValue();
  if ((nv.getName() != null) && (nv.getName().length() > 0) && (value instanceof JstLiteral)) {
    JstLiteral literal=(JstLiteral)value;
    List<IJsCommentMeta> commentMeta=TranslateHelper.findMetaFromExpr(literal);
    IJsCommentMeta meta=null;
    if (commentMeta != null) {
      meta=commentMeta.get(0);
    }
    IJstType jstType=null;
    if (meta != null) {
      jstType=TranslateHelper.findType(m_ctx,meta.getTyping(),meta);
    }
    if (jstType == null) {
      jstType=value.getResultType();
    }
    if (jstType == null) {
      jstType=JstCache.getInstance().getType("String_Node_Str");
    }
    JstProperty jstProperty=new JstProperty(jstType,nv.getName(),(JstLiteral)value,new JstModifiers().setPublic());
    jstProperty.setSource(nv.getSource());
    jstProperty.setComments(nv.getComments());
    return jstProperty;
  }
  return null;
}
Program: 17031
Project: 17031
Buggy source:
private void processDef(JstType jstType,ObjLiteral literal,NV field){
  if (field.getValue() != null) {
    if (field.getValue() instanceof ObjLiteral) {
      processObjLiteralDef(jstType,field.getName(),(ObjLiteral)field.getValue());
    }
 else     if (field.getValue() instanceof FuncExpr) {
      processFunctionDef(jstType,((FuncExpr)field.getValue()).getFunc());
    }
 else     if (field.getValue() instanceof BaseJstNode) {
      processObjLiteralDef(jstType,field.getName(),(BaseJstNode)field.getValue());
    }
  }
}

Fixed version (ground truth):
private void processDef(JstType jstType,ObjLiteral literal,NV field){
  IExpr value=field.getValue();
  if (value != null) {
    if (value instanceof ObjLiteral) {
      processObjLiteralDef(jstType,field.getName(),(ObjLiteral)value);
    }
 else     if (value instanceof FuncExpr) {
      processFunctionDef(jstType,((FuncExpr)value).getFunc());
    }
 else     if (value instanceof BaseJstNode) {
      processObjLiteralDef(jstType,field.getName(),(BaseJstNode)value,field);
    }
  }
}
Program: 17033
Project: 17033
Buggy source:
@Override protected FieldAccessExpr doTranslate(FieldReference expr){
  String identifierStr=String.valueOf(expr.token);
  if (TranslateHelper.MISSING_TOKEN.equals(identifierStr)) {
    identifierStr="String_Node_Str";
  }
  JstIdentifier identifier=new JstIdentifier(identifierStr);
  int nameLength=identifier.getName().length();
  JstSource sourceIden=TranslateHelper.getSource(expr.sourceEnd,nameLength);
  identifier.setSource(sourceIden);
  FieldAccessExpr far=new FieldAccessExpr(identifier);
  IExpr qualifier=(IExpr)getTranslatorAndTranslate(expr.receiver,far);
  far.setExpr(qualifier);
  if (qualifier instanceof JstIdentifier) {
    IJstType type=((JstIdentifier)qualifier).getType();
    if (type != null && type.getProperty(identifierStr) != null) {
      identifier.setType(type.getProperty(identifierStr).getType());
    }
  }
  JstSource source=TranslateHelper.getSource(expr,m_ctx.getSourceUtil());
  far.setSource(source);
  this.setParent(far);
  return far;
}

Fixed version (ground truth):
@Override protected FieldAccessExpr doTranslate(FieldReference expr){
  String identifierStr=String.valueOf(expr.token);
  if (TranslateHelper.MISSING_TOKEN.equals(identifierStr)) {
    identifierStr="String_Node_Str";
  }
  JstIdentifier identifier=new JstIdentifier(identifierStr);
  int nameLength=identifier.getName().length();
  JstSource sourceIden=TranslateHelper.getSource(expr.sourceEnd,nameLength);
  identifier.setSource(sourceIden);
  FieldAccessExpr far=new FieldAccessExpr(identifier);
  IExpr qualifier=(IExpr)getTranslatorAndTranslate(expr.receiver,far);
  far.setExpr(qualifier);
  if (qualifier instanceof JstIdentifier) {
    IJstType type=((JstIdentifier)qualifier).getType();
    if (type != null && type.getProperty(identifierStr) != null) {
      IJstType fnType=JstCache.getInstance().getType("String_Node_Str");
      IJstType propType=type.getProperty(identifierStr).getType();
      if (fnType != null && fnType.equals(propType)) {
        List<IJsCommentMeta> metaArr=m_ctx.getCommentCollector().getCommentMeta(expr.sourceStart,m_ctx.getPreviousNodeSourceEnd(),m_ctx.getNextNodeSourceStart(),true);
        if (metaArr != null && metaArr.size() > 0) {
          final JsCommentMetaNode metaJstNode=new JsCommentMetaNode();
          metaJstNode.setJsCommentMetas(metaArr);
          far.addChild(metaJstNode);
        }
      }
      identifier.setType(propType);
    }
  }
  JstSource source=TranslateHelper.getSource(expr,m_ctx.getSourceUtil());
  far.setSource(source);
  this.setParent(far);
  return far;
}
Program: 17034
Project: 17034
Buggy source:
@Override protected Object doTranslate(ObjectLiteralField astObjectliteralField){
  int completionPos=m_ctx.getCompletionPos();
  try {
    NV nv=new NV();
    if (astObjectliteralField.initializer instanceof ObjectLiteral) {
      m_ctx.enterBlock(ScopeIds.PROPERTY);
    }
    IExpr value=(IExpr)getTranslatorAndTranslate(astObjectliteralField.initializer);
    final JstIdentifier id=createId(astObjectliteralField);
    bindObjLiteralId(astObjectliteralField,id,value,nv);
    nv.setName(id);
    nv.setValue(value);
    nv.setComments(m_ctx.getCommentCollector().getCommentNonMeta(astObjectliteralField.sourceStart()));
    int start=id.getSource().getStartOffSet();
    if (value != null && value.getSource() != null) {
      int end=value.getSource().getEndOffSet();
      int length=end - start;
      nv.setSource(TranslateHelper.createJstSource(m_ctx.getSourceUtil(),length,start,end));
    }
    if (astObjectliteralField.initializer instanceof ObjectLiteral) {
      m_ctx.exitBlock();
    }
    m_result=nv;
    return nv;
  }
  finally {
    m_ctx.setCompletionPos(completionPos);
  }
}

Fixed version (ground truth):
@Override protected Object doTranslate(ObjectLiteralField astObjectliteralField){
  int completionPos=m_ctx.getCompletionPos();
  try {
    NV nv=new NV();
    if (astObjectliteralField.initializer instanceof ObjectLiteral) {
      m_ctx.enterBlock(ScopeIds.PROPERTY);
    }
    IExpr value=(IExpr)getTranslatorAndTranslate(astObjectliteralField.initializer);
    final JstIdentifier id=createId(astObjectliteralField);
    bindObjLiteralId(astObjectliteralField,id,value,nv);
    nv.setName(id);
    nv.addChild(id);
    nv.setValue(value);
    nv.addChild(value);
    nv.setComments(m_ctx.getCommentCollector().getCommentNonMeta(astObjectliteralField.sourceStart()));
    int start=id.getSource().getStartOffSet();
    if (value != null && value.getSource() != null) {
      int end=value.getSource().getEndOffSet();
      int length=end - start;
      nv.setSource(TranslateHelper.createJstSource(m_ctx.getSourceUtil(),length,start,end));
    }
    if (astObjectliteralField.initializer instanceof ObjectLiteral) {
      m_ctx.exitBlock();
    }
    m_result=nv;
    return nv;
  }
  finally {
    m_ctx.setCompletionPos(completionPos);
  }
}
Program: 17035
Project: 17035
Buggy source:
private JstIdentifier createId(ObjectLiteralField astObjectliteralField){
  JstIdentifier id=new JstIdentifier(astObjectliteralField.getFieldName().toString());
  int startOffset=astObjectliteralField.sourceStart;
  int endOffset=astObjectliteralField.sourceEnd;
  int length=endOffset - startOffset + 1;
  id.setSource(TranslateHelper.createJstSource(m_ctx.getSourceUtil(),length,startOffset,endOffset));
  return id;
}

Fixed version (ground truth):
private JstIdentifier createId(ObjectLiteralField astObjectliteralField){
  JstIdentifier id=new JstIdentifier(astObjectliteralField.getFieldName().toString());
  int startOffset=astObjectliteralField.fieldName.sourceStart;
  int endOffset=astObjectliteralField.fieldName.sourceEnd;
  int length=endOffset - startOffset + 1;
  id.setSource(TranslateHelper.createJstSource(m_ctx.getSourceUtil(),length,startOffset,endOffset));
  return id;
}
Program: 17036
Project: 17036
Buggy source:
private void resolveTypeInternal(IJstType type,ResolutionResult rr){
  promoteGlobals(type,m_controller.getJstTypeSpaceMgr(),rr);
  m_typeLinkerVisitor.setCurrentType(type);
  m_typeLinkerVisitor.setGroupName(type.getPackage().getGroupName());
  JstExpressionTypeLinkerTraversal.accept(type,m_typeLinkerVisitor);
  if (m_typeLinkerVisitor.isTypeConstructed() && !type.equals(m_typeLinkerVisitor.getType())) {
    JstExpressionTypeLinkerTraversal.accept(m_typeLinkerVisitor.getType(),m_typeLinkerVisitor);
    type=m_typeLinkerVisitor.getType();
  }
  if (type instanceof JstType) {
    JstType type2=(JstType)type;
    setResolutionStatus(type2);
    rr.setType(type2);
  }
}

Fixed version (ground truth):
private void resolveTypeInternal(IJstType type,ResolutionResult rr){
  promoteGlobals(type,m_controller.getJstTypeSpaceMgr(),rr);
  m_typeLinkerVisitor.setCurrentType(type);
  m_typeLinkerVisitor.setGroupName(type.getPackage().getGroupName());
  JstExpressionTypeLinkerTraversal.accept(type,m_typeLinkerVisitor);
  if (!type.equals(m_typeLinkerVisitor.getType())) {
    JstExpressionTypeLinkerTraversal.accept(m_typeLinkerVisitor.getType(),m_typeLinkerVisitor);
    type=m_typeLinkerVisitor.getType();
  }
  if (type instanceof JstType) {
    JstType type2=(JstType)type;
    setResolutionStatus(type2);
    rr.setType(type2);
  }
}
Program: 17037
Project: 17037
Buggy source:
private void postVisitCurrentType(){
  IJstType outerType=m_currentType.getOuterType();
  if (outerType != null && outerType != m_currentType) {
    setCurrentType(outerType);
  }
}

Fixed version (ground truth):
private void postVisitCurrentType(){
  IJstType outerType=m_currentType.getOuterType();
  if (outerType != null && outerType != m_currentType) {
    setCurrentType(outerType);
  }
 else   if (m_currentType.getParentNode() instanceof IJstType) {
    setCurrentType((IJstType)m_currentType.getParentNode());
  }
}
Program: 17038
Project: 17038
Buggy source:
protected void transformType(){
  weakTranslator.getProvider().getTypeTranslator().processMType((MessageSend)current,jst);
  weakTranslator.getCtx().setCurrentType(jst);
}

Fixed version (ground truth):
protected void transformType(){
  weakTranslator.getProvider().getTypeTranslator().processOType((MessageSend)current,jst);
  weakTranslator.getCtx().setCurrentType(jst);
}
Program: 17039
Project: 17039
Buggy source:
/** 
 * Remove all static initialization statements from the type
 */
public void clearStaticInits(){
synchronized (this) {
    if (m_staticInits != null) {
      removeChildren(m_staticInits);
      removeChild(m_initBlock);
      m_initBlock=null;
      m_staticInits=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Remove all static initialization statements from the type
 */
public void clearStaticInits(){
synchronized (this) {
    if (m_staticInits != null) {
      removeChildren(m_staticInits);
      m_staticInits=null;
    }
    if (m_initBlock != null) {
      removeChild(m_initBlock);
      m_initBlock=null;
    }
  }
}
Program: 17040
Project: 17040
Buggy source:
private static IPath newDefaultSdkContainerPath(){
  return new Path(VjetPlugin.SDK_CONTAINER).append(VjetPlugin.ID_DEFAULT_SDK);
}

Fixed version (ground truth):
private static IPath newDefaultSdkContainerPath(){
  return new Path(VjetPlugin.BROWSERSDK_ID).append(VjetPlugin.BROWSERSDK_LABEL);
}
Program: 17041
Project: 17041
Buggy source:
private static IPath jsSdkContainerPath(){
  return new Path(VjetPlugin.JSNATIVESDK_ID).append(VjetPlugin.ID_DEFAULT_SDK);
}

Fixed version (ground truth):
private static IPath jsSdkContainerPath(){
  return new Path(VjetPlugin.JS_DEFAULT_SDK).append(VjetPlugin.JS_DEFAULT_SDK_LABEL);
}
Program: 17042
Project: 17042
Buggy source:
public synchronized boolean addType(String key,JstType type){
  if (type == null) {
    return false;
  }
  if (key == null) {
    m_temp.add(type);
    return true;
  }
  if (type.isLocalType()) {
    return false;
  }
  if (m_types.containsKey(key)) {
    return false;
  }
  m_types.put(key,type);
  return true;
}

Fixed version (ground truth):
public synchronized boolean addType(String key,JstType type){
  if (type == null) {
    return false;
  }
  if (key == null) {
    m_temp.add(type);
    return true;
  }
  if (type.isLocalType()) {
    return false;
  }
  m_types.put(key,type);
  return true;
}
Program: 17043
Project: 17043
Buggy source:
private void validateReturnType(final VjoValidationCtx ctx,final IJstMethod jstMethod,IJstType rtnType){
  if (rtnType != null) {
    if (getKnownType(ctx,jstMethod.getOwnerType(),rtnType) == null) {
      if (rtnType.getPackage() == null && !"String_Node_Str".equals(rtnType.getName())) {
        if (!ctx.getMissingImportTypes().contains(rtnType)) {
          ctx.addMissingImportType(rtnType);
        }
        final BaseVjoSemanticRuleCtx ruleCtx=new BaseVjoSemanticRuleCtx(jstMethod.getName(),ctx.getGroupId(),new String[]{rtnType.getName()});
        satisfyRule(ctx,VjoSemanticRuleRepo.getInstance().UNKNOWN_TYPE_MISSING_IMPORT,ruleCtx);
      }
    }
    if (rtnType != null && rtnType instanceof JstTypeWithArgs) {
      validateJstWithArgs(jstMethod.getOwnerType(),jstMethod.getName(),jstMethod.getName().getName(),ctx,(JstTypeWithArgs)rtnType);
    }
  }
}

Fixed version (ground truth):
private void validateReturnType(final VjoValidationCtx ctx,final IJstMethod jstMethod,IJstType rtnType){
  if (rtnType != null) {
    if (getKnownType(ctx,jstMethod.getOwnerType(),rtnType) == null) {
      if (rtnType.getPackage().getName() == "String_Node_Str" && !"String_Node_Str".equals(rtnType.getName())) {
        if (!ctx.getMissingImportTypes().contains(rtnType)) {
          ctx.addMissingImportType(rtnType);
        }
        final BaseVjoSemanticRuleCtx ruleCtx=new BaseVjoSemanticRuleCtx(jstMethod.getName(),ctx.getGroupId(),new String[]{rtnType.getName()});
        satisfyRule(ctx,VjoSemanticRuleRepo.getInstance().UNKNOWN_TYPE_MISSING_IMPORT,ruleCtx);
      }
    }
    if (rtnType != null && rtnType instanceof JstTypeWithArgs) {
      validateJstWithArgs(jstMethod.getOwnerType(),jstMethod.getName(),jstMethod.getName().getName(),ctx,(JstTypeWithArgs)rtnType);
    }
  }
}
Program: 17044
Project: 17044
Buggy source:
public ScopeId getCurrentScope(){
  try {
    return blockStack.peek();
  }
 catch (  EmptyStackException e) {
    return ScopeIds.GLOBAL;
  }
}

Fixed version (ground truth):
public ScopeId getCurrentScope(){
  try {
    if (blockStack.isEmpty()) {
      return ScopeIds.GLOBAL;
    }
    return blockStack.peek();
  }
 catch (  EmptyStackException e) {
    return ScopeIds.GLOBAL;
  }
}
Program: 17045
Project: 17045
Buggy source:
/** 
 * Retrieves an attribute value by name.
 * @param name The name of the attribute to retrieve.
 * @return The <code>Attr</code> value as a string, or the empty string if that attribute does not have a specified or default value.
 */
@Function String getAttribute(String name);

Fixed version (ground truth):
@JstMultiReturn({String.class,int.class,boolean.class}) @OverLoadFunc Object getAttribute(String sAttrName,int iFlags);
Program: 17046
Project: 17046
Buggy source:
private IJstType checkFullyQualifierTypeInvocation(MtdInvocationExpr mtdInvocationExpr){
  final String fullName=JstExpressionTypeLinkerHelper.getFullName(mtdInvocationExpr);
  IJstType type=JstExpressionTypeLinkerHelper.findFullQualifiedType(m_resolver,fullName);
  if (type != null) {
    JstExpressionTypeLinkerHelper.bindMtdInvocations(m_resolver,this,mtdInvocationExpr,type.getConstructor());
    JstExpressionTypeLinkerHelper.doExprTypeUpdate(m_resolver,this,mtdInvocationExpr,type,m_groupInfo);
    JstExpressionTypeLinkerHelper.setPackageBindingForQualifier(mtdInvocationExpr.getQualifyExpr());
    return type;
  }
  return null;
}

Fixed version (ground truth):
private IJstType checkFullyQualifierTypeInvocation(MtdInvocationExpr mtdInvocationExpr){
  final String fullName=JstExpressionTypeLinkerHelper.getFullName(mtdInvocationExpr);
  IJstType type=JstExpressionTypeLinkerHelper.findFullQualifiedType(m_resolver,fullName,m_groupInfo);
  if (type != null) {
    JstExpressionTypeLinkerHelper.bindMtdInvocations(m_resolver,this,mtdInvocationExpr,type.getConstructor());
    JstExpressionTypeLinkerHelper.doExprTypeUpdate(m_resolver,this,mtdInvocationExpr,type,m_groupInfo);
    JstExpressionTypeLinkerHelper.setPackageBindingForQualifier(mtdInvocationExpr.getQualifyExpr());
    return type;
  }
  return null;
}
Program: 17047
Project: 17047
Buggy source:
/** 
 * SYMBOL MAP MANAGEMENT
 */
private IJstType checkFullyQualifierTypeAccess(FieldAccessExpr fieldAccessExpr){
  final String fullName=fieldAccessExpr.toExprText();
  IJstType type=JstExpressionTypeLinkerHelper.findFullQualifiedType(m_resolver,fullName);
  if (type != null) {
    final JstTypeRefType typeRef=new JstTypeRefType(type);
    fieldAccessExpr.getName().setJstBinding(typeRef);
    JstExpressionTypeLinkerHelper.doExprTypeUpdate(m_resolver,this,fieldAccessExpr,typeRef,m_groupInfo);
    JstExpressionTypeLinkerHelper.setPackageBindingForQualifier(fieldAccessExpr.getExpr());
    return typeRef;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * SYMBOL MAP MANAGEMENT
 */
private IJstType checkFullyQualifierTypeAccess(FieldAccessExpr fieldAccessExpr){
  final String fullName=fieldAccessExpr.toExprText();
  IJstType type=JstExpressionTypeLinkerHelper.findFullQualifiedType(m_resolver,fullName,m_groupInfo);
  if (type != null) {
    final JstTypeRefType typeRef=new JstTypeRefType(type);
    fieldAccessExpr.getName().setJstBinding(typeRef);
    JstExpressionTypeLinkerHelper.doExprTypeUpdate(m_resolver,this,fieldAccessExpr,typeRef,m_groupInfo);
    JstExpressionTypeLinkerHelper.setPackageBindingForQualifier(fieldAccessExpr.getExpr());
    return typeRef;
  }
  return null;
}
Program: 17048
Project: 17048
Buggy source:
public static IJstType findFullQualifiedType(final JstExpressionBindingResolver resolver,String fullName){
  JstTypeSpaceMgr tsMgr=resolver.getController().getJstTypeSpaceMgr();
  ITypeSpace<IJstType,IJstNode> ts=tsMgr.getTypeSpace();
  List<IJstType> typeList=ts.getType(fullName);
  if (typeList != null && typeList.size() != 0) {
    IJstType type=typeList.get(0);
    if (type != null) {
      return type;
    }
  }
  IJstType typeInCache=JstCache.getInstance().getType(fullName);
  if (typeInCache != null) {
    return typeInCache;
  }
  return null;
}

Fixed version (ground truth):
public static IJstType findFullQualifiedType(final JstExpressionBindingResolver resolver,String fullName,GroupInfo groupInfo){
  JstTypeSpaceMgr tsMgr=resolver.getController().getJstTypeSpaceMgr();
  ITypeSpace<IJstType,IJstNode> ts=tsMgr.getTypeSpace();
  List<IJstType> typeList=ts.getVisibleType(fullName,ts.getGroup(groupInfo.getGroupName()));
  if (typeList != null && typeList.size() != 0) {
    IJstType type=typeList.get(0);
    if (type != null) {
      return type;
    }
  }
  return null;
}
Program: 17049
Project: 17049
Buggy source:
@BeforeClass public static void beforeClass(){
  JstCache.getInstance().clear();
  LibManager.getInstance().clear();
}

Fixed version (ground truth):
@BeforeClass public static void beforeClass(){
}