nus-yam/ex-repair huggingface dataset:
Program: 62782
Project: 62782
Buggy source:
public static <T extends MultiView2 & ExampleView & OnDestroyListener>void bind(T multiView2){
}

Fixed version (ground truth):
public static <T extends MultiView2 & ExampleView & SlickLifecycleListener>void bind(T multiView2){
}
Program: 62783
Project: 62783
Buggy source:
public static <T extends View & ExampleView & OnDestroyListener>void onAttach(T multiView1){
  hostInstance.delegates.get(SlickDelegateView.getId(multiView1)).onAttach(multiView1);
}

Fixed version (ground truth):
public static <T extends View & ExampleView & SlickLifecycleListener>void onAttach(T multiView1){
  hostInstance.delegates.get(SlickDelegateView.getId(multiView1)).onAttach(multiView1);
}
Program: 62784
Project: 62784
Buggy source:
public static <T extends View & ExampleView & OnDestroyListener>void onDetach(T multiView1){
  if (hostInstance == null || hostInstance.delegates.get(SlickDelegateView.getId(multiView1)) == null)   return;
  hostInstance.delegates.get(SlickDelegateView.getId(multiView1)).onDetach(multiView1);
}

Fixed version (ground truth):
public static <T extends View & ExampleView & SlickLifecycleListener>void onDetach(T multiView1){
  if (hostInstance == null || hostInstance.delegates.get(SlickDelegateView.getId(multiView1)) == null)   return;
  hostInstance.delegates.get(SlickDelegateView.getId(multiView1)).onDetach(multiView1);
}
Program: 62785
Project: 62785
Buggy source:
@Override protected void onAttachedToWindow(){
  super.onAttachedToWindow();
  ExamplePresenter_Slick.bind(this);
  ExamplePresenter_Slick.onAttach(this);
}

Fixed version (ground truth):
@Override protected void onAttachedToWindow(){
  super.onAttachedToWindow();
  ExamplePresenter_Slick.onAttach(this);
}
Program: 62786
Project: 62786
Buggy source:
@Override protected void onAttachedToWindow(){
  super.onAttachedToWindow();
  ExamplePresenter_Slick.bind(this);
  ExamplePresenter_Slick.onAttach(this);
}

Fixed version (ground truth):
@Override protected void onAttachedToWindow(){
  super.onAttachedToWindow();
  ExamplePresenter_Slick.onAttach(this);
}
Program: 62787
Project: 62787
Buggy source:
private void destroy(V view){
  final Activity activity=(Activity)((View)view).getContext();
  if (!activity.isChangingConfigurations()) {
    if (!hasOnViewDownCalled)     onDetach(view);
    presenter.onDestroy();
    if (listener != null) {
      listener.onDestroy(id);
    }
    presenter=null;
  }
}

Fixed version (ground truth):
private void destroy(V view){
  final Activity activity=getActivity((View)view);
  if (!activity.isChangingConfigurations()) {
    if (!hasOnViewDownCalled)     onDetach(view);
    presenter.onDestroy();
    if (listener != null) {
      listener.onDestroy(id);
    }
    presenter=null;
  }
}
Program: 62788
Project: 62788
Buggy source:
@Override public void onDestroy(){
  DaggerCustomView_Slick.onDestroy(this);
}

Fixed version (ground truth):
@Override public void onDestroy(){
  System.out.println("String_Node_Str");
  DaggerCustomView_Slick.onDestroy(this);
}
Program: 62789
Project: 62789
Buggy source:
@Override protected void onDetachedFromWindow(){
  super.onDetachedFromWindow();
  DaggerCustomView_Slick.onDetach(this);
}

Fixed version (ground truth):
@Override protected void onDetachedFromWindow(){
  System.out.println("String_Node_Str");
  super.onDetachedFromWindow();
  DaggerCustomView_Slick.onDetach(this);
}
Program: 62790
Project: 62790
Buggy source:
@Override protected void onAttachedToWindow(){
  super.onAttachedToWindow();
  App.getDaggerComponent(getContext()).inject(this);
  DaggerCustomView_Slick.bind(this);
  DaggerCustomView_Slick.onAttach(this);
  final TextView textView=(TextView)findViewById(R.id.textView_custom_view);
  textView.setText(presenter.getData());
}

Fixed version (ground truth):
@Override protected void onAttachedToWindow(){
  System.out.println("String_Node_Str");
  super.onAttachedToWindow();
  App.getDaggerComponent(getContext()).inject(this);
  DaggerCustomView_Slick.bind(this);
  DaggerCustomView_Slick.onAttach(this);
  final TextView textView=(TextView)findViewById(R.id.textView_custom_view);
  textView.setText(presenter.getData());
}
Program: 62791
Project: 62791
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_custom_view);
  customView=(DaggerCustomView)findViewById(R.id.custom_view_dagger);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_custom_view_dagger);
  customView=(DaggerCustomView)findViewById(R.id.custom_view_dagger);
}
Program: 62792
Project: 62792
Buggy source:
@Override protected void onDestroy(){
  super.onDestroy();
  customView.onDestroy();
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  System.out.println("String_Node_Str");
  super.onDestroy();
  customView.onDestroy();
}
Program: 62793
Project: 62793
Buggy source:
/** 
 * Builds the bind method
 * @param view             the class which implements the view interface
 * @param presenter        presenter class
 * @param presenterHost    presenter host class
 * @param fieldName        presenter name in view class
 * @param argNameView      activity parameter name
 * @param presenterArgName
 * @param viewGenericType  activity type
 * @param typeNameDelegate delegate type
 * @param argsCode         the presenter parameters in a comma separated string    @return bind method builder
 */
protected abstract MethodSpec.Builder bindMethod(ClassName view,ClassName presenter,ClassName presenterHost,ClassName classNameDelegate,String fieldName,String argNameView,String presenterArgName,TypeVariableName viewGenericType,ParameterizedTypeName typeNameDelegate,StringBuilder argsCode);

