nus-yam/ex-repair huggingface dataset:
Program: 39855
Project: 39855
Buggy source:
private void setValueBase(JsonArray values){
  if (values == null)   return;
  List vs=values.getList();
  List<TableColumn> leafColumns=((javafx.scene.control.TableView)body).getVisibleLeafColumns();
  for (int i=0; i < vs.size(); i++) {
    Item item=new Item();
    Object object=vs.get(i);
    if (object instanceof List) {
      List<String> list=(List)object;
      for (int j=0; j < leafColumns.size(); j++) {
        if (j >= list.size())         continue;
        item.setProperty(leafColumns.get(j).getText(),list.get(j));
      }
    }
 else     if (object instanceof Map) {
      Map<String,Object> map=(Map)object;
      for (      String key : map.keySet()) {
        if (map.get(key) instanceof String)         item.setProperty(key,map.get(key));
 else         if (map.get(key) instanceof Boolean)         item.setProperty(key,(Boolean)map.get(key));
      }
    }
    items.add(item);
  }
}

Fixed version (ground truth):
private void setValueBase(JsonArray values){
  if (values == null)   return;
  List vs=values.getList();
  List<TableColumn> leafColumns=((javafx.scene.control.TableView)body).getVisibleLeafColumns();
  for (int i=0; i < vs.size(); i++) {
    Item item=new Item();
    Object object=vs.get(i);
    if (object instanceof List) {
      List list=(List)object;
      for (int j=0; j < leafColumns.size(); j++) {
        if (j >= list.size())         continue;
        item.setProperty(leafColumns.get(j).getText(),list.get(j));
      }
    }
 else     if (object instanceof Map) {
      Map<String,Object> map=(Map)object;
      for (      String key : map.keySet()) {
        item.setProperty(key,map.get(key));
      }
    }
    items.add(item);
  }
}
Program: 39856
Project: 39856
Buggy source:
public void load(String url){
  removeParent();
  if (url == null || url.equals("String_Node_Str")) {
  }
 else   if (url.startsWith("String_Node_Str")) {
    try {
      URI uri=new URI(url);
      File file=new File(uri);
      loadFile(file);
    }
 catch (    Exception e) {
      handleExceptionMessage(e);
    }
  }
 else {
    loadWeb(url);
  }
}

Fixed version (ground truth):
public void load(String url){
  if (url == null || url.equals("String_Node_Str")) {
    handleMessage("String_Node_Str");
    return;
  }
  removeParent();
  if (url.startsWith("String_Node_Str")) {
    try {
      URI uri=new URI(url);
      File file=new File(uri);
      loadFile(file);
    }
 catch (    Exception e) {
      handleExceptionMessage(e);
    }
  }
 else {
    loadWeb(url);
  }
}
Program: 39857
Project: 39857
Buggy source:
public void loadWeb(String url){
  if (!url.startsWith("String_Node_Str")) {
    url="String_Node_Str" + url;
  }
  String immutableUrl=url;
  try {
    webClient.getAbs(url).send(ar -> {
      if (ar.succeeded()) {
        handleHttpResponse(immutableUrl,ar.result());
      }
 else {
        Throwable throwable=ar.cause();
        handleExceptionMessage(throwable);
      }
    }
);
  }
 catch (  Exception e) {
    handleExceptionMessage(e);
  }
}

Fixed version (ground truth):
private void loadWeb(String url){
  if (!url.startsWith("String_Node_Str")) {
    url="String_Node_Str" + url;
  }
  String immutableUrl=url;
  try {
    webClient.getAbs(url).send(ar -> {
      if (ar.succeeded()) {
        handleHttpResponse(immutableUrl,ar.result());
      }
 else {
        Throwable throwable=ar.cause();
        handleExceptionMessage(throwable);
      }
    }
);
  }
 catch (  Exception e) {
    handleExceptionMessage(e);
  }
}
Program: 39858
Project: 39858
Buggy source:
public Hyperlink(String text,javafx.scene.Node graphic){
  if (Platform.isFxApplicationThread()) {
    body=new javafx.scene.control.Hyperlink(text,graphic);
    setAction(event -> {
      if (value == null)       app.loadWeb(((javafx.scene.control.Hyperlink)body).getText());
 else       app.loadWeb(value);
    }
);
  }
 else   Platform.runLater(() -> {
    body=new javafx.scene.control.Hyperlink(text,graphic);
    setAction(event -> {
      if (value == null)       app.loadWeb(((javafx.scene.control.Hyperlink)body).getText());
 else       app.loadWeb(value);
    }
);
  }
);
}

Fixed version (ground truth):
public Hyperlink(String text,javafx.scene.Node graphic){
  if (Platform.isFxApplicationThread()) {
    body=new javafx.scene.control.Hyperlink(text,graphic);
    setAction(event -> {
      if (value == null)       app.load(((javafx.scene.control.Hyperlink)body).getText());
 else       app.load(value);
    }
);
  }
 else   Platform.runLater(() -> {
    body=new javafx.scene.control.Hyperlink(text,graphic);
    setAction(event -> {
      if (value == null)       app.load(((javafx.scene.control.Hyperlink)body).getText());
 else       app.load(value);
    }
);
  }
);
}
Program: 39859
Project: 39859
Buggy source:
private void processClass(Class clazz) throws Exception {
  handleCustomerCode(Main.getGlobalAccessCode(),accessCode -> {
    URL url=new URL(clazz.getUrl());
    URLClassLoader urlClassLoader=new URLClassLoader(new URL[]{url});
    Thread.currentThread().setName(accessCode);
    java.lang.Class<?> targetClass=urlClassLoader.loadClass(clazz.getName());
    Object object=targetClass.getDeclaredConstructor().newInstance();
    object.getClass().getDeclaredMethod("String_Node_Str",Object.class).invoke(object,this);
    object.getClass().getDeclaredMethod("String_Node_Str",Map.class).invoke(object,context);
    object.getClass().getDeclaredMethod("String_Node_Str",Map.class).invoke(object,preload);
    return object.getClass().getDeclaredMethod(clazz.getFunction(),null).invoke(object);
  }
);
}

