nus-yam/ex-repair huggingface dataset:
Program: 173978
Project: 173978
Buggy source:
@Test public void testXML() throws JAXBException {
  byte b=1;
  b=Objects.deepClone(b);
  byte[] bytes=Objects.deepClone(new byte[10]);
  Array.getLength(bytes);
  Assert.assertTrue(10 == bytes.length);
  int[] ints=Objects.deepClone(new int[10]);
  Assert.assertTrue(10 == ints.length);
  PoJo pojo=new PoJo();
  pojo.setIn(0);
  ints[0]=1;
  pojo.setIns(ints);
  pojo.setObjs(new Object[10]);
  pojo.setStr("String_Node_Str");
  pojo.setStrs(new String[3]);
  bytes[9]=10;
  pojo.setBytes(bytes);
  pojo.getBytes()[2]=1;
  String xml=Objects.Xml.toString(pojo);
  ObjectsXml xmlConvertor=Objects.Xml.custom(null,false,Encoding.GB18030,true,"String_Node_Str");
  String xml2=xmlConvertor.toString(pojo);
  System.out.println(xml);
  System.out.println(xml2);
  PoJo pojo2=Objects.Xml.toObject(xml,PoJo.class);
  Assert.assertTrue(0 == pojo2.getIn());
  Assert.assertTrue(1 == pojo2.getIns()[0]);
  Assert.assertTrue("String_Node_Str".equals(pojo2.getStr()));
  Assert.assertTrue(10 == pojo2.getBytes()[9]);
}

Fixed version (ground truth):
@Test public void testXML() throws JAXBException {
  byte b=1;
  b=Objects.deepClone(b);
  byte[] bytes=Objects.deepClone(new byte[10]);
  Array.getLength(bytes);
  Assert.assertTrue(10 == bytes.length);
  int[] ints=Objects.deepClone(new int[10]);
  Assert.assertTrue(10 == ints.length);
  PoJo pojo=new PoJo();
  pojo.setIn(0);
  ints[0]=1;
  pojo.setIns(ints);
  pojo.setObjs(new Object[10]);
  pojo.setStr("String_Node_Str");
  pojo.setStrs(new String[3]);
  bytes[9]=10;
  pojo.setBytes(bytes);
  pojo.getBytes()[2]=1;
  String xml=Objects.Xml.toString(pojo);
  System.out.println(xml);
  PoJo pojo2=Objects.Xml.toObject(xml,PoJo.class);
  Assert.assertTrue(0 == pojo2.getIn());
  Assert.assertTrue(1 == pojo2.getIns()[0]);
  Assert.assertTrue("String_Node_Str".equals(pojo2.getStr()));
  Assert.assertTrue(10 == pojo2.getBytes()[9]);
  ObjectsXml xmlConvertor=Objects.Xml.custom(null,false,Encoding.GB18030,false,"String_Node_Str");
  xml=xmlConvertor.toString(pojo);
  System.out.println(xml);
  pojo2=xmlConvertor.toObject(xml,PoJo.class);
  Assert.assertTrue(0 == pojo2.getIn());
  Assert.assertTrue(1 == pojo2.getIns()[0]);
  Assert.assertTrue("String_Node_Str".equals(pojo2.getStr()));
  Assert.assertTrue(10 == pojo2.getBytes()[9]);
}
Program: 173980
Project: 173980
Buggy source:
@Override public IToken evaluate(ICharacterScanner scanner,boolean resume){
  char start=(char)scanner.read();
  if (!isWordStart(start)) {
    scanner.unread();
    return Token.UNDEFINED;
  }
  ScanContext context=new ScanContext();
  context.state=State.INITIAL;
  do {
    char c=(char)scanner.read();
    if (ICharacterScanner.EOF == c || (!isWordPart(c,context))) {
      scanner.unread();
      break;
    }
    if (context.hasEndReached()) {
      break;
    }
    if (context.state == State.INITIAL) {
      context.state=State.NORMAL;
    }
  }
 while (true);
  return getSuccessToken();
}

