nus-yam/ex-repair huggingface dataset:
Program: 39718
Project: 39718
Buggy source:
/** 
 * Registers a method to be ran while gui is open. Registered method runs on mouse click.
 * @param methodName the method to run
 * @return the trigger
 */
public OnTrigger registerClicked(String methodName){
  return onClick=new OnTrigger(methodName,TriggerType.OTHER){
    @Override public void trigger(    Object... args){
      if (!(args[0] instanceof Integer && args[1] instanceof Integer && args[2] instanceof Integer)) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      int mouseX=(int)args[0];
      int mouseY=(int)args[1];
      int button=(int)args[2];
      try {
        CTJS.getInstance().getModuleManager().invokeFunction(methodName,mouseX,mouseY,button);
      }
 catch (      ScriptException|NoSuchMethodException e) {
        onClick=null;
        e.printStackTrace();
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Registers a method to be ran while gui is open. Registered method runs on mouse click.
 * @param methodName the method to run
 * @return the trigger
 */
public OnTrigger registerClicked(String methodName){
  return onClick=new OnTrigger(methodName,TriggerType.OTHER){
    @Override public void trigger(    Object... args){
      if (!(args[0] instanceof Integer && args[1] instanceof Integer && args[2] instanceof Integer)) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      int mouseX=(int)args[0];
      int mouseY=(int)args[1];
      int button=(int)args[2];
      try {
        CTJS.getInstance().getModuleManager().invokeFunction(methodName,mouseX,mouseY,button);
      }
 catch (      ScriptException|NoSuchMethodException exception) {
        onClick=null;
        Console.getConsole().printStackTrace(exception);
      }
    }
  }
;
}
Program: 39719
Project: 39719
Buggy source:
private void simulateChat(String[] args){
  StringBuilder toSend=new StringBuilder();
  for (int i=1; i < args.length; i++) {
    toSend.append(args[i]).append("String_Node_Str");
  }
  ClientChatReceivedEvent event=new ClientChatReceivedEvent((byte)0,new ChatComponentText(toSend.toString()));
  CTJS.getInstance().getChatListener().onReceiveChat(event);
  if (!event.isCanceled()) {
    ChatLib.chat(event.message.getFormattedText());
  }
}

Fixed version (ground truth):
private void simulateChat(String[] args){
  StringBuilder toSend=new StringBuilder();
  for (int i=1; i < args.length; i++) {
    toSend.append(args[i]);
    if (i != args.length - 1)     toSend.append("String_Node_Str");
  }
  ClientChatReceivedEvent event=new ClientChatReceivedEvent((byte)0,new ChatComponentText(toSend.toString()));
  CTJS.getInstance().getChatListener().onReceiveChat(event);
  if (!event.isCanceled()) {
    ChatLib.chat(event.message.getFormattedText());
  }
}
Program: 39720
Project: 39720
Buggy source:
private void injectResourcePack(String path){
  try {
    File pictures=new File(path,"String_Node_Str");
    Field field=FMLClientHandler.class.getDeclaredField("String_Node_Str");
    field.setAccessible(true);
    List<IResourcePack> packs=(List<IResourcePack>)field.get(FMLClientHandler.instance());
    packs.add(imagesPack=new ImagesPack(pictures));
    pictures.mkdirs();
    assetsDir=pictures;
  }
 catch (  Exception e) {
    Console.getConsole().printStackTrace(e);
  }
}

Fixed version (ground truth):
private void injectResourcePack(String path){
  try {
    File pictures=new File(path,"String_Node_Str");
    Field field=FMLClientHandler.class.getDeclaredField("String_Node_Str");
    field.setAccessible(true);
    List<IResourcePack> packs=(List<IResourcePack>)field.get(FMLClientHandler.instance());
    packs.add(imagesPack=new ImagesPack(pictures));
    pictures.mkdirs();
    assetsDir=pictures;
  }
 catch (  Exception exception) {
    exception.printStackTrace();
  }
}
Program: 39721
Project: 39721
Buggy source:
private Object extractGenotypeValues(Object genotypeAttribute,VariantPropertyType type){
  Object defaultValue=null;
switch (type) {
case NUMERIC_COLLECTION:
case STRING_COLLECTION:
    defaultValue=new ArrayList<>();
  break;
case STRING:
defaultValue="String_Node_Str";
}
if (genotypeAttribute == null) {
return defaultValue;
}
if (type == VariantPropertyType.STRING) {
return genotypeAttribute.toString();
}
if (type == VariantPropertyType.NUMERIC) {
String value=genotypeAttribute.toString();
if ("String_Node_Str".equals(value)) {
return null;
}
return Double.parseDouble(value);
}
String[] splitValues=((String)genotypeAttribute).split("String_Node_Str");
if (type == VariantPropertyType.STRING_COLLECTION) {
return new ArrayList<>(Arrays.asList(splitValues));
}
if (type == VariantPropertyType.NUMERIC_COLLECTION) {
List<Double> parsed=Arrays.stream(splitValues).map((str) -> "String_Node_Str".equals(str) ? null : Double.parseDouble(str)).collect(Collectors.toList());
return parsed;
}
throw new IllegalStateException("String_Node_Str" + type + "String_Node_Str");
}

Fixed version (ground truth):
private Object extractGenotypeValues(Object genotypeAttribute,VariantPropertyType type){
  Object defaultValue=null;
switch (type) {
case NUMERIC_COLLECTION:
case STRING_COLLECTION:
    defaultValue=new ArrayList<>();
  break;
case STRING:
defaultValue="String_Node_Str";
}
if (genotypeAttribute == null) {
return defaultValue;
}
if (type == VariantPropertyType.STRING) {
return genotypeAttribute.toString();
}
if (type == VariantPropertyType.NUMERIC) {
String value=genotypeAttribute.toString();
if ("String_Node_Str".equals(value)) {
return null;
}
return Double.parseDouble(value);
}
List splitValues=genotypeAttribute instanceof List ? (List)genotypeAttribute : Arrays.asList(genotypeAttribute.toString().split("String_Node_Str"));
if (type == VariantPropertyType.STRING_COLLECTION) {
return new ArrayList<>(splitValues);
}
if (type == VariantPropertyType.NUMERIC_COLLECTION) {
List<Double> parsed=(List<Double>)splitValues.stream().map((str) -> "String_Node_Str".equals(str.toString()) ? null : Double.parseDouble(str.toString())).collect(Collectors.toList());
return parsed;
}
throw new IllegalStateException("String_Node_Str" + type + "String_Node_Str");
}
Program: 39722
Project: 39722
Buggy source:
private boolean isCollectionType(VCFCompoundHeaderLine info){
  VCFHeaderLineCount count=info.getCountType();
  return count == VCFHeaderLineCount.A || count == VCFHeaderLineCount.R || count == VCFHeaderLineCount.UNBOUNDED || (count == VCFHeaderLineCount.INTEGER && info.getCount() > 1);
}

Fixed version (ground truth):
private boolean isCollectionType(VCFCompoundHeaderLine info){
  VCFHeaderLineCount count=info.getCountType();
  return count == VCFHeaderLineCount.A || count == VCFHeaderLineCount.G || count == VCFHeaderLineCount.R || count == VCFHeaderLineCount.UNBOUNDED || (count == VCFHeaderLineCount.INTEGER && info.getCount() > 1);
}
Program: 39723
Project: 39723
Buggy source:
private String getSingleColumnValue(List call,String column){
  VariantPropertyType type=getColumnType(column);
  Object value=call.get(indexMap.get(column));
switch (type) {
case STRING:
    return (String)value;
case STRING_COLLECTION:
  List<String> values=(List<String>)value;
if (values.size() != 1) {
  throw new IllegalStateException("String_Node_Str");
}
return values.get(0);
default :
throw new IllegalStateException("String_Node_Str");
}
}

Fixed version (ground truth):
private String getSingleColumnValue(List call,String column){
  VariantPropertyType type=getColumnType(column);
  Object value=call.get(indexMap.get(column));
switch (type) {
case NUMERIC:
case STRING:
    return value.toString();
case NUMERIC_COLLECTION:
case STRING_COLLECTION:
  List values=(List)value;
if (values.size() != 1) {
  throw new IllegalStateException("String_Node_Str");
}
return values.get(0).toString();
default :
throw new IllegalStateException("String_Node_Str");
}
}
Program: 39725
Project: 39725
Buggy source:
public void checkConnect(final Context context){
  BmobUtil.connect(BmobUser.getCurrentUser(User.class),new BmobEvent.onConnectListener(){
    @Override public void connectSuccessful(    User user){
      EventBus.getDefault().post(new BmobIMMessage());
      BmobIM.getInstance().updateUserInfo(new BmobIMUserInfo(user.getObjectId(),user.getUsername(),null));
    }
    @Override public void connectFailed(    String error){
      Toast.makeText(context,error,Toast.LENGTH_SHORT).show();
    }
  }
);
  BmobIM.getInstance().setOnConnectStatusChangeListener(new ConnectStatusChangeListener(){
    @Override public void onChange(    ConnectionStatus status){
      Toast.makeText(context,status.getMsg(),Toast.LENGTH_SHORT).show();
      L.i(BmobIM.getInstance().getCurrentStatus().getMsg());
    }
  }
);
}

Fixed version (ground truth):
public void checkConnect(){
  mSendToUsername=BmobUser.getCurrentUser(User.class).getContact().get(0).getUsername();
  BmobUtil.connect(BmobUser.getCurrentUser(User.class),new BmobEvent.onConnectListener(){
    @Override public void connectSuccessful(    User user){
      BmobIM.getInstance().updateUserInfo(new BmobIMUserInfo(user.getObjectId(),user.getUsername(),null));
      checkConversations(mSendToUsername,true);
    }
    @Override public void connectFailed(    String error){
      toast(error);
    }
  }
);
}
Program: 39726
Project: 39726
Buggy source:
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_map);
  ButterKnife.bind(this);
  checkConnect(this);
  List<BmobIMConversation> list=BmobIM.getInstance().loadAllConversation();
  if (null != list) {
    mIMConversations.addAll(list);
  }
  User user=BmobUser.getCurrentUser(User.class);
  mSendToUsername=user.getContact().get(0).getUsername();
  checkConversations(mSendToUsername,true);
  initLocation();
  mMapView.onCreate(savedInstanceState);
  init();
  checkLocationPermission();
  EventBus.getDefault().register(this);
}

Fixed version (ground truth):
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_map);
  ButterKnife.bind(this);
  BmobIM.getInstance().setOnConnectStatusChangeListener(new ConnectStatusChangeListener(){
    @Override public void onChange(    ConnectionStatus status){
      Toast.makeText(MapActivity.this,status.getMsg(),Toast.LENGTH_SHORT).show();
      L.i(BmobIM.getInstance().getCurrentStatus().getMsg());
      if (status.equals(ConnectionStatus.DISCONNECT)) {
        checkConnect();
      }
 else       if (status.equals(ConnectionStatus.NETWORK_UNAVAILABLE)) {
        toast("String_Node_Str");
      }
    }
  }
);
  List<BmobIMConversation> list=BmobIM.getInstance().loadAllConversation();
  if (null != list) {
    mIMConversations.addAll(list);
  }
  initLocation();
  mMapView.onCreate(savedInstanceState);
  init();
  checkLocationPermission();
  EventBus.getDefault().register(this);
}
Program: 39727
Project: 39727
Buggy source:
@Override public void onChange(ConnectionStatus status){
  Toast.makeText(context,status.getMsg(),Toast.LENGTH_SHORT).show();
  L.i(BmobIM.getInstance().getCurrentStatus().getMsg());
}