Fixed version (ground truth):
private void processClass(Class clazz) throws Exception {
  handleCustomerCode(Main.getGlobalAccessCode(),accessCode -> {
    URL url=new URL(clazz.getUrl());
    URLClassLoader urlClassLoader=new URLClassLoader(new URL[]{url});
    Thread.currentThread().setName(accessCode);
    java.lang.Class<?> targetClass=urlClassLoader.loadClass(clazz.getName());
    Object object=targetClass.getDeclaredConstructor().newInstance();
    object.getClass().getDeclaredMethod("String_Node_Str",Object.class).invoke(object,this);
    object.getClass().getDeclaredMethod("String_Node_Str",Map.class).invoke(object,context);
    object.getClass().getDeclaredMethod("String_Node_Str",Map.class).invoke(object,preload);
    accessCode=null;
    return object.getClass().getDeclaredMethod(clazz.getFunction(),null).invoke(object);
  }
);
}
Program: 39860
Project: 39860
Buggy source:
private void processScript(Script script){
  String scriptType=script.getType();
  scriptEngine=Main.scriptEngineManager.getEngineByName(scriptType);
  scriptEngine.put("String_Node_Str",this);
  scriptEngine.put("String_Node_Str",preload);
  scriptEngine.put("String_Node_Str",context);
  for (  String id : preload.keySet()) {
    scriptEngine.put(id,preload.get(id));
  }
  for (  String id : context.keySet()) {
    scriptEngine.put(id,context.get(id));
  }
  handleCustomerCode(Main.getGlobalAccessCode(),accessCode -> scriptEngine.eval(script.getScript()));
  try {
    if (script.getHref() != null && !script.getHref().trim().equals("String_Node_Str")) {
      webClient.getAbs(script.getHref()).send(ar -> {
        if (ar.succeeded()) {
          String result=ar.result().bodyAsString();
          handleCustomerCode(Main.getGlobalAccessCode(),accessCode -> scriptEngine.eval(result));
        }
 else {
          handleThrowableMessage(ar.cause());
        }
      }
);
    }
  }
 catch (  Throwable throwable) {
    handleThrowableMessage(throwable);
  }
}

Fixed version (ground truth):
private void processScript(Script script){
  String scriptType=script.getType();
  scriptEngine=Main.scriptEngineManager.getEngineByName(scriptType);
  scriptEngine.put("String_Node_Str",this);
  scriptEngine.put("String_Node_Str",preload);
  scriptEngine.put("String_Node_Str",context);
  for (  String id : preload.keySet()) {
    scriptEngine.put(id,preload.get(id));
  }
  for (  String id : context.keySet()) {
    scriptEngine.put(id,context.get(id));
  }
  handleCustomerCode(null,accessCode -> scriptEngine.eval(script.getScript()));
  try {
    if (script.getHref() != null && !script.getHref().trim().equals("String_Node_Str")) {
      webClient.getAbs(script.getHref()).send(ar -> {
        if (ar.succeeded()) {
          String result=ar.result().bodyAsString();
          handleCustomerCode(null,accessCode -> scriptEngine.eval(result));
        }
 else {
          handleThrowableMessage(ar.cause());
        }
      }
);
    }
  }
 catch (  Throwable throwable) {
    handleThrowableMessage(throwable);
  }
}
Program: 39861
Project: 39861
Buggy source:
@FXML private void loadUrl(Event event){
  String url=urlInput.getText();
  if (url.startsWith("String_Node_Str")) {
    try {
      URI uri=new URI(url);
      File file=new File(uri);
      loadFile(file);
    }
 catch (    Exception e) {
      handleExceptionMessage(e);
    }
  }
 else {
    loadWeb(url);
  }
}

Fixed version (ground truth):
@FXML private void loadUrl(Event event){
  String url=urlInput.getText();
  if (url == null) {
  }
 else   if (url.startsWith("String_Node_Str")) {
    try {
      URI uri=new URI(url);
      File file=new File(uri);
      loadFile(file);
    }
 catch (    Exception e) {
      handleExceptionMessage(e);
    }
  }
 else {
    loadWeb(url);
  }
}
Program: 39862
Project: 39862
Buggy source:
public PagePane(){
  super();
  this.setOnKeyPressed(event -> {
    if (event.isShortcutDown() && event.getCode() == KeyCode.T) {
      this.buildPane();
    }
 else     if (event.isShortcutDown() && event.getCode() == KeyCode.W) {
      Tab tab=this.getSelectionModel().getSelectedItem();
      if (tab != null) {
        Page page=(Page)tab;
        page.getOnClosed().handle(null);
        this.getTabs().remove(this.getSelectionModel().getSelectedItem());
      }
    }
 else     if (event.isShortcutDown() && event.getCode() == KeyCode.S) {
      Page page=(Page)this.getSelectionModel().getSelectedItem();
      page.getController().saveFile(null);
    }
 else     if (event.isShortcutDown() && event.getCode() == KeyCode.L) {
      Page page=(Page)this.getSelectionModel().getSelectedItem();
      page.getController().onFileSelector(null);
    }
  }
);
}

Fixed version (ground truth):
public PagePane(){
  super();
  this.setOnKeyPressed(event -> {
    if (event.isShortcutDown() && event.getCode() == KeyCode.T) {
      this.buildPane();
    }
 else     if (event.isShortcutDown()) {
      Tab tab=this.getSelectionModel().getSelectedItem();
      if (tab == null)       return;
      Page page=(Page)tab;
switch (event.getCode()) {
case W:
        page.getOnClosed().handle(null);
      this.getTabs().remove(this.getSelectionModel().getSelectedItem());
    break;
case S:
  page.getController().saveFile(null);
break;
case L:
page.getController().onFileSelector(null);
break;
}
}
}
);
}
Program: 39863
Project: 39863
Buggy source:
public PagePane(){
  super();
  this.setOnKeyPressed(event -> {
    if (event.isShortcutDown() && event.getCode() == KeyCode.T) {
      this.buildPane();
    }
 else     if (event.isShortcutDown() && event.getCode() == KeyCode.W) {
      this.getTabs().remove(this.getSelectionModel().getSelectedItem());
    }
 else     if (event.isShortcutDown() && event.getCode() == KeyCode.S) {
      Page page=(Page)this.getSelectionModel().getSelectedItem();
      page.getController().saveFile(null);
    }
 else     if (event.isShortcutDown() && event.getCode() == KeyCode.L) {
      Page page=(Page)this.getSelectionModel().getSelectedItem();
      page.getController().onFileSelector(null);
    }
  }
);
}