Fixed version (ground truth):
/** 
 * Builds the bind method
 * @param ap
 * @param view             the class which implements the view interface
 * @param presenter        presenter class
 * @param presenterHost    presenter host class
 * @param fieldName        presenter name in view class
 * @param argNameView      activity parameter name
 * @param presenterArgName
 * @param viewGenericType  activity type
 * @param typeNameDelegate delegate type
 * @param argsCode         the presenter parameters in a comma separated string    @return bind method builder
 */
protected abstract MethodSpec.Builder bindMethod(AnnotatedPresenter ap,ClassName view,ClassName presenter,ClassName presenterHost,ClassName classNameDelegate,String fieldName,String argNameView,String presenterArgName,TypeVariableName viewGenericType,ParameterizedTypeName typeNameDelegate,StringBuilder argsCode);
Program: 62795
Project: 62795
Buggy source:
@Override protected MethodSpec.Builder bindMethod(ClassName view,ClassName presenter,ClassName presenterHost,ClassName classNameDelegate,String fieldName,String argNameView,String presenterArgName,TypeVariableName viewGenericType,ParameterizedTypeName typeNameDelegate,StringBuilder argsCode){
  return MethodSpec.methodBuilder("String_Node_Str").addModifiers(Modifier.PUBLIC,Modifier.STATIC).addTypeVariable(viewGenericType.withBounds(ClASS_NAME_SLICK_VIEW)).addParameter(viewGenericType,argNameView).addStatement("String_Node_Str",argNameView).addStatement("String_Node_Str",hostInstanceName,hostInstanceName,presenterHost).addStatement("String_Node_Str",typeNameDelegate,varNameDelegate,hostInstanceName,fieldNameDelegates).beginControlFlow("String_Node_Str",varNameDelegate).addStatement("String_Node_Str",presenter,presenterName,presenter,argsCode.toString()).addStatement("String_Node_Str",varNameDelegate,classNameDelegate,presenterName,argNameView).addStatement("String_Node_Str",varNameDelegate,hostInstanceName).addStatement("String_Node_Str",hostInstanceName,fieldNameDelegates,varNameDelegate).addStatement("String_Node_Str",argNameView,varNameDelegate).endControlFlow().addStatement("String_Node_Str",view.simpleName(),argNameView,fieldName,varNameDelegate).returns(void.class);
}

Fixed version (ground truth):
@Override protected MethodSpec.Builder bindMethod(AnnotatedPresenter ap,ClassName view,ClassName presenter,ClassName presenterHost,ClassName classNameDelegate,String fieldName,String argNameView,String presenterArgName,TypeVariableName viewGenericType,ParameterizedTypeName typeNameDelegate,StringBuilder argsCode){
  return MethodSpec.methodBuilder("String_Node_Str").addModifiers(Modifier.PUBLIC,Modifier.STATIC).addTypeVariable(viewGenericType.withBounds(ClASS_NAME_SLICK_VIEW)).addParameter(viewGenericType,argNameView).addStatement("String_Node_Str",argNameView).addStatement("String_Node_Str",hostInstanceName,hostInstanceName,presenterHost).addStatement("String_Node_Str",typeNameDelegate,varNameDelegate,hostInstanceName,fieldNameDelegates).beginControlFlow("String_Node_Str",varNameDelegate).addStatement("String_Node_Str",presenter,presenterName,presenter,argsCode.toString()).addStatement("String_Node_Str",varNameDelegate,classNameDelegate,presenterName,argNameView).addStatement("String_Node_Str",varNameDelegate,hostInstanceName).addStatement("String_Node_Str",hostInstanceName,fieldNameDelegates,varNameDelegate).addStatement("String_Node_Str",argNameView,varNameDelegate).endControlFlow().addStatement("String_Node_Str",view.simpleName(),argNameView,fieldName,varNameDelegate).returns(void.class);
}
Program: 62796
Project: 62796
Buggy source:
@Override protected MethodSpec.Builder bindMethod(ClassName view,ClassName presenter,ClassName presenterHost,ClassName classNameDelegate,String fieldName,String argNameView,String presenterArgName,TypeVariableName viewGenericType,ParameterizedTypeName typeNameDelegate,StringBuilder argsCode){
  return MethodSpec.methodBuilder("String_Node_Str").addModifiers(Modifier.PUBLIC,Modifier.STATIC).addTypeVariable(viewGenericType.withBounds(ClASS_NAME_SLICK_VIEW)).addParameter(viewGenericType,argNameView).addParameter(presenter,deCapitalize(presenter.simpleName())).beginControlFlow("String_Node_Str",hostInstanceName).addStatement("String_Node_Str",hostInstanceName,presenterHost).addStatement("String_Node_Str",hostInstanceName,varNameDelegate,classNameDelegate,deCapitalize(presenter.simpleName()),argNameView).addStatement("String_Node_Str",argNameView,hostInstanceName,varNameDelegate).addStatement("String_Node_Str",hostInstanceName,varNameDelegate,hostInstanceName).endControlFlow().returns(void.class);
}

