nus-yam/ex-repair huggingface dataset:
Program: 87055
Project: 87055
Buggy source:
private void buildDependencyGraph(){
  components.addAll(reflections.getTypesAnnotatedWith(Component.class));
  injections.addAll(reflections.getFieldsAnnotatedWith(Inject.class));
  initializations.addAll(reflections.getMethodsAnnotatedWith(PostConstruct.class));
  initializations.addAll(reflections.getMethodsAnnotatedWith(Initialize.class));
  for (  Field inject : injections) {
    if (inject.getType().isAssignableFrom(List.class)) {
      if (multipleDependencies.get(inject.getDeclaringClass()) == null) {
        multipleDependencies.put(inject.getDeclaringClass(),new ArrayList<Field>());
      }
      multipleDependencies.get(inject.getDeclaringClass()).add(inject);
    }
 else {
      if (dependencies.get(inject.getDeclaringClass()) == null) {
        dependencies.put(inject.getDeclaringClass(),new ArrayList<Field>());
      }
      dependencies.get(inject.getDeclaringClass()).add(inject);
    }
  }
}

Fixed version (ground truth):
private void buildDependencyGraph(){
  components.addAll(reflections.getTypesAnnotatedWith(Component.class));
  injections.addAll(reflections.getFieldsAnnotatedWith(Inject.class));
  for (  Method init : reflections.getMethodsAnnotatedWith(PostConstruct.class)) {
    initializations.put(init.getDeclaringClass(),init);
  }
  for (  Method init : reflections.getMethodsAnnotatedWith(Initialize.class)) {
    initializations.put(init.getDeclaringClass(),init);
  }
  for (  Field inject : injections) {
    if (inject.getType().isAssignableFrom(List.class)) {
      if (multipleDependencies.get(inject.getDeclaringClass()) == null) {
        multipleDependencies.put(inject.getDeclaringClass(),new ArrayList<Field>());
      }
      multipleDependencies.get(inject.getDeclaringClass()).add(inject);
    }
 else {
      if (dependencies.get(inject.getDeclaringClass()) == null) {
        dependencies.put(inject.getDeclaringClass(),new ArrayList<Field>());
      }
      dependencies.get(inject.getDeclaringClass()).add(inject);
    }
  }
}
Program: 87056
Project: 87056
Buggy source:
private void loadJars(){
  List<URL> urls=new ArrayList<>();
  FileSystem fileSystem=FileSystems.getDefault();
  Path componentPath=fileSystem.getPath(componentDir);
  Path binPath=fileSystem.getPath(binDir);
  try (DirectoryStream<Path> directoryStream=Files.newDirectoryStream(binPath)){
    for (    Path path : directoryStream) {
      urls.add(path.toUri().toURL());
    }
  }
 catch (  IOException ex) {
    LOG.warn("String_Node_Str" + binPath + "String_Node_Str");
  }
  try (DirectoryStream<Path> directoryStream=Files.newDirectoryStream(componentPath)){
    for (    Path path : directoryStream) {
      LOG.info("String_Node_Str" + path);
      urls.add(path.toUri().toURL());
    }
  }
 catch (  IOException ex) {
    LOG.warn("String_Node_Str" + componentPath + "String_Node_Str");
  }
  Configuration config=new ConfigurationBuilder().setUrls(urls).setScanners(new TypeAnnotationsScanner(),new FieldAnnotationsScanner(),new MethodAnnotationsScanner());
  reflections=new Reflections(config);
}