Fixed version (ground truth):
public PagePane(){
  super();
  this.setOnKeyPressed(event -> {
    if (event.isShortcutDown() && event.getCode() == KeyCode.T) {
      this.buildPane();
    }
 else     if (event.isShortcutDown() && event.getCode() == KeyCode.W) {
      Tab tab=this.getSelectionModel().getSelectedItem();
      if (tab != null) {
        Page page=(Page)tab;
        page.getOnClosed().handle(null);
        this.getTabs().remove(this.getSelectionModel().getSelectedItem());
      }
    }
 else     if (event.isShortcutDown() && event.getCode() == KeyCode.S) {
      Page page=(Page)this.getSelectionModel().getSelectedItem();
      page.getController().saveFile(null);
    }
 else     if (event.isShortcutDown() && event.getCode() == KeyCode.L) {
      Page page=(Page)this.getSelectionModel().getSelectedItem();
      page.getController().onFileSelector(null);
    }
  }
);
}
Program: 39868
Project: 39868
Buggy source:
public void submit(){
  if (handler.handle())   return;
  MultiMap form=MultiMap.caseInsensitiveMultiMap();
  for (int i=0; i < children.size(); i++) {
    String id=children.getValue(i).toString();
    Object object=app.getScriptEngine().get(id);
    if (object != null && object instanceof Control) {
      Control control=(Control)object;
      if (control.getName() == null || control.getName().isEmpty())       continue;
      form.set(control.getName(),control.getValue().toString());
    }
  }
  for (  String key : jsonObject.fieldNames()) {
    form.add(key,jsonObject.getValue(key).toString());
  }
  app.submit(form,method,action);
}

Fixed version (ground truth):
public void submit(){
  if (handler.handle())   return;
  MultiMap form=MultiMap.caseInsensitiveMultiMap();
  for (int i=0; i < children.size(); i++) {
    String id=children.getValue(i).toString();
    Object object=app.getContext().get(id);
    if (object != null && object instanceof Control) {
      Control control=(Control)object;
      if (control.getName() == null || control.getName().isEmpty())       continue;
      form.set(control.getName(),control.getValue().toString());
    }
  }
  for (  String key : jsonObject.fieldNames()) {
    form.add(key,jsonObject.getValue(key).toString());
  }
  app.submit(form,method,action);
}
Program: 39869
Project: 39869
Buggy source:
public Object get(String name){
  for (int i=0; i < children.size(); i++) {
    String id=children.getValue(i).toString();
    Object object=app.getScriptEngine().get(id);
    if (object != null && object instanceof Control) {
      Control control=(Control)object;
      if (control.getName().equals(name))       return control.getValue();
    }
  }
  return jsonObject.getValue(name).toString();
}

Fixed version (ground truth):
public Object get(String name){
  for (int i=0; i < children.size(); i++) {
    String id=children.getValue(i).toString();
    Object object=app.getContext().get(id);
    if (object != null && object instanceof Control) {
      Control control=(Control)object;
      if (control.getName().equals(name))       return control.getValue();
    }
  }
  return jsonObject.getValue(name).toString();
}
Program: 39870
Project: 39870
Buggy source:
public void send(){
  if (handler.handle())   return;
  for (int i=0; i < children.size(); i++) {
    String id=children.getValue(i).toString();
    Object object=app.getScriptEngine().get(id);
    if (object != null && object instanceof Control) {
      Control control=(Control)object;
      if (control.getName() == null || control.getName().isEmpty())       continue;
      jsonObject.put(control.getName(),control.getValue());
    }
  }
  app.send(jsonObject,method,action);
}

Fixed version (ground truth):
public void send(){
  if (handler.handle())   return;
  for (int i=0; i < children.size(); i++) {
    String id=children.getValue(i).toString();
    Object object=app.getContext().get(id);
    if (object != null && object instanceof Control) {
      Control control=(Control)object;
      if (control.getName() == null || control.getName().isEmpty())       continue;
      jsonObject.put(control.getName(),control.getValue());
    }
  }
  app.send(jsonObject,method,action);
}
Program: 39871
Project: 39871
Buggy source:
public static void main(String[] args) throws Exception {
  System.getProperties().setProperty("String_Node_Str","String_Node_Str");
  vertx=Vertx.vertx();
  scriptEngineManager=new ScriptEngineManager();
  launch(args);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  System.getProperties().setProperty("String_Node_Str","String_Node_Str");
  System.getProperties().setProperty(CACHE_DIR_BASE_PROP_NAME,Res.getDefaultDirectory().getPath());
  vertx=Vertx.vertx();
  scriptEngineManager=new ScriptEngineManager();
  launch(args);
}
Program: 39872
Project: 39872
Buggy source:
private void removeParent(){
  super.dispose();
  preload.clear();
  if (loadingTask != null)   loadingTask.cancel();
  scriptEngine=null;
  container.getChildren().clear();
  exceptionBox.setExceptionMessage(null);
}

Fixed version (ground truth):
private void removeParent(){
  super.dispose();
  preload.clear();
  if (loadingTask != null)   loadingTask.cancel();
  scriptEngine=null;
  container.getChildren().clear();
  exceptionBox.clearExceptionMessage();
}
Program: 39873
Project: 39873
Buggy source:
public void clearExceptionMessage(){
  exceptionButton.setTextFill(Color.BLACK);
  textArea.setText("String_Node_Str");
}

Fixed version (ground truth):
public void clearExceptionMessage(){
  this.setExceptionMessage(null);
}
Program: 39874
Project: 39874
Buggy source:
public void submit(String[] ids,String method,String action){
  MultiMap form=MultiMap.caseInsensitiveMultiMap();
  for (  String id : ids) {
    Object object=scriptEngine.get(id);
    if (object != null && object instanceof Control) {
      Control control=(Control)object;
      if (control.getName() == null || control.getName().isEmpty())       continue;
      form.set(control.getName(),control.getValue());
    }
  }
  System.out.println(form);
  HttpMethod m=HttpMethod.POST;
  if (method != null) {
switch (method.trim().toLowerCase()) {
case "String_Node_Str":
      m=HttpMethod.GET;
    break;
case "String_Node_Str":
  m=HttpMethod.DELETE;
break;
case "String_Node_Str":
m=HttpMethod.PUT;
break;
default :
break;
}
}
if (action == null || action.isEmpty()) return;
String url=action.trim().toLowerCase();
if (url.startsWith("String_Node_Str")) {
client.requestAbs(m,action).sendForm(form,ar -> handleHttpResponse(url,ar.result()));
}
 else {
client.request(m,action).sendForm(form,ar -> handleHttpResponse(url,ar.result()));
}
}