Fixed version (ground truth):
@Override public IToken evaluate(ICharacterScanner scanner,boolean resume){
  char start=(char)scanner.read();
  if (!isWordStart(start)) {
    scanner.unread();
    return Token.UNDEFINED;
  }
  ScanContext context=new ScanContext();
  context.state=State.INITIAL;
  do {
    int read=scanner.read();
    char c=(char)read;
    if (ICharacterScanner.EOF == read || (!isWordPart(c,context))) {
      scanner.unread();
      break;
    }
    if (context.hasEndReached()) {
      break;
    }
    if (context.state == State.INITIAL) {
      context.state=State.NORMAL;
    }
  }
 while (true);
  return getSuccessToken();
}
Program: 173981
Project: 173981
Buggy source:
private boolean selectfirstMatching(Object[] elements){
  if (treeViewer == null) {
    return false;
  }
  if (textFilter == null) {
    return false;
  }
  if (elements == null) {
    return false;
  }
  for (int i=0; i < elements.length; i++) {
    Object element=elements[i];
    if (textFilter.isMatching(element)) {
      StructuredSelection selection=new StructuredSelection(element);
      treeViewer.setSelection(selection,true);
      return true;
    }
    ITreeContentProvider contentProvider=getTreeContentProvider();
    Object[] children=contentProvider.getChildren(element);
    boolean selectionDone=selectfirstMatching(children);
    if (selectionDone) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean selectfirstMatching(Object[] elements){
  if (treeViewer == null) {
    return false;
  }
  if (textFilter == null) {
    return false;
  }
  if (elements == null) {
    return false;
  }
  for (int i=0; i < elements.length; i++) {
    Object element=elements[i];
    if (Boolean.TRUE.equals(textFilter.isMatchingOrNull(element))) {
      StructuredSelection selection=new StructuredSelection(element);
      treeViewer.setSelection(selection,true);
      return true;
    }
    ITreeContentProvider contentProvider=getTreeContentProvider();
    Object[] children=contentProvider.getChildren(element);
    boolean selectionDone=selectfirstMatching(children);
    if (selectionDone) {
      return true;
    }
  }
  return false;
}
Program: 173982
Project: 173982
Buggy source:
private boolean selectTreePath(Viewer viewer,TreePath parentPath,Object element){
  for (int i=0; i < parentPath.getSegmentCount() - 1; i++) {
    if (element.equals(parentPath.getSegment(i))) {
      return false;
    }
  }
  if (!(viewer instanceof TreeViewer)) {
    return true;
  }
  if (matcher == null) {
    return true;
  }
  TreeViewer treeViewer=(TreeViewer)viewer;
  Boolean matchingResult=isMatching(element);
  if (matchingResult != null) {
    return matchingResult;
  }
  return hasUnfilteredChild(treeViewer,parentPath,element);
}

Fixed version (ground truth):
private boolean selectTreePath(Viewer viewer,TreePath parentPath,Object element){
  for (int i=0; i < parentPath.getSegmentCount() - 1; i++) {
    if (element.equals(parentPath.getSegment(i))) {
      return false;
    }
  }
  if (!(viewer instanceof TreeViewer)) {
    return true;
  }
  if (matcher == null) {
    return true;
  }
  TreeViewer treeViewer=(TreeViewer)viewer;
  Boolean matchingResult=isMatchingOrNull(element);
  if (matchingResult != null) {
    return matchingResult;
  }
  return hasUnfilteredChild(treeViewer,parentPath,element);
}
Program: 173983
Project: 173983
Buggy source:
/** 
 * Creates configuration by given adaptable
 * @param adaptable must provide  {@link ColorManager} and {@link IFile}
 */
public BashSourceViewerConfiguration(IAdaptable adaptable){
  Assert.isNotNull(adaptable,"String_Node_Str");
  this.annotationHoover=new BashEditorAnnotationHoover();
  this.colorManager=adaptable.getAdapter(ColorManager.class);
  Assert.isNotNull(colorManager,"String_Node_Str");
  this.defaultTextAttribute=new TextAttribute(colorManager.getColor(getPreferences().getColor(COLOR_NORMAL_TEXT)));
  this.adaptable=adaptable;
}

Fixed version (ground truth):
/** 
 * Creates configuration by given adaptable
 * @param adaptable must provide  {@link ColorManager} and {@link IFile}
 */
public BashSourceViewerConfiguration(IAdaptable adaptable){
  IPreferenceStore generalTextStore=EditorsUI.getPreferenceStore();
  this.fPreferenceStore=new ChainedPreferenceStore(new IPreferenceStore[]{getPreferences().getPreferenceStore(),generalTextStore});
  Assert.isNotNull(adaptable,"String_Node_Str");
  this.annotationHoover=new BashEditorAnnotationHoover();
  this.colorManager=adaptable.getAdapter(ColorManager.class);
  Assert.isNotNull(colorManager,"String_Node_Str");
  this.defaultTextAttribute=new TextAttribute(colorManager.getColor(getPreferences().getColor(COLOR_NORMAL_TEXT)));
  this.adaptable=adaptable;
}
Program: 173986
Project: 173986
Buggy source:
@Test public void bugfix_45() throws Exception {
  String string="String_Node_Str";
  List<ParseToken> tokens=parserToTest.parse(string);
  assertThat(tokens).containsTokens("String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void bugfix_45() throws Exception {
  String string="String_Node_Str";
  List<ParseToken> tokens=parserToTest.parse(string);
  assertThat(tokens).containsTokens("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 173987
Project: 173987
Buggy source:
public void rebuildOutline(){
  String text=getDocumentText();
  IPreferenceStore store=BashEditorUtil.getPreferences().getPreferenceStore();
  final boolean validateBlocks=store.getBoolean(VALIDATE_BLOCK_STATEMENTS.getId());
  final boolean validateDo=store.getBoolean(VALIDATE_DO_STATEMENTS.getId());
  final boolean validateIf=store.getBoolean(VALIDATE_IF_STATEMENTS.getId());
  final boolean validateFunctions=store.getBoolean(VALIDATE_IF_STATEMENTS.getId());
  EclipseUtil.safeAsyncExec(new Runnable(){
    @Override public void run(){
      BashEditorUtil.removeScriptErrors(BashEditor.this);
      modelBuilder.setIgnoreBlockValidation(!validateBlocks);
      modelBuilder.setIgnoreDoValidation(!validateDo);
      modelBuilder.setIgnoreIfValidation(!validateIf);
      modelBuilder.setIgnoreFunctionValidation(!validateFunctions);
      BashScriptModel model=modelBuilder.build(text);
      getOutlinePage().rebuild(model);
      if (model.hasErrors()) {
        addErrorMarkers(model);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Does rebuild the outline - this is done asynchronous
 */
public void rebuildOutline(){
  String text=getDocumentText();
  IPreferenceStore store=BashEditorUtil.getPreferences().getPreferenceStore();
  final boolean validateBlocks=store.getBoolean(VALIDATE_BLOCK_STATEMENTS.getId());
  final boolean validateDo=store.getBoolean(VALIDATE_DO_STATEMENTS.getId());
  final boolean validateIf=store.getBoolean(VALIDATE_IF_STATEMENTS.getId());
  final boolean validateFunctions=store.getBoolean(VALIDATE_IF_STATEMENTS.getId());
  EclipseUtil.safeAsyncExec(new Runnable(){
    @Override public void run(){
      BashEditorUtil.removeScriptErrors(BashEditor.this);
      modelBuilder.setIgnoreBlockValidation(!validateBlocks);
      modelBuilder.setIgnoreDoValidation(!validateDo);
      modelBuilder.setIgnoreIfValidation(!validateIf);
      modelBuilder.setIgnoreFunctionValidation(!validateFunctions);
      BashScriptModel model=modelBuilder.build(text);
      getOutlinePage().rebuild(model);
      if (model.hasErrors()) {
        addErrorMarkers(model);
      }
    }
  }
);
}
Program: 173988
Project: 173988
Buggy source:
public void createControl(Composite parent){
  super.createControl(parent);
  labelProvider=new BashEditorOutlineLabelProvider();
  TreeViewer viewer=getTreeViewer();
  viewer.setContentProvider(contentProvider);
  viewer.addDoubleClickListener(this);
  viewer.setLabelProvider(new DelegatingStyledCellLabelProvider(labelProvider));
  viewer.addSelectionChangedListener(this);
  if (input != null) {
    viewer.setInput(input);
  }
}

Fixed version (ground truth):
public void createControl(Composite parent){
  super.createControl(parent);
  labelProvider=new BashEditorOutlineLabelProvider();
  TreeViewer viewer=getTreeViewer();
  viewer.setContentProvider(contentProvider);
  viewer.addDoubleClickListener(this);
  viewer.setLabelProvider(new DelegatingStyledCellLabelProvider(labelProvider));
  viewer.addSelectionChangedListener(this);
  if (input != null) {
    viewer.setInput(input);
  }
  if (input == null && editor != null) {
    editor.rebuildOutline();
  }
}
Program: 173989
Project: 173989
Buggy source:
void switchTo(ParserState parserState){
  this.parserState=parserState;
  if (ParserState.VARIABLE.equals(parserState)) {
    variableState=VariableState.NO_ARRAY;
  }
}

Fixed version (ground truth):
void switchTo(ParserState parserState){
  this.parserState=parserState;
  if (ParserState.VARIABLE.equals(parserState)) {
    getVariableContext().variableState=VariableState.NO_ARRAY;
  }
 else {
    variableContext=null;
  }
}
Program: 173992
Project: 173992
Buggy source:
@Test public void a_double_string_containing_double_ticked_string_has_token_with_singlestring_contained(){
  List<ParseToken> tokens=parserToTest.parse("String_Node_Str");
  assertThat(tokens).containsNotToken("String_Node_Str");
}

Fixed version (ground truth):
@Test public void a_double_string_containing_double_ticked_string_has_token_with_singlestring_contained(){
  List<ParseToken> tokens=parserToTest.parse("String_Node_Str");
  assertThat(tokens).containsOneToken("String_Node_Str");
}
Program: 173993
Project: 173993
Buggy source:
@Test public void a_single_string_containing_double_string_has_token_with_singlestring_contained(){
  List<ParseToken> tokens=parserToTest.parse("String_Node_Str");
  assertThat(tokens).containsNotToken("String_Node_Str");
}

Fixed version (ground truth):
@Test public void a_single_string_containing_double_string_has_token_with_singlestring_contained(){
  List<ParseToken> tokens=parserToTest.parse("String_Node_Str");
  assertThat(tokens).containsOneToken("String_Node_Str");
}
Program: 173994
Project: 173994
Buggy source:
@Test public void a_double_string_containing_single_string_has_token_with_singlestring_contained(){
  List<ParseToken> tokens=parserToTest.parse("String_Node_Str");
  assertThat(tokens).containsNotToken("String_Node_Str");
}

Fixed version (ground truth):
@Test public void a_double_string_containing_single_string_has_token_with_singlestring_contained(){
  List<ParseToken> tokens=parserToTest.parse("String_Node_Str");
  assertThat(tokens).containsOneToken("String_Node_Str");
}
Program: 173995
Project: 173995
Buggy source:
@Test public void a_single_string_containing_double_ticked_string_has_token_with_singlestring_contained(){
  List<ParseToken> tokens=parserToTest.parse("String_Node_Str");
  assertThat(tokens).containsNotToken("String_Node_Str");
}

Fixed version (ground truth):
@Test public void a_single_string_containing_double_ticked_string_has_token_with_singlestring_contained(){
  List<ParseToken> tokens=parserToTest.parse("String_Node_Str");
  assertThat(tokens).containsOneToken("String_Node_Str");
}
Program: 173997
Project: 173997
Buggy source:
/** 
 * Scans for functions like: <pre> #!/bin/bash  function quit {  exit  }  function hello {  echo Hello!  }  hello quit echo foo </pre>
 * @param bashScript
 */
void buildFunctions(String bashScript,BashScriptModel model){
  scanForIdentifierFollowedByWord(bashScript,model,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Scans for functions like: <pre> #!/bin/bash  function quit {  exit  }  function hello {  echo Hello!  }  hello quit echo foo </pre>
 * @param bashScript
 */
void buildFunctions(String bashScript,BashScriptModel model){
  String scanString="String_Node_Str";
  int pos=0;
  while (true) {
    if (pos >= bashScript.length()) {
      break;
    }
    pos=bashScript.indexOf(scanString,pos);
    if (pos < 0) {
      break;
    }
    if (pos > 0) {
      char before=bashScript.charAt(pos - 1);
      if (!Character.isWhitespace(before)) {
        pos++;
        continue;
      }
    }
    int namePos=pos + scanString.length();
    while (true) {
      char charAt=bashScript.charAt(namePos);
      if (namePos >= bashScript.length()) {
        break;
      }
      if (!Character.isWhitespace(charAt)) {
        break;
      }
      namePos++;
    }
    StringBuilder sb=new StringBuilder();
    while (true) {
      if (namePos >= bashScript.length()) {
        break;
      }
      char charAt=bashScript.charAt(namePos);
      if (Character.isLetterOrDigit(charAt) || charAt == '_' || charAt == '-') {
        sb.append(charAt);
        namePos++;
      }
 else {
        break;
      }
    }
    BashFunction bashFunction=new BashFunction();
    bashFunction.name=sb.toString();
    bashFunction.position=pos;
    bashFunction.length=namePos - pos;
    model.functions.add(bashFunction);
    pos=namePos + 1;
  }
}
Program: 173998
Project: 173998
Buggy source:
@Override public void getAdImage(){
  mModel.getAdImage(new Subscriber<AdList>(){
    @Override public void onCompleted(){
    }
    @Override public void onError(    Throwable e){
      mView.showErrorTip(e.getLocalizedMessage());
    }
    @Override public void onNext(    AdList adList){
      mView.onAdImgGet(adList);
      SharedPreManager.getInstance().putAdList(mContext,adList);
    }
  }
);
}

Fixed version (ground truth):
@Override public void getAdImage(){
  mModel.getAdImage(new Subscriber<AdList>(){
    @Override public void onCompleted(){
    }
    @Override public void onError(    Throwable e){
      mView.showErrorTip(e.getLocalizedMessage());
      Log.e("String_Node_Str","String_Node_Str");
      getCacheAdImage();
    }
    @Override public void onNext(    AdList adList){
      if (adList == null) {
        Log.e("String_Node_Str","String_Node_Str");
        getCacheAdImage();
        return;
      }
      mView.onAdImgGet(adList);
      SharedPreManager.getInstance().putAdList(mContext,adList);
    }
  }
);
}
Program: 173999
Project: 173999
Buggy source:
@Override public void getCacheAdImage(){
  AdList adList=SharedPreManager.getInstance().getAdList(mContext);
  if (adList != null) {
    mView.onAdImgGet(adList);
  }
}

Fixed version (ground truth):
@Override public void getCacheAdImage(){
  AdList adList=SharedPreManager.getInstance().getAdList(mContext);
  if (adList != null) {
    mView.onAdImgGet(adList);
  }
 else {
    mView.skip();
  }
}
Program: 174000
Project: 174000
Buggy source:
@SneakyThrows public DocumentationYaml(final String yamlFile){
  try (final InputStream in=DocumentationYaml.class.getResourceAsStream(yamlFile)){
    final Yaml yaml=new Yaml(new Constructor(RestOperations.class));
    final RestOperations items=(RestOperations)yaml.load(in);
    this.operations=items.getRestOperations().stream().collect(Collectors.toMap(p -> Pair.of(p.getPath(),p.getMethod()),Function.identity()));
  }
 }

Fixed version (ground truth):
@SneakyThrows public DocumentationYaml(final String yamlFile){
  try (final InputStream in=DocumentationYaml.class.getResourceAsStream(yamlFile)){
    final Yaml yaml=new Yaml(new Constructor(RestOperations.class));
    final RestOperations items=(RestOperations)yaml.load(in);
    this.operations=new HashMap<>();
    for (    final RestOperation r : items.getRestOperations()) {
      this.operations.put(Pair.of(r.getPath(),r.getMethod()),r);
    }
  }
 }
Program: 174001
Project: 174001
Buggy source:
/** 
 * Determines parameter name.
 * @param param parameter to extract name for.
 * @param all parameters for checking.
 * @return name of the parameter.
 */
public static String paramName(final Parameter param,final Parameter[] all){
  final Optional<Pair<Class<? extends Annotation>,String>> parameterAnnotation=parameterAnnotation(param);
  String paramName;
  if (parameterAnnotation.isPresent()) {
    paramName=parameterAnnotation.get().getValue();
  }
 else {
    if (param.getType().isPrimitive()) {
      paramName=param.getType().getSimpleName() + "String_Node_Str";
    }
 else {
      paramName=param.getType().getSimpleName();
    }
    final boolean sameTypeParametersPresent=Arrays.stream(all).anyMatch(p -> (!parameterAnnotation(param).isPresent() && p.getType().equals(param.getType())));
    if (sameTypeParametersPresent) {
      paramName+=ThreadLocalRandom.current().nextInt(0,9999);
    }
  }
  return uncapitalize(paramName);
}

Fixed version (ground truth):
/** 
 * Determines parameter name.
 * @param param parameter to extract name for.
 * @param all parameters for checking.
 * @return name of the parameter.
 */
public static String paramName(final Parameter param,final Parameter[] all){
  final Optional<Pair<Class<? extends Annotation>,String>> parameterAnnotation=parameterAnnotation(param);
  String paramName;
  if (parameterAnnotation.isPresent()) {
    paramName=parameterAnnotation.get().getValue();
  }
 else {
    if (param.getType().isPrimitive()) {
      paramName=param.getType().getSimpleName() + "String_Node_Str";
    }
 else {
      paramName=param.getType().getSimpleName();
    }
    int found=0;
    for (    final Parameter p : all) {
      if (!parameterAnnotation(param).isPresent() && p.getType().equals(param.getType())) {
        found++;
      }
    }
    if (found > 1) {
      paramName+=ThreadLocalRandom.current().nextInt(0,9999);
    }
  }
  return uncapitalize(paramName);
}
Program: 174002
Project: 174002
Buggy source:
private void parseBody(String body){
  log.info("String_Node_Str");
  parseParams(body.trim());
  if (this.params == null) {
    this.params=new HashMap<>();
  }
}

Fixed version (ground truth):
private void parseBody(String body){
  log.info("String_Node_Str");
  byte[] bytes=body.getBytes(CharsetProperties.UTF_8_CHARSET);
  List<String> lengths=this.headers.get("String_Node_Str");
  if (lengths != null) {
    int length=Integer.parseInt(lengths.get(0));
    log.info("String_Node_Str",length);
    parseParams(new String(bytes,0,length,CharsetProperties.UTF_8_CHARSET));
  }
 else {
    parseParams(body.trim());
  }
  if (this.params == null) {
    this.params=new HashMap<>();
  }
}
Program: 174003
Project: 174003
Buggy source:
public boolean login(String username,String password){
  try {
    Thread.sleep(10000);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  String val=users.get(username);
  if (password.equals(val)) {
    online.put(username,"String_Node_Str");
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean login(String username,String password){
  String val=users.get(username);
  if (password.equals(val)) {
    online.put(username,"String_Node_Str");
    return true;
  }
  return false;
}
Program: 174004
Project: 174004
Buggy source:
private String cdPath(String destination){
  File file=new File(destination);
  if (file.isAbsolute()) {
    printDebug("String_Node_Str");
    return tryToChangeCurrentDirectory(file);
  }
 else {
    printDebug("String_Node_Str");
    File current=getCurrentDir();
    String destPath=FileUtil.buildFilePath(current.getAbsolutePath(),destination);
    return tryToChangeCurrentDirectory(new File(destPath));
  }
}

Fixed version (ground truth):
private String cdPath(String destination){
  if (destination.startsWith("String_Node_Str")) {
    printDebug("String_Node_Str");
    return tryToChangeCurrentDirectory(new File(destination));
  }
 else {
    printDebug("String_Node_Str");
    File current=getCurrentDir();
    String destPath=FileUtil.buildFilePath(current.getAbsolutePath(),destination);
    return tryToChangeCurrentDirectory(new File(destPath));
  }
}
Program: 174005
Project: 174005
Buggy source:
private String newModel(String modelName){
  String projectFullPath=getCurrentHome();
  TelosysProject telosysProject=new TelosysProject(projectFullPath);
  try {
    File file=telosysProject.createNewDslModel(modelName);
    setCurrentModel(modelName);
    return "String_Node_Str" + modelName + "String_Node_Str"+ file.getName()+ "String_Node_Str"+ modelName+ "String_Node_Str";
  }
 catch (  TelosysToolsException e) {
    return "String_Node_Str" + modelName + "String_Node_Str"+ "String_Node_Str"+ e.getMessage();
  }
}

Fixed version (ground truth):
private String newModel(String modelName){
  String projectFullPath=getCurrentHome();
  TelosysProject telosysProject=new TelosysProject(projectFullPath);
  try {
    File modelFile=telosysProject.createNewDslModel(modelName);
    setCurrentModel(modelFile);
    return "String_Node_Str" + modelName + "String_Node_Str"+ modelFile.getName()+ "String_Node_Str"+ modelName+ "String_Node_Str";
  }
 catch (  TelosysToolsException e) {
    return "String_Node_Str" + modelName + "String_Node_Str"+ "String_Node_Str"+ e.getMessage();
  }
}
Program: 174007
Project: 174007
Buggy source:
private final CommandsGroup getDatabaseCommands(CommandProvider commandProvider){
  List<String> commands=new LinkedList<>();
  String name="String_Node_Str";
  commands.add("String_Node_Str");
  commands.add("String_Node_Str");
  return new CommandsGroup(name,commands);
}

Fixed version (ground truth):
private final CommandsGroup getDatabaseCommands(CommandProvider commandProvider){
  List<String> commands=new LinkedList<>();
  String name="String_Node_Str";
  commands.add("String_Node_Str");
  commands.add("String_Node_Str");
  commands.add("String_Node_Str");
  return new CommandsGroup(name,commands);
}
Program: 174008
Project: 174008
Buggy source:
private String getExceptionInfo(Exception e){
  StringBuffer sb=new StringBuffer();
  appendLine(sb,"String_Node_Str" + e.getClass().getSimpleName());
  appendLine(sb,"String_Node_Str" + e.getMessage());
  appendLine(sb,"String_Node_Str");
  appendLine(sb,getStackTraceInfo(e));
  if (e.getCause() != null) {
    appendLine(sb,"String_Node_Str");
    appendLine(sb,getExceptionInfo(e));
  }
  return sb.toString();
}

Fixed version (ground truth):
private String getExceptionInfo(Throwable e){
  StringBuffer sb=new StringBuffer();
  appendLine(sb,"String_Node_Str" + e.getClass().getSimpleName());
  appendLine(sb,"String_Node_Str" + e.getMessage());
  appendLine(sb,"String_Node_Str");
  appendLine(sb,getStackTraceInfo(e));
  Throwable cause=e.getCause();
  if (cause != null) {
    appendEndOfLine(sb);
    appendLine(sb,"String_Node_Str");
    sb.append(getExceptionInfo(cause));
  }
  return sb.toString();
}
Program: 174009
Project: 174009
Buggy source:
private String getStackTraceInfo(Exception e){
  StringBuffer sb=new StringBuffer();
  StackTraceElement[] stack=e.getStackTrace();
  for (  StackTraceElement ste : stack) {
    appendLine(sb,"String_Node_Str" + ste.getFileName() + "String_Node_Str"+ ste.getLineNumber()+ "String_Node_Str"+ ste.getMethodName());
  }
  return sb.toString();
}

Fixed version (ground truth):
private String getStackTraceInfo(Throwable e){
  StringBuffer sb=new StringBuffer();
  StackTraceElement[] stack=e.getStackTrace();
  for (  StackTraceElement ste : stack) {
    appendLine(sb,"String_Node_Str" + ste.getClassName() + "String_Node_Str"+ ste.getLineNumber()+ "String_Node_Str"+ ste.getMethodName());
  }
  return sb.toString();
}
Program: 174010
Project: 174010
Buggy source:
@Override public String execute(String[] args){
  if (args.length > 1) {
    printDebug("String_Node_Str");
    return deleteModel(args[1]);
  }
 else {
    printDebug("String_Node_Str");
    if (checkModelDefined()) {
      printDebug("String_Node_Str");
      String result=deleteModel(getCurrentModel());
      return result;
    }
 else {
      printDebug("String_Node_Str");
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public String execute(String[] args){
  if (checkHomeDirectoryDefined()) {
    if (args.length > 1) {
      return deleteModel(args[1]);
    }
 else {
      if (checkModelDefined()) {
        return deleteModel(getCurrentModel());
      }
    }
  }
  return null;
}
Program: 174011
Project: 174011
Buggy source:
@Override public String execute(String[] args){
  if (args.length > 1) {
    if (checkModelDefined()) {
      return editEntity(args[1]);
    }
  }
 else {
    return invalidUsage("String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
@Override public String execute(String[] args){
  if (args.length > 1) {
    if (checkModelDefined()) {
      if (getCurrentModel().endsWith("String_Node_Str")) {
        return editEntityDSL(args[1]);
      }
 else {
        editDBModelFile();
      }
    }
  }
 else {
    return invalidUsage("String_Node_Str");
  }
  return null;
}
Program: 174012
Project: 174012
Buggy source:
private String tryToSetCurrentModel(String modelName){
  File modelFile=getModelFile(modelName);
  if (modelFile != null) {
    setCurrentModel(modelFile.getName());
    return "String_Node_Str" + getCurrentModel() + "String_Node_Str";
  }
 else {
    return "String_Node_Str" + modelName + "String_Node_Str";
  }
}

Fixed version (ground truth):
private String tryToSetCurrentModel(String modelName){
  File modelFile=getModelFile(modelName);
  if (modelFile != null) {
    setCurrentModel(modelFile.getName());
    return "String_Node_Str" + getCurrentModel() + "String_Node_Str";
  }
  return null;
}
Program: 174013
Project: 174013
Buggy source:
@Override public String execute(String[] args){
  if (args.length > 1) {
    return tryToSetCurrentModel(args[1]);
  }
 else {
    return undefinedIfNull(getCurrentModel());
  }
}

Fixed version (ground truth):
@Override public String execute(String[] args){
  if (args.length > 1) {
    if (checkHomeDirectoryDefined()) {
      return tryToSetCurrentModel(args[1]);
    }
  }
 else {
    return undefinedIfNull(getCurrentModel());
  }
  return null;
}
Program: 174014
Project: 174014
Buggy source:
@Override public String execute(String[] args){
  if (args.length > 1) {
    editBundle(args);
  }
 else {
    if (checkBundleDefined()) {
      editBundle(getCurrentBundle());
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public String execute(String[] args){
  if (checkHomeDirectoryDefined()) {
    if (args.length > 1) {
      editBundle(args);
    }
 else {
      if (checkBundleDefined()) {
        editBundle(getCurrentBundle());
      }
    }
  }
  return null;
}
Program: 174015
Project: 174015
Buggy source:
/** 
 * Returns the editor command to be used <br> The specific command if defined in the '.cfg' file or the standard default command <br>
 * @return
 */
private String findEditorCommand(){
  String specificEditorCommand=getSpecificEditorCommand();
  if (specificEditorCommand != null) {
    return specificEditorCommand;
  }
 else {
    return getDefaultEditorCommand();
  }
}

Fixed version (ground truth):
/** 
 * Returns the editor command to be used <br> The specific command if defined in the '.cfg' file or the standard default command <br>
 * @return
 */
private String findEditorCommand(){
  String specificEditorCommand=findSpecificEditorCommand();
  if (specificEditorCommand != null) {
    return specificEditorCommand;
  }
 else {
    return determineDefaultEditorCommand();
  }
}
Program: 174016
Project: 174016
Buggy source:
private File findConfigFile(){
  File file=findJarFile();
  if (file.exists()) {
    File parent=file.getParentFile();
    String folderPath=parent.toString();
    File cfgFile=new File(FileUtil.buildFilePath(folderPath,TELOSYS_CLI_CFG));
    if (cfgFile.exists() && cfgFile.isFile()) {
      return cfgFile;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Tries to find a configuration file 
 * @return the file or null if not found
 */
private File findConfigFile(){
  File file=findJarFile();
  if (file.exists()) {
    File parent=file.getParentFile();
    String folderPath=parent.toString();
    File cfgFile=new File(FileUtil.buildFilePath(folderPath,TELOSYS_CLI_CFG));
    if (cfgFile.exists() && cfgFile.isFile()) {
      return cfgFile;
    }
  }
  return null;
}
Program: 174017
Project: 174017
Buggy source:
private String env(){
  Environment environment=getEnvironment();
  StringBuffer sb=new StringBuffer();
  appendLine(sb,"String_Node_Str");
  appendLine(sb,"String_Node_Str" + environment.getOperatingSystem());
  appendLine(sb,"String_Node_Str" + environment.getEditorCommand());
  appendLine(sb,"String_Node_Str" + environment.getJarLocation());
  appendLine(sb,"String_Node_Str" + environment.getCurrentDirectory());
  appendLine(sb,"String_Node_Str" + undefinedIfNull(environment.getHomeDirectory()));
  appendLine(sb,"String_Node_Str" + undefinedIfNull(environment.getCurrentGitHubStore()));
  appendLine(sb,"String_Node_Str" + undefinedIfNull(environment.getCurrentModel()));
  appendLine(sb,"String_Node_Str" + undefinedIfNull(environment.getCurrentBundle()));
  return sb.toString();
}

Fixed version (ground truth):
private String env(){
  Environment environment=getEnvironment();
  StringBuffer sb=new StringBuffer();
  appendLine(sb,"String_Node_Str");
  appendLine(sb,"String_Node_Str" + environment.getOperatingSystem());
  appendLine(sb,"String_Node_Str" + environment.getEditorCommand());
  appendLine(sb,"String_Node_Str" + environment.getJarLocation());
  appendLine(sb,"String_Node_Str" + environment.getCurrentDirectory());
  appendLine(sb,"String_Node_Str" + undefinedIfNull(environment.getCurrentGitHubStore()));
  appendLine(sb,"String_Node_Str" + undefinedIfNull(environment.getHomeDirectory()));
  appendLine(sb,"String_Node_Str" + undefinedIfNull(environment.getCurrentModel()));
  appendLine(sb,"String_Node_Str" + undefinedIfNull(environment.getCurrentBundle()));
  return sb.toString();
}
Program: 174019
Project: 174019
Buggy source:
protected void reply(Transport<byte[][]> t,byte[] message){
  t.write("String_Node_Str",false);
  t.write(message,false);
  t.write("String_Node_Str".getBytes(),true);
}

Fixed version (ground truth):
protected void reply(Transport<byte[][]> t,byte[] message){
  t.write("String_Node_Str".getBytes(),false);
  t.write(message,false);
  t.write("String_Node_Str".getBytes(),true);
}
Program: 174020
Project: 174020
Buggy source:
@Override public void handle(Transport<byte[][]> t,String[] message,byte[][] rawMessage){
  if (message.length == 1) {
    reply(t,"String_Node_Str");
    managers.watchdog.stop(10,TimeUnit.SECONDS);
  }
 else   if (message.length == 2 && message[1] != null && (message[1].equalsIgnoreCase("String_Node_Str") || message[1].equalsIgnoreCase("String_Node_Str"))) {
    reply(t,"String_Node_Str");
    managers.watchdog.stop(10,TimeUnit.SECONDS);
  }
 else {
    replyError(t,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void handle(Transport<byte[][]> t,String[] message,byte[][] rawMessage){
  if (message.length == 1) {
    reply(t,"String_Node_Str");
    managers.cron.execute(() -> managers.watchdog.stop(10,TimeUnit.SECONDS));
  }
 else   if (message.length == 2 && message[1] != null && (message[1].equalsIgnoreCase("String_Node_Str") || message[1].equalsIgnoreCase("String_Node_Str"))) {
    reply(t,"String_Node_Str");
    managers.cron.execute(() -> managers.watchdog.stop(10,TimeUnit.SECONDS));
  }
 else {
    replyError(t,"String_Node_Str");
  }
}
Program: 174025
Project: 174025
Buggy source:
public ClusterMessage clusterBuildMessageHdr(int type){
  ClusterMessage hdr=new ClusterMessage();
  ClusterNode master=(nodeIsSlave(server.myself) && server.myself.master != null) ? server.myself.master : server.myself;
  hdr.version=CLUSTER_PROTOCOL_VERSION;
  hdr.signature="String_Node_Str";
  hdr.type=type;
  hdr.name=server.myself.name;
  hdr.ip=managers.configuration.getClusterAnnounceIp();
  hdr.slots=master.slots;
  if (server.myself.master != null) {
    hdr.master=server.myself.master.name;
  }
  hdr.flags=server.myself.flags;
  hdr.port=managers.configuration.getClusterAnnouncePort();
  hdr.busPort=managers.configuration.getClusterAnnounceBusPort();
  hdr.state=server.cluster.state;
  hdr.currentEpoch=server.cluster.currentEpoch;
  hdr.configEpoch=master.configEpoch;
  hdr.offset=0;
  return hdr;
}

Fixed version (ground truth):
public ClusterMessage clusterBuildMessageHdr(int type){
  ClusterMessage hdr=new ClusterMessage();
  ClusterNode master=(nodeIsSlave(server.myself) && server.myself.master != null) ? server.myself.master : server.myself;
  hdr.version=CLUSTER_PROTOCOL_VERSION;
  hdr.signature="String_Node_Str";
  hdr.type=type;
  hdr.name=server.myself.name;
  hdr.ip=managers.configuration.getClusterAnnounceIp();
  hdr.slots=master.slots;
  if (server.myself.master != null) {
    hdr.master=server.myself.master.name;
  }
  hdr.flags=server.myself.flags;
  hdr.port=managers.configuration.getClusterAnnouncePort();
  hdr.busPort=managers.configuration.getClusterAnnounceBusPort();
  hdr.state=server.cluster.state;
  hdr.currentEpoch=server.cluster.currentEpoch;
  hdr.configEpoch=master.configEpoch;
  if (nodeIsSlave(server.myself))   hdr.offset=managers.replications.replicationGetSlaveOffset();
  return hdr;
}
Program: 174026
Project: 174026
Buggy source:
public void clusterSetGossipEntry(ClusterMessage hdr,ClusterNode n){
  ClusterMessageDataGossip gossip=new ClusterMessageDataGossip();
  gossip.ip=n.ip;
  gossip.name=n.name;
  gossip.port=n.port;
  gossip.flags=n.flags;
  gossip.busPort=n.busPort;
  gossip.reserved=new byte[4];
  gossip.pingTime=n.pingTime;
  gossip.pongTime=n.pongTime;
  hdr.data.gossips.add(gossip);
}

Fixed version (ground truth):
public void clusterSetGossipEntry(ClusterMessage hdr,ClusterNode n){
  ClusterMessageDataGossip gossip=new ClusterMessageDataGossip();
  gossip.ip=n.ip;
  gossip.name=n.name;
  gossip.port=n.port;
  gossip.flags=n.flags;
  gossip.busPort=n.busPort;
  gossip.pingTime=n.pingTime;
  gossip.pongTime=n.pongTime;
  gossip.reserved=new byte[4];
  hdr.data.gossips.add(gossip);
}
Program: 174027
Project: 174027
Buggy source:
public void clusterSendPing(ClusterLink link,int type){
  int actives=server.cluster.nodes.size() - 2;
  int wanted=server.cluster.nodes.size() / 10;
  if (wanted < 3)   wanted=3;
  if (wanted > actives)   wanted=actives;
  int pFailWanted=(int)server.cluster.pFailNodes;
  if (link.node != null && type == CLUSTERMSG_TYPE_PING)   link.node.pingTime=System.currentTimeMillis();
  ClusterMessage hdr=clusterBuildMessageHdr(type);
  hdr.data=new ClusterMessageData();
  int maxIterations=wanted * 3, gossips=0;
  while (actives > 0 && gossips < wanted && maxIterations-- > 0) {
    List<ClusterNode> list=new ArrayList<>(server.cluster.nodes.values());
    ClusterNode node=list.get(ThreadLocalRandom.current().nextInt(list.size()));
    if (Objects.equals(node,server.myself))     continue;
    if ((node.flags & CLUSTER_NODE_PFAIL) != 0)     continue;
    if ((node.flags & (CLUSTER_NODE_HANDSHAKE | CLUSTER_NODE_NOADDR)) != 0 || (node.link == null && node.assignedSlots == 0))     continue;
    if (clusterNodeIsInGossipSection(hdr,gossips,node))     continue;
    clusterSetGossipEntry(hdr,node);
    actives--;
    gossips++;
  }
  if (pFailWanted != 0) {
    List<ClusterNode> nodes=new ArrayList<>(server.cluster.nodes.values());
    for (int i=0; i < nodes.size() && pFailWanted > 0; i++) {
      ClusterNode node=nodes.get(i);
      if (nodeInHandshake(node) || nodeWithoutAddr(node) || !nodePFailed(node))       continue;
      clusterSetGossipEntry(hdr,node);
      actives--;
      gossips++;
      pFailWanted--;
    }
  }
  hdr.count=gossips;
  clusterSendMessage(link,hdr);
}

Fixed version (ground truth):
public void clusterSendPing(ClusterLink link,int type){
  int actives=server.cluster.nodes.size() - 2;
  int wanted=server.cluster.nodes.size() / 10;
  int fWanted=(int)server.cluster.pFailNodes;
  wanted=Math.min(Math.max(wanted,3),actives);
  if (link.node != null && type == CLUSTERMSG_TYPE_PING)   link.node.pingTime=System.currentTimeMillis();
  ClusterMessage hdr=clusterBuildMessageHdr(type);
  int max=wanted * 3, gossips=0;
  while (actives > 0 && gossips < wanted && max-- > 0) {
    List<ClusterNode> list=new ArrayList<>(server.cluster.nodes.values());
    ClusterNode node=list.get(ThreadLocalRandom.current().nextInt(list.size()));
    if (Objects.equals(node,server.myself))     continue;
    if ((node.flags & CLUSTER_NODE_PFAIL) != 0)     continue;
    if ((node.flags & (CLUSTER_NODE_HANDSHAKE | CLUSTER_NODE_NOADDR)) != 0 || (node.link == null && node.assignedSlots == 0))     continue;
    if (clusterNodeIsInGossipSection(hdr,gossips,node))     continue;
    clusterSetGossipEntry(hdr,node);
    actives--;
    gossips++;
  }
  if (fWanted != 0) {
    List<ClusterNode> nodes=new ArrayList<>(server.cluster.nodes.values());
    for (int i=0; i < nodes.size() && fWanted > 0; i++) {
      ClusterNode node=nodes.get(i);
      if (nodeInHandshake(node) || nodeWithoutAddr(node) || !nodePFailed(node))       continue;
      clusterSetGossipEntry(hdr,node);
      actives--;
      gossips++;
      fWanted--;
    }
  }
  hdr.count=gossips;
  clusterSendMessage(link,hdr);
}
Program: 174028
Project: 174028
Buggy source:
public static void main(String[] args) throws ExecutionException, InterruptedException {
  ClusterManagers managers=new ClusterManagers(ClusterConfiguration.defaultSetting());
  final ThinServer client=new ThinServer(managers);
  final ThinGossip gossip=new ThinGossip(managers);
  client.start();
  gossip.start();
}

Fixed version (ground truth):
public static void main(String[] args) throws ExecutionException, InterruptedException {
  ClusterManagers managers=new ClusterManagers(ClusterConfiguration.defaultSetting().setAsMaster(true));
  final ThinServer client=new ThinServer(managers);
  final ThinGossip gossip=new ThinGossip(managers);
  client.start();
  gossip.start();
}
Program: 174029
Project: 174029
Buggy source:
public void clusterReset(boolean hard){
  if (nodeIsSlave(server.myself)) {
    managers.nodes.clusterSetNodeAsMaster(server.myself);
    managers.replications.replicationUnsetMaster();
  }
  managers.slots.clusterCloseAllSlots();
  for (int i=0; i < CLUSTER_SLOTS; i++)   managers.slots.clusterDelSlot(i);
  List<ClusterNode> nodes=new ArrayList<>(server.cluster.nodes.values());
  nodes.stream().filter(e -> Objects.equals(e,server.myself)).forEach(managers.nodes::clusterDelNode);
  if (!hard)   return;
  server.myself.configEpoch=0;
  server.cluster.currentEpoch=0;
  server.cluster.lastVoteEpoch=0;
  String previous=server.myself.name;
  server.cluster.nodes.remove(previous);
  server.myself.name=getRandomHexChars();
  managers.nodes.clusterAddNode(server.myself);
  logger.info("String_Node_Str" + server.myself.name);
}

Fixed version (ground truth):
public void clusterReset(boolean hard){
  if (nodeIsSlave(server.myself)) {
    managers.nodes.clusterSetNodeAsMaster(server.myself);
    managers.replications.replicationUnsetMaster();
  }
  managers.slots.clusterCloseAllSlots();
  for (int i=0; i < CLUSTER_SLOTS; i++)   managers.slots.clusterDelSlot(i);
  List<ClusterNode> nodes=new ArrayList<>(server.cluster.nodes.values());
  nodes.stream().filter(e -> !Objects.equals(e,server.myself)).forEach(managers.nodes::clusterDelNode);
  if (!hard)   return;
  server.myself.configEpoch=0;
  server.cluster.currentEpoch=0;
  server.cluster.lastVoteEpoch=0;
  String previous=server.myself.name;
  server.cluster.nodes.remove(previous);
  server.myself.name=getRandomHexChars();
  managers.nodes.clusterAddNode(server.myself);
  logger.info("String_Node_Str" + server.myself.name);
}
Program: 174030
Project: 174030
Buggy source:
@Override EagerLoadNulableObservableReferenceModel.MyEntity getMyEntity(){
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> ComponentState.isActive(this.$$arezi$$_state),() -> "String_Node_Str" + ComponentState.describe(this.$$arezi$$_state) + "String_Node_Str"+ $$arezi$$_name()+ "String_Node_Str");
  }
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> null != $$arezr$$_myEntity && null != getMyEntityId(),() -> "String_Node_Str" + $$arezi$$_name() + "String_Node_Str"+ getMyEntityId());
  }
  this.$$arez$$_myEntityId.reportObserved();
  return this.$$arezr$$_myEntity;
}

Fixed version (ground truth):
@Override EagerLoadNulableObservableReferenceModel.MyEntity getMyEntity(){
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> ComponentState.isActive(this.$$arezi$$_state),() -> "String_Node_Str" + ComponentState.describe(this.$$arezi$$_state) + "String_Node_Str"+ $$arezi$$_name()+ "String_Node_Str");
  }
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> null != $$arezr$$_myEntity || null == getMyEntityId(),() -> "String_Node_Str" + $$arezi$$_name() + "String_Node_Str"+ getMyEntityId());
  }
  this.$$arez$$_myEntityId.reportObserved();
  return this.$$arezr$$_myEntity;
}
Program: 174032
Project: 174032
Buggy source:
@Override EagerLoadNulableObservableReferenceModel.MyEntity getMyEntity(){
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> ComponentState.isActive(this.$$arezi$$_state),() -> "String_Node_Str" + ComponentState.describe(this.$$arezi$$_state) + "String_Node_Str"+ $$arezi$$_name()+ "String_Node_Str");
  }
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> null != $$arezr$$_myEntity && null != getMyEntityId(),() -> "String_Node_Str" + $$arezi$$_name() + "String_Node_Str"+ getMyEntityId());
  }
  return this.$$arezr$$_myEntity;
}

Fixed version (ground truth):
@Override EagerLoadNulableObservableReferenceModel.MyEntity getMyEntity(){
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> ComponentState.isActive(this.$$arezi$$_state),() -> "String_Node_Str" + ComponentState.describe(this.$$arezi$$_state) + "String_Node_Str"+ $$arezi$$_name()+ "String_Node_Str");
  }
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> null != $$arezr$$_myEntity && null != getMyEntityId(),() -> "String_Node_Str" + $$arezi$$_name() + "String_Node_Str"+ getMyEntityId());
  }
  this.$$arez$$_myEntityId.reportObserved();
  return this.$$arezr$$_myEntity;
}
Program: 174033
Project: 174033
Buggy source:
@Override EagerLoadObservableReferenceModel.MyEntity getMyEntity(){
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> ComponentState.isActive(this.$$arezi$$_state),() -> "String_Node_Str" + ComponentState.describe(this.$$arezi$$_state) + "String_Node_Str"+ $$arezi$$_name()+ "String_Node_Str");
  }
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> null != $$arezr$$_myEntity,() -> "String_Node_Str" + $$arezi$$_name() + "String_Node_Str"+ getMyEntityId());
  }
  return this.$$arezr$$_myEntity;
}

Fixed version (ground truth):
@Override EagerLoadObservableReferenceModel.MyEntity getMyEntity(){
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> ComponentState.isActive(this.$$arezi$$_state),() -> "String_Node_Str" + ComponentState.describe(this.$$arezi$$_state) + "String_Node_Str"+ $$arezi$$_name()+ "String_Node_Str");
  }
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> null != $$arezr$$_myEntity,() -> "String_Node_Str" + $$arezi$$_name() + "String_Node_Str"+ getMyEntityId());
  }
  this.$$arez$$_myEntityId.reportObserved();
  return this.$$arezr$$_myEntity;
}
Program: 174034
Project: 174034
Buggy source:
@Override ExplicitLoadObservableReferenceModel.MyEntity getMyEntity(){
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> ComponentState.isActive(this.$$arezi$$_state),() -> "String_Node_Str" + ComponentState.describe(this.$$arezi$$_state) + "String_Node_Str"+ $$arezi$$_name()+ "String_Node_Str");
  }
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> null != $$arezr$$_myEntity,() -> "String_Node_Str" + $$arezi$$_name() + "String_Node_Str"+ getMyEntityId());
  }
  return this.$$arezr$$_myEntity;
}

Fixed version (ground truth):
@Override ExplicitLoadObservableReferenceModel.MyEntity getMyEntity(){
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> ComponentState.isActive(this.$$arezi$$_state),() -> "String_Node_Str" + ComponentState.describe(this.$$arezi$$_state) + "String_Node_Str"+ $$arezi$$_name()+ "String_Node_Str");
  }
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> null != $$arezr$$_myEntity,() -> "String_Node_Str" + $$arezi$$_name() + "String_Node_Str"+ getMyEntityId());
  }
  this.$$arez$$_myEntityId.reportObserved();
  return this.$$arezr$$_myEntity;
}
Program: 174035
Project: 174035
Buggy source:
@Override ObservableReferenceModel.MyEntity getMyEntity(){
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> ComponentState.isActive(this.$$arezi$$_state),() -> "String_Node_Str" + ComponentState.describe(this.$$arezi$$_state) + "String_Node_Str"+ $$arezi$$_name()+ "String_Node_Str");
  }
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> null != $$arezr$$_myEntity,() -> "String_Node_Str" + $$arezi$$_name() + "String_Node_Str"+ getMyEntityId());
  }
  return this.$$arezr$$_myEntity;
}

Fixed version (ground truth):
@Override ObservableReferenceModel.MyEntity getMyEntity(){
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> ComponentState.isActive(this.$$arezi$$_state),() -> "String_Node_Str" + ComponentState.describe(this.$$arezi$$_state) + "String_Node_Str"+ $$arezi$$_name()+ "String_Node_Str");
  }
  if (Arez.shouldCheckApiInvariants()) {
    Guards.apiInvariant(() -> null != $$arezr$$_myEntity,() -> "String_Node_Str" + $$arezi$$_name() + "String_Node_Str"+ getMyEntityId());
  }
  this.$$arez$$_myEntityId.reportObserved();
  return this.$$arezr$$_myEntity;
}