Fixed version (ground truth):
@Override public void onChange(ConnectionStatus status){
  Toast.makeText(MapActivity.this,status.getMsg(),Toast.LENGTH_SHORT).show();
  L.i(BmobIM.getInstance().getCurrentStatus().getMsg());
  if (status.equals(ConnectionStatus.DISCONNECT)) {
    checkConnect();
  }
 else   if (status.equals(ConnectionStatus.NETWORK_UNAVAILABLE)) {
    toast("String_Node_Str");
  }
}
Program: 39728
Project: 39728
Buggy source:
private void sendToChildrenLocation(final String address,final LatLng latLng){
  BmobIMLocationMessage message=new BmobIMLocationMessage();
  message.setAddress(address);
  message.setLatitude(latLng.latitude);
  message.setLongitude(latLng.longitude);
  mConversationManager.sendMessage(message,new MessageSendListener(){
    @Override public void done(    BmobIMMessage bmobIMMessage,    BmobException e){
      if (e != null) {
        L.i(e.getMessage());
      }
 else {
        L.i("String_Node_Str" + address);
        L.i("String_Node_Str" + latLng.latitude);
        L.i("String_Node_Str" + latLng.longitude);
      }
    }
  }
);
}

Fixed version (ground truth):
private void sendToChildrenLocation(final String address,final LatLng latLng){
  BmobIMLocationMessage message=new BmobIMLocationMessage();
  message.setAddress(address);
  message.setLatitude(latLng.latitude);
  message.setLongitude(latLng.longitude);
  mConversationManager.sendMessage(message,new MessageSendListener(){
    @Override public void done(    BmobIMMessage bmobIMMessage,    BmobException e){
      if (e != null) {
        L.i(e.getMessage());
      }
 else {
        L.i("String_Node_Str");
        L.i("String_Node_Str" + address);
        L.i("String_Node_Str" + latLng.latitude);
        L.i("String_Node_Str" + latLng.longitude);
      }
    }
  }
);
}
Program: 39729
Project: 39729
Buggy source:
public void checkConnect(){
  mSendToUsername=BmobUser.getCurrentUser(User.class).getContact().get(0).getUsername();
  BmobUtil.connect(BmobUser.getCurrentUser(User.class),new BmobEvent.onConnectListener(){
    @Override public void connectSuccessful(    User user){
      BmobIM.getInstance().updateUserInfo(new BmobIMUserInfo(user.getObjectId(),user.getUsername(),null));
      checkConversations(mSendToUsername,true);
    }
    @Override public void connectFailed(    String error){
      toast(error);
    }
  }
);
}