Fixed version (ground truth):
public void submit(String[] ids,String method,String action){
  MultiMap form=MultiMap.caseInsensitiveMultiMap();
  for (  String id : ids) {
    Object object=scriptEngine.get(id);
    if (object != null && object instanceof Control) {
      Control control=(Control)object;
      if (control.getName() == null || control.getName().isEmpty())       continue;
      form.set(control.getName(),control.getValue());
    }
  }
  HttpMethod m=HttpMethod.POST;
  if (method != null) {
switch (method.trim().toLowerCase()) {
case "String_Node_Str":
      m=HttpMethod.GET;
    break;
case "String_Node_Str":
  m=HttpMethod.DELETE;
break;
case "String_Node_Str":
m=HttpMethod.PUT;
break;
default :
break;
}
}
if (action == null || action.isEmpty() || form.isEmpty()) return;
String url=action.trim();
if (!url.startsWith("String_Node_Str")) {
action="String_Node_Str" + action;
}
client.requestAbs(m,action).sendForm(form,ar -> {
if (ar.succeeded()) handleHttpResponse(url,ar.result());
 else handleExceptionMessage(ar.cause());
}
);
}
Program: 39875
Project: 39875
Buggy source:
private void loadWeb(final String url){
  try {
    client.getAbs(url).send(ar -> {
      if (ar.succeeded()) {
        handleHttpResponse(url,ar.result());
      }
 else {
        Throwable throwable=ar.cause();
        Platform.runLater(() -> handleExceptionMessage(throwable));
      }
    }
);
  }
 catch (  Exception e) {
    handleExceptionMessage(e);
  }
}

Fixed version (ground truth):
private void loadWeb(final String url){
  try {
    client.getAbs(url).send(ar -> {
      if (ar.succeeded()) {
        handleHttpResponse(url,ar.result());
      }
 else {
        Throwable throwable=ar.cause();
        handleExceptionMessage(throwable);
      }
    }
);
  }
 catch (  Exception e) {
    handleExceptionMessage(e);
  }
}
Program: 39876
Project: 39876
Buggy source:
public Node generateNodeByJsonObject(JsonObject jsonObject,TabContent tabContent) throws Exception {
  String type=jsonObject.getString("String_Node_Str");
  Node node;
switch (type == null ? "String_Node_Str" : type.toLowerCase()) {
case "String_Node_Str":
    Canvas canvas=new Canvas();
  node=canvas;
break;
case "String_Node_Str":
Form form=new Form(tabContent);
node=form;
break;
case "String_Node_Str":
TextField textField=new TextField();
decorateControl(textField,jsonObject);
textField.setText(jsonObject.getString("String_Node_Str"));
node=textField;
break;
case "String_Node_Str":
Label label=new Label();
decorateControl(label,jsonObject);
label.setText(jsonObject.getString("String_Node_Str"));
node=label;
break;
case "String_Node_Str":
Button button=new Button();
decorateControl(button,jsonObject);
button.setText(jsonObject.getString("String_Node_Str"));
node=button;
break;
default :
Pane pane=new Pane();
JsonArray jsonArray=jsonObject.getJsonArray("String_Node_Str");
if (jsonArray != null) {
for (Object jo : jsonArray) {
Node child=generateNodeByJsonObject((JsonObject)jo,tabContent);
if (child.getNode() != null) pane.add(child);
}
}
node=pane;
break;
}
if (jsonObject.getString("String_Node_Str") != null && tabContent.getScriptEngine() != null) {
node.setId(jsonObject.getString("String_Node_Str"));
tabContent.getScriptEngine().put(jsonObject.getString("String_Node_Str"),node);
}
return node;
}

Fixed version (ground truth):
public Node generateNodeByJsonObject(JsonObject jsonObject,TabContent tabContent) throws Exception {
  String type=jsonObject.getString("String_Node_Str");
  Node node;
switch (type == null ? "String_Node_Str" : type.toLowerCase()) {
case "String_Node_Str":
    Canvas canvas=new Canvas();
  node=canvas;
break;
case "String_Node_Str":
Form form=new Form(tabContent);
form.setChildren(jsonObject.getJsonArray("String_Node_Str"));
form.setAction(jsonObject.getString("String_Node_Str"));
form.setMethod(jsonObject.getString("String_Node_Str"));
node=form;
break;
case "String_Node_Str":
TextField textField=new TextField();
decorateControl(textField,jsonObject);
textField.setText(jsonObject.getString("String_Node_Str"));
node=textField;
break;
case "String_Node_Str":
Label label=new Label();
decorateControl(label,jsonObject);
label.setText(jsonObject.getString("String_Node_Str"));
node=label;
break;
case "String_Node_Str":
Button button=new Button();
decorateControl(button,jsonObject);
button.setText(jsonObject.getString("String_Node_Str"));
node=button;
break;
default :
Pane pane=new Pane();
JsonArray jsonArray=jsonObject.getJsonArray("String_Node_Str");
if (jsonArray != null) {
for (Object jo : jsonArray) {
Node child=generateNodeByJsonObject((JsonObject)jo,tabContent);
if (child.getNode() != null) pane.add(child);
}
}
node=pane;
break;
}
if (jsonObject.getString("String_Node_Str") != null && tabContent.getScriptEngine() != null) {
node.setId(jsonObject.getString("String_Node_Str"));
tabContent.getScriptEngine().put(jsonObject.getString("String_Node_Str"),node);
}
return node;
}
Program: 39877
Project: 39877
Buggy source:
public MediaPlayer play(Media media,int cycle,int volume){
  if (mediaPlayer != null)   mediaPlayer.dispose();
  mediaPlayer=new MediaPlayer(media);
  mediaPlayer.setVolume(volume);
  mediaPlayer.setCycleCount(cycle);
  mediaPlayer.setOnError(() -> play(media,cycle,volume));
  mediaPlayer.setOnStopped(() -> play(media,cycle,volume));
  mediaPlayer.setOnEndOfMedia(() -> play(media,cycle,volume));
  mediaPlayer.play();
  return mediaPlayer;
}