Fixed version (ground truth):
@Override protected MethodSpec.Builder bindMethod(AnnotatedPresenter ap,ClassName view,ClassName presenter,ClassName presenterHost,ClassName classNameDelegate,String fieldName,String argNameView,String presenterArgName,TypeVariableName viewGenericType,ParameterizedTypeName typeNameDelegate,StringBuilder argsCode){
  return MethodSpec.methodBuilder("String_Node_Str").addModifiers(Modifier.PUBLIC,Modifier.STATIC).addTypeVariable(viewGenericType.withBounds(ClASS_NAME_SLICK_VIEW)).addParameter(viewGenericType,argNameView).addParameter(presenter,deCapitalize(presenter.simpleName())).beginControlFlow("String_Node_Str",hostInstanceName).addStatement("String_Node_Str",hostInstanceName,presenterHost).addStatement("String_Node_Str",hostInstanceName,varNameDelegate,classNameDelegate,deCapitalize(presenter.simpleName()),argNameView).addStatement("String_Node_Str",argNameView,hostInstanceName,varNameDelegate).addStatement("String_Node_Str",hostInstanceName,varNameDelegate,hostInstanceName).endControlFlow().returns(void.class);
}
Program: 62797
Project: 62797
Buggy source:
@Override protected MethodSpec.Builder bindMethod(ClassName view,ClassName presenter,ClassName presenterHost,ClassName classNameDelegate,String fieldName,String argNameView,String presenterArgName,TypeVariableName viewGenericType,ParameterizedTypeName typeNameDelegate,StringBuilder argsCode){
  return MethodSpec.methodBuilder("String_Node_Str").addModifiers(Modifier.PUBLIC,Modifier.STATIC).addTypeVariable(viewGenericType.withBounds(ClASS_NAME_SLICK_VIEW)).addParameter(viewGenericType,argNameView).addParameter(presenter,deCapitalize(presenter.simpleName())).beginControlFlow("String_Node_Str",hostInstanceName).addStatement("String_Node_Str",hostInstanceName,presenterHost).addStatement("String_Node_Str",hostInstanceName,varNameDelegate,classNameDelegate,deCapitalize(presenter.simpleName()),argNameView).addStatement("String_Node_Str",hostInstanceName,varNameDelegate,hostInstanceName).endControlFlow().addStatement("String_Node_Str",hostInstanceName,varNameDelegate).returns(typeNameDelegate);
}

Fixed version (ground truth):
@Override protected MethodSpec.Builder bindMethod(AnnotatedPresenter ap,ClassName view,ClassName presenter,ClassName presenterHost,ClassName classNameDelegate,String fieldName,String argNameView,String presenterArgName,TypeVariableName viewGenericType,ParameterizedTypeName typeNameDelegate,StringBuilder argsCode){
  return MethodSpec.methodBuilder("String_Node_Str").addModifiers(Modifier.PUBLIC,Modifier.STATIC).addTypeVariable(viewGenericType.withBounds(ClASS_NAME_SLICK_VIEW).withBounds(ap.getViewInterface())).addParameter(viewGenericType,argNameView).addParameter(presenter,deCapitalize(presenter.simpleName())).beginControlFlow("String_Node_Str",hostInstanceName).addStatement("String_Node_Str",hostInstanceName,presenterHost).addStatement("String_Node_Str",hostInstanceName,varNameDelegate,classNameDelegate,deCapitalize(presenter.simpleName()),argNameView).addStatement("String_Node_Str",hostInstanceName,varNameDelegate,hostInstanceName).endControlFlow().addStatement("String_Node_Str",hostInstanceName,varNameDelegate).returns(typeNameDelegate);
}
Program: 62798
Project: 62798
Buggy source:
@Override public void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  delegate=bind();
}