Fixed version (ground truth):
private void loadJars(){
  List<URL> urls=new ArrayList<>();
  FileSystem fileSystem=FileSystems.getDefault();
  Path componentPath=fileSystem.getPath(componentDir);
  Path binPath=fileSystem.getPath(binDir);
  try (DirectoryStream<Path> directoryStream=Files.newDirectoryStream(binPath)){
    for (    Path path : directoryStream) {
      urls.add(path.toUri().toURL());
    }
  }
 catch (  IOException ex) {
    LOG.warn("String_Node_Str" + binPath + "String_Node_Str");
  }
  try (DirectoryStream<Path> directoryStream=Files.newDirectoryStream(componentPath)){
    for (    Path path : directoryStream) {
      urls.add(path.toUri().toURL());
    }
  }
 catch (  IOException ex) {
    LOG.warn("String_Node_Str" + componentPath + "String_Node_Str");
  }
  Configuration config=new ConfigurationBuilder().setUrls(urls).setScanners(new TypeAnnotationsScanner(),new FieldAnnotationsScanner(),new MethodAnnotationsScanner());
  reflections=new Reflections(config);
}
Program: 87057
Project: 87057
Buggy source:
private void instantiateTree(Class<?> clazz){
  if (instances.get(clazz) == null) {
    try {
      instances.put(clazz,clazz.newInstance());
    }
 catch (    InstantiationException ex) {
      LOG.error("String_Node_Str" + clazz.getName(),ex);
    }
catch (    IllegalAccessException ex) {
      LOG.error("String_Node_Str",ex);
    }
  }
 else {
    return;
  }
  if (dependencies.containsKey(clazz)) {
    for (    Field field : dependencies.get(clazz)) {
      for (      Class<?> cl : components) {
        LOG.info(cl.getName() + "String_Node_Str" + field.getType().getName()+ "String_Node_Str"+ field.getType().isAssignableFrom(cl));
        if (field.getType().isAssignableFrom(cl)) {
          LOG.info("String_Node_Str" + cl.getName());
          instantiateTree(cl);
        }
      }
    }
  }
  if (multipleDependencies.containsKey(clazz)) {
    for (    Field field : multipleDependencies.get(clazz)) {
      ParameterizedType listType=(ParameterizedType)field.getGenericType();
      Class<?> listClass=(Class<?>)listType.getActualTypeArguments()[0];
      for (      Class<?> cl : components) {
        if (listClass.isAssignableFrom(cl)) {
          instantiateTree(cl);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void instantiateTree(Class<?> clazz){
  if (instances.get(clazz) == null) {
    try {
      instances.put(clazz,clazz.newInstance());
    }
 catch (    InstantiationException ex) {
      LOG.error("String_Node_Str" + clazz.getName(),ex);
    }
catch (    IllegalAccessException ex) {
      LOG.error("String_Node_Str",ex);
    }
  }
 else {
    return;
  }
  if (dependencies.containsKey(clazz)) {
    for (    Field field : dependencies.get(clazz)) {
      for (      Class<?> cl : components) {
        if (field.getType().isAssignableFrom(cl)) {
          instantiateTree(cl);
        }
      }
    }
  }
  if (multipleDependencies.containsKey(clazz)) {
    for (    Field field : multipleDependencies.get(clazz)) {
      ParameterizedType listType=(ParameterizedType)field.getGenericType();
      Class<?> listClass=(Class<?>)listType.getActualTypeArguments()[0];
      for (      Class<?> cl : components) {
        if (listClass.isAssignableFrom(cl)) {
          instantiateTree(cl);
        }
      }
    }
  }
}
Program: 87058
Project: 87058
Buggy source:
public void scan(){
  loadProperties();
  loadJars();
  buildDependencyGraph();
  instantiateComponents();
  inject();
  initialize();
}

Fixed version (ground truth):
public void scan(){
  loadProperties();
  loadJars();
  buildDependencyGraph();
  instantiateComponents();
  inject();
}
Program: 87060
Project: 87060
Buggy source:
public GossipServerThread(){
  gossipBossGroup=new NioEventLoopGroup(GOSSIP_BOSS_THREADS);
  gossipWorkerGroup=new NioEventLoopGroup(GOSSIP_WORKER_THREADS);
  try {
    ServerBootstrap b=new ServerBootstrap();
    b.group(gossipBossGroup,gossipWorkerGroup).channel(NioServerSocketChannel.class).childHandler(new ChannelInitializer<SocketChannel>(){
      @Override public void initChannel(      SocketChannel ch) throws Exception {
        ch.config().setAllocator(new PooledByteBufAllocator());
        ch.pipeline().addLast(new GossipMessageDecoder());
        ch.pipeline().addLast("String_Node_Str",new ByteArrayEncoder());
        ch.pipeline().addLast("String_Node_Str",new ByteArrayDecoder());
        ch.pipeline().addLast(new GossipMessageHandler());
        if (LOG.isTraceEnabled()) {
          ch.pipeline().addLast(new LoggingHandler(LogLevel.TRACE));
        }
      }
      @Override public void exceptionCaught(      ChannelHandlerContext ctx,      Throwable cause) throws Exception {
        LOG.error("String_Node_Str",cause);
      }
    }
).option(ChannelOption.SO_BACKLOG,128).childOption(ChannelOption.SO_KEEPALIVE,true);
    f=b.bind(getIp(),getGossipPort()).sync();
  }
 catch (  InterruptedException ex) {
    LOG.error("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
public GossipServerThread(){
  gossipBossGroup=new NioEventLoopGroup(GOSSIP_BOSS_THREADS);
  gossipWorkerGroup=new NioEventLoopGroup(GOSSIP_WORKER_THREADS);
  try {
    ServerBootstrap b=new ServerBootstrap();
    b.group(gossipBossGroup,gossipWorkerGroup).channel(NioServerSocketChannel.class).childHandler(new ChannelInitializer<SocketChannel>(){
      @Override public void initChannel(      SocketChannel ch) throws Exception {
        ch.config().setAllocator(UnpooledByteBufAllocator.DEFAULT);
        ch.pipeline().addLast(new GossipMessageDecoder());
        ch.pipeline().addLast("String_Node_Str",new ByteArrayEncoder());
        ch.pipeline().addLast("String_Node_Str",new ByteArrayDecoder());
        ch.pipeline().addLast(new GossipMessageHandler());
        if (LOG.isTraceEnabled()) {
          ch.pipeline().addLast(new LoggingHandler(LogLevel.TRACE));
        }
      }
      @Override public void exceptionCaught(      ChannelHandlerContext ctx,      Throwable cause) throws Exception {
        LOG.error("String_Node_Str",cause);
      }
    }
).option(ChannelOption.SO_BACKLOG,128).childOption(ChannelOption.SO_KEEPALIVE,true);
    f=b.bind(getIp(),getGossipPort()).sync();
  }
 catch (  InterruptedException ex) {
    LOG.error("String_Node_Str",ex);
  }
}
Program: 87061
Project: 87061
Buggy source:
@Override public void initChannel(DatagramChannel ch) throws Exception {
  ch.config().setAllocator(new PooledByteBufAllocator());
  ch.pipeline().addLast(new DataMessageHandler());
  if (LOG.isTraceEnabled()) {
    ch.pipeline().addLast(new LoggingHandler(LogLevel.TRACE));
  }
}

Fixed version (ground truth):
@Override public void initChannel(DatagramChannel ch) throws Exception {
  ch.config().setAllocator(UnpooledByteBufAllocator.DEFAULT);
  ch.pipeline().addLast(new DataMessageHandler());
  if (LOG.isTraceEnabled()) {
    ch.pipeline().addLast(new LoggingHandler(LogLevel.TRACE));
  }
}
Program: 87062
Project: 87062
Buggy source:
public DataServerThread(){
  dataBossGroup=new NioEventLoopGroup(DATA_BOSS_THREADS);
  dataWorkerGroup=new NioEventLoopGroup(DATA_WORKER_THREADS);
  try {
    Bootstrap b=new Bootstrap();
    b.group(dataWorkerGroup).channelFactory(new ChannelFactory<Channel>(){
      @Override public Channel newChannel(){
        return new NioDatagramChannel(InternetProtocolFamily.IPv4);
      }
      @Override public String toString(){
        return NioDatagramChannel.class.getSimpleName() + "String_Node_Str";
      }
    }
).handler(new ChannelInitializer<DatagramChannel>(){
      @Override public void initChannel(      DatagramChannel ch) throws Exception {
        ch.config().setAllocator(new PooledByteBufAllocator());
        ch.pipeline().addLast(new DataMessageHandler());
        if (LOG.isTraceEnabled()) {
          ch.pipeline().addLast(new LoggingHandler(LogLevel.TRACE));
        }
      }
      @Override public void exceptionCaught(      ChannelHandlerContext ctx,      Throwable cause) throws Exception {
        LOG.error("String_Node_Str",cause);
      }
    }
);
    f=b.bind(getIp(),getDataPort()).sync();
    LOG.debug("String_Node_Str");
  }
 catch (  InterruptedException ex) {
    LOG.error("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
public DataServerThread(){
  dataBossGroup=new NioEventLoopGroup(DATA_BOSS_THREADS);
  dataWorkerGroup=new NioEventLoopGroup(DATA_WORKER_THREADS);
  try {
    Bootstrap b=new Bootstrap();
    b.group(dataWorkerGroup).channelFactory(new ChannelFactory<Channel>(){
      @Override public Channel newChannel(){
        return new NioDatagramChannel(InternetProtocolFamily.IPv4);
      }
      @Override public String toString(){
        return NioDatagramChannel.class.getSimpleName() + "String_Node_Str";
      }
    }
).handler(new ChannelInitializer<DatagramChannel>(){
      @Override public void initChannel(      DatagramChannel ch) throws Exception {
        ch.config().setAllocator(UnpooledByteBufAllocator.DEFAULT);
        ch.pipeline().addLast(new DataMessageHandler());
        if (LOG.isTraceEnabled()) {
          ch.pipeline().addLast(new LoggingHandler(LogLevel.TRACE));
        }
      }
      @Override public void exceptionCaught(      ChannelHandlerContext ctx,      Throwable cause) throws Exception {
        LOG.error("String_Node_Str",cause);
      }
    }
);
    f=b.bind(getIp(),getDataPort()).sync();
  }
 catch (  InterruptedException ex) {
    LOG.error("String_Node_Str",ex);
  }
}
Program: 87063
Project: 87063
Buggy source:
@Override public void decode(ChannelHandlerContext ctx,DatagramPacket packet,List<Object> out){
  ByteBuf buff=packet.content();
  byte[] bytes=new byte[2];
  buff.readBytes(bytes,0,2);
  int size=(bytes[0] & 0xFF) << 8 | (bytes[1] & 0xFF);
  bytes=new byte[size];
  buff.readBytes(bytes,0,size);
  decoderReactor.notify(Event.wrap(bytes));
}

Fixed version (ground truth):
@Override public void decode(ChannelHandlerContext ctx,DatagramPacket packet,List<Object> out){
  ByteBuf buff=packet.content();
  byte[] bytes=new byte[2];
  buff.readBytes(bytes,0,2);
  int size=(bytes[0] & 0xFF) << 8 | (bytes[1] & 0xFF);
  bytes=new byte[size];
  buff.readBytes(bytes,0,size);
  decoderReactor.notify(DECODE_TOPIC,Event.wrap(bytes));
}
Program: 87064
Project: 87064
Buggy source:
@Override public void shutdown(){
  gossipBossGroup.shutdownGracefully();
  gossipWorkerGroup.shutdownGracefully();
  dataBossGroup.shutdownGracefully();
  dataWorkerGroup.shutdownGracefully();
}

Fixed version (ground truth):
@Override public void shutdown(){
  if (gossipBossGroup != null) {
    gossipBossGroup.shutdownGracefully();
  }
  if (gossipWorkerGroup != null) {
    gossipWorkerGroup.shutdownGracefully();
  }
  if (dataBossGroup != null) {
    dataBossGroup.shutdownGracefully();
  }
  if (dataWorkerGroup != null) {
    dataWorkerGroup.shutdownGracefully();
  }
}
Program: 87065
Project: 87065
Buggy source:
@Override public void channelRead(ChannelHandlerContext ctx,Object msg){
  if (msg instanceof byte[]) {
    byte[] bytes=(byte[])msg;
    try {
      GossipMessage message=GossipDecoder.decode(bytes);
      reactor.notify(Event.wrap(message));
    }
 catch (    IOException ex) {
      LOG.error("String_Node_Str",ex);
    }
 finally {
      ReferenceCountUtil.release(msg);
    }
  }
 else {
    LOG.trace(msg.getClass().getName());
    ReferenceCountUtil.release(msg);
  }
}

Fixed version (ground truth):
@Override public void channelRead(ChannelHandlerContext ctx,Object msg){
  if (msg instanceof byte[]) {
    byte[] bytes=(byte[])msg;
    try {
      GossipMessage message=GossipDecoder.decode(bytes);
      reactor.notify(GOSSIP_TOPIC,Event.wrap(message));
    }
 catch (    IOException ex) {
      LOG.error("String_Node_Str",ex);
    }
 finally {
      ReferenceCountUtil.release(msg);
    }
  }
 else {
    LOG.trace(msg.getClass().getName());
    ReferenceCountUtil.release(msg);
  }
}
Program: 87066
Project: 87066
Buggy source:
@Override public void initChannel(DatagramChannel ch) throws Exception {
  ch.pipeline().addLast("String_Node_Str",new ByteArrayEncoder());
  ch.pipeline().addLast("String_Node_Str",new ByteArrayDecoder());
  ch.pipeline().addLast(new DataExceptionHandler());
  if (LOG.isTraceEnabled()) {
    ch.pipeline().addLast(new LoggingHandler(LogLevel.TRACE));
  }
}

Fixed version (ground truth):
@Override public void initChannel(DatagramChannel ch) throws Exception {
  ch.config().setAllocator(UnpooledByteBufAllocator.DEFAULT);
  ch.pipeline().addLast("String_Node_Str",new ByteArrayEncoder());
  ch.pipeline().addLast("String_Node_Str",new ByteArrayDecoder());
  ch.pipeline().addLast(new DataExceptionHandler());
  if (LOG.isTraceEnabled()) {
    ch.pipeline().addLast(new LoggingHandler(LogLevel.TRACE));
  }
}
Program: 87067
Project: 87067
Buggy source:
private void initializeGossipClient(){
  LOG.debug("String_Node_Str");
  gossipWorkerGroup=new NioEventLoopGroup(GOSSIP_WORKER_THREADS);
  Bootstrap b=new Bootstrap();
  b.group(gossipWorkerGroup);
  b.channel(NioSocketChannel.class);
  b.option(ChannelOption.SO_KEEPALIVE,true);
  b.option(ChannelOption.CONNECT_TIMEOUT_MILLIS,timeout);
  b.handler(new ChannelInitializer<SocketChannel>(){
    @Override public void initChannel(    SocketChannel ch) throws Exception {
      ch.config().setAllocator(new PooledByteBufAllocator());
      ch.pipeline().addLast("String_Node_Str",new ByteArrayEncoder());
      ch.pipeline().addLast("String_Node_Str",new ByteArrayDecoder());
      ch.pipeline().addLast(new GossipExceptionHandler());
      if (LOG.isTraceEnabled()) {
        ch.pipeline().addLast(new LoggingHandler(LogLevel.TRACE));
      }
    }
    @Override public void exceptionCaught(    ChannelHandlerContext ctx,    Throwable cause) throws Exception {
      LOG.error("String_Node_Str",cause);
      ctx.close();
    }
  }
);
  ChannelFuture future=b.connect(getIp(),getGossipPort()).awaitUninterruptibly();
  if (future.isCancelled()) {
    gossipChannel=null;
  }
 else   if (!future.isSuccess()) {
    gossipChannel=null;
    retryGossipConnection();
  }
 else {
    gossipChannel=future.channel();
    setStatus(MemberStatus.Alive);
    updateMember();
  }
}

Fixed version (ground truth):
private void initializeGossipClient(){
  LOG.trace("String_Node_Str");
  gossipWorkerGroup=new NioEventLoopGroup(GOSSIP_WORKER_THREADS);
  Bootstrap b=new Bootstrap();
  b.group(gossipWorkerGroup);
  b.channel(NioSocketChannel.class);
  b.option(ChannelOption.SO_KEEPALIVE,true);
  b.option(ChannelOption.CONNECT_TIMEOUT_MILLIS,timeout);
  b.handler(new ChannelInitializer<SocketChannel>(){
    @Override public void initChannel(    SocketChannel ch) throws Exception {
      ch.config().setAllocator(UnpooledByteBufAllocator.DEFAULT);
      ch.pipeline().addLast("String_Node_Str",new ByteArrayEncoder());
      ch.pipeline().addLast("String_Node_Str",new ByteArrayDecoder());
      ch.pipeline().addLast(new GossipExceptionHandler());
      if (LOG.isTraceEnabled()) {
        ch.pipeline().addLast(new LoggingHandler(LogLevel.TRACE));
      }
    }
    @Override public void exceptionCaught(    ChannelHandlerContext ctx,    Throwable cause) throws Exception {
      LOG.error("String_Node_Str",cause);
      ctx.close();
    }
  }
);
  ChannelFuture future=b.connect(getIp(),getGossipPort()).awaitUninterruptibly();
  if (future.isCancelled()) {
    gossipChannel=null;
  }
 else   if (!future.isSuccess()) {
    gossipChannel=null;
    retryGossipConnection();
  }
 else {
    gossipChannel=future.channel();
    setStatus(MemberStatus.Alive);
    updateMember();
  }
}
Program: 87068
Project: 87068
Buggy source:
@Override public void gossip(final GossipMessage message) throws IOException {
  byte[] bytes=GossipEncoder.encode(message);
  if (gossipChannel != null) {
    gossipChannel.writeAndFlush(bytes);
  }
}

Fixed version (ground truth):
@Override public void gossip(final GossipMessage message) throws IOException {
  byte[] bytes=GossipEncoder.encode(message);
  if (LOG.isTraceEnabled()) {
    gossipSizeStat.push(bytes.length);
  }
  if (gossipChannel != null) {
    gossipChannel.writeAndFlush(bytes);
  }
}
Program: 87069
Project: 87069
Buggy source:
@Override public void send(final Envelope message) throws IOException {
  byte[] bytes=EnvelopeEncoder.encode(message);
  if (dataChannel != null) {
    dataChannel.writeAndFlush(new DatagramPacket(Unpooled.wrappedBuffer(bytes),address));
  }
}

Fixed version (ground truth):
@Override public void send(final Envelope message) throws IOException {
  byte[] bytes=EnvelopeEncoder.encode(message);
  if (LOG.isTraceEnabled()) {
    dataSizeStat.push(bytes.length);
  }
  if (dataChannel != null) {
    dataChannel.writeAndFlush(new DatagramPacket(Unpooled.wrappedBuffer(bytes),address));
  }
}
Program: 87070
Project: 87070
Buggy source:
@Override public void shutdown(){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + getIp() + "String_Node_Str"+ getGossipPort()+ "String_Node_Str"+ getDataPort());
  }
  if (gossipWorkerGroup != null) {
    gossipWorkerGroup.shutdownGracefully();
  }
  if (dataWorkerGroup != null) {
    dataWorkerGroup.shutdownGracefully();
  }
}

Fixed version (ground truth):
@Override public void shutdown(){
  if (LOG.isTraceEnabled()) {
    LOG.trace("String_Node_Str" + getIp() + "String_Node_Str"+ getGossipPort()+ "String_Node_Str"+ getDataPort());
  }
  if (gossipWorkerGroup != null) {
    gossipWorkerGroup.shutdownGracefully();
  }
  if (dataWorkerGroup != null) {
    dataWorkerGroup.shutdownGracefully();
  }
  if (LOG.isTraceEnabled()) {
    LOG.trace("String_Node_Str" + gossipSizeStat.mean() + "String_Node_Str"+ gossipSizeStat.numSamples()+ "String_Node_Str");
    LOG.trace("String_Node_Str" + dataSizeStat.mean() + "String_Node_Str"+ dataSizeStat.numSamples()+ "String_Node_Str");
  }
}
Program: 87072
Project: 87072
Buggy source:
/** 
 * Get the set of relations containing the specified key.
 * @param key a key.
 * @param index the index of the key.
 * @return the collection of keys containing the specified key.
 */
private List<R> get(Object key,int index){
  if (distinct && !(key instanceof Range)) {
    index=classes.indexOf(key.getClass());
  }
  Class sup=key.getClass().getSuperclass();
  while (index == -1 && sup != null) {
    index=classes.indexOf(sup);
    sup=sup.getSuperclass();
  }
  if (key instanceof Range && index == -1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (index < 0 || mapping.get(index) == null) {
    return Collections.emptyList();
  }
  if (mapping.get(index).get(key) == null && !(key instanceof Range)) {
    return Collections.emptyList();
  }
  if (key instanceof Range) {
    Range range=(Range)key;
    ArrayList ret=new ArrayList();
    for (    Object number : mapping.get(index).keySet()) {
      if (number instanceof Number) {
        if (range.contains((Number)number)) {
          ret.addAll(mapping.get(index).get(number));
        }
      }
    }
    return ret;
  }
 else {
    return new ArrayList(mapping.get(index).get(key));
  }
}

Fixed version (ground truth):
/** 
 * Get the set of relations containing the specified key.
 * @param key a key.
 * @param index the index of the key.
 * @return the collection of keys containing the specified key.
 */
private List<R> get(Object key,int index){
  if (distinct && !(key instanceof Range)) {
    index=classes.indexOf(key.getClass());
  }
  Class sup=key.getClass().getSuperclass();
  while (index == -1 && sup != null) {
    index=classes.indexOf(sup);
    sup=sup.getSuperclass();
  }
  if (key instanceof Range && index == -1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (index < 0 || mapping.get(index) == null) {
    return Collections.emptyList();
  }
  if (mapping.get(index).get(key) == null && !(key instanceof Range)) {
    return Collections.emptyList();
  }
  if (key instanceof Range) {
    Range range=(Range)key;
    List ret=Collections.synchronizedList(new ArrayList());
    for (    Object number : mapping.get(index).keySet()) {
      if (number instanceof Number) {
        if (range.contains((Number)number)) {
          ret.addAll(mapping.get(index).get(number));
        }
      }
    }
    return ret;
  }
 else {
    return Collections.synchronizedList(new ArrayList(mapping.get(index).get(key)));
  }
}
Program: 87074
Project: 87074
Buggy source:
@Override public void visit(int version,int access,String name,String signature,String superName,String[] interfaces){
  currentClass=name;
  isMessage=false;
  msgPackDefined=false;
  if (superName.equals("String_Node_Str")) {
    if (!name.startsWith("String_Node_Str") && !name.startsWith("String_Node_Str") && !name.startsWith("String_Node_Str")&& !name.startsWith("String_Node_Str")) {
      isEnum=true;
    }
  }
  cv.visit(version,access,name,signature,superName,interfaces);
}

Fixed version (ground truth):
@Override public void visit(int version,int access,String name,String signature,String superName,String[] interfaces){
  currentClass=name;
  isMessage=false;
  msgPackDefined=false;
  if (superName.equals("String_Node_Str")) {
    if (!name.startsWith("String_Node_Str") && !name.startsWith("String_Node_Str") && !name.startsWith("String_Node_Str")&& !name.startsWith("String_Node_Str")&& !name.startsWith("String_Node_Str")) {
      isEnum=true;
    }
  }
  cv.visit(version,access,name,signature,superName,interfaces);
}
Program: 87075
Project: 87075
Buggy source:
public static void main(String[] args) throws Exception {
  ConfigurableApplicationContext context=SpringApplication.run(Starter.class,args);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  Parameters.INSTANCE.currentOS();
  ConfigurableApplicationContext context=SpringApplication.run(Starter.class,args);
}
Program: 87076
Project: 87076
Buggy source:
public PyxlLexerAdapter(){
  super(new PyxlLexer());
}

Fixed version (ground truth):
public PyxlLexerAdapter(){
  super(new PyxlLexer((Reader)null));
}
Program: 87077
Project: 87077
Buggy source:
/** 
 * Parse a pyxl tag.
 */
private void parsePyxlTag(){
  final PsiBuilder.Marker pyxl=myBuilder.mark();
  myBuilder.advanceLexer();
  IElementType token=myBuilder.getTokenType();
  if (!parsePyxlTagName()) {
    myBuilder.error("String_Node_Str");
    pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
    return;
  }
  parsePyxlAttributes();
  token=myBuilder.getTokenType();
  if (token == PyxlTokenTypes.TAGENDANDCLOSE) {
    myBuilder.advanceLexer();
  }
 else   if (token == PyxlTokenTypes.TAGEND) {
    myBuilder.advanceLexer();
    while ((token=myBuilder.getTokenType()) != PyxlTokenTypes.TAGCLOSE) {
      try {
        if (parsePyxlEmbed()) {
          continue;
        }
      }
 catch (      PyxlParsingException e) {
        pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
        return;
      }
      if (token == PyxlTokenTypes.TAGBEGIN) {
        parsePyxlTag();
      }
 else       if (token == PyxlTokenTypes.STRING) {
        myBuilder.advanceLexer();
      }
 else {
        myBuilder.error("String_Node_Str" + token.toString());
        pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
        return;
      }
    }
    myBuilder.advanceLexer();
    if (!parsePyxlTagName()) {
      myBuilder.error("String_Node_Str");
      pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
      return;
    }
    if (myBuilder.getTokenType() == PyxlTokenTypes.TAGEND) {
      myBuilder.advanceLexer();
    }
 else {
      myBuilder.error("String_Node_Str");
    }
  }
  pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
}

Fixed version (ground truth):
/** 
 * Parse a pyxl tag.
 */
private void parsePyxlTag(){
  final PsiBuilder.Marker pyxl=myBuilder.mark();
  myBuilder.advanceLexer();
  IElementType token=myBuilder.getTokenType();
  if (!parsePyxlTagName()) {
    myBuilder.error("String_Node_Str");
    pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
    return;
  }
  parsePyxlAttributes();
  token=myBuilder.getTokenType();
  if (token == PyxlTokenTypes.TAGENDANDCLOSE) {
    myBuilder.advanceLexer();
  }
 else   if (token == PyxlTokenTypes.TAGEND) {
    myBuilder.advanceLexer();
    while ((token=myBuilder.getTokenType()) != PyxlTokenTypes.TAGCLOSE) {
      try {
        if (parsePyxlEmbed()) {
          continue;
        }
      }
 catch (      PyxlParsingException e) {
        pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
        return;
      }
      if (token == PyxlTokenTypes.TAGBEGIN) {
        parsePyxlTag();
      }
 else       if (token == PyxlTokenTypes.STRING) {
        myBuilder.advanceLexer();
      }
 else {
        myBuilder.error(String.format("String_Node_Str",token));
        pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
        return;
      }
    }
    myBuilder.advanceLexer();
    if (!parsePyxlTagName()) {
      myBuilder.error("String_Node_Str");
      pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
      return;
    }
    if (myBuilder.getTokenType() == PyxlTokenTypes.TAGEND) {
      myBuilder.advanceLexer();
    }
 else {
      myBuilder.error("String_Node_Str");
    }
  }
  pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
}
Program: 87078
Project: 87078
Buggy source:
@NonNull public String getTagName(){
  return String.format("String_Node_Str",text);
}

Fixed version (ground truth):
@NotNull public String getTagName(){
  return String.format("String_Node_Str",text);
}
Program: 87079
Project: 87079
Buggy source:
/** 
 * Parse as many attribute="value" pairs as possible.
 */
private void parsePyxlAttributes(){
  if (myBuilder.getTokenType() == PyxlTokenTypes.ATTRNAME) {
    final PsiBuilder.Marker attr=myBuilder.mark();
    myBuilder.advanceLexer();
    if (myBuilder.getTokenType() == PyTokenTypes.EQ) {
      myBuilder.advanceLexer();
      if (parsePyxlEmbed()) {
        attr.done(PyElementTypes.KEYWORD_ARGUMENT_EXPRESSION);
        parsePyxlAttributes();
        return;
      }
    }
    myBuilder.error("String_Node_Str");
    attr.done(PyElementTypes.KEYWORD_ARGUMENT_EXPRESSION);
  }
}

Fixed version (ground truth):
/** 
 * Parse as many attribute="value" pairs as possible.
 */
private void parsePyxlAttributes(){
  if (myBuilder.getTokenType() == PyxlTokenTypes.ATTRNAME) {
    final PsiBuilder.Marker attr=myBuilder.mark();
    myBuilder.advanceLexer();
    if (myBuilder.getTokenType() == PyTokenTypes.EQ) {
      myBuilder.advanceLexer();
      if (parsePyxlEmbed() || myBuilder.getTokenType() == PyxlTokenTypes.ATTRVALUE) {
        if (myBuilder.getTokenType() == PyxlTokenTypes.ATTRVALUE) {
          myBuilder.advanceLexer();
        }
        attr.done(PyElementTypes.KEYWORD_ARGUMENT_EXPRESSION);
        parsePyxlAttributes();
        return;
      }
    }
    myBuilder.error("String_Node_Str");
    attr.done(PyElementTypes.KEYWORD_ARGUMENT_EXPRESSION);
  }
}
Program: 87080
Project: 87080
Buggy source:
/** 
 * Parse the current pyxl tag.
 */
private void parsePyxlTag(){
  final PsiBuilder.Marker pyxl=myBuilder.mark();
  myBuilder.advanceLexer();
  if (myBuilder.getTokenType() == PyxlTokenTypes.TAGNAME) {
    consumeTokenAsPyxlTag();
  }
  parsePyxlAttributes();
  if (myBuilder.getTokenType() == PyxlTokenTypes.TAGENDANDCLOSE) {
    myBuilder.advanceLexer();
    pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
    return;
  }
 else   if (myBuilder.getTokenType() == PyxlTokenTypes.TAGEND) {
    myBuilder.advanceLexer();
    while (!myBuilder.eof()) {
      if (parsePyxlEmbed() == null) {
        break;
      }
      if (myBuilder.getTokenType() == PyxlTokenTypes.STRING) {
        myBuilder.advanceLexer();
      }
 else       if (PYXL_BEGIN_TOKENS.contains(myBuilder.getTokenType())) {
        parsePyxlTag();
      }
 else       if (PYXL_CLOSE_TOKENS.contains(myBuilder.getTokenType())) {
        consumeTokenAsPyxlTag();
        pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
        return;
      }
 else {
        myBuilder.advanceLexer();
      }
    }
  }
  myBuilder.error("String_Node_Str");
  pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
}

Fixed version (ground truth):
/** 
 * Parse the current pyxl tag.
 */
private void parsePyxlTag(){
  final PsiBuilder.Marker pyxl=myBuilder.mark();
  myBuilder.advanceLexer();
  IElementType token=myBuilder.getTokenType();
  if (!parsePyxlTagName()) {
    myBuilder.error("String_Node_Str");
    pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
    return;
  }
  parsePyxlAttributes();
  token=myBuilder.getTokenType();
  if (token == PyxlTokenTypes.TAGENDANDCLOSE) {
    myBuilder.advanceLexer();
  }
 else   if (token == PyxlTokenTypes.TAGEND) {
    myBuilder.advanceLexer();
    while ((token=myBuilder.getTokenType()) != PyxlTokenTypes.TAGCLOSE) {
      if (parsePyxlEmbed() == null) {
        pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
        return;
      }
      token=myBuilder.getTokenType();
      if (token == PyxlTokenTypes.TAGBEGIN) {
        parsePyxlTag();
      }
 else       if (token == PyxlTokenTypes.STRING) {
        myBuilder.advanceLexer();
      }
 else {
        myBuilder.error("String_Node_Str" + token.toString());
        pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
        return;
      }
    }
    myBuilder.advanceLexer();
    if (!parsePyxlTagName()) {
      myBuilder.error("String_Node_Str");
      pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
      return;
    }
    if (myBuilder.getTokenType() == PyxlTokenTypes.TAGEND) {
      myBuilder.advanceLexer();
    }
 else {
      myBuilder.error("String_Node_Str");
    }
  }
  pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
}
Program: 87081
Project: 87081
Buggy source:
public boolean parsePrimaryExpression(boolean isTargetExpression){
  boolean match=super.parsePrimaryExpression(isTargetExpression);
  if (!match) {
    if (PYXL_BEGIN_TOKENS.contains(myBuilder.getTokenType())) {
      parsePyxlTag();
      return true;
    }
  }
  return match;
}

Fixed version (ground truth):
public boolean parsePrimaryExpression(boolean isTargetExpression){
  boolean match=super.parsePrimaryExpression(isTargetExpression);
  if (!match) {
    if (myBuilder.getTokenType() == PyxlTokenTypes.TAGBEGIN) {
      parsePyxlTag();
      return true;
    }
  }
  return match;
}
Program: 87082
Project: 87082
Buggy source:
/** 
 * Parse the current pyxl tag.
 */
private void parsePyxlTag(){
  final PsiBuilder.Marker pyxl=myBuilder.mark();
  consumeTokenAsPyxlTag();
  parsePyxlAttributes();
  if (myBuilder.getTokenType() == PyxlTokenTypes.TAGENDANDCLOSE) {
    myBuilder.advanceLexer();
    pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
    return;
  }
 else   if (myBuilder.getTokenType() == PyxlTokenTypes.TAGEND) {
    consumeTokenAsPyxlTag();
    while (!myBuilder.eof()) {
      if (!parsePyxlEmbed()) {
        break;
      }
      if (myBuilder.getTokenType() == PyxlTokenTypes.STRING) {
        myBuilder.advanceLexer();
      }
 else       if (myBuilder.getTokenType() == PyxlTokenTypes.TAGBEGIN) {
        parsePyxlTag();
      }
 else       if (myBuilder.getTokenType() == PyxlTokenTypes.TAGCLOSE) {
        consumeTokenAsPyxlTag();
        pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
        return;
      }
 else {
        myBuilder.advanceLexer();
      }
    }
  }
  myBuilder.error("String_Node_Str");
  pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
}

Fixed version (ground truth):
/** 
 * Parse the current pyxl tag.
 */
private void parsePyxlTag(){
  final PsiBuilder.Marker pyxl=myBuilder.mark();
  consumeTokenAsPyxlTag();
  parsePyxlAttributes();
  if (myBuilder.getTokenType() == PyxlTokenTypes.TAGENDANDCLOSE) {
    myBuilder.advanceLexer();
    pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
    return;
  }
 else   if (myBuilder.getTokenType() == PyxlTokenTypes.TAGEND) {
    myBuilder.advanceLexer();
    while (!myBuilder.eof()) {
      if (!parsePyxlEmbed()) {
        break;
      }
      if (myBuilder.getTokenType() == PyxlTokenTypes.STRING) {
        myBuilder.advanceLexer();
      }
 else       if (myBuilder.getTokenType() == PyxlTokenTypes.TAGBEGIN) {
        parsePyxlTag();
      }
 else       if (myBuilder.getTokenType() == PyxlTokenTypes.TAGCLOSE) {
        consumeTokenAsPyxlTag();
        pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
        return;
      }
 else {
        myBuilder.advanceLexer();
      }
    }
  }
  myBuilder.error("String_Node_Str");
  pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
}
Program: 87083
Project: 87083
Buggy source:
/** 
 * Parse the current pyxl tag.
 */
private void parsePyxlTag(){
  final PsiBuilder.Marker pyxl=myBuilder.mark();
  myBuilder.advanceLexer();
  IElementType token=myBuilder.getTokenType();
  if (!parsePyxlTagName()) {
    myBuilder.error("String_Node_Str");
    pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
    return;
  }
  parsePyxlAttributes();
  token=myBuilder.getTokenType();
  if (token == PyxlTokenTypes.TAGENDANDCLOSE) {
    myBuilder.advanceLexer();
  }
 else   if (token == PyxlTokenTypes.TAGEND) {
    myBuilder.advanceLexer();
    while ((token=myBuilder.getTokenType()) != PyxlTokenTypes.TAGCLOSE) {
      if (parsePyxlEmbed() == null) {
        pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
        return;
      }
      token=myBuilder.getTokenType();
      if (token == PyxlTokenTypes.TAGBEGIN) {
        parsePyxlTag();
      }
 else       if (token == PyxlTokenTypes.STRING) {
        myBuilder.advanceLexer();
      }
 else {
        myBuilder.error("String_Node_Str" + token.toString());
        pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
        return;
      }
    }
    myBuilder.advanceLexer();
    if (!parsePyxlTagName()) {
      myBuilder.error("String_Node_Str");
      pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
      return;
    }
    if (myBuilder.getTokenType() == PyxlTokenTypes.TAGEND) {
      myBuilder.advanceLexer();
    }
 else {
      myBuilder.error("String_Node_Str");
    }
  }
  pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
}

Fixed version (ground truth):
/** 
 * Parse the current pyxl tag.
 */
private void parsePyxlTag(){
  final PsiBuilder.Marker pyxl=myBuilder.mark();
  myBuilder.advanceLexer();
  IElementType token=myBuilder.getTokenType();
  if (!parsePyxlTagName()) {
    myBuilder.error("String_Node_Str");
    pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
    return;
  }
  parsePyxlAttributes();
  token=myBuilder.getTokenType();
  if (token == PyxlTokenTypes.TAGENDANDCLOSE) {
    myBuilder.advanceLexer();
  }
 else   if (token == PyxlTokenTypes.TAGEND) {
    myBuilder.advanceLexer();
    while ((token=myBuilder.getTokenType()) != PyxlTokenTypes.TAGCLOSE) {
      Integer parsedEmbed=parsePyxlEmbed();
      if (parsedEmbed == null) {
        pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
        return;
      }
 else       if (parsedEmbed == 1) {
        continue;
      }
      if (token == PyxlTokenTypes.TAGBEGIN) {
        parsePyxlTag();
      }
 else       if (token == PyxlTokenTypes.STRING) {
        myBuilder.advanceLexer();
      }
 else {
        myBuilder.error("String_Node_Str" + token.toString());
        pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
        return;
      }
    }
    myBuilder.advanceLexer();
    if (!parsePyxlTagName()) {
      myBuilder.error("String_Node_Str");
      pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
      return;
    }
    if (myBuilder.getTokenType() == PyxlTokenTypes.TAGEND) {
      myBuilder.advanceLexer();
    }
 else {
      myBuilder.error("String_Node_Str");
    }
  }
  pyxl.done(PyxlElementTypes.PYXL_STATEMENT);
}
Program: 87084
Project: 87084
Buggy source:
public PyxlIndentingLexer(){
  super(new PythonPyxlLexer((Reader)null),TokenSet.EMPTY);
}

Fixed version (ground truth):
public PyxlIndentingLexer(){
  super(new PyxlLexer((Reader)null),TokenSet.EMPTY);
}
Program: 87085
Project: 87085
Buggy source:
/** 
 * Parse the current pyxl tag.
 */
private void parsePyxlTag(){
  final PsiBuilder.Marker pyxl=myBuilder.mark();
  myBuilder.advanceLexer();
  parsePyxlAttributes();
  if (myBuilder.getTokenType() == PyxlTokenTypes.TAGENDANDCLOSE) {
    myBuilder.advanceLexer();
    pyxl.done(PyElementTypes.STRING_LITERAL_EXPRESSION);
    return;
  }
 else   if (myBuilder.getTokenType() == PyxlTokenTypes.TAGEND) {
    myBuilder.advanceLexer();
    while (!myBuilder.eof()) {
      if (myBuilder.getTokenType() == PyxlTokenTypes.STRING) {
        myBuilder.advanceLexer();
      }
 else       if (myBuilder.getTokenType() == PyxlTokenTypes.TAGBEGIN) {
        parsePyxlTag();
      }
 else       if (myBuilder.getTokenType() == PyxlTokenTypes.TAGCLOSE) {
        pyxl.done(PyElementTypes.STRING_LITERAL_EXPRESSION);
        return;
      }
 else {
        myBuilder.advanceLexer();
      }
    }
  }
  myBuilder.error("String_Node_Str");
  pyxl.done(PyElementTypes.STRING_LITERAL_EXPRESSION);
}

Fixed version (ground truth):
/** 
 * Parse the current pyxl tag.
 */
private void parsePyxlTag(){
  final PsiBuilder.Marker pyxl=myBuilder.mark();
  myBuilder.advanceLexer();
  parsePyxlAttributes();
  if (myBuilder.getTokenType() == PyxlTokenTypes.TAGENDANDCLOSE) {
    myBuilder.advanceLexer();
    pyxl.done(PyElementTypes.CALL_EXPRESSION);
    return;
  }
 else   if (myBuilder.getTokenType() == PyxlTokenTypes.TAGEND) {
    myBuilder.advanceLexer();
    while (!myBuilder.eof()) {
      if (myBuilder.getTokenType() == PyxlTokenTypes.STRING) {
        myBuilder.advanceLexer();
      }
 else       if (myBuilder.getTokenType() == PyxlTokenTypes.TAGBEGIN) {
        parsePyxlTag();
      }
 else       if (myBuilder.getTokenType() == PyxlTokenTypes.TAGCLOSE) {
        myBuilder.advanceLexer();
        pyxl.done(PyElementTypes.CALL_EXPRESSION);
        return;
      }
 else {
        myBuilder.advanceLexer();
      }
    }
  }
  myBuilder.error("String_Node_Str");
  pyxl.done(PyElementTypes.CALL_EXPRESSION);
}
Program: 87086
Project: 87086
Buggy source:
/** 
 * Parse as many attribute="value" pairs as possible.
 */
private void parsePyxlAttributes(){
  if (myBuilder.getTokenType() == PyxlTokenTypes.ATTRNAME) {
    myBuilder.advanceLexer();
    if (myBuilder.getTokenType() == PyTokenTypes.EQ) {
      myBuilder.advanceLexer();
      if (myBuilder.getTokenType() == PyxlTokenTypes.ATTRVALUE) {
        myBuilder.advanceLexer();
        parsePyxlAttributes();
        return;
      }
    }
    myBuilder.error("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Parse as many attribute="value" pairs as possible.
 */
private void parsePyxlAttributes(){
  if (myBuilder.getTokenType() == PyxlTokenTypes.ATTRNAME) {
    final PsiBuilder.Marker attr=myBuilder.mark();
    myBuilder.advanceLexer();
    if (myBuilder.getTokenType() == PyTokenTypes.EQ) {
      myBuilder.advanceLexer();
      if (myBuilder.getTokenType() == PyxlTokenTypes.ATTRVALUE) {
        myBuilder.advanceLexer();
        attr.done(PyElementTypes.KEYWORD_ARGUMENT_EXPRESSION);
        parsePyxlAttributes();
        return;
      }
    }
    myBuilder.error("String_Node_Str");
  }
}
Program: 87088
Project: 87088
Buggy source:
@Test public void testSetUpMerchant() throws InstantiationException, IllegalAccessException, SignException {
  String keyAlias="String_Node_Str" + config.getMerchantID() + "String_Node_Str";
  X509Certificate x509Cert=Mockito.mock(X509Certificate.class);
  Principal principal=Mockito.mock(Principal.class);
  PrivateKey pkey=Mockito.mock(PrivateKey.class);
  Logger logger=Mockito.mock(Logger.class);
  Mockito.when(x509Cert.getSubjectDN()).thenReturn(principal);
  Mockito.when(principal.getName()).thenReturn(keyAlias);
  Identity identity=new Identity(config,x509Cert,pkey,logger);
  assertEquals(identity.getName(),config.getMerchantID());
  assertEquals(identity.getSerialNumber(),"String_Node_Str");
  assertNotNull(identity.getPrivateKey());
}

Fixed version (ground truth):
@Test public void testSetUpMerchant() throws InstantiationException, IllegalAccessException, SignException, ConfigException {
  File p12file=Mockito.mock(File.class);
  MerchantConfig mc=Mockito.mock(MerchantConfig.class);
  String keyAlias="String_Node_Str" + mc.getMerchantID() + "String_Node_Str";
  X509Certificate x509Cert=Mockito.mock(X509Certificate.class);
  Principal principal=Mockito.mock(Principal.class);
  PrivateKey pkey=Mockito.mock(PrivateKey.class);
  Logger logger=Mockito.mock(Logger.class);
  Mockito.when(x509Cert.getSubjectDN()).thenReturn(principal);
  Mockito.when(principal.getName()).thenReturn(keyAlias);
  Mockito.when(mc.getKeyFile()).thenReturn(p12file);
  Identity identity=new Identity(mc,x509Cert,pkey,logger);
  assertEquals(identity.getName(),mc.getMerchantID());
  assertEquals(identity.getSerialNumber(),"String_Node_Str");
  assertNotNull(identity.getPrivateKey());
}
Program: 87090
Project: 87090
Buggy source:
void postDocument(Document request) throws IOException, TransformerConfigurationException, TransformerException, MalformedURLException, ProtocolException {
  HttpClient httpClient=new HttpClient();
  setTimeout(httpClient,mc.getTimeout() * 1000);
  setProxy(httpClient);
  String serverURL=mc.getEffectiveServerURL();
  postMethod=new PostMethod(serverURL);
  postMethod.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,new MyRetryHandler());
  String requestString=documentToString(request);
  logger.log(Logger.LT_INFO,"String_Node_Str" + requestString.length() + "String_Node_Str"+ serverURL);
  postMethod.setRequestEntity(new StringRequestEntity(requestString,null,"String_Node_Str"));
  httpClient.executeMethod(postMethod);
}

Fixed version (ground truth):
void postDocument(Document request) throws IOException, TransformerConfigurationException, TransformerException, MalformedURLException, ProtocolException {
  HttpClient httpClient=new HttpClient(new SimpleHttpConnectionManager(true));
  setTimeout(httpClient,mc.getTimeout() * 1000);
  setProxy(httpClient);
  String serverURL=mc.getEffectiveServerURL();
  postMethod=new PostMethod(serverURL);
  postMethod.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,new MyRetryHandler());
  String requestString=documentToString(request);
  logger.log(Logger.LT_INFO,"String_Node_Str" + requestString.length() + "String_Node_Str"+ serverURL);
  postMethod.setRequestEntity(new StringRequestEntity(requestString,null,"String_Node_Str"));
  httpClient.executeMethod(postMethod);
}
Program: 87091
Project: 87091
Buggy source:
private String getRRDPath(String host){
  return rrdpath + (host != null ? host : "String_Node_Str");
}

Fixed version (ground truth):
private String getRRDPath(String host) throws AnkushException {
  return rrdpath + (host != null ? getRRDHostPath(host) : "String_Node_Str");
}
Program: 87092
Project: 87092
Buggy source:
/** 
 * DIGITAL SIGNATURES 
 */
public static final boolean sign(byte[] v,byte[] h,byte[] x,byte[] s){
  byte[] tmp1=new byte[65];
  byte[] tmp2=new byte[33];
  int w;
  int i;
  for (i=0; i < 32; i++)   v[i]=0;
  i=mula_small(v,x,0,h,32,-1);
  mula_small(v,v,0,ORDER,32,(15 - v[31]) / 16);
  mula32(tmp1,v,s,32,1);
  divmod(tmp2,tmp1,64,ORDER,32);
  for (w=0, i=0; i < 32; i++)   w|=v[i]=tmp1[i];
  return w != 0;
}

Fixed version (ground truth):
/** 
 * DIGITAL SIGNATURES 
 */
public static final boolean sign(byte[] v,byte[] h,byte[] x,byte[] s){
  int w, i;
  byte[] h1=new byte[32], x1=new byte[32];
  byte[] tmp1=new byte[64];
  byte[] tmp2=new byte[64];
  cpy32(h1,h);
  cpy32(x1,x);
  byte[] tmp3=new byte[32];
  divmod(tmp3,h1,32,ORDER,32);
  divmod(tmp3,x1,32,ORDER,32);
  mula_small(v,x1,0,h1,32,-1);
  mula_small(v,v,0,ORDER,32,1);
  mula32(tmp1,v,s,32,1);
  divmod(tmp2,tmp1,64,ORDER,32);
  for (w=0, i=0; i < 32; i++)   w|=v[i]=tmp1[i];
  return w != 0;
}
Program: 87093
Project: 87093
Buggy source:
/** 
 * DIGITAL SIGNATURES 
 */
public static final boolean sign(byte[] v,byte[] h,byte[] x,byte[] s){
  byte[] tmp1=new byte[65];
  byte[] tmp2=new byte[33];
  int w;
  int i;
  for (i=0; i < 32; i++)   v[i]=0;
  i=mula_small(v,x,0,h,32,-1);
  mula_small(v,v,0,ORDER,32,(15 - v[31]) / 16);
  mula32(tmp1,v,s,32,1);
  divmod(tmp2,tmp1,64,ORDER,32);
  for (w=0, i=0; i < 32; i++)   w|=v[i]=tmp1[i];
  return w != 0;
}

Fixed version (ground truth):
/** 
 * DIGITAL SIGNATURES 
 */
public static final boolean sign(byte[] v,byte[] h,byte[] x,byte[] s){
  int w, i;
  byte[] h1=new byte[32], x1=new byte[32];
  byte[] tmp1=new byte[64];
  byte[] tmp2=new byte[64];
  cpy32(h1,h);
  cpy32(x1,x);
  byte[] tmp3=new byte[32];
  divmod(tmp3,h1,32,ORDER,32);
  divmod(tmp3,x1,32,ORDER,32);
  mula_small(v,x1,0,h1,32,-1);
  mula_small(v,v,0,ORDER,32,1);
  mula32(tmp1,v,s,32,1);
  divmod(tmp2,tmp1,64,ORDER,32);
  for (w=0, i=0; i < 32; i++)   w|=v[i]=tmp1[i];
  return w != 0;
}
Program: 87094
Project: 87094
Buggy source:
@Override public ItemStack slotClick(int slotNum,int mouseButton,int modifier,EntityPlayer player){
  return super.slotClick(slotNum,mouseButton,modifier,player);
}

Fixed version (ground truth):
@Override public ItemStack slotClick(int slotNum,int mouseButton,int modifier,EntityPlayer player){
  if (modifier == 2) {
    Slot slot1=(Slot)this.inventorySlots.get(slotNum);
    ItemStack stack2=player.inventory.getStackInSlot(mouseButton);
    if (stack2 != null && !slot1.isItemValid(stack2))     return slot1.getStack();
  }
  return super.slotClick(slotNum,mouseButton,modifier,player);
}
Program: 87095
Project: 87095
Buggy source:
public static ItemStack insertStackIntoInventory(ItemStack itemStack,IInventory inventory){
  return TileEntityHopper.func_145889_a(inventory,itemStack,ForgeDirection.UNKNOWN.ordinal());
}

Fixed version (ground truth):
public static ItemStack insertStackIntoInventory(ItemStack itemStack,IInventory inventory,ForgeDirection direction){
  return TileEntityHopper.func_145889_a(inventory,itemStack,direction.ordinal());
}