Fixed version (ground truth):
public MediaPlayer play(Media media,int cycle,double volume){
  if (mediaPlayer != null)   mediaPlayer.dispose();
  if (media == null)   return null;
  mediaPlayer=new MediaPlayer(media);
  mediaPlayer.setVolume(volume);
  mediaPlayer.setCycleCount(cycle);
  mediaPlayer.setOnError(() -> play(media,cycle,volume));
  mediaPlayer.setOnStopped(() -> play(media,cycle,volume));
  mediaPlayer.setOnEndOfMedia(() -> play(media,cycle,volume));
  mediaPlayer.play();
  return mediaPlayer;
}
Program: 39878
Project: 39878
Buggy source:
public Map<String,Object> generateResources(){
  Map<String,Object> map=new HashMap<>();
  if (getPreload() != null && getPreload().getPreload() != null && !getPreload().getPreload().replace("String_Node_Str","String_Node_Str").trim().equals("String_Node_Str")) {
    String preload=getPreload().getPreload().replace("String_Node_Str","String_Node_Str").trim();
    String[] elements=preload.split("String_Node_Str");
    for (    String element : elements) {
      String[] res=element.split("String_Node_Str");
      if (res[1].endsWith("String_Node_Str")) {
        map.put(res[0],new AudioClip(res[1]));
      }
 else       if (res[1].endsWith("String_Node_Str") || res[1].endsWith("String_Node_Str")) {
        map.put(res[0],new Media(res[1]));
      }
 else {
        map.put(res[0],new Image(res[1]));
      }
    }
  }
  return map;
}

Fixed version (ground truth):
public Map<String,Object> generateResources(){
  Map<String,Object> map=new HashMap<>();
  if (getPreload() != null && getPreload().getPreload() != null && !getPreload().getPreload().replace("String_Node_Str","String_Node_Str").trim().equals("String_Node_Str")) {
    String preload=getPreload().getPreload().replace("String_Node_Str","String_Node_Str").trim();
    String[] elements=preload.split("String_Node_Str");
    for (    String element : elements) {
      if (element.replace("String_Node_Str","String_Node_Str").trim().equals("String_Node_Str"))       continue;
      String[] res=element.split("String_Node_Str");
      if (res[1].endsWith("String_Node_Str")) {
        map.put(res[0],new AudioClip(res[1]));
      }
 else       if (res[1].endsWith("String_Node_Str") || res[1].endsWith("String_Node_Str")) {
        map.put(res[0],new Media(res[1]));
      }
 else {
        map.put(res[0],new Image(res[1]));
      }
    }
  }
  return map;
}
Program: 39879
Project: 39879
Buggy source:
private void processParent(ParentType type,String result,String urlOrMsg){
  removeParent();
switch (type) {
case GROUP:
    container.setPadding(new Insets(0));
  com.whitewoodcity.core.node.Group group=new com.whitewoodcity.core.node.Group();
try {
  XmlV xmlV=xmlMapper.readValue(result,XmlV.class);
  Button button=new Button("String_Node_Str");
  button.setWidth(100);
  group.add(button);
  parent=(Parent)group.getNode();
  container.getChildren().add(group.getNode());
}
 catch (Exception e) {
  handleExceptionMessage(e);
}
break;
case ERROR_MESSAGE:
TextArea errorMsg=new TextArea();
errorMsg.setPrefHeight(container.getHeight() - 20);
errorMsg.setText(result);
container.setPadding(new Insets(10));
container.getChildren().add(errorMsg);
parent=errorMsg;
tab.setText(urlOrMsg);
break;
default :
container.setPadding(new Insets(0));
if (webView == null) {
webView=new WebView();
}
webView.getEngine().loadContent(result);
tab.textProperty().unbind();
tab.textProperty().bind(webView.getEngine().titleProperty());
webView.getEngine().load(urlOrMsg);
container.getChildren().add(webView);
parent=webView;
break;
}
}

Fixed version (ground truth):
private void processParent(ParentType type,String result,String urlOrMsg){
  removeParent();
switch (type) {
case GROUP:
    container.setPadding(new Insets(0));
  com.whitewoodcity.core.node.Group group=new com.whitewoodcity.core.node.Group();
try {
  XmlV xmlV=xmlMapper.readValue(result,XmlV.class);
  Button button=new Button("String_Node_Str");
  button.setWidth(100);
  group.add(button);
  parent=(Parent)group.getNode();
  container.getChildren().add(group.getNode());
}
 catch (Exception e) {
  handleExceptionMessage(e);
}
break;
case ERROR_MESSAGE:
TextArea errorMsg=new TextArea();
errorMsg.setPrefHeight(container.getHeight() - 20);
errorMsg.setText(result);
container.setPadding(new Insets(10));
container.getChildren().add(errorMsg);
parent=errorMsg;
tab.textProperty().unbind();
tab.setText(urlOrMsg);
break;
default :
container.setPadding(new Insets(0));
if (webView == null) {
webView=new WebView();
}
webView.getEngine().loadContent(result);
tab.textProperty().unbind();
tab.textProperty().bind(webView.getEngine().titleProperty());
webView.getEngine().load(urlOrMsg);
container.getChildren().add(webView);
parent=webView;
break;
}
}
Program: 39880
Project: 39880
Buggy source:
public static void main(String[] args){
  ITransactionBuilder t=TransactionFactory.tx_T();
  ITransactionBuilder t1=TransactionFactory.tx_T1(42);
  ITransactionBuilder t2=TransactionFactory.tx_T2();
  System.out.println(t);
  System.out.println(t1);
  System.out.println(t2);
}

Fixed version (ground truth):
public static void main(String[] args){
}
Program: 39881
Project: 39881
Buggy source:
public void acknowledge(@NonNull CompletionHandler<Void> callback){
  _phone.getCallService().acknowledge(getKey());
  setStatus(CallStatus.RINGING);
  callback.onComplete(null);
}

Fixed version (ground truth):
public void acknowledge(@NonNull CompletionHandler<Void> callback){
  _phone.getCallService().acknowledge(getKey());
  callback.onComplete(null);
}
Program: 39883
Project: 39883
Buggy source:
public boolean isReceivingAudio(){
  return _phone.getCallService().isRemoteAudioMuted(getKey());
}

Fixed version (ground truth):
public boolean isReceivingAudio(){
  return !_phone.getCallService().isRemoteAudioMuted(getKey());
}
Program: 39884
Project: 39884
Buggy source:
public Spark(Application application,Authenticator authenticator){
  ConversationContract.CONTENT_AUTHORITY=getAuthority(application.getApplicationContext());
  ConversationContentProvider.resetUriMatcher();
  com.cisco.spark.android.core.Application.setApplication(application);
  _authenticator=authenticator;
  _injector=new SparkInjector(application);
  _injector.create();
  _injector.inject(this);
  _injector.inject(_authenticator);
  _phone=new PhoneImpl(application.getApplicationContext(),_authenticator,_injector);
}