Fixed version (ground truth):
@Override public void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (savedInstanceState != null) {
    id=savedInstanceState.getString(SLICK_UNIQUE_KEY);
  }
  delegate=bind();
}
Program: 62799
Project: 62799
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public void onActivityStopped(Activity activity){
  if (multiInstance) {
    if (isSameInstance(activity)) {
      presenter.onViewDown();
    }
 else     if (cls.isInstance(activity)) {
      presenter.onViewDown();
    }
  }
  Log.d(TAG,"String_Node_Str" + activity.toString());
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public void onActivityStopped(Activity activity){
  if (multiInstance) {
    if (isSameInstance(activity)) {
      presenter.onViewDown();
    }
  }
 else   if (cls.isInstance(activity)) {
    presenter.onViewDown();
  }
}
Program: 62800
Project: 62800
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public void onActivityStarted(Activity activity){
  if (multiInstance) {
    if (isSameInstance(activity)) {
      presenter.onViewUp((V)activity);
    }
 else     if (cls.isInstance(activity)) {
      presenter.onViewUp((V)activity);
    }
    Log.d(TAG,"String_Node_Str" + activity.toString());
  }
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public void onActivityStarted(Activity activity){
  if (multiInstance) {
    if (isSameInstance(activity)) {
      presenter.onViewUp((V)activity);
    }
  }
 else   if (cls.isInstance(activity)) {
    presenter.onViewUp((V)activity);
  }
}
Program: 62801
Project: 62801
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public void onActivityDestroyed(Activity activity){
  if (multiInstance) {
    if (isSameInstance(activity)) {
      onDestroy((V)activity);
    }
 else     if (cls.isInstance(activity)) {
      onDestroy((V)activity);
    }
  }
  Log.d(TAG,"String_Node_Str" + activity.toString());
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public void onActivityDestroyed(Activity activity){
  if (multiInstance) {
    if (isSameInstance(activity)) {
      onDestroy((V)activity);
    }
  }
 else   if (cls.isInstance(activity)) {
    onDestroy((V)activity);
  }
}
Program: 62803
Project: 62803
Buggy source:
/** 
 * unlock
 * @param key
 * @param request request must be the same as lock request
 * @return
 */
public boolean unlock(String key,String request){
  Object connection=getConnection();
  Object result=null;
  if (connection instanceof Jedis) {
    result=((Jedis)connection).eval(script,Collections.singletonList(lockPrefix + key),Collections.singletonList(request));
    ((Jedis)connection).close();
  }
 else   if (connection instanceof JedisCluster) {
    result=((JedisCluster)connection).eval(script,Collections.singletonList(lockPrefix + key),Collections.singletonList(request));
    try {
      ((JedisCluster)connection).close();
    }
 catch (    IOException e) {
      logger.error("String_Node_Str",e);
    }
  }
 else {
    return false;
  }
  if (UNLOCK_MSG.equals(result)) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * unlock
 * @param key
 * @param request request must be the same as lock request
 * @return
 */
public boolean unlock(String key,String request){
  Object connection=getConnection();
  Object result=null;
  if (connection instanceof Jedis) {
    result=((Jedis)connection).eval(script,Collections.singletonList(lockPrefix + key),Collections.singletonList(request));
    ((Jedis)connection).close();
  }
 else   if (connection instanceof JedisCluster) {
    result=((JedisCluster)connection).eval(script,Collections.singletonList(lockPrefix + key),Collections.singletonList(request));
  }
 else {
    return false;
  }
  if (UNLOCK_MSG.equals(result)) {
    return true;
  }
 else {
    return false;
  }
}
Program: 62804
Project: 62804
Buggy source:
/** 
 * blocking lock,custom time
 * @param key
 * @param request
 * @param blockTime custom time
 * @return
 * @throws InterruptedException
 */
public boolean lock(String key,String request,int blockTime) throws InterruptedException {
  Object connection=getConnection();
  String result;
  while (blockTime >= 0) {
    if (connection instanceof Jedis) {
      result=((Jedis)connection).set(lockPrefix + key,request,SET_IF_NOT_EXIST,SET_WITH_EXPIRE_TIME,10 * TIME);
      if (LOCK_MSG.equals(request)) {
        ((Jedis)connection).close();
      }
    }
 else {
      result=((JedisCluster)connection).set(lockPrefix + key,request,SET_IF_NOT_EXIST,SET_WITH_EXPIRE_TIME,10 * TIME);
      try {
        if (LOCK_MSG.equals(request)) {
          ((JedisCluster)connection).close();
        }
      }
 catch (      IOException e) {
        logger.error("String_Node_Str",e);
      }
    }
    if (LOCK_MSG.equals(result)) {
      return true;
    }
    blockTime-=sleepTime;
    Thread.sleep(sleepTime);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * blocking lock,custom time
 * @param key
 * @param request
 * @param blockTime custom time
 * @return
 * @throws InterruptedException
 */
public boolean lock(String key,String request,int blockTime) throws InterruptedException {
  Object connection=getConnection();
  String result;
  while (blockTime >= 0) {
    if (connection instanceof Jedis) {
      result=((Jedis)connection).set(lockPrefix + key,request,SET_IF_NOT_EXIST,SET_WITH_EXPIRE_TIME,10 * TIME);
      if (LOCK_MSG.equals(request)) {
        ((Jedis)connection).close();
      }
    }
 else {
      result=((JedisCluster)connection).set(lockPrefix + key,request,SET_IF_NOT_EXIST,SET_WITH_EXPIRE_TIME,10 * TIME);
    }
    if (LOCK_MSG.equals(result)) {
      return true;
    }
    blockTime-=sleepTime;
    Thread.sleep(sleepTime);
  }
  return false;
}
Program: 62805
Project: 62805
Buggy source:
/** 
 * Non-blocking lock
 * @param key        lock business type
 * @param request    value
 * @param expireTime custom expireTime
 * @return true lock successfalse lock fail
 */
public boolean tryLock(String key,String request,int expireTime){
  Object connection=getConnection();
  String result;
  if (connection instanceof Jedis) {
    result=((Jedis)connection).set(lockPrefix + key,request,SET_IF_NOT_EXIST,SET_WITH_EXPIRE_TIME,expireTime);
    ((Jedis)connection).close();
  }
 else {
    result=((JedisCluster)connection).set(lockPrefix + key,request,SET_IF_NOT_EXIST,SET_WITH_EXPIRE_TIME,expireTime);
    try {
      ((JedisCluster)connection).close();
    }
 catch (    IOException e) {
      logger.error("String_Node_Str",e);
    }
  }
  if (LOCK_MSG.equals(result)) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Non-blocking lock
 * @param key        lock business type
 * @param request    value
 * @param expireTime custom expireTime
 * @return true lock successfalse lock fail
 */
public boolean tryLock(String key,String request,int expireTime){
  Object connection=getConnection();
  String result;
  if (connection instanceof Jedis) {
    result=((Jedis)connection).set(lockPrefix + key,request,SET_IF_NOT_EXIST,SET_WITH_EXPIRE_TIME,expireTime);
    ((Jedis)connection).close();
  }
 else {
    result=((JedisCluster)connection).set(lockPrefix + key,request,SET_IF_NOT_EXIST,SET_WITH_EXPIRE_TIME,expireTime);
  }
  if (LOCK_MSG.equals(result)) {
    return true;
  }
 else {
    return false;
  }
}
Program: 62806
Project: 62806
Buggy source:
private void init(){
  JedisPoolConfig config=new JedisPoolConfig();
  config.setMaxIdle(100);
  config.setMaxTotal(100);
  config.setMaxWaitMillis(10000);
  config.setTestOnBorrow(true);
  config.setTestOnReturn(true);
  RedisClusterConfiguration redisClusterConfiguration=new RedisClusterConfiguration();
  redisClusterConfiguration.addClusterNode(new RedisNode("String_Node_Str",7000));
  JedisConnectionFactory jedisConnectionFactory=new JedisConnectionFactory(config);
  jedisConnectionFactory.setHostName("String_Node_Str");
  jedisConnectionFactory.setPort(6379);
  jedisConnectionFactory.setPassword("String_Node_Str");
  jedisConnectionFactory.setTimeout(100000);
  jedisConnectionFactory.afterPropertiesSet();
  HostAndPort hostAndPort=new HostAndPort("String_Node_Str",7000);
  JedisCluster jedisCluster=new JedisCluster(hostAndPort);
  redisLock=new RedisLock.Builder(jedisConnectionFactory,RedisToolsConstant.SINGLE).lockPrefix("String_Node_Str").sleepTime(100).build();
}

Fixed version (ground truth):
private void init(){
  JedisPoolConfig config=new JedisPoolConfig();
  config.setMaxIdle(100);
  config.setMaxTotal(100);
  config.setMaxWaitMillis(10000);
  config.setTestOnBorrow(true);
  config.setTestOnReturn(true);
  RedisClusterConfiguration redisClusterConfiguration=new RedisClusterConfiguration();
  redisClusterConfiguration.addClusterNode(new RedisNode("String_Node_Str",7000));
  JedisConnectionFactory jedisConnectionFactory=new JedisConnectionFactory(redisClusterConfiguration);
  jedisConnectionFactory.setTimeout(100000);
  jedisConnectionFactory.afterPropertiesSet();
  HostAndPort hostAndPort=new HostAndPort("String_Node_Str",7000);
  JedisCluster jedisCluster=new JedisCluster(hostAndPort);
  redisLock=new RedisLock.Builder(jedisConnectionFactory,RedisToolsConstant.CLUSTER).lockPrefix("String_Node_Str").sleepTime(100).build();
}
Program: 62807
Project: 62807
Buggy source:
@Override public void run(){
  try {
    redisLock.lock("String_Node_Str","String_Node_Str");
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  logger.info("String_Node_Str");
  redisLock.unlock("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  boolean limit=redisLock.tryLock("String_Node_Str","String_Node_Str",1000);
  if (limit) {
    logger.info("String_Node_Str");
    boolean unlock=redisLock.unlock("String_Node_Str","String_Node_Str");
    logger.info("String_Node_Str",unlock);
  }
 else {
    logger.info("String_Node_Str");
  }
}
Program: 62808
Project: 62808
Buggy source:
public static void main(String[] args) throws InterruptedException {
  RealRedisLockTest redisLockTest=new RealRedisLockTest();
  redisLockTest.init();
  initThread();
  for (int i=0; i < 50; i++) {
    executorServicePool.execute(new Worker(i));
  }
  executorServicePool.shutdown();
  while (!executorServicePool.awaitTermination(1,TimeUnit.SECONDS)) {
    logger.info("String_Node_Str");
  }
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args) throws InterruptedException {
  RealRedisLockTest redisLockTest=new RealRedisLockTest();
  redisLockTest.init();
  initThread();
  for (int i=0; i < 1; i++) {
    executorServicePool.execute(new Worker(i));
  }
  executorServicePool.shutdown();
  while (!executorServicePool.awaitTermination(1,TimeUnit.SECONDS)) {
    logger.info("String_Node_Str");
  }
  logger.info("String_Node_Str");
}
Program: 62809
Project: 62809
Buggy source:
@Override public void run(){
  try {
    redisLock.lock("String_Node_Str","String_Node_Str");
    logger.info("String_Node_Str");
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  redisLock.unlock("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  try {
    boolean limit=redisLock.lock("String_Node_Str","String_Node_Str",100);
    if (limit) {
      logger.info("String_Node_Str");
      boolean unlock=redisLock.unlock("String_Node_Str","String_Node_Str");
      logger.info("String_Node_Str",unlock);
    }
 else {
      logger.info("String_Node_Str");
    }
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 62810
Project: 62810
Buggy source:
private void init(){
  JedisPoolConfig config=new JedisPoolConfig();
  config.setMaxIdle(10);
  config.setMaxTotal(300);
  config.setMaxWaitMillis(10000);
  config.setTestOnBorrow(true);
  config.setTestOnReturn(true);
  RedisClusterConfiguration redisClusterConfiguration=new RedisClusterConfiguration();
  redisClusterConfiguration.addClusterNode(new RedisNode("String_Node_Str",7000));
  JedisConnectionFactory jedisConnectionFactory=new JedisConnectionFactory(redisClusterConfiguration,config);
  jedisConnectionFactory.setHostName("String_Node_Str");
  jedisConnectionFactory.setPort(6379);
  jedisConnectionFactory.setPassword("String_Node_Str");
  jedisConnectionFactory.setTimeout(100000);
  jedisConnectionFactory.afterPropertiesSet();
  HostAndPort hostAndPort=new HostAndPort("String_Node_Str",6379);
  Jedis jedis=new Jedis("String_Node_Str",6379);
  redisLimit=new RedisLimit.Builder(jedisConnectionFactory,RedisToolsConstant.CLUSTER).limit(5).build();
}

Fixed version (ground truth):
private void init(){
  JedisPoolConfig config=new JedisPoolConfig();
  config.setMaxIdle(10);
  config.setMaxTotal(300);
  config.setMaxWaitMillis(10000);
  config.setTestOnBorrow(true);
  config.setTestOnReturn(true);
  RedisClusterConfiguration redisClusterConfiguration=new RedisClusterConfiguration();
  redisClusterConfiguration.addClusterNode(new RedisNode("String_Node_Str",7000));
  JedisConnectionFactory jedisConnectionFactory=new JedisConnectionFactory(config);
  jedisConnectionFactory.setHostName("String_Node_Str");
  jedisConnectionFactory.setPort(6379);
  jedisConnectionFactory.setPassword("String_Node_Str");
  jedisConnectionFactory.setTimeout(100000);
  jedisConnectionFactory.afterPropertiesSet();
  HostAndPort hostAndPort=new HostAndPort("String_Node_Str",6379);
  Jedis jedis=new Jedis("String_Node_Str",6379);
  redisLimit=new RedisLimit.Builder(jedisConnectionFactory,RedisToolsConstant.SINGLE).limit(5).build();
}
Program: 62811
Project: 62811
Buggy source:
private void init(){
  JedisPoolConfig config=new JedisPoolConfig();
  config.setMaxIdle(50);
  config.setMaxTotal(50);
  config.setMaxWaitMillis(10000);
  config.setTestOnBorrow(true);
  config.setTestOnReturn(true);
  RedisClusterConfiguration redisClusterConfiguration=new RedisClusterConfiguration();
  redisClusterConfiguration.addClusterNode(new RedisNode("String_Node_Str",7000));
  JedisConnectionFactory jedisConnectionFactory=new JedisConnectionFactory(config);
  jedisConnectionFactory.setHostName("String_Node_Str");
  jedisConnectionFactory.setPort(6379);
  jedisConnectionFactory.setPassword("String_Node_Str");
  jedisConnectionFactory.setTimeout(100000);
  jedisConnectionFactory.afterPropertiesSet();
  HostAndPort hostAndPort=new HostAndPort("String_Node_Str",7000);
  JedisCluster jedisCluster=new JedisCluster(hostAndPort);
  redisLock=new RedisLock.Builder(jedisConnectionFactory,RedisToolsConstant.SINGLE).lockPrefix("String_Node_Str").sleepTime(100).build();
}

Fixed version (ground truth):
private void init(){
  JedisPoolConfig config=new JedisPoolConfig();
  config.setMaxIdle(100);
  config.setMaxTotal(100);
  config.setMaxWaitMillis(10000);
  config.setTestOnBorrow(true);
  config.setTestOnReturn(true);
  RedisClusterConfiguration redisClusterConfiguration=new RedisClusterConfiguration();
  redisClusterConfiguration.addClusterNode(new RedisNode("String_Node_Str",7000));
  JedisConnectionFactory jedisConnectionFactory=new JedisConnectionFactory(config);
  jedisConnectionFactory.setHostName("String_Node_Str");
  jedisConnectionFactory.setPort(6379);
  jedisConnectionFactory.setPassword("String_Node_Str");
  jedisConnectionFactory.setTimeout(100000);
  jedisConnectionFactory.afterPropertiesSet();
  HostAndPort hostAndPort=new HostAndPort("String_Node_Str",7000);
  JedisCluster jedisCluster=new JedisCluster(hostAndPort);
  redisLock=new RedisLock.Builder(jedisConnectionFactory,RedisToolsConstant.SINGLE).lockPrefix("String_Node_Str").sleepTime(100).build();
}
Program: 62812
Project: 62812
Buggy source:
public static void main(String[] args) throws InterruptedException {
  RedisLockTest redisLockTest=new RedisLockTest();
  redisLockTest.init();
  initThread();
  for (int i=0; i < 100; i++) {
    executorServicePool.execute(new Worker(i));
  }
  executorServicePool.shutdown();
  while (!executorServicePool.awaitTermination(1,TimeUnit.SECONDS)) {
    logger.info("String_Node_Str");
  }
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args) throws InterruptedException {
  RedisLockTest redisLockTest=new RedisLockTest();
  redisLockTest.init();
  initThread();
  for (int i=0; i < 50; i++) {
    executorServicePool.execute(new Worker(i));
  }
  executorServicePool.shutdown();
  while (!executorServicePool.awaitTermination(1,TimeUnit.SECONDS)) {
    logger.info("String_Node_Str");
  }
  logger.info("String_Node_Str");
}
Program: 62813
Project: 62813
Buggy source:
@Override public void run(){
  boolean limit=redisLock.tryLock("String_Node_Str","String_Node_Str");
  if (limit) {
    logger.info("String_Node_Str");
  }
 else {
    logger.info("String_Node_Str");
  }
  redisLock.unlock("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  try {
    redisLock.lock("String_Node_Str","String_Node_Str");
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  logger.info("String_Node_Str");
  redisLock.unlock("String_Node_Str","String_Node_Str");
}
Program: 62814
Project: 62814
Buggy source:
/** 
 * return lua script String
 * @param path
 * @return
 */
public static String getScript(String path){
  String script=null;
  URL resource=ScriptUtil.class.getResource("String_Node_Str" + path);
  String fileName=resource.getFile();
  FileInputStream in=null;
  String encoding="String_Node_Str";
  File file=new File(fileName);
  Long length=file.length();
  byte[] fileContent=new byte[length.intValue()];
  try {
    in=new FileInputStream(file);
    in.read(fileContent);
    script=new String(fileContent,encoding);
  }
 catch (  IOException e) {
    System.err.println(e.getStackTrace());
  }
 finally {
    try {
      in.close();
    }
 catch (    IOException e) {
      System.err.println(e.getStackTrace());
    }
  }
  return script;
}

Fixed version (ground truth):
/** 
 * return lua script String
 * @param path
 * @return
 */
public static String getScript(String path){
  StringBuilder sb=new StringBuilder();
  InputStream stream=ScriptUtil.class.getClassLoader().getResourceAsStream(path);
  BufferedReader br=new BufferedReader(new InputStreamReader(stream));
  try {
    String str="String_Node_Str";
    while ((str=br.readLine()) != null) {
      sb.append(str).append(System.lineSeparator());
    }
  }
 catch (  IOException e) {
    System.err.println(e.getStackTrace());
  }
  return sb.toString();
}
Program: 62815
Project: 62815
Buggy source:
public void populateId(Id id,IdMeta idMeta){
  while (true) {
    Variant varOld=new Variant();
    varOld.sequence=variant.get().sequence;
    varOld.lastTimestamp=variant.get().lastTimestamp;
    long timestamp=TimeUtils.genTime(IdType.parse(id.getType()));
    TimeUtils.validateTimestamp(varOld.lastTimestamp,timestamp);
    long sequence=variant.get().sequence;
    if (timestamp == varOld.lastTimestamp) {
      sequence++;
      sequence&=idMeta.getSeqBitsMask();
      if (sequence == 0) {
        timestamp=TimeUtils.tillNextTimeUnit(varOld.lastTimestamp,IdType.parse(id.getType()));
      }
    }
 else {
      sequence=0;
    }
    Variant varNew=new Variant();
    varNew.sequence=sequence;
    varNew.lastTimestamp=timestamp;
    if (variant.compareAndSet(varOld,varNew)) {
      id.setSeq(sequence);
      id.setTime(timestamp);
      break;
    }
  }
}

Fixed version (ground truth):
public void populateId(Id id,IdMeta idMeta){
  Variant varOld, varNew;
  long timestamp, sequence;
  while (true) {
    varOld=variant.get();
    timestamp=TimeUtils.genTime(IdType.parse(id.getType()));
    TimeUtils.validateTimestamp(varOld.lastTimestamp,timestamp);
    sequence=varOld.sequence;
    if (timestamp == varOld.lastTimestamp) {
      sequence++;
      sequence&=idMeta.getSeqBitsMask();
      if (sequence == 0) {
        timestamp=TimeUtils.tillNextTimeUnit(varOld.lastTimestamp,IdType.parse(id.getType()));
      }
    }
 else {
      sequence=0;
    }
    varNew=new Variant();
    varNew.sequence=sequence;
    varNew.lastTimestamp=timestamp;
    if (variant.compareAndSet(varOld,varNew)) {
      id.setSeq(sequence);
      id.setTime(timestamp);
      break;
    }
  }
}
Program: 62816
Project: 62816
Buggy source:
public static boolean isOn(String swtch){
  if (Arrays.asList(SWITCH_ON_EXP).contains(swtch)) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public static boolean isOn(String swtch){
  if (Arrays.asList(SWITCH_ON_EXP).contains(swtch)) {
    return true;
  }
  return false;
}
Program: 62817
Project: 62817
Buggy source:
@Test(groups={"String_Node_Str"}) public void testIpConfigurable(){
  ApplicationContext applicationContext=new ClassPathXmlApplicationContext("String_Node_Str");
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  long id=idService.genId();
  Id ido=idService.expId(id);
  long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getMachine(),ido.getTime(),ido.getSeq());
  System.err.println(id + "String_Node_Str" + ido);
  AssertJUnit.assertEquals(id,id1);
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testIpConfigurable(){
  ApplicationContext applicationContext=new ClassPathXmlApplicationContext("String_Node_Str");
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  long id=idService.genId();
  Id ido=idService.expId(id);
  long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getTime(),ido.getSeq(),ido.getMachine());
  System.err.println(id + "String_Node_Str" + ido);
  AssertJUnit.assertEquals(id,id1);
}
Program: 62818
Project: 62818
Buggy source:
@Test(groups={"String_Node_Str"}) public void testDb(){
  ApplicationContext applicationContext=new ClassPathXmlApplicationContext("String_Node_Str");
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  long id=idService.genId();
  Id ido=idService.expId(id);
  long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getMachine(),ido.getTime(),ido.getSeq());
  System.err.println(id + "String_Node_Str" + ido);
  AssertJUnit.assertEquals(id,id1);
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testDb(){
  ApplicationContext applicationContext=new ClassPathXmlApplicationContext("String_Node_Str");
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  long id=idService.genId();
  Id ido=idService.expId(id);
  long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getTime(),ido.getSeq(),ido.getMachine());
  System.err.println(id + "String_Node_Str" + ido);
  AssertJUnit.assertEquals(id,id1);
}
Program: 62819
Project: 62819
Buggy source:
@Test(groups={"String_Node_Str"}) public void testSimple(){
  ApplicationContext applicationContext=new ClassPathXmlApplicationContext("String_Node_Str");
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  long id=idService.genId();
  Id ido=idService.expId(id);
  long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getMachine(),ido.getTime(),ido.getSeq());
  System.err.println(id + "String_Node_Str" + ido);
  AssertJUnit.assertEquals(id,id1);
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testSimple(){
  ApplicationContext applicationContext=new ClassPathXmlApplicationContext("String_Node_Str");
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  long id=idService.genId();
  Id ido=idService.expId(id);
  long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getTime(),ido.getSeq(),ido.getMachine());
  System.err.println(id + "String_Node_Str" + ido);
  AssertJUnit.assertEquals(id,id1);
}
Program: 62820
Project: 62820
Buggy source:
@Test(groups={"String_Node_Str"}) public void testIpConfigurable(){
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  long id=idService.genId();
  Id ido=idService.expId(id);
  long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getMachine(),ido.getTime(),ido.getSeq());
  System.err.println(id + "String_Node_Str" + ido);
  AssertJUnit.assertEquals(id,id1);
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testIpConfigurable(){
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  long id=idService.genId();
  Id ido=idService.expId(id);
  long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getTime(),ido.getSeq(),ido.getMachine());
  System.err.println(id + "String_Node_Str" + ido);
  AssertJUnit.assertEquals(id,id1);
}
Program: 62821
Project: 62821
Buggy source:
@Test(groups={"String_Node_Str"}) public void testDb(){
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  long id=idService.genId();
  Id ido=idService.expId(id);
  long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getMachine(),ido.getTime(),ido.getSeq());
  System.err.println(id + "String_Node_Str" + ido);
  AssertJUnit.assertEquals(id,id1);
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testDb(){
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  long id=idService.genId();
  Id ido=idService.expId(id);
  long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getTime(),ido.getSeq(),ido.getMachine());
  System.err.println(id + "String_Node_Str" + ido);
  AssertJUnit.assertEquals(id,id1);
}
Program: 62822
Project: 62822
Buggy source:
@Test(groups={"String_Node_Str"}) public void testSimple(){
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  long id=idService.genId();
  Id ido=idService.expId(id);
  long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getMachine(),ido.getTime(),ido.getSeq());
  System.err.println(id + "String_Node_Str" + ido);
  AssertJUnit.assertEquals(id,id1);
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testSimple(){
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  long id=idService.genId();
  Id ido=idService.expId(id);
  long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getTime(),ido.getSeq(),ido.getMachine());
  System.err.println(id + "String_Node_Str" + ido);
  AssertJUnit.assertEquals(id,id1);
}
Program: 62823
Project: 62823
Buggy source:
@Test(groups={"String_Node_Str"}) public void testSimple(){
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  for (int i=0; i < 10; i++) {
    long id=idService.genId();
    Id ido=idService.expId(id);
    long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getTime(),ido.getSeq(),ido.getMachine());
    System.out.println(id + "String_Node_Str" + ido);
    AssertJUnit.assertEquals(id,id1);
    try {
      System.out.println("String_Node_Str");
      Thread.sleep(10000);
    }
 catch (    InterruptedException e) {
    }
  }
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testSimple(){
  IdService idService=(IdService)applicationContext.getBean("String_Node_Str");
  for (int i=0; i < 2; i++) {
    long id=idService.genId();
    Id ido=idService.expId(id);
    long id1=idService.makeId(ido.getVersion(),ido.getType(),ido.getGenMethod(),ido.getTime(),ido.getSeq(),ido.getMachine());
    System.out.println(id + "String_Node_Str" + ido);
    AssertJUnit.assertEquals(id,id1);
    try {
      System.out.println("String_Node_Str");
      Thread.sleep(10000);
    }
 catch (    InterruptedException e) {
    }
  }
}
Program: 62825
Project: 62825
Buggy source:
@Override public void updateImage(final Bitmap picture,final View target){
  sHandler.post(new Runnable(){
    @Override public void run(){
      ImageCardView cardView=(ImageCardView)target;
      if (picture != null && picture.getByteCount() > 4)       cardView.setMainImage(new BitmapDrawable(res,picture));
 else       cardView.setMainImage(sDefaultCardImage);
    }
  }
);
}

Fixed version (ground truth):
@Override public void updateImage(final Bitmap picture,final View target){
  sHandler.post(new Runnable(){
    @Override public void run(){
      ImageCardView cardView=(ImageCardView)target;
      if (picture != null && picture.getByteCount() > 4) {
        if (mediaLibraryItem.getArtworkMrl() != null && !mediaLibraryItem.getArtworkMrl().isEmpty())         cardView.getMainImageView().setScaleType(ImageView.ScaleType.CENTER_CROP);
 else         cardView.getMainImageView().setScaleType(ImageView.ScaleType.FIT_CENTER);
        cardView.setMainImage(new BitmapDrawable(res,picture));
      }
 else {
        cardView.setMainImage(sDefaultCardImage);
        cardView.getMainImageView().setScaleType(ImageView.ScaleType.FIT_CENTER);
      }
    }
  }
);
}
Program: 62826
Project: 62826
Buggy source:
@Override public void run(){
  ImageCardView cardView=(ImageCardView)target;
  if (picture != null && picture.getByteCount() > 4)   cardView.setMainImage(new BitmapDrawable(res,picture));
 else   cardView.setMainImage(sDefaultCardImage);
}

Fixed version (ground truth):
@Override public void run(){
  ImageCardView cardView=(ImageCardView)target;
  if (picture != null && picture.getByteCount() > 4) {
    if (mediaLibraryItem.getArtworkMrl() != null && !mediaLibraryItem.getArtworkMrl().isEmpty())     cardView.getMainImageView().setScaleType(ImageView.ScaleType.CENTER_CROP);
 else     cardView.getMainImageView().setScaleType(ImageView.ScaleType.FIT_CENTER);
    cardView.setMainImage(new BitmapDrawable(res,picture));
  }
 else {
    cardView.setMainImage(sDefaultCardImage);
    cardView.getMainImageView().setScaleType(ImageView.ScaleType.FIT_CENTER);
  }
}
Program: 62827
Project: 62827
Buggy source:
void updateCardViewImage(Drawable image){
  mCardView.setMainImage(image);
}

Fixed version (ground truth):
void updateCardViewImage(Drawable image){
  mCardView.setMainImage(image);
  mCardView.getMainImageView().setScaleType(ImageView.ScaleType.FIT_CENTER);
}
Program: 62828
Project: 62828
Buggy source:
public ViewHolder(View view){
  super(view);
  mCardView=(ImageCardView)view;
  mCardView.getMainImageView().setScaleType(ImageView.ScaleType.CENTER_CROP);
}

Fixed version (ground truth):
public ViewHolder(View view){
  super(view);
  mCardView=(ImageCardView)view;
  mCardView.getMainImageView().setScaleType(ImageView.ScaleType.FIT_CENTER);
}
Program: 62829
Project: 62829
Buggy source:
protected ArrayList<MediaLibraryItem> prepareList(ArrayList<MediaLibraryItem> items){
  if (mMakeSections) {
    if (sMediaComparator.sortBy == MediaLibraryItemComparator.SORT_DEFAULT) {
      return generateSections(items,getDefaultSort());
    }
 else {
      ArrayList<MediaLibraryItem> newList=removeSections(items);
      Collections.sort(newList,sMediaComparator);
      return generateSections(newList,sMediaComparator.sortBy);
    }
  }
 else {
    Collections.sort(items,sMediaComparator);
    return items;
  }
}

Fixed version (ground truth):
protected ArrayList<MediaLibraryItem> prepareList(ArrayList<MediaLibraryItem> items){
  if (!isSortAllowed(getSortBy()))   sMediaComparator.setSortDefault();
  if (mMakeSections) {
    if (sMediaComparator.sortBy == MediaLibraryItemComparator.SORT_DEFAULT) {
      return generateSections(items,getDefaultSort());
    }
 else {
      ArrayList<MediaLibraryItem> newList=removeSections(items);
      Collections.sort(newList,sMediaComparator);
      return generateSections(newList,sMediaComparator.sortBy);
    }
  }
 else {
    Collections.sort(items,sMediaComparator);
    return items;
  }
}
Program: 62830
Project: 62830
Buggy source:
private void init(Context context,float band){
  LayoutInflater.from(context).inflate(R.layout.equalizer_bar,this,true);
  mSeek=(VerticalSeekBar)findViewById(R.id.equalizer_seek);
  mSeek.setMax(2 * RANGE);
  mSeek.setProgress(RANGE);
  mSeek.setOnSeekBarChangeListener(mSeekListener);
  mBand=(TextView)findViewById(R.id.equalizer_band);
  mBand.setText(band < 999.5f ? (int)(band + 0.5f) + "String_Node_Str" : (int)(band / 1000.0f + 0.5f) + "String_Node_Str");
  mValue=(TextView)findViewById(R.id.equalizer_value);
}

Fixed version (ground truth):
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) private void init(Context context,float band){
  LayoutInflater.from(context).inflate(R.layout.equalizer_bar,this,true);
  mSeek=(VerticalSeekBar)findViewById(R.id.equalizer_seek);
  if (AndroidUtil.isJellyBeanMR1OrLater) {
    mSeek.setLayoutDirection(LAYOUT_DIRECTION_LTR);
  }
  mSeek.setMax(2 * RANGE);
  mSeek.setProgress(RANGE);
  mSeek.setOnSeekBarChangeListener(mSeekListener);
  mBand=(TextView)findViewById(R.id.equalizer_band);
  mBand.setText(band < 999.5f ? (int)(band + 0.5f) + "String_Node_Str" : (int)(band / 1000.0f + 0.5f) + "String_Node_Str");
  mValue=(TextView)findViewById(R.id.equalizer_value);
}