Fixed version (ground truth):
public void checkConnect(){
  mSendToUsername=BmobUser.getCurrentUser(User.class).getContact().get(0).getUsername();
  BmobUtil.connect(BmobUser.getCurrentUser(User.class),new BmobEvent.onConnectListener(){
    @Override public void connectSuccessful(    User user){
      BmobIM.getInstance().updateUserInfo(new BmobIMUserInfo(user.getObjectId(),user.getUsername(),null));
      checkConversations(mSendToUsername,true);
    }
    @Override public void connectFailed(    String error){
      toast(error);
    }
  }
);
  BmobIM.getInstance().setOnConnectStatusChangeListener(new ConnectStatusChangeListener(){
    @Override public void onChange(    ConnectionStatus status){
      toast(status.getMsg());
      L.i(BmobIM.getInstance().getCurrentStatus().getMsg());
    }
  }
);
}
Program: 39730
Project: 39730
Buggy source:
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_map);
  ButterKnife.bind(this);
  BmobIM.getInstance().setOnConnectStatusChangeListener(new ConnectStatusChangeListener(){
    @Override public void onChange(    ConnectionStatus status){
      Toast.makeText(MapActivity.this,status.getMsg(),Toast.LENGTH_SHORT).show();
      L.i(BmobIM.getInstance().getCurrentStatus().getMsg());
      if (status.equals(ConnectionStatus.DISCONNECT)) {
        checkConnect();
      }
 else       if (status.equals(ConnectionStatus.NETWORK_UNAVAILABLE)) {
        toast("String_Node_Str");
      }
    }
  }
);
  List<BmobIMConversation> list=BmobIM.getInstance().loadAllConversation();
  if (null != list) {
    mIMConversations.addAll(list);
  }
  initLocation();
  mMapView.onCreate(savedInstanceState);
  init();
  checkLocationPermission();
  EventBus.getDefault().register(this);
}

Fixed version (ground truth):
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_map);
  ButterKnife.bind(this);
  checkConnect();
  List<BmobIMConversation> list=BmobIM.getInstance().loadAllConversation();
  if (null != list) {
    mIMConversations.addAll(list);
  }
  initLocation();
  mMapView.onCreate(savedInstanceState);
  init();
  checkLocationPermission();
  EventBus.getDefault().register(this);
}
Program: 39731
Project: 39731
Buggy source:
@Override public void onChange(ConnectionStatus status){
  Toast.makeText(MapActivity.this,status.getMsg(),Toast.LENGTH_SHORT).show();
  L.i(BmobIM.getInstance().getCurrentStatus().getMsg());
  if (status.equals(ConnectionStatus.DISCONNECT)) {
    checkConnect();
  }
 else   if (status.equals(ConnectionStatus.NETWORK_UNAVAILABLE)) {
    toast("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onChange(ConnectionStatus status){
  toast(status.getMsg());
  L.i(BmobIM.getInstance().getCurrentStatus().getMsg());
}
Program: 39733
Project: 39733
Buggy source:
private void processSDKMessage(BmobIMMessage msg,MessageEvent event){
  L.i("String_Node_Str");
  if (msg.getMsgType().equals(BmobIMMessageType.LOCATION.getType())) {
    L.i("String_Node_Str");
    BmobIMLocationMessage locationMessage=BmobIMLocationMessage.buildFromDB(msg);
    EventBus.getDefault().post(locationMessage);
  }
 else {
    EventBus.getDefault().post(event);
  }
}

Fixed version (ground truth):
private void processSDKMessage(BmobIMMessage msg,MessageEvent event){
  L.i("String_Node_Str");
  EventBus.getDefault().post(event);
}
Program: 39734
Project: 39734
Buggy source:
private void sendToCloseShareMap(){
  ShareMapMessage message=new ShareMapMessage();
  message.setContent(ShareMapMessage.CLOSE);
  mConversationManager.sendMessage(message,new MessageSendListener(){
    @Override public void done(    BmobIMMessage bmobIMMessage,    BmobException e){
      if (null == e) {
        toast("String_Node_Str");
      }
 else {
        toast(e.getMessage());
        L.i("String_Node_Str",e.getMessage());
      }
    }
  }
);
}

Fixed version (ground truth):
private void sendToCloseShareMap(){
  ShareMapMessage message=new ShareMapMessage();
  message.setContent(ShareMapMessage.CLOSE);
  mConversationManager.sendMessage(message,new MessageSendListener(){
    @Override public void done(    BmobIMMessage bmobIMMessage,    BmobException e){
      if (null == e) {
        toast("String_Node_Str");
      }
 else {
        toast(e.getMessage());
        L.i("String_Node_Str" + e.getMessage());
      }
    }
  }
);
}
Program: 39735
Project: 39735
Buggy source:
public void checkConnect(){
  mSendToUsername=BmobUser.getCurrentUser(User.class).getContact().get(0).getUsername();
  BmobUtil.connect(BmobUser.getCurrentUser(User.class),new BmobEvent.onConnectListener(){
    @Override public void connectSuccessful(    User user){
      BmobIM.getInstance().updateUserInfo(new BmobIMUserInfo(user.getObjectId(),user.getUsername(),null));
      checkConversations(mSendToUsername,true);
    }
    @Override public void connectFailed(    String error){
      toast(error);
    }
  }
);
  BmobIM.getInstance().setOnConnectStatusChangeListener(new ConnectStatusChangeListener(){
    @Override public void onChange(    ConnectionStatus status){
      toast(status.getMsg());
      L.i(BmobIM.getInstance().getCurrentStatus().getMsg());
    }
  }
);
}

Fixed version (ground truth):
public void checkConnect(){
  mSendToUsername=BmobUser.getCurrentUser(User.class).getContact().get(0).getUsername();
  L.i("String_Node_Str" + mSendToUsername);
  BmobUtil.connect(BmobUser.getCurrentUser(User.class),new BmobEvent.onConnectListener(){
    @Override public void connectSuccessful(    User user){
      BmobIM.getInstance().updateUserInfo(new BmobIMUserInfo(user.getObjectId(),user.getUsername(),null));
      checkConversations(mSendToUsername,true);
    }
    @Override public void connectFailed(    String error){
      toast(error);
    }
  }
);
  BmobIM.getInstance().setOnConnectStatusChangeListener(new ConnectStatusChangeListener(){
    @Override public void onChange(    ConnectionStatus status){
      toast(status.getMsg());
      L.i(BmobIM.getInstance().getCurrentStatus().getMsg());
    }
  }
);
}
Program: 39736
Project: 39736
Buggy source:
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_map);
  ButterKnife.bind(this);
  checkConnect();
  List<BmobIMConversation> list=BmobIM.getInstance().loadAllConversation();
  if (null != list) {
    mIMConversations.addAll(list);
  }
  initLocation();
  mMapView.onCreate(savedInstanceState);
  init();
  checkLocationPermission();
  EventBus.getDefault().register(this);
}