Fixed version (ground truth):
public Spark(Application application,Authenticator authenticator){
  SquaredContentProvider.CONTENT_AUTHORITY=getAuthority(application.getApplicationContext());
  ConversationContentProvider.resetUriMatcher();
  com.cisco.spark.android.core.Application.setApplication(application);
  _authenticator=authenticator;
  _injector=new SparkInjector(application);
  _injector.create();
  _injector.inject(this);
  _injector.inject(_authenticator);
  _phone=new PhoneImpl(application.getApplicationContext(),_authenticator,_injector);
}
Program: 39885
Project: 39885
Buggy source:
/** 
 * Get current SDK version
 * @return major.minor.build-alpha/beta/SNAPSHOT
 * @since 0.1
 */
public String getVersion(){
  return APP_VERSION;
}

Fixed version (ground truth):
/** 
 * Get current SDK version
 * @return major.minor.build-alpha/beta/SNAPSHOT
 * @since 0.1
 */
public String getVersion(){
  return BuildConfig.VERSION_NAME;
}
Program: 39886
Project: 39886
Buggy source:
public void setSendingVideo(boolean sending){
  if (_phone.getCallService().getCall(this._key).isAudioCall()) {
    Ln.d("String_Node_Str");
    return;
  }
  if (sending) {
    _phone.getCallService().unMuteVideo(getKey(),MediaRequestSource.USER);
  }
 else {
    _phone.getCallService().muteVideo(getKey(),MediaRequestSource.USER);
  }
}

Fixed version (ground truth):
public void setSendingVideo(boolean sending){
  if (!_option.hasVideo()) {
    Ln.d("String_Node_Str");
    return;
  }
  if (sending) {
    _phone.getCallService().unMuteVideo(getKey(),MediaRequestSource.USER);
  }
 else {
    _phone.getCallService().muteVideo(getKey(),MediaRequestSource.USER);
  }
}
Program: 39887
Project: 39887
Buggy source:
public boolean isSendingVideo(){
  return !_phone.getCallService().getCall(this._key).isAudioCall() && !_phone.getCallService().isVideoMuted(getKey());
}

Fixed version (ground truth):
public boolean isSendingVideo(){
  return _option.hasVideo() && !_phone.getCallService().isVideoMuted(getKey());
}
Program: 39888
Project: 39888
Buggy source:
public void setReceivingVideo(boolean receiving){
  if (_phone.getCallService().getCall(this._key).isAudioCall()) {
    Ln.d("String_Node_Str");
    return;
  }
  _phone.getCallService().muteRemoteVideos(getKey(),!receiving);
  CallObserver observer=getObserver();
  if (observer != null) {
    observer.onMediaChanged(new CallObserver.ReceivingVideo(this,receiving));
  }
}

Fixed version (ground truth):
public void setReceivingVideo(boolean receiving){
  if (!_option.hasVideo()) {
    Ln.d("String_Node_Str");
    return;
  }
  _phone.getCallService().muteRemoteVideos(getKey(),!receiving);
  CallObserver observer=getObserver();
  if (observer != null) {
    observer.onMediaChanged(new CallObserver.ReceivingVideo(this,receiving));
  }
}
Program: 39889
Project: 39889
Buggy source:
CallImpl(@NonNull PhoneImpl phone,@NonNull Direction direction,@NonNull LocusKey key){
  _phone=phone;
  _direction=direction;
  _key=key;
  _status=CallStatus.INITIATED;
}

Fixed version (ground truth):
CallImpl(@NonNull PhoneImpl phone,@NonNull MediaOption option,@NonNull Direction direction,@NonNull LocusKey key){
  _phone=phone;
  _option=option;
  _direction=direction;
  _key=key;
  _status=CallStatus.INITIATED;
}
Program: 39890
Project: 39890
Buggy source:
public boolean isReceivingVideo(){
  return !_phone.getCallService().getCall(this._key).isAudioCall() && !_phone.getCallService().isRemoteVideoMuted(getKey());
}

Fixed version (ground truth):
public boolean isReceivingVideo(){
  return _option.hasVideo() && !_phone.getCallService().isRemoteVideoMuted(getKey());
}
Program: 39891
Project: 39891
Buggy source:
public static String versionInfo(){
  String tempUserAgent=String.format("String_Node_Str",Spark.APP_NAME,Spark.APP_VERSION,Build.VERSION.RELEASE,Strings.capitalize(Build.MANUFACTURER),Strings.capitalize(Build.DEVICE),Strings.capitalize(Build.BRAND),Strings.capitalize(Build.MODEL),BuildConfig.BUILD_TIME,BuildConfig.BUILD_REVISION);
  return Strings.stripInvalidHeaderChars(tempUserAgent);
}

Fixed version (ground truth):
public static String versionInfo(){
  String tempUserAgent=String.format("String_Node_Str",Spark.APP_NAME,Spark.APP_VERSION,Build.VERSION.RELEASE,Strings.capitalize(Build.MANUFACTURER),Strings.capitalize(Build.DEVICE),Strings.capitalize(Build.BRAND),Strings.capitalize(Build.MODEL));
  return Strings.stripInvalidHeaderChars(tempUserAgent);
}
Program: 39892
Project: 39892
Buggy source:
private static String getAuthority(final Context appContext){
  try {
    final ComponentName componentName=new ComponentName(appContext,ConversationContentProvider.class.getName());
    final ProviderInfo providerInfo=appContext.getPackageManager().getProviderInfo(componentName,0);
    return providerInfo.authority;
  }
 catch (  Throwable t) {
    t.printStackTrace();
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
private static String getAuthority(final Context appContext){
  try {
    final ComponentName componentName=new ComponentName(appContext,ConversationContentProvider.class.getName());
    final ProviderInfo providerInfo=appContext.getPackageManager().getProviderInfo(componentName,0);
    return providerInfo.authority;
  }
 catch (  Throwable t) {
    Log.d(TAG,Exceptions.printStackTrace(t));
    return "String_Node_Str";
  }
}
Program: 39893
Project: 39893
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  instance=this;
  Log.d(TAG,"String_Node_Str");
  delegate=new SparkApplicationDelegate(this);
  delegate.create();
  Log.i(TAG,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  instance=this;
  delegate=new SparkApplicationDelegate(this);
  delegate.create();
}
Program: 39894
Project: 39894
Buggy source:
@Override public void success(Response<JwtToken> response){
  mToken=response.body();
  if (mToken == null)   handler.onError(new SparkError(CLIENT_ERROR,response.errorBody().toString()));
 else {
    if (mToken.getAccessToken() != null && !mToken.getAccessToken().isEmpty()) {
      handler.onComplete(mToken.getAccessToken());
    }
 else {
      handler.onError(new SparkError(UNEXPECTED_ERROR,"String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
@Override public void success(Response<JwtToken> response){
  mToken=response.body();
  if (mToken == null)   handler.onError(new SparkError(CLIENT_ERROR,response.errorBody().toString()));
 else {
    if (mToken.getAccessToken() != null && !mToken.getAccessToken().isEmpty()) {
      mToken.shoudlRefetchTokenNow();
      handler.onComplete(mToken.getAccessToken());
    }
 else {
      handler.onError(new SparkError(UNEXPECTED_ERROR,"String_Node_Str"));
    }
  }
}
Program: 39896
Project: 39896
Buggy source:
boolean shoudlRefetchTokenNow(){
  return super.shouldRefreshNow();
}

Fixed version (ground truth):
boolean shoudlRefetchTokenNow(){
  super.expiresIn=this.expiresIn;
  return super.shouldRefreshNow();
}
Program: 39897
Project: 39897
Buggy source:
public Spark(Application application,Authenticator authenticator){
  UserAgentProvider.APP_NAME=DefaultHeadersInterceptor.APP_NAME;
  UserAgentProvider.APP_VERSION=DefaultHeadersInterceptor.APP_VERSION;
  com.cisco.spark.android.core.Application.setApplication(application);
  _authenticator=authenticator;
  _injector=new SparkInjector(application);
  _injector.create();
  _injector.inject(this);
  _injector.inject(_authenticator);
  _phone=new PhoneImpl(application.getApplicationContext(),_authenticator,_injector);
}

Fixed version (ground truth):
public Spark(Application application,Authenticator authenticator){
  ConversationContract.CONTENT_AUTHORITY=getAuthority(application.getApplicationContext());
  ConversationContentProvider.resetUriMatcher();
  com.cisco.spark.android.core.Application.setApplication(application);
  _authenticator=authenticator;
  _injector=new SparkInjector(application);
  _injector.create();
  _injector.inject(this);
  _injector.inject(_authenticator);
  _phone=new PhoneImpl(application.getApplicationContext(),_authenticator,_injector);
}
Program: 39898
Project: 39898
Buggy source:
@Override public boolean shouldOverrideUrlLoading(WebView view,String url){
  if (url.startsWith(getRedirectUri().toLowerCase())) {
    Uri uri=Uri.parse(url);
    String code=uri.getQueryParameter("String_Node_Str");
    if (code == null || code.isEmpty()) {
      mAuthListener.onError(new SparkError());
      return false;
    }
    setAuthCode(code);
    mWebView.clearCache(true);
    mWebView.loadUrl("String_Node_Str");
    mOAuthStategyDelegate.setAuthCode(getAuthCode());
    mOAuthStategyDelegate.authorize(mAuthListener);
    return false;
  }
  return super.shouldOverrideUrlLoading(view,url);
}

Fixed version (ground truth):
@Override public boolean shouldOverrideUrlLoading(WebView view,String url){
  if (url.startsWith(getRedirectUri().toLowerCase())) {
    Uri uri=Uri.parse(url);
    String code=uri.getQueryParameter("String_Node_Str");
    if (code == null || code.isEmpty()) {
      mAuthListener.onError(new SparkError(SERVER_ERROR,"String_Node_Str"));
      return false;
    }
    setAuthCode(code);
    mWebView.clearCache(true);
    mWebView.loadUrl("String_Node_Str");
    mOAuthStategyDelegate.setAuthCode(getAuthCode());
    mOAuthStategyDelegate.authorize(mAuthListener);
    return false;
  }
  return super.shouldOverrideUrlLoading(view,url);
}
Program: 39899
Project: 39899
Buggy source:
@Override public void onReceivedError(WebView view,int errorCode,String description,String failingUrl){
  if (mAuthListener != null)   mAuthListener.onError(new SparkError(SERVER_ERROR,Integer.toString(errorCode)));
  super.onReceivedError(view,errorCode,description,failingUrl);
}

Fixed version (ground truth):
@Override public void onReceivedError(WebView view,int errorCode,String description,String failingUrl){
  if (!failingUrl.toLowerCase().startsWith(getRedirectUri().toLowerCase())) {
    if (mAuthListener != null)     mAuthListener.onError(new SparkError(SERVER_ERROR,Integer.toString(errorCode)));
  }
  super.onReceivedError(view,errorCode,description,failingUrl);
}
Program: 39900
Project: 39900
Buggy source:
@Override public void onResponse(Call<JwtToken> call,Response<JwtToken> response){
  token=response.body();
  if (token == null)   listener.onFailed();
 else   listener.onSuccess();
}

Fixed version (ground truth):
@Override public void onResponse(Call<JwtToken> call,Response<JwtToken> response){
  mToken=response.body();
  if (mToken == null)   listener.onFailed();
 else   listener.onSuccess();
}
Program: 39901
Project: 39901
Buggy source:
@Override public boolean isAuthorized(){
  return (token != null);
}

Fixed version (ground truth):
@Override public boolean isAuthorized(){
  return (mToken != null);
}
Program: 39902
Project: 39902
Buggy source:
public JWTStrategy(String authcode){
  Retrofit retrofit=new Retrofit.Builder().baseUrl(JWT_BASE_URL).addConverterFactory(GsonConverterFactory.create()).build();
  AuthService service=retrofit.create(AuthService.class);
  call=service.getToken(authcode);
}

Fixed version (ground truth):
public JWTStrategy(String authcode){
  setAuthCode(authcode);
  Retrofit retrofit=new Retrofit.Builder().baseUrl(JWT_BASE_URL).addConverterFactory(GsonConverterFactory.create()).build();
  mAuthService=retrofit.create(AuthService.class);
}
Program: 39903
Project: 39903
Buggy source:
@Override public void deauthorize(){
  token=null;
}

Fixed version (ground truth):
@Override public void deauthorize(){
  mToken=null;
}
Program: 39904
Project: 39904
Buggy source:
@Override public void authorize(AuthorizeListener listener){
  call.enqueue(new Callback<JwtToken>(){
    @Override public void onResponse(    Call<JwtToken> call,    Response<JwtToken> response){
      token=response.body();
      if (token == null)       listener.onFailed();
 else       listener.onSuccess();
    }
    @Override public void onFailure(    Call<JwtToken> call,    Throwable t){
      listener.onFailed();
    }
  }
);
}

Fixed version (ground truth):
@Override public void authorize(AuthorizeListener listener){
  mAuthService.getToken(getAuthCode()).enqueue(new Callback<JwtToken>(){
    @Override public void onResponse(    Call<JwtToken> call,    Response<JwtToken> response){
      mToken=response.body();
      if (mToken == null)       listener.onFailed();
 else       listener.onSuccess();
    }
    @Override public void onFailure(    Call<JwtToken> call,    Throwable t){
      listener.onFailed();
    }
  }
);
}
Program: 39905
Project: 39905
Buggy source:
@Override public void onResponse(Call<OAuth2Tokens> call,Response<OAuth2Tokens> response){
  token=response.body();
  if (token != null)   listener.onSuccess();
 else   listener.onFailed();
}

Fixed version (ground truth):
@Override public void onResponse(Call<OAuth2Tokens> call,Response<OAuth2Tokens> response){
  mToken=response.body();
  if (mToken != null)   listener.onSuccess();
 else   listener.onFailed();
}
Program: 39906
Project: 39906
Buggy source:
@Override public boolean isAuthorized(){
  return token != null;
}

Fixed version (ground truth):
@Override public boolean isAuthorized(){
  return mToken != null;
}
Program: 39907
Project: 39907
Buggy source:
/** 
 * OAuth 2 authorize strategy.
 * @param clientId
 * @param clientSecret
 * @param scope
 * @param redirectUri
 * @param authCode
 */
public OAuthStrategy(String clientId,String clientSecret,String redirectUri,String scope,String email,String authCode){
  this.clientId=clientId;
  this.clientScret=clientSecret;
  this.scope=scope;
  this.redirectUri=redirectUri;
  this.email=email;
  this.authCode=authCode;
  retrofit=new Retrofit.Builder().baseUrl(OAUTH_BASE_URL).addConverterFactory(GsonConverterFactory.create()).build();
  AuthService service=retrofit.create(AuthService.class);
  call=service.getToken(clientId,clientSecret,redirectUri,AUTHORIZATION_CODE,authCode);
}

Fixed version (ground truth):
/** 
 * OAuth 2 authorize strategy.
 * @param clientId
 * @param clientSecret
 * @param scope
 * @param redirectUri
 * @param authCode
 */
public OAuthStrategy(String clientId,String clientSecret,String redirectUri,String scope,String email,String authCode){
  this.setClientId(clientId);
  this.setClientSecret(clientSecret);
  this.setScope(scope);
  this.setRedirectUri(redirectUri);
  this.setEmail(email);
  this.setAuthCode(authCode);
  Retrofit retrofit=new Retrofit.Builder().baseUrl(OAUTH_BASE_URL).addConverterFactory(GsonConverterFactory.create()).build();
  mAuthService=retrofit.create(AuthService.class);
}
Program: 39908
Project: 39908
Buggy source:
@Override public void deauthorize(){
  token=null;
}

Fixed version (ground truth):
@Override public void deauthorize(){
  mToken=null;
}
Program: 39909
Project: 39909
Buggy source:
/** 
 * @param listener
 */
@Override public void authorize(AuthorizeListener listener){
  call.enqueue(new Callback<OAuth2Tokens>(){
    @Override public void onResponse(    Call<OAuth2Tokens> call,    Response<OAuth2Tokens> response){
      token=response.body();
      if (token != null)       listener.onSuccess();
 else       listener.onFailed();
    }
    @Override public void onFailure(    Call<OAuth2Tokens> call,    Throwable t){
      listener.onFailed();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param listener
 */
@Override public void authorize(AuthorizeListener listener){
  mAuthService.getToken(mClientId,mClientSecret,mRedirectUri,AUTHORIZATION_CODE,mAuthCode).enqueue(new Callback<OAuth2Tokens>(){
    @Override public void onResponse(    Call<OAuth2Tokens> call,    Response<OAuth2Tokens> response){
      mToken=response.body();
      if (mToken != null)       listener.onSuccess();
 else       listener.onFailed();
    }
    @Override public void onFailure(    Call<OAuth2Tokens> call,    Throwable t){
      listener.onFailed();
    }
  }
);
}
Program: 39910
Project: 39910
Buggy source:
@Override public void onResponse(Call<JwtToken> call,Response<JwtToken> response){
  token=response.body();
  listener.onSuccess();
}

Fixed version (ground truth):
@Override public void onResponse(Call<JwtToken> call,Response<JwtToken> response){
  token=response.body();
  if (token == null)   listener.onFailed();
 else   listener.onSuccess();
}
Program: 39911
Project: 39911
Buggy source:
@Override public void authorize(AuthorizeListener listener){
  call.enqueue(new Callback<JwtToken>(){
    @Override public void onResponse(    Call<JwtToken> call,    Response<JwtToken> response){
      token=response.body();
      listener.onSuccess();
    }
    @Override public void onFailure(    Call<JwtToken> call,    Throwable t){
      listener.onFailed();
    }
  }
);
}

Fixed version (ground truth):
@Override public void authorize(AuthorizeListener listener){
  call.enqueue(new Callback<JwtToken>(){
    @Override public void onResponse(    Call<JwtToken> call,    Response<JwtToken> response){
      token=response.body();
      if (token == null)       listener.onFailed();
 else       listener.onSuccess();
    }
    @Override public void onFailure(    Call<JwtToken> call,    Throwable t){
      listener.onFailed();
    }
  }
);
}
Program: 39912
Project: 39912
Buggy source:
@Override public void onResponse(Call<JwtToken> call,Response<JwtToken> response){
  token=response.body();
  listener.onSuccess();
}

Fixed version (ground truth):
@Override public void onResponse(Call<JwtToken> call,Response<JwtToken> response){
  token=response.body();
  if (token == null)   listener.onFailed();
 else   listener.onSuccess();
}
Program: 39913
Project: 39913
Buggy source:
@Override public void authorize(AuthorizeListener listener){
  call.enqueue(new Callback<JwtToken>(){
    @Override public void onResponse(    Call<JwtToken> call,    Response<JwtToken> response){
      token=response.body();
      listener.onSuccess();
    }
    @Override public void onFailure(    Call<JwtToken> call,    Throwable t){
      listener.onFailed();
    }
  }
);
}

Fixed version (ground truth):
@Override public void authorize(AuthorizeListener listener){
  call.enqueue(new Callback<JwtToken>(){
    @Override public void onResponse(    Call<JwtToken> call,    Response<JwtToken> response){
      token=response.body();
      if (token == null)       listener.onFailed();
 else       listener.onSuccess();
    }
    @Override public void onFailure(    Call<JwtToken> call,    Throwable t){
      listener.onFailed();
    }
  }
);
}
Program: 39914
Project: 39914
Buggy source:
@Override public void onFailed(){
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onFailed(){
  assertFalse(strategy.isAuthorized());
}