Fixed version (ground truth):
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_map);
  ButterKnife.bind(this);
  List<BmobIMConversation> list=BmobIM.getInstance().loadAllConversation();
  if (null != list) {
    mIMConversations.addAll(list);
  }
  checkConnect();
  initLocation();
  mMapView.onCreate(savedInstanceState);
  init();
  checkLocationPermission();
  EventBus.getDefault().register(this);
}
Program: 39737
Project: 39737
Buggy source:
@OnClick({R2.id.action_locate,R2.id.action_settings,R2.id.action_reminder}) public void onViewClicked(View view){
  int id=view.getId();
  if (id == R.id.action_locate) {
    toast("String_Node_Str");
  }
 else   if (id == R.id.action_settings) {
    startActivity(new Intent(this,SettingsActivity.class));
  }
 else   if (id == R.id.action_reminder) {
    startActivity(new Intent(this,ReminderActivity.class));
  }
  mFloatingActionsMenu.toggle();
}

Fixed version (ground truth):
@OnClick({R2.id.action_locate,R2.id.action_settings,R2.id.action_reminder}) public void onViewClicked(View view){
  int id=view.getId();
  if (id == R.id.action_locate) {
    checkConversations(mSendToUsername,true);
  }
 else   if (id == R.id.action_settings) {
    startActivity(new Intent(this,SettingsActivity.class));
  }
 else   if (id == R.id.action_reminder) {
    startActivity(new Intent(this,ReminderActivity.class));
  }
  mFloatingActionsMenu.toggle();
}
Program: 39739
Project: 39739
Buggy source:
@Override public void done(BmobIMMessage bmobIMMessage,BmobException e){
  if (null == e) {
    toast("String_Node_Str");
  }
 else {
    toast(e.getMessage());
    L.i("String_Node_Str",e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void done(BmobIMMessage bmobIMMessage,BmobException e){
  if (null == e) {
    toast("String_Node_Str");
  }
 else {
    toast(e.getMessage());
    L.i("String_Node_Str" + e.getMessage());
  }
}
Program: 39740
Project: 39740
Buggy source:
private void sendToOpenSharedMap(){
  ShareMapMessage message=new ShareMapMessage();
  message.setContent(ShareMapMessage.OPEN);
  mConversationManager.sendMessage(message,new MessageSendListener(){
    @Override public void done(    BmobIMMessage bmobIMMessage,    BmobException e){
      if (null == e) {
        toast("String_Node_Str");
      }
 else {
        toast(e.getMessage());
        L.i("String_Node_Str",e.getMessage());
      }
    }
  }
);
}

Fixed version (ground truth):
private void sendToOpenSharedMap(){
  ShareMapMessage message=new ShareMapMessage();
  message.setContent(ShareMapMessage.OPEN);
  mConversationManager.sendMessage(message,new MessageSendListener(){
    @Override public void done(    BmobIMMessage bmobIMMessage,    BmobException e){
      if (null == e) {
        toast("String_Node_Str");
      }
 else {
        toast(e.getMessage());
        L.i("String_Node_Str" + e.getMessage());
      }
    }
  }
);
}
Program: 39741
Project: 39741
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  BmobAPI.init(this,new IMMessageHandler(this));
  if (BuildConfig.DEBUG) {
    ARouter.openLog();
    ARouter.openDebug();
  }
  ARouter.init(this);
  L.Debug=true;
  XFYun.init(this);
  GreenDaoConfig.getInstance().init(this);
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  if (BuildConfig.DEBUG) {
    ARouter.openLog();
    ARouter.openDebug();
  }
  ARouter.init(this);
  L.Debug=true;
  XFYun.init(this);
  GreenDaoConfig.getInstance().init(this);
  BmobAPI.init(this,new IMMessageHandler(this));
}
Program: 39742
Project: 39742
Buggy source:
/** 
 * 注册消息接收时间
 * @param event
 */
@Subscribe(sticky=true) public void onHandleMessageEvent(MessageEvent event){
  L.i("String_Node_Str");
  handleMessage(event);
}

Fixed version (ground truth):
/** 
 * 注册消息接收时间
 * @param event
 */
@Subscribe public void onHandleMessageEvent(MessageEvent event){
  L.i("String_Node_Str");
  handleMessage(event);
}
Program: 39743
Project: 39743
Buggy source:
public static SmsFragment newInstance(){
  return Holder.sInstance;
}

Fixed version (ground truth):
public static SmsFragment newInstance(){
  return new SmsFragment();
}
Program: 39744
Project: 39744
Buggy source:
@Override public void onViewCreated(View view,@Nullable Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  mSmsTextView=(TextView)view.findViewById(R.id.sms_text_view);
  RequestPermissions.requestRuntimePermission(getActivity(),new String[]{Manifest.permission.RECEIVE_SMS},new RequestPermissions.OnRequestPermissionsListener(){
    @Override public void onGranted(){
    }
    @Override public void onDenied(    List<String> deniedPermission){
    }
  }
);
  EventBus.getDefault().register(this);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,@Nullable Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  mSmsTextView=(TextView)view.findViewById(R.id.sms_text_view);
  RequestPermissions.requestRuntimePermission(getActivity(),new String[]{Manifest.permission.RECEIVE_SMS},new RequestPermissions.OnRequestPermissionsListener(){
    @Override public void onGranted(){
    }
    @Override public void onDenied(    List<String> deniedPermission){
    }
  }
);
  if (!EventBus.getDefault().isRegistered(this)) {
    EventBus.getDefault().register(this);
  }
}
Program: 39747
Project: 39747
Buggy source:
@GetMapping("String_Node_Str") List<Booking> bookingsByUser(@PathVariable UUID user){
  return view.currentBookings().filter(b -> b.getUserId() == user).collect(toList());
}

Fixed version (ground truth):
@GetMapping("String_Node_Str") List<Booking> bookingsByUser(@PathVariable UUID user){
  return view.currentBookings().filter(b -> b.getUserId().equals(user)).collect(toList());
}
Program: 39748
Project: 39748
Buggy source:
@Override public void onRobotFocusGained(QiContext qiContext){
  this.qiContext=qiContext;
  String textToSay="String_Node_Str";
  displayLine(textToSay,ConversationItemType.ROBOT_OUTPUT);
  Say say=SayBuilder.with(qiContext).withText(textToSay).build();
  say.run();
  startCounting();
}

Fixed version (ground truth):
@Override public void onRobotFocusGained(QiContext qiContext){
  this.qiContext=qiContext;
  String textToSay="String_Node_Str";
  displayLine(textToSay,ConversationItemType.ROBOT_OUTPUT);
  Say say=SayBuilder.with(qiContext).withText(textToSay).build();
  say.run();
}
Program: 39749
Project: 39749
Buggy source:
@Override public void consume(Future<Void> voidFuture) throws Throwable {
  setButtonText("String_Node_Str");
  if (voidFuture.hasError()) {
    Log.e(TAG,voidFuture.getErrorMessage());
  }
}

Fixed version (ground truth):
@Override public void consume(Future<Void> future) throws Throwable {
  if (future.hasError()) {
    String message="String_Node_Str";
    Log.e(TAG,message,future.getError());
    displayLine(message,ConversationItemType.ERROR_LOG);
  }
 else {
    String message="String_Node_Str";
    Log.i(TAG,message);
    displayLine(message,ConversationItemType.INFO_LOG);
  }
  setButtonText(getResources().getString(R.string.enforce_tablet_reachability));
  String textToSay="String_Node_Str";
  displayLine(textToSay,ConversationItemType.ROBOT_OUTPUT);
  Say say=SayBuilder.with(qiContext).withText(textToSay).build();
  say.run();
}
Program: 39750
Project: 39750
Buggy source:
@Override public void onStarted(){
  setButtonText("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onStarted(){
  String infoLog="String_Node_Str";
  displayLine(infoLog,ConversationItemType.INFO_LOG);
}
Program: 39752
Project: 39752
Buggy source:
private void createCompressedImageWithExceptions(String image,String directoryPath,final Callback successCb,final Callback failureCb) throws IOException {
  File imageFile=new ImageCompress(this).setDestinationDirectoryPath(Environment.getExternalStorageDirectory().getPath()).compressToFile(new File(uriPath.getRealPathFromURI(Uri.parse(image))),directoryPath);
  if (imageFile != null) {
    WritableMap response=Arguments.createMap();
    response.putString("String_Node_Str",imageFile.getAbsolutePath());
    response.putString("String_Node_Str",Uri.fromFile(imageFile).toString());
    response.putString("String_Node_Str",imageFile.getName());
    response.putDouble("String_Node_Str",imageFile.length());
    successCb.invoke(response);
  }
 else {
    failureCb.invoke("String_Node_Str");
  }
}

Fixed version (ground truth):
private void createCompressedImageWithExceptions(String image,String directoryPath,final Callback successCb,final Callback failureCb) throws IOException {
  File imageFile=new ImageCompress(mContext).setDestinationDirectoryPath(Environment.getExternalStorageDirectory().getPath()).compressToFile(new File(uriPath.getRealPathFromURI(Uri.parse(image))),directoryPath);
  if (imageFile != null) {
    WritableMap response=Arguments.createMap();
    response.putString("String_Node_Str",imageFile.getAbsolutePath());
    response.putString("String_Node_Str",Uri.fromFile(imageFile).toString());
    response.putString("String_Node_Str",imageFile.getName());
    response.putDouble("String_Node_Str",imageFile.length());
    successCb.invoke(response);
  }
 else {
    failureCb.invoke("String_Node_Str");
  }
}
Program: 39753
Project: 39753
Buggy source:
private void createCustomCompressedImageWithExceptions(String image,String directoryPath,int maxWidth,int maxHeight,int quality,final Callback successCb,final Callback failureCb) throws IOException {
  File imageFile=new ImageCompress(this).setMaxWidth(maxWidth).setMaxHeight(maxHeight).setQuality(quality).setCompressFormat(Bitmap.CompressFormat.JPEG).setDestinationDirectoryPath(Environment.getExternalStorageDirectory().getPath()).compressToFile(new File(uriPath.getRealPathFromURI(Uri.parse(image))),directoryPath);
  if (imageFile != null) {
    WritableMap response=Arguments.createMap();
    response.putString("String_Node_Str",imageFile.getAbsolutePath());
    response.putString("String_Node_Str",Uri.fromFile(imageFile).toString());
    response.putString("String_Node_Str",imageFile.getName());
    response.putDouble("String_Node_Str",imageFile.length());
    successCb.invoke(response);
  }
 else {
    failureCb.invoke("String_Node_Str");
  }
}

Fixed version (ground truth):
private void createCustomCompressedImageWithExceptions(String image,String directoryPath,int maxWidth,int maxHeight,int quality,final Callback successCb,final Callback failureCb) throws IOException {
  File imageFile=new ImageCompress(mContext).setMaxWidth(maxWidth).setMaxHeight(maxHeight).setQuality(quality).setCompressFormat(Bitmap.CompressFormat.JPEG).setDestinationDirectoryPath(Environment.getExternalStorageDirectory().getPath()).compressToFile(new File(uriPath.getRealPathFromURI(Uri.parse(image))),directoryPath);
  if (imageFile != null) {
    WritableMap response=Arguments.createMap();
    response.putString("String_Node_Str",imageFile.getAbsolutePath());
    response.putString("String_Node_Str",Uri.fromFile(imageFile).toString());
    response.putString("String_Node_Str",imageFile.getName());
    response.putDouble("String_Node_Str",imageFile.length());
    successCb.invoke(response);
  }
 else {
    failureCb.invoke("String_Node_Str");
  }
}
Program: 39754
Project: 39754
Buggy source:
/** 
 * 构造方法
 * @param paramMap 参数Map
 */
public Params(Map<String,Object> paramMap){
  this.paramMap=paramMap;
  PropertiesUtil.Parser parser=PropertiesUtil.loadProps(ConfigHelper.getAppViewReplaceStrFileName());
  this.paramMap.putAll(parser.getMap());
}

Fixed version (ground truth):
/** 
 * 构造方法
 * @param paramMap 参数Map
 */
public Params(Map<String,Object> paramMap){
  this.paramMap=paramMap;
}
Program: 39755
Project: 39755
Buggy source:
/** 
 * 构造方法
 * @param path 视图路径
 */
public View(String path){
  this.path=path;
  dataModel=new HashMap<String,Object>();
}

Fixed version (ground truth):
/** 
 * 构造方法
 * @param path 视图路径
 */
public View(String path){
  this.path=path;
  dataModel=new HashMap<String,Object>();
  PropertiesUtil.Parser parser=PropertiesUtil.loadProps(ConfigHelper.getAppViewReplaceStrFileName());
  if (parser != null) {
    dataModel.putAll(parser.getMap());
  }
}
Program: 39756
Project: 39756
Buggy source:
/** 
 * 加载属性文件
 */
public static Parser loadProps(String fileName){
  Properties properties=null;
  InputStream inputStream=null;
  try {
    inputStream=Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
    if (inputStream == null) {
      throw new FileNotFoundException(fileName + "String_Node_Str");
    }
    properties=new Properties();
    properties.load(inputStream);
  }
 catch (  FileNotFoundException e) {
    LOGGER.error(fileName + "String_Node_Str",e);
  }
catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
 finally {
    if (inputStream != null) {
      try {
        inputStream.close();
      }
 catch (      IOException e) {
        LOGGER.error("String_Node_Str",e);
      }
    }
  }
  return new Parser(properties);
}

Fixed version (ground truth):
/** 
 * 加载属性文件
 */
public static Parser loadProps(String fileName){
  Properties properties=null;
  InputStream inputStream=null;
  try {
    inputStream=Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
    if (inputStream == null) {
      throw new FileNotFoundException(fileName + "String_Node_Str");
    }
    properties=new Properties();
    properties.load(inputStream);
  }
 catch (  FileNotFoundException e) {
    LOGGER.error(fileName + "String_Node_Str",e);
  }
catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
 finally {
    if (inputStream != null) {
      try {
        inputStream.close();
      }
 catch (      IOException e) {
        LOGGER.error("String_Node_Str",e);
      }
    }
  }
  return properties == null ? null : new Parser(properties);
}
Program: 39757
Project: 39757
Buggy source:
/** 
 * 执行代理
 * @param proxyChain 代理链
 * @return 方法执行结果
 * @throws Throwable 抛出异常
 */
@Override public final Object doProxy(ProxyChain proxyChain) throws Throwable {
  Object result=null;
  Class<?> cls=proxyChain.getTargetClass();
  Method method=proxyChain.getTargetMethod();
  Object[] params=proxyChain.getTargetMethodParams();
  begin();
  try {
    if (intercept(cls,method,params)) {
      before(cls,method,params);
      result=proxyChain.doProxyChain();
      after(cls,method,params,result);
    }
 else {
      result=proxyChain.doProxyChain();
    }
  }
 catch (  Throwable throwable) {
    LOGGER.error("String_Node_Str",throwable);
    error(cls,method,params,throwable);
  }
 finally {
    end();
  }
  return result;
}

Fixed version (ground truth):
/** 
 * 执行代理
 * @param proxyChain 代理链
 * @return 方法执行结果
 * @throws Throwable 抛出异常
 */
@Override public final Object doProxy(ProxyChain proxyChain) throws Throwable {
  Object result=null;
  HttpServletResponse response=ServletApi.getResponse();
  Class<?> cls=proxyChain.getTargetClass();
  Method method=proxyChain.getTargetMethod();
  Object[] params=proxyChain.getTargetMethodParams();
  begin();
  try {
    if (intercept(cls,method,params)) {
      if (!response.isCommitted()) {
        before(cls,method,params);
      }
      if (!response.isCommitted()) {
        result=proxyChain.doProxyChain();
      }
      if (!response.isCommitted()) {
        after(cls,method,params,result);
      }
    }
 else {
      result=proxyChain.doProxyChain();
    }
  }
 catch (  Throwable throwable) {
    LOGGER.error("String_Node_Str",throwable);
    error(cls,method,params,throwable);
  }
 finally {
    end();
  }
  return result;
}
Program: 39758
Project: 39758
Buggy source:
/** 
 * 执行代理链（链式执行，返回则相反）
 * @return 方法执行结果
 * @throws Throwable 抛出异常（交由上级处理）
 */
public Object doProxyChain() throws Throwable {
  Object result;
  if (proxyIndex < proxyList.size()) {
    result=proxyList.get(proxyIndex++).doProxy(this);
  }
 else {
    result=methodProxy.invokeSuper(targetObject,targetMethodParams);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * 执行代理链（链式执行，返回则相反）
 * @return 方法执行结果
 * @throws Throwable 抛出异常（交由上级处理）
 */
public Object doProxyChain() throws Throwable {
  Object result;
  if (proxyIndex < proxyList.size()) {
    result=proxyList.get(proxyIndex++).doProxy(this);
  }
 else   if (!ServletApi.getResponse().isCommitted()) {
    result=methodProxy.invokeSuper(targetObject,targetMethodParams);
  }
 else {
    result=null;
  }
  return result;
}
Program: 39760
Project: 39760
Buggy source:
final Object invokeImpl(Object thiz,boolean arrayChecks,Object... args) throws Exception {
  try {
    final AbstractFXPresenter presenter=(AbstractFXPresenter)presenter();
    if (LOG.isLoggable(Level.FINE)) {
      LOG.log(Level.FINE,"String_Node_Str",new Object[]{++call,id});
      LOG.log(Level.FINER,"String_Node_Str",thiz);
      LOG.log(Level.FINER,"String_Node_Str",Arrays.asList(args));
    }
    List<Object> all=new ArrayList<Object>(args.length + 1);
    all.add(thiz == null ? presenter.undefined() : thiz);
    for (int i=0; i < args.length; i++) {
      Object conv=args[i];
      if (arrayChecks) {
        boolean alive=keepAlive == null || keepAlive[i];
        conv=presenter.toJavaScript(conv,alive);
      }
      all.add(conv);
    }
    Object ret=fn.call("String_Node_Str",all.toArray());
    if (ret == presenter.undefined()) {
      return null;
    }
    if (!arrayChecks) {
      return ret;
    }
    return presenter.toJava(ret);
  }
 catch (  Error t) {
    t.printStackTrace();
    throw t;
  }
catch (  Exception t) {
    t.printStackTrace();
    throw t;
  }
}

Fixed version (ground truth):
final Object invokeImpl(Object thiz,boolean arrayChecks,Object... args) throws Exception {
  try {
    final AbstractFXPresenter presenter=(AbstractFXPresenter)presenter();
    if (LOG.isLoggable(Level.FINE)) {
      LOG.log(Level.FINE,"String_Node_Str",new Object[]{++call,id});
      LOG.log(Level.FINER,"String_Node_Str",thiz);
      LOG.log(Level.FINER,"String_Node_Str",Arrays.asList(args));
    }
    List<Object> all=new ArrayList<Object>(args.length + 1);
    all.add(thiz == null ? presenter.undefined() : presenter.toJavaScript(thiz,true));
    for (int i=0; i < args.length; i++) {
      Object conv=args[i];
      if (arrayChecks) {
        boolean alive=keepAlive == null || keepAlive[i];
        conv=presenter.toJavaScript(conv,alive);
      }
      all.add(conv);
    }
    Object ret=fn.call("String_Node_Str",all.toArray());
    if (ret == presenter.undefined()) {
      return null;
    }
    if (!arrayChecks) {
      return ret;
    }
    return presenter.toJava(ret);
  }
 catch (  Error t) {
    t.printStackTrace();
    throw t;
  }
catch (  Exception t) {
    t.printStackTrace();
    throw t;
  }
}
Program: 39761
Project: 39761
Buggy source:
@KOTest public void noLongerNeededArrayElementsCanDisappear() throws Exception {
  BrwsrCtx ctx=Utils.newContext(GCKnockoutTest.class);
  Object exp=Utils.exposeHTML(GCKnockoutTest.class,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  try {
    GC m=Models.bind(new GC(),ctx);
    m.getAll().add(new Fullname("String_Node_Str","String_Node_Str"));
    Models.applyBindings(m);
    int cnt=Utils.countChildren(GCKnockoutTest.class,"String_Node_Str");
    assertEquals(cnt,1,"String_Node_Str" + cnt);
    m.getAll().add(new Fullname("String_Node_Str","String_Node_Str"));
    cnt=Utils.countChildren(GCKnockoutTest.class,"String_Node_Str");
    assertEquals(cnt,2,"String_Node_Str" + cnt);
    Fullname removed=m.getAll().get(0);
    m.getAll().remove(0);
    cnt=Utils.countChildren(GCKnockoutTest.class,"String_Node_Str");
    assertEquals(cnt,1,"String_Node_Str" + cnt);
    Reference<?> ref=new WeakReference<Object>(removed);
    removed=null;
    assertGC(ref,"String_Node_Str");
    ref=new WeakReference<Object>(m);
    m=null;
    assertNotGC(ref,"String_Node_Str");
  }
  finally {
    Utils.exposeHTML(GCKnockoutTest.class,"String_Node_Str");
  }
}

Fixed version (ground truth):
@KOTest public void noLongerNeededArrayElementsCanDisappear() throws Exception {
  BrwsrCtx ctx=Utils.newContext(GCKnockoutTest.class);
  Object exp=Utils.exposeHTML(GCKnockoutTest.class,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  try {
    GC m=Models.bind(new GC(),ctx);
    m.getAll().add(new Fullname("String_Node_Str","String_Node_Str"));
    Models.applyBindings(m);
    int cnt=Utils.countChildren(GCKnockoutTest.class,"String_Node_Str");
    assertEquals(cnt,1,"String_Node_Str" + cnt);
    m.getAll().add(new Fullname("String_Node_Str","String_Node_Str"));
    cnt=Utils.countChildren(GCKnockoutTest.class,"String_Node_Str");
    assertEquals(cnt,2,"String_Node_Str" + cnt);
    Fullname removed=m.getAll().remove(0);
    cnt=Utils.countChildren(GCKnockoutTest.class,"String_Node_Str");
    assertEquals(cnt,1,"String_Node_Str" + cnt);
    Reference<?> ref=new WeakReference<Object>(removed);
    removed=null;
    assertGC(ref,"String_Node_Str");
    ref=new WeakReference<Object>(m);
    m=null;
    assertNotGC(ref,"String_Node_Str");
  }
  finally {
    Utils.exposeHTML(GCKnockoutTest.class,"String_Node_Str");
  }
}
Program: 39762
Project: 39762
Buggy source:
private void notifyChange(){
  proto.getContext().execute(new Runnable(){
    @Override public void run(){
      Bindings m=PropertyBindingAccessor.getBindings(proto,false,null);
      if (m != null) {
        m.valueHasMutated(name,null,JSONList.this);
        for (        String dependant : deps) {
          m.valueHasMutated(dependant,null,null);
        }
        if (index >= 0) {
          PropertyBindingAccessor.notifyProtoChange(proto,index);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
private void notifyChange(){
  proto.getContext().execute(new Runnable(){
    @Override public void run(){
      proto.valueHasMutated(name);
      Bindings m=PropertyBindingAccessor.getBindings(proto,false,null);
      if (m != null) {
        for (        String dependant : deps) {
          m.valueHasMutated(dependant,null,null);
        }
        if (index >= 0) {
          PropertyBindingAccessor.notifyProtoChange(proto,index);
        }
      }
    }
  }
);
}
Program: 39763
Project: 39763
Buggy source:
@Override public void run(){
  Bindings m=PropertyBindingAccessor.getBindings(proto,false,null);
  if (m != null) {
    m.valueHasMutated(name,null,JSONList.this);
    for (    String dependant : deps) {
      m.valueHasMutated(dependant,null,null);
    }
    if (index >= 0) {
      PropertyBindingAccessor.notifyProtoChange(proto,index);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  proto.valueHasMutated(name);
  Bindings m=PropertyBindingAccessor.getBindings(proto,false,null);
  if (m != null) {
    for (    String dependant : deps) {
      m.valueHasMutated(dependant,null,null);
    }
    if (index >= 0) {
      PropertyBindingAccessor.notifyProtoChange(proto,index);
    }
  }
}
Program: 39764
Project: 39764
Buggy source:
void add(Watcher w,Ref r){
  Thread.holdsLock(GLOBAL);
  if (w == null) {
    return;
  }
  Iterator<Ref> it=observers.iterator();
  while (it.hasNext()) {
    Ref ref=it.next();
    if (r == ref) {
      return;
    }
    final Watcher rw=ref.get();
    if (rw == null) {
      it.remove();
      continue;
    }
    if (rw == w && r.prop.equals(r.prop)) {
      return;
    }
  }
  observers.add(r);
}

Fixed version (ground truth):
void add(Watcher w,Ref r){
  Thread.holdsLock(GLOBAL);
  if (w == null) {
    return;
  }
  Iterator<Ref> it=observers.iterator();
  while (it.hasNext()) {
    Ref ref=it.next();
    if (r == ref) {
      return;
    }
    final Watcher rw=ref.get();
    if (rw == null) {
      it.remove();
      continue;
    }
    if (rw == w && ref.prop.equals(r.prop)) {
      return;
    }
  }
  observers.add(r);
}
Program: 39765
Project: 39765
Buggy source:
public Ref(Watcher ref,String prop){
  super(ref);
  this.prop=prop;
}

Fixed version (ground truth):
public Ref(Watcher ref,String prop){
  this.ref=ref;
  this.prop=prop;
}
Program: 39766
Project: 39766
Buggy source:
static void beginComputing(Proto p,String name){
synchronized (GLOBAL) {
    verifyUnlocked(p);
    final Watcher nw=new Watcher(p,name);
    GLOBAL.push(nw);
  }
}

Fixed version (ground truth):
static Usages beginComputing(Proto p,String name,Usages usages){
synchronized (GLOBAL) {
    verifyUnlocked(p);
    final Watcher nw=new Watcher(p,name);
    GLOBAL.push(nw);
    return Usages.register(name,nw,usages);
  }
}
Program: 39767
Project: 39767
Buggy source:
/** 
 * Acquires global lock to compute a   {@link ComputedProperty derived property}on this proto object. This proto object must not be locked yet. The name of the property is used to track dependencies on own properties of other proto objects - when they are changed, this  {@link #valueHasMutated(java.lang.String) property is changed too}.
 * @param propName name of property we are about to compute
 * @throws IllegalStateException thrown when there is a cycliccall is detected
 * @since 0.9
 */
public void acquireLock(String propName) throws IllegalStateException {
  Observers.beginComputing(this,propName);
}

Fixed version (ground truth):
/** 
 * Acquires global lock to compute a   {@link ComputedProperty derived property}on this proto object. This proto object must not be locked yet. The name of the property is used to track dependencies on own properties of other proto objects - when they are changed, this  {@link #valueHasMutated(java.lang.String) property is changed too}.
 * @param propName name of property we are about to compute
 * @throws IllegalStateException thrown when there is a cycliccall is detected
 * @since 0.9
 */
public void acquireLock(String propName) throws IllegalStateException {
  usages=Observers.beginComputing(this,propName,usages);
}
Program: 39768
Project: 39768
Buggy source:
@Test public void firstChangeInArrayNotifiedTransitively() throws Exception {
  MyOverall p=Models.bind(new MyOverall(new MyX(new MyY("String_Node_Str",0),new MyY("String_Node_Str",333),new MyY("String_Node_Str",999))),c);
  Models.applyBindings(p);
  Map m=(Map)Models.toRaw(p);
  Object v=m.get("String_Node_Str");
  assertNotNull(v,"String_Node_Str");
  assertEquals(v.getClass(),One.class,"String_Node_Str");
  One o=(One)v;
  assertEquals(o.changes,0,"String_Node_Str");
  assertTrue(o.pb.isReadOnly(),"String_Node_Str");
  assertEquals(o.get(),"String_Node_Str");
  p.getX().getAll().get(0).setValue("String_Node_Str");
  assertEquals(o.get(),"String_Node_Str");
  assertEquals(o.changes,1,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void firstChangeInArrayNotifiedTransitively() throws Exception {
  MyOverall p=Models.bind(new MyOverall(new MyX(new MyY("String_Node_Str",0),new MyY("String_Node_Str",333),new MyY("String_Node_Str",999))),c);
  Models.applyBindings(p);
  Map m=(Map)Models.toRaw(p);
  Object v=m.get("String_Node_Str");
  assertNotNull(v,"String_Node_Str");
  assertEquals(v.getClass(),One.class,"String_Node_Str");
  One o=(One)v;
  assertEquals(o.changes,0,"String_Node_Str");
  assertTrue(o.pb.isReadOnly(),"String_Node_Str");
  assertEquals(o.get(),"String_Node_Str");
  final List<MyY> all=p.getX().getAll();
  MyY refStrong=all.get(0);
  Reference<MyY> ref=new WeakReference<MyY>(refStrong);
  refStrong.setValue("String_Node_Str");
  assertEquals(o.get(),"String_Node_Str");
  assertEquals(o.changes,1,"String_Node_Str");
  final MyY hi=Models.bind(new MyY("String_Node_Str",33),c);
  all.set(0,hi);
  assertEquals(o.changes,2,"String_Node_Str");
  assertEquals(o.get(),"String_Node_Str");
  refStrong.setValue("String_Node_Str");
  assertEquals(o.changes,2,"String_Node_Str");
  refStrong=null;
  assertGC(ref,"String_Node_Str");
}
Program: 39769
Project: 39769
Buggy source:
@Override public Object toJava(Object toJS){
  if (toJS == undefined()) {
    return null;
  }
  if (!(toJS instanceof JSObject)) {
    return toJS;
  }
  JSObject js=(JSObject)toJS;
  int length=getArrayLength(toJS);
  if (length != -1) {
    Object[] arr=toArray(length,toJS);
    System.err.println("String_Node_Str");
    dumpArray(arr,"String_Node_Str");
    return arr;
  }
  return values().realValue(js);
}

Fixed version (ground truth):
@Override public Object toJava(Object toJS){
  if (toJS == undefined()) {
    return null;
  }
  if (!(toJS instanceof JSObject)) {
    return toJS;
  }
  JSObject js=(JSObject)toJS;
  int length=getArrayLength(toJS);
  if (length != -1) {
    Object[] arr=toArray(length,toJS);
    return arr;
  }
  return values().realValue(js);
}