nus-yam/ex-repair huggingface dataset:
Program: 187298
Project: 187298
Buggy source:
MethodHelperImpl(MethodOutline method){
  this.method=method;
}

Fixed version (ground truth):
public MethodHelperImpl(MethodOutline method){
  this.method=method;
}
Program: 187299
Project: 187299
Buggy source:
@Override public void between(int atLeast,int atMost){
  if (atLeast < 0) {
    throw new DescriptorBuilderException("String_Node_Str");
  }
  if (atMost <= 0) {
    throw new DescriptorBuilderException("String_Node_Str");
  }
  if (atMost < atLeast) {
    throw new DescriptorBuilderException("String_Node_Str");
  }
  method.setMaxOccurrences(atLeast);
  method.setMinOccurrences(atMost);
}

Fixed version (ground truth):
@Override public void between(int atLeast,int atMost){
  if (atLeast < 0) {
    throw new DescriptorBuilderException("String_Node_Str");
  }
  if (atMost <= 0) {
    throw new DescriptorBuilderException("String_Node_Str");
  }
  if (atMost < atLeast) {
    throw new DescriptorBuilderException("String_Node_Str");
  }
  method.setMinOccurrences(atLeast);
  method.setMaxOccurrences(atMost);
}
Program: 187300
Project: 187300
Buggy source:
private static void generateNamesForAnonymousBlocks(BlockOutline block,AtomicInteger counter){
  if (block.getName() == null) {
    MethodParser parsed=new MethodParser(block.getConstructor().getMethodSignature());
    block.setName("String_Node_Str" + counter.getAndIncrement() + "String_Node_Str"+ parsed.methodName);
  }
  for (  MethodOutline method : block.getAllMethods()) {
    for (    BlockOutline chain : method.getBlockChain()) {
      if (chain == block) {
        continue;
      }
      generateNamesForAnonymousBlocks(chain,counter);
    }
  }
}

Fixed version (ground truth):
private static void generateNamesForAnonymousBlocks(BlockOutline block,AtomicInteger counter){
  if (block.getName() == null || block.getName().trim().isEmpty()) {
    StringBuilder name=new StringBuilder().append("String_Node_Str").append(counter.getAndIncrement());
    if (block.getConstructor() != null) {
      MethodParser parsed=new MethodParser(block.getConstructor().getMethodSignature());
      name.append("String_Node_Str").append(parsed.methodName);
    }
    block.setName(name.toString());
  }
  for (  MethodOutline method : block.getAllMethods()) {
    for (    BlockOutline chain : method.getBlockChain()) {
      if (chain == block) {
        continue;
      }
      generateNamesForAnonymousBlocks(chain,counter);
    }
  }
}
Program: 187301
Project: 187301
Buggy source:
private ClassLoader compileAndWriteClasses(Descriptor descriptor,URLClassLoader classLoader) throws MojoExecutionException {
  JavaCompiler compiler=ToolProvider.getSystemJavaCompiler();
  DiagnosticCollector<JavaFileObject> diagnostics=new DiagnosticCollector<JavaFileObject>();
  JavaFileManager fileManager=new ClassFileManager(compiler.getStandardFileManager(null,null,null),classesDirectory);
  List<String> options=new ArrayList<String>();
  options.add("String_Node_Str");
  options.add(makeClasspath(classLoader));
  Iterable<? extends JavaFileObject> compilationUnits=getSourceFiles(descriptor);
  JavaCompiler.CompilationTask task=compiler.getTask(null,fileManager,diagnostics,options,null,compilationUnits);
  task.call();
  try {
    fileManager.close();
  }
 catch (  IOException e) {
  }
  boolean atLeastOneError=false;
  for (  Diagnostic<? extends JavaFileObject> error : diagnostics.getDiagnostics()) {
    if (error.getKind() != Diagnostic.Kind.NOTE) {
      StringBuilder message=new StringBuilder().append(error.getSource().getName()).append("String_Node_Str").append(error.getLineNumber()).append("String_Node_Str").append(error.getColumnNumber()).append("String_Node_Str").append(error.getMessage(Locale.getDefault()));
      getLog().warn(message.toString());
      atLeastOneError=true;
    }
  }
  if (atLeastOneError) {
    throw new MojoExecutionException("String_Node_Str");
  }
  return fileManager.getClassLoader(StandardLocation.CLASS_PATH);
}

Fixed version (ground truth):
private ClassLoader compileAndWriteClasses(Descriptor descriptor,URLClassLoader classLoader) throws MojoExecutionException {
  JavaCompiler compiler=ToolProvider.getSystemJavaCompiler();
  DiagnosticCollector<JavaFileObject> diagnostics=new DiagnosticCollector<JavaFileObject>();
  JavaFileManager fileManager=new ClassFileManager(compiler.getStandardFileManager(null,null,null),classesDirectory);
  List<String> options=new ArrayList<String>();
  options.add("String_Node_Str");
  options.add(makeClasspath(classLoader));
  options.add("String_Node_Str");
  options.add("String_Node_Str");
  Iterable<? extends JavaFileObject> compilationUnits=getSourceFiles(descriptor);
  JavaCompiler.CompilationTask task=compiler.getTask(null,fileManager,diagnostics,options,null,compilationUnits);
  task.call();
  try {
    fileManager.close();
  }
 catch (  IOException e) {
  }
  boolean atLeastOneError=false;
  for (  Diagnostic<? extends JavaFileObject> error : diagnostics.getDiagnostics()) {
    if (error.getKind() != Diagnostic.Kind.NOTE) {
      StringBuilder message=new StringBuilder().append(error.getSource().getName()).append("String_Node_Str").append(error.getLineNumber()).append("String_Node_Str").append(error.getColumnNumber()).append("String_Node_Str").append(error.getMessage(Locale.getDefault()));
      getLog().warn(message.toString());
      atLeastOneError=true;
    }
  }
  if (atLeastOneError) {
    throw new MojoExecutionException("String_Node_Str");
  }
  return fileManager.getClassLoader(StandardLocation.CLASS_PATH);
}
Program: 187302
Project: 187302
Buggy source:
private ClassLoader compileAndWriteClasses(Descriptor descriptor,URLClassLoader classLoader) throws MojoExecutionException {
  JavaCompiler compiler=ToolProvider.getSystemJavaCompiler();
  DiagnosticCollector<JavaFileObject> diagnostics=new DiagnosticCollector<JavaFileObject>();
  JavaFileManager fileManager=new ClassFileManager(compiler.getStandardFileManager(null,null,null),classesDirectory);
  List<String> options=new ArrayList<String>();
  options.add("String_Node_Str");
  options.add(makeClasspath(classLoader));
  options.add("String_Node_Str");
  options.add("String_Node_Str");
  Iterable<? extends JavaFileObject> compilationUnits=getSourceFiles(descriptor);
  JavaCompiler.CompilationTask task=compiler.getTask(null,fileManager,diagnostics,options,null,compilationUnits);
  task.call();
  try {
    fileManager.close();
  }
 catch (  IOException e) {
  }
  boolean atLeastOneError=false;
  for (  Diagnostic<? extends JavaFileObject> error : diagnostics.getDiagnostics()) {
    if (error.getKind() != Diagnostic.Kind.NOTE) {
      StringBuilder message=new StringBuilder().append(error.getSource().getName()).append("String_Node_Str").append(error.getLineNumber()).append("String_Node_Str").append(error.getColumnNumber()).append("String_Node_Str").append(error.getMessage(Locale.getDefault()));
      getLog().warn(message.toString());
      atLeastOneError=true;
    }
  }
  if (atLeastOneError) {
    throw new MojoExecutionException("String_Node_Str");
  }
  return fileManager.getClassLoader(StandardLocation.CLASS_PATH);
}

Fixed version (ground truth):
private ClassLoader compileAndWriteClasses(Descriptor descriptor,URLClassLoader classLoader) throws MojoExecutionException {
  JavaCompiler compiler=ToolProvider.getSystemJavaCompiler();
  DiagnosticCollector<JavaFileObject> diagnostics=new DiagnosticCollector<JavaFileObject>();
  JavaFileManager fileManager=new ClassFileManager(compiler.getStandardFileManager(null,null,null),classesDirectory);
  List<String> options=new ArrayList<String>();
  options.add("String_Node_Str");
  options.add(makeClasspath(classLoader));
  Iterable<? extends JavaFileObject> compilationUnits=getSourceFiles(descriptor);
  JavaCompiler.CompilationTask task=compiler.getTask(null,fileManager,diagnostics,options,null,compilationUnits);
  task.call();
  try {
    fileManager.close();
  }
 catch (  IOException e) {
  }
  boolean atLeastOneError=false;
  for (  Diagnostic<? extends JavaFileObject> error : diagnostics.getDiagnostics()) {
    if (error.getKind() != Diagnostic.Kind.NOTE) {
      StringBuilder message=new StringBuilder().append(error.getSource().getName()).append("String_Node_Str").append(error.getLineNumber()).append("String_Node_Str").append(error.getColumnNumber()).append("String_Node_Str").append(error.getMessage(Locale.getDefault()));
      getLog().warn(message.toString());
      atLeastOneError=true;
    }
  }
  if (atLeastOneError) {
    throw new MojoExecutionException("String_Node_Str");
  }
  return fileManager.getClassLoader(StandardLocation.CLASS_PATH);
}
Program: 187303
Project: 187303
Buggy source:
private void trackMethod(Method method){
  Tracked annotation=method.getAnnotation(Tracked.class);
  if (annotation == null) {
    return;
  }
  if (!trackedMethods.containsKey(annotation.key())) {
    Counter counter=new Counter(annotation.atLeast());
    trackedMethods.put(annotation.key(),new Pair<Counter,String>(counter,method.getName()));
  }
  trackedMethods.get(annotation.key()).one.decrementAndGet();
}

Fixed version (ground truth):
private void trackMethod(Method method){
  Tracked annotation=method.getAnnotation(Tracked.class);
  if (annotation == null) {
    return;
  }
  trackedMethods.get(annotation.key()).one.decrementAndGet();
}
Program: 187304
Project: 187304
Buggy source:
@SuppressWarnings("String_Node_Str") public final <T>T _proxy(Class<?> clazz){
  return (T)Proxy.newProxyInstance(this.getClass().getClassLoader(),new Class[]{clazz},this);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public final <T>T _proxy(Class<?> clazz){
  registerNewTrackedMethods(clazz);
  return (T)Proxy.newProxyInstance(this.getClass().getClassLoader(),new Class[]{clazz},this);
}
Program: 187306
Project: 187306
Buggy source:
private boolean checkForBlocksWithNoEnd(StateClass state,final Map<StateClass,Boolean> seen){
  final ObjectWrapper<Boolean> terminal=new ObjectWrapper<Boolean>(false);
  final ObjectWrapper<Boolean> valid=new ObjectWrapper<Boolean>(false);
  for (  Transition transition : state.getTransitions()) {
    transition.accept(new TransitionVisitor.$(){
      public @Override void visit(      TerminalTransition transition){
        terminal.set(true);
      }
      public @Override void visit(      AscendingTransition transition){
        terminal.set(true);
      }
    }
);
    valid.set(valid.get() || terminal.get());
  }
  if (seen.containsKey(state)) {
    return seen.get(state);
  }
 else {
    seen.put(state,terminal.get());
  }
  for (  Transition transition : state.getTransitions()) {
    final TransitionType transitionType=transition.getType();
    transition.acceptForTraversal(new GenericVisitor<StateClass>(){
      public void visit(      StateClass next){
        boolean nextIsTerminal=checkForBlocksWithNoEnd(next,seen);
        if (transitionType != TransitionType.Recursive) {
          valid.set(valid.get() || nextIsTerminal);
        }
      }
    }
);
  }
  if (valid.get() != true) {
    throw new DescriptorBuilderException("String_Node_Str" + state.getName());
  }
  return terminal.get();
}

Fixed version (ground truth):
private boolean checkForBlocksWithNoEnd(StateClass state,final Map<StateClass,Boolean> seen){
  if (seen.containsKey(state)) {
    return seen.get(state);
  }
  final ObjectWrapper<Boolean> valid=new ObjectWrapper<Boolean>(false);
  final ObjectWrapper<Boolean> terminal=new ObjectWrapper<Boolean>(false);
  for (  Transition transition : state.getTransitions()) {
    transition.accept(new TransitionVisitor.$(){
      public @Override void visit(      TerminalTransition transition){
        terminal.set(true);
      }
      public @Override void visit(      AscendingTransition transition){
        terminal.set(true);
      }
    }
);
  }
  valid.set(valid.get() || terminal.get());
  seen.put(state,terminal.get());
  for (  Transition transition : state.getTransitions()) {
    final TransitionType transitionType=transition.getType();
    transition.acceptForTraversal(new GenericVisitor<StateClass>(){
      public void visit(      StateClass next){
        boolean nextIsTerminal=checkForBlocksWithNoEnd(next,seen);
        if (transitionType != TransitionType.Recursive) {
          valid.set(valid.get() || nextIsTerminal);
        }
      }
    }
);
  }
  boolean hasImplicitTerminals=state.getBaseState() != null ? state.getBaseState().hasImplicitTerminal() : state.hasImplicitTerminal();
  valid.set(valid.get() || hasImplicitTerminals);
  if (!valid.get().equals(true)) {
    throw new DescriptorBuilderException("String_Node_Str" + state.getName());
  }
  return terminal.get();
}
Program: 187307
Project: 187307
Buggy source:
private Transition visitCandidateState(LateralTransition transition){
  StateClass owner=transition.getOwner();
  if (owner.getBaseState() != transition.getSibling()) {
    return null;
  }
  if (transition.info().getMaxOccurrences() != 1) {
    return null;
  }
  if (!transition.getSibling().getTransitions().isEmpty()) {
    return null;
  }
  Transition replacement;
  if (owner.isTopLevel()) {
    replacement=new TerminalTransition(Void.class);
  }
 else {
    replacement=new AscendingTransition();
  }
  replacement.setMethodInfo(transition.info().copy());
  replacement.getStateChain().addAll(transition.getStateChain());
  return replacement;
}

Fixed version (ground truth):
private Transition visitCandidateState(LateralTransition transition){
  StateClass owner=transition.getOwner();
  if (owner.getBaseState() != transition.getSibling()) {
    return null;
  }
  if (transition.info().getMaxOccurrences() != 1) {
    return null;
  }
  if (!transition.getSibling().getTransitions().isEmpty()) {
    return null;
  }
  Transition replacement=new AscendingTransition();
  replacement.setMethodInfo(transition.info().copy());
  replacement.getStateChain().addAll(transition.getStateChain());
  return replacement;
}
Program: 187308
Project: 187308
Buggy source:
@Override public void visit(StateClass state){
  if (seen.contains(state)) {
    return;
  }
 else {
    seen.add(state);
  }
  Map<Transition,Transition> replacements=new HashMap<Transition,Transition>();
  for (  Transition transition : state.getTransitions()) {
    if (LateralTransition.class.isAssignableFrom(transition.getClass())) {
      Transition replacement=visitCandidateState((LateralTransition)transition);
      if (replacement != null) {
        replacements.put(transition,replacement);
      }
    }
    transition.acceptForTraversal(this);
  }
  for (  Map.Entry<Transition,Transition> entry : replacements.entrySet()) {
    state.replaceTransition(entry.getKey(),entry.getValue());
  }
}

Fixed version (ground truth):
@Override public void visit(StateClass state){
  if (seen.contains(state)) {
    return;
  }
 else {
    seen.add(state);
  }
  Map<Transition,Transition> replacements=new HashMap<Transition,Transition>();
  for (  Transition transition : state.getTransitions()) {
    if (LateralTransition.class.isAssignableFrom(transition.getClass())) {
      Transition replacement=visitCandidateState((LateralTransition)transition);
      if (replacement != null) {
        replacements.put(transition,replacement);
        state.getBaseState().setImplicitTerminal();
      }
    }
    transition.acceptForTraversal(this);
  }
  for (  Map.Entry<Transition,Transition> entry : replacements.entrySet()) {
    state.replaceTransition(entry.getKey(),entry.getValue());
  }
}
Program: 187310
Project: 187310
Buggy source:
public Set<MethodOutline> getAllMethods(){
  return new HashSet<MethodOutline>(methods);
}

Fixed version (ground truth):
public Set<MethodOutline> getAllMethods(){
  return methods;
}
Program: 187311
Project: 187311
Buggy source:
private static void copyFile(File sourceFile,File destFile){
  FileChannel source=null;
  FileChannel destination=null;
  try {
    source=new FileInputStream(sourceFile).getChannel();
    destination=new FileOutputStream(destFile).getChannel();
    destination.transferFrom(source,0,source.size());
  }
 catch (  Exception ex) {
    throw new DescriptorBuilderException("String_Node_Str",ex);
  }
 finally {
    if (source != null) {
      try {
        source.close();
      }
 catch (      Exception ex) {
      }
    }
    if (destination != null) {
      try {
        destination.close();
      }
 catch (      Exception ex) {
      }
    }
  }
}

Fixed version (ground truth):
private static void copyFile(InputStream sourceFile,File destFile){
  FileOutputStream destination=null;
  try {
    String data=new Scanner(sourceFile).useDelimiter("String_Node_Str").next();
    destination=new FileOutputStream(destFile);
    destination.write(data.getBytes());
  }
 catch (  Exception ex) {
    throw new DescriptorBuilderException("String_Node_Str",ex);
  }
 finally {
    if (destination != null) {
      try {
        destination.close();
      }
 catch (      Exception ex) {
      }
    }
  }
}
Program: 187312
Project: 187312
Buggy source:
private static File getResourceFile(String name){
  URL url=CodeWriter.class.getClassLoader().getResource(name);
  File f;
  if (url == null) {
    throw new DescriptorBuilderException("String_Node_Str" + name + "String_Node_Str");
  }
  try {
    f=new File(url.toURI());
  }
 catch (  URISyntaxException ex) {
    throw new DescriptorBuilderException(ex);
  }
  if (!f.exists()) {
    throw new DescriptorBuilderException("String_Node_Str" + name + "String_Node_Str");
  }
  return f;
}

Fixed version (ground truth):
private static InputStream getResourceFile(String name){
  InputStream stream=CodeWriter.class.getClassLoader().getResourceAsStream(name);
  if (stream == null) {
    throw new DescriptorBuilderException("String_Node_Str" + name + "String_Node_Str");
  }
  return stream;
}
Program: 187313
Project: 187313
Buggy source:
/** 
 * Perform a search on the IMDB
 * @param query
 * @return
 */
public Map<String,List<SearchObject>> getSearch(String query){
  Map<String,String> args=new HashMap<String,String>();
  String encodedQuery;
  try {
    encodedQuery=URLEncoder.encode(query,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException ex) {
    encodedQuery=query;
  }
  args.put("String_Node_Str",encodedQuery);
  args.put("String_Node_Str","String_Node_Str");
  WrapperSearch wrapper=ApiBuilder.getSearchWrapper("String_Node_Str",args);
  if (wrapper == null) {
    return Collections.emptyMap();
  }
 else {
    return wrapper.getSearchResults();
  }
}

Fixed version (ground truth):
/** 
 * Perform a search on the IMDB
 * @param query
 * @return
 */
public Map<String,List<SearchObject>> getSearch(String query){
  Map<String,String> args=new HashMap<String,String>();
  String encodedQuery;
  try {
    encodedQuery=URLEncoder.encode(query,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException ex) {
    LOG.trace("String_Node_Str",query);
    encodedQuery=query;
  }
  args.put("String_Node_Str",encodedQuery);
  args.put("String_Node_Str","String_Node_Str");
  WrapperSearch wrapper=ApiBuilder.getSearchWrapper("String_Node_Str",args);
  if (wrapper == null) {
    return Collections.emptyMap();
  }
 else {
    return wrapper.getSearchResults();
  }
}
Program: 187314
Project: 187314
Buggy source:
/** 
 * Get the Chart Movie Meter
 * @return
 */
public List<ImdbChartMoviemeter> getChartMoviemeter(){
  WrapperChartMoviemeter wrapper=ApiBuilder.getWrapper(WrapperChartMoviemeter.class,"String_Node_Str",Collections.EMPTY_MAP);
  if (wrapper == null) {
    return Collections.emptyList();
  }
 else {
    return wrapper.getData().getChartMoviemeter();
  }
}

Fixed version (ground truth):
/** 
 * Get the Chart Movie Meter
 * @return
 */
public List<ImdbChartMoviemeter> getChartMoviemeter(){
  WrapperChartMoviemeter wrapper=ApiBuilder.getWrapper(WrapperChartMoviemeter.class,"String_Node_Str",Collections.<String,String>emptyMap());
  if (wrapper == null) {
    return Collections.emptyList();
  }
 else {
    return wrapper.getData().getChartMoviemeter();
  }
}
Program: 187315
Project: 187315
Buggy source:
/** 
 * Get the Chart Star Meter
 * @return
 */
public List<ImdbChartStarmeter> getChartStarmeter(){
  WrapperChartStarmeter wrapper=ApiBuilder.getWrapper(WrapperChartStarmeter.class,"String_Node_Str",Collections.EMPTY_MAP);
  if (wrapper == null) {
    return Collections.emptyList();
  }
 else {
    return wrapper.getData().getChartStarmeter();
  }
}

Fixed version (ground truth):
/** 
 * Get the Chart Star Meter
 * @return
 */
public List<ImdbChartStarmeter> getChartStarmeter(){
  WrapperChartStarmeter wrapper=ApiBuilder.getWrapper(WrapperChartStarmeter.class,"String_Node_Str",Collections.<String,String>emptyMap());
  if (wrapper == null) {
    return Collections.emptyList();
  }
 else {
    return wrapper.getData().getChartStarmeter();
  }
}
Program: 187316
Project: 187316
Buggy source:
/** 
 * Get the latest box office information
 * @return
 */
public List<ImdbBoxOffice> getBoxOffice(){
  WrapperBoxOffice wrapper=ApiBuilder.getWrapper(WrapperBoxOffice.class,"String_Node_Str",Collections.EMPTY_MAP);
  if (wrapper != null && wrapper.getData().getBoxOfficeList() != null) {
    return wrapper.getData().getBoxOfficeList().getBoxOffice();
  }
  return Collections.emptyList();
}

Fixed version (ground truth):
/** 
 * Get the latest box office information
 * @return
 */
public List<ImdbBoxOffice> getBoxOffice(){
  WrapperBoxOffice wrapper=ApiBuilder.getWrapper(WrapperBoxOffice.class,"String_Node_Str",Collections.<String,String>emptyMap());
  if (wrapper != null && wrapper.getData().getBoxOfficeList() != null) {
    return wrapper.getData().getBoxOfficeList().getBoxOffice();
  }
  return Collections.emptyList();
}
Program: 187317
Project: 187317
Buggy source:
public static ResponseDetail getResponse(String function){
  return getResponse(function,Collections.EMPTY_MAP);
}

Fixed version (ground truth):
public static ResponseDetail getResponse(String function){
  return getResponse(function,Collections.<String,String>emptyMap());
}
Program: 187318
Project: 187318
Buggy source:
public static URL buildUrl(String function,Map<String,String> arguments){
  StringBuilder sbURL=new StringBuilder(BASE_URL);
  sbURL.append(function);
  sbURL.append("String_Node_Str").append(API_VERSION);
  sbURL.append("String_Node_Str").append(APP_ID);
  sbURL.append("String_Node_Str").append(imdbLocale);
  sbURL.append("String_Node_Str").append(System.currentTimeMillis() / 1000);
  for (  Map.Entry<String,String> argEntry : arguments.entrySet()) {
    sbURL.append("String_Node_Str").append(argEntry.getKey());
    sbURL.append("String_Node_Str").append(argEntry.getValue());
  }
  sbURL.append("String_Node_Str").append(SIG);
  LOG.trace("String_Node_Str",sbURL.toString());
  try {
    return new URL(sbURL.toString());
  }
 catch (  MalformedURLException ex) {
    LOG.trace("String_Node_Str",ex.getMessage());
    return null;
  }
}

Fixed version (ground truth):
public static URL buildUrl(String function,Map<String,String> arguments){
  StringBuilder sbURL=new StringBuilder(BASE_URL);
  sbURL.append(function);
  sbURL.append("String_Node_Str").append(API_VERSION);
  sbURL.append("String_Node_Str").append(APP_ID);
  sbURL.append("String_Node_Str").append(imdbLocale);
  sbURL.append("String_Node_Str").append(System.currentTimeMillis() / MILLIS_PER_SECOND);
  for (  Map.Entry<String,String> argEntry : arguments.entrySet()) {
    sbURL.append("String_Node_Str").append(argEntry.getKey());
    sbURL.append("String_Node_Str").append(argEntry.getValue());
  }
  sbURL.append("String_Node_Str").append(SIG);
  LOG.trace("String_Node_Str",sbURL.toString());
  try {
    return new URL(sbURL.toString());
  }
 catch (  MalformedURLException ex) {
    LOG.trace("String_Node_Str",ex.getMessage());
    return null;
  }
}
Program: 187319
Project: 187319
Buggy source:
public static <T>T getWrapper(Class<T> clazz,String function,Map<String,String> args){
  try {
    String webPage=httpClient.requestContent(buildUrl(function,args),Charset.forName(DEFAULT_CHARSET));
    Object response=MAPPER.readValue(webPage,clazz);
    return clazz.cast(response);
  }
 catch (  JsonParseException ex) {
    LOG.warn("String_Node_Str",ex.getMessage());
  }
catch (  JsonMappingException ex) {
    LOG.warn("String_Node_Str",ex.getMessage());
  }
catch (  IOException ex) {
    LOG.warn("String_Node_Str",ex.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public static <T>T getWrapper(Class<T> clazz,String function,Map<String,String> args){
  try {
    String webPage=httpClient.requestContent(buildUrl(function,args),Charset.forName(DEFAULT_CHARSET));
    Object response=MAPPER.readValue(webPage,clazz);
    return clazz.cast(response);
  }
 catch (  JsonParseException ex) {
    LOG.warn("String_Node_Str",ex.getMessage(),ex);
  }
catch (  JsonMappingException ex) {
    LOG.warn("String_Node_Str",ex.getMessage(),ex);
  }
catch (  IOException ex) {
    LOG.warn("String_Node_Str",ex.getMessage(),ex);
  }
  return null;
}
Program: 187320
Project: 187320
Buggy source:
public static Map<String,List<SearchObject>> getSearch(String query){
  Map<String,String> args=new HashMap<String,String>();
  String encodedQuery;
  try {
    encodedQuery=URLEncoder.encode(query,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException ex) {
    encodedQuery=query;
  }
  args.put("String_Node_Str",encodedQuery);
  WrapperSearch wrapper=ApiBuilder.getSearchWrapper("String_Node_Str",args);
  if (wrapper == null) {
    return null;
  }
 else {
    return wrapper.getSearchResults();
  }
}

Fixed version (ground truth):
public static Map<String,List<SearchObject>> getSearch(String query){
  Map<String,String> args=new HashMap<String,String>();
  String encodedQuery;
  try {
    encodedQuery=URLEncoder.encode(query,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException ex) {
    encodedQuery=query;
  }
  args.put("String_Node_Str",encodedQuery);
  args.put("String_Node_Str","String_Node_Str");
  WrapperSearch wrapper=ApiBuilder.getSearchWrapper("String_Node_Str",args);
  if (wrapper == null) {
    return null;
  }
 else {
    return wrapper.getSearchResults();
  }
}
Program: 187321
Project: 187321
Buggy source:
/** 
 * {@inheritDoc}
 */
public void diff(TextNodeComparator leftComparator,TextNodeComparator rightComparator) throws SAXException {
  LCSSettings settings=new LCSSettings();
  settings.setUseGreedyMethod(false);
  RangeDifference[] differences=RangeDifferencer.findDifferences(settings,leftComparator,rightComparator);
  List<RangeDifference> pdifferences=preProcess(differences);
  int currentIndexLeft=0;
  int currentIndexRight=0;
  for (  RangeDifference d : pdifferences) {
    if (d.leftStart() > currentIndexLeft) {
      rightComparator.handlePossibleChangedPart(currentIndexLeft,d.leftStart(),currentIndexRight,d.rightStart(),leftComparator);
    }
    if (d.leftLength() > 0) {
      rightComparator.markAsDeleted(d.leftStart(),d.leftEnd(),leftComparator,d.rightStart());
    }
    rightComparator.markAsNew(d.rightStart(),d.rightEnd());
    currentIndexLeft=d.leftEnd();
    currentIndexRight=d.rightEnd();
  }
  if (currentIndexLeft < leftComparator.getRangeCount()) {
    rightComparator.handlePossibleChangedPart(currentIndexLeft,leftComparator.getRangeCount(),currentIndexRight,rightComparator.getRangeCount(),leftComparator);
  }
  rightComparator.expandWhiteSpace();
  output.generateOutput(rightComparator.getBodyNode());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void diff(TextNodeComparator leftComparator,TextNodeComparator rightComparator) throws SAXException {
  LCSSettings settings=new LCSSettings();
  settings.setUseGreedyMethod(false);
  RangeDifference[] differences=RangeDifferencer.findDifferences(settings,leftComparator,rightComparator);
  List<RangeDifference> pdifferences=preProcess(differences);
  int currentIndexLeft=0;
  int currentIndexRight=0;
  for (  RangeDifference d : pdifferences) {
    if (d.leftStart() > currentIndexLeft) {
      rightComparator.handlePossibleChangedPart(currentIndexLeft,d.leftStart(),currentIndexRight,d.rightStart(),leftComparator);
    }
    if (d.leftLength() > 0) {
      rightComparator.markAsDeleted(d.leftStart(),d.leftEnd(),leftComparator,d.rightStart(),d.rightEnd());
    }
    rightComparator.markAsNew(d.rightStart(),d.rightEnd());
    currentIndexLeft=d.leftEnd();
    currentIndexRight=d.rightEnd();
  }
  if (currentIndexLeft < leftComparator.getRangeCount()) {
    rightComparator.handlePossibleChangedPart(currentIndexLeft,leftComparator.getRangeCount(),currentIndexRight,rightComparator.getRangeCount(),leftComparator);
  }
  rightComparator.expandWhiteSpace();
  output.generateOutput(rightComparator.getBodyNode());
}
Program: 187322
Project: 187322
Buggy source:
/** 
 * Marks the given range as deleted. In the output, the range will be formatted as "removed".
 * @param start
 * @param end
 * @param oldComp
 * @param before
 */
public void markAsDeleted(int start,int end,TextNodeComparator oldComp,int before){
  markAsDeleted(start,end,oldComp,before,ModificationType.REMOVED);
}

Fixed version (ground truth):
/** 
 * Marks the given range as deleted. In the output, the range will be formatted as "removed".
 * @param start
 * @param end
 * @param oldComp
 * @param before
 */
public void markAsDeleted(int start,int end,TextNodeComparator oldComp,int before,int after){
  markAsDeleted(start,end,oldComp,before,after,ModificationType.REMOVED);
}
Program: 187324
Project: 187324
Buggy source:
@Override public List<NATTraversalTechnique> getAllFallbackTechniques(){
  List<NATTraversalTechnique> result=new ArrayList<NATTraversalTechnique>();
  List<NATTraversalTechnique> all=this.getAllSupportedNATTraversalTechniques();
  for (  NATTraversalTechnique natTraversalTechnique : all) {
    if (natTraversalTechnique.getMetaData().getTraversaledNATSituations().size() == this.nubmerOfPossibleNatSituation)     result.add(natTraversalTechnique.copy());
  }
  return Collections.unmodifiableList(result);
}

Fixed version (ground truth):
@Override public List<NATTraversalTechnique> getAllFallbackTechniques(){
  List<NATTraversalTechnique> result=new ArrayList<NATTraversalTechnique>();
  List<NATTraversalTechnique> all=this.getAllSupportedNATTraversalTechniques();
  for (  NATTraversalTechnique natTraversalTechnique : all) {
    if (natTraversalTechnique.getMetaData().getTraversaledNATSituations().size() == this.nubmerOfPossibleNatSituation) {
      result.add(natTraversalTechnique.copy());
    }
  }
  return Collections.unmodifiableList(result);
}
Program: 187325
Project: 187325
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + connectionSetupTime;
  result=prime * result + ((name == null) ? 0 : name.hashCode());
  result=prime * result + timoutInSeconds;
  result=prime * result + ((version == null) ? 0 : version.hashCode());
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=(prime * result) + connectionSetupTime;
  result=(prime * result) + ((name == null) ? 0 : name.hashCode());
  result=(prime * result) + timoutInSeconds;
  result=(prime * result) + ((version == null) ? 0 : version.hashCode());
  return result;
}
Program: 187326
Project: 187326
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  DirectconnectionMetaData other=(DirectconnectionMetaData)obj;
  if (connectionSetupTime != other.connectionSetupTime)   return false;
  if (name == null) {
    if (other.name != null)     return false;
  }
 else   if (!name.equals(other.name))   return false;
  if (timoutInSeconds != other.timoutInSeconds)   return false;
  if (version == null) {
    if (other.version != null)     return false;
  }
 else   if (!version.equals(other.version))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  DirectconnectionMetaData other=(DirectconnectionMetaData)obj;
  if (connectionSetupTime != other.connectionSetupTime) {
    return false;
  }
  if (name == null) {
    if (other.name != null) {
      return false;
    }
  }
 else   if (!name.equals(other.name)) {
    return false;
  }
  if (timoutInSeconds != other.timoutInSeconds) {
    return false;
  }
  if (version == null) {
    if (other.version != null) {
      return false;
    }
  }
 else   if (!version.equals(other.version)) {
    return false;
  }
  return true;
}
Program: 187327
Project: 187327
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + maxConnectionSetupTime;
  result=prime * result + ((name == null) ? 0 : name.hashCode());
  result=prime * result + timeoutInSeconds;
  result=prime * result + ((version == null) ? 0 : version.hashCode());
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=(prime * result) + maxConnectionSetupTime;
  result=(prime * result) + ((name == null) ? 0 : name.hashCode());
  result=(prime * result) + timeoutInSeconds;
  result=(prime * result) + ((version == null) ? 0 : version.hashCode());
  return result;
}
Program: 187328
Project: 187328
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  HolePunchingMetaData other=(HolePunchingMetaData)obj;
  if (maxConnectionSetupTime != other.maxConnectionSetupTime)   return false;
  if (name == null) {
    if (other.name != null)     return false;
  }
 else   if (!name.equals(other.name))   return false;
  if (timeoutInSeconds != other.timeoutInSeconds)   return false;
  if (version == null) {
    if (other.version != null)     return false;
  }
 else   if (!version.equals(other.version))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  HolePunchingMetaData other=(HolePunchingMetaData)obj;
  if (maxConnectionSetupTime != other.maxConnectionSetupTime) {
    return false;
  }
  if (name == null) {
    if (other.name != null) {
      return false;
    }
  }
 else   if (!name.equals(other.name)) {
    return false;
  }
  if (timeoutInSeconds != other.timeoutInSeconds) {
    return false;
  }
  if (version == null) {
    if (other.version != null) {
      return false;
    }
  }
 else   if (!version.equals(other.version)) {
    return false;
  }
  return true;
}
Program: 187329
Project: 187329
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((comparator == null) ? 0 : comparator.hashCode());
  result=prime * result + ((decisionTree == null) ? 0 : decisionTree.hashCode());
  result=prime * result + ((registry == null) ? 0 : registry.hashCode());
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=(prime * result) + ((comparator == null) ? 0 : comparator.hashCode());
  result=(prime * result) + ((decisionTree == null) ? 0 : decisionTree.hashCode());
  result=(prime * result) + ((registry == null) ? 0 : registry.hashCode());
  return result;
}
Program: 187330
Project: 187330
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  ConnectionSetupTimeSelection other=(ConnectionSetupTimeSelection)obj;
  if (comparator == null) {
    if (other.comparator != null)     return false;
  }
 else   if (!comparator.equals(other.comparator))   return false;
  if (decisionTree == null) {
    if (other.decisionTree != null)     return false;
  }
 else   if (!decisionTree.equals(other.decisionTree))   return false;
  if (registry == null) {
    if (other.registry != null)     return false;
  }
 else   if (!registry.equals(other.registry))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  ConnectionSetupTimeSelection other=(ConnectionSetupTimeSelection)obj;
  if (comparator == null) {
    if (other.comparator != null) {
      return false;
    }
  }
 else   if (!comparator.equals(other.comparator)) {
    return false;
  }
  if (decisionTree == null) {
    if (other.decisionTree != null) {
      return false;
    }
  }
 else   if (!decisionTree.equals(other.decisionTree)) {
    return false;
  }
  if (registry == null) {
    if (other.registry != null) {
      return false;
    }
  }
 else   if (!registry.equals(other.registry)) {
    return false;
  }
  return true;
}
Program: 187331
Project: 187331
Buggy source:
/** 
 * Runs in a loop until the interrupt status of this thread is set or an  {@link IOException} occurs. Waits for a new connection via the server socketand then executes a task to handle it via the given executor. The task is created by the  {@link SocketTaskFactory} member and the accepted socketgets handed over to it. Before the thread terminates the given executor is shutdown. 
 */
@Override public final void run(){
  try {
    while (!isInterrupted()) {
      Socket s=server.accept();
      logger.info("String_Node_Str",s);
      executor.execute(tasks.getTask(s));
    }
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e.getMessage());
  }
 finally {
    logger.info("String_Node_Str",isInterrupted());
    executor.shutdownNow();
  }
}

Fixed version (ground truth):
/** 
 * Runs in a loop until the interrupt status of this thread is set or an  {@link IOException} occurs. Waits for a new connection via the server socketand then executes a task to handle it via the given executor. The task is created by the  {@link SocketTaskFactory} member and the accepted socketgets handed over to it. Before the thread terminates the given executor is shutdown.
 */
@Override public final void run(){
  try {
    while (!isInterrupted()) {
      Socket s=server.accept();
      logger.info("String_Node_Str",s);
      executor.execute(tasks.getTask(s));
    }
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e.getMessage());
  }
 finally {
    logger.info("String_Node_Str",isInterrupted());
    executor.shutdownNow();
  }
}
Program: 187332
Project: 187332
Buggy source:
/** 
 * Test method for  {@link FilePropertyReader#readArguments(java.util.List,java.util.List,java.util.List)}.
 */
@Test public final void testReadArguments(){
  FilePropertyReader filePropReader=new FilePropertyReader();
  try {
    filePropReader.readArguments(stunArgs,relayArgs,mediatorArgs);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
}

Fixed version (ground truth):
/** 
 * Test method for  {@link FilePropertyReader#readArguments(java.util.List,java.util.List,java.util.List)}.
 */
@Test public final void testReadArguments(){
  FilePropertyReader filePropReader=new FilePropertyReader();
  try {
    filePropReader.readArguments(stunArgs,relayArgs,mediatorArgs);
  }
 catch (  IllegalArgumentException e) {
  }
}
Program: 187333
Project: 187333
Buggy source:
/** 
 * Test method for  {@link SystemPropertyReader#readArguments(java.util.List,java.util.List,java.util.List)}with no system properties.
 */
@Test public final void testReadArguments1(){
  SystemPropertyReader sysPropReader=new SystemPropertyReader();
  sysPropReader.readArguments(stunArgs,relayArgs,mediatorArgs);
}

Fixed version (ground truth):
/** 
 * Test method for  {@link SystemPropertyReader#readArguments(java.util.List,java.util.List,java.util.List)}with no system properties.
 */
@Test public final void testReadArguments1(){
  List<String> emptyList=new ArrayList<String>();
  emptyList.add("String_Node_Str");
  SystemPropertyReader sysPropReader=new SystemPropertyReader();
  sysPropReader.readArguments(stunArgs,relayArgs,mediatorArgs);
  assertEquals(emptyList,relayArgs);
}
Program: 187334
Project: 187334
Buggy source:
/** 
 * Test method for  {@link SystemPropertyReader#readArguments(java.util.List,java.util.List,java.util.List)}with all system properties.
 */
@Test public final void testReadArguments2(){
  Properties props=new Properties();
  props.setProperty(AbstractReader.STUN_FIRST_IP,"String_Node_Str");
  props.setProperty(AbstractReader.STUN_SECOND_IP,"String_Node_Str");
  props.setProperty(AbstractReader.RELAY_PORT,"String_Node_Str");
  props.setProperty(AbstractReader.MEDIATOR_PORT,"String_Node_Str");
  props.setProperty(AbstractReader.MEDIATOR_ITERATION,"String_Node_Str");
  props.setProperty(AbstractReader.MEDIATOR_LIFETIME,"String_Node_Str");
  System.setProperties(props);
  SystemPropertyReader sysPropReader=new SystemPropertyReader();
  sysPropReader.readArguments(stunArgs,relayArgs,mediatorArgs);
}

Fixed version (ground truth):
/** 
 * Test method for  {@link SystemPropertyReader#readArguments(java.util.List,java.util.List,java.util.List)}with all system properties.
 */
@Test public final void testReadArguments2(){
  List<String> relayReference=new ArrayList<String>();
  relayReference.add("String_Node_Str");
  Properties props=new Properties();
  props.setProperty(AbstractReader.STUN_FIRST_IP,"String_Node_Str");
  props.setProperty(AbstractReader.STUN_SECOND_IP,"String_Node_Str");
  props.setProperty(AbstractReader.RELAY_PORT,"String_Node_Str");
  props.setProperty(AbstractReader.MEDIATOR_PORT,"String_Node_Str");
  props.setProperty(AbstractReader.MEDIATOR_ITERATION,"String_Node_Str");
  props.setProperty(AbstractReader.MEDIATOR_LIFETIME,"String_Node_Str");
  System.setProperties(props);
  SystemPropertyReader sysPropReader=new SystemPropertyReader();
  sysPropReader.readArguments(stunArgs,relayArgs,mediatorArgs);
  System.clearProperty(AbstractReader.STUN_FIRST_IP);
  System.clearProperty(AbstractReader.STUN_SECOND_IP);
  System.clearProperty(AbstractReader.RELAY_PORT);
  System.clearProperty(AbstractReader.MEDIATOR_PORT);
  System.clearProperty(AbstractReader.MEDIATOR_ITERATION);
  System.clearProperty(AbstractReader.MEDIATOR_LIFETIME);
  assertEquals(relayReference,relayArgs);
}
Program: 187335
Project: 187335
Buggy source:
@Override protected void dispatchDraw(Canvas canvas){
  if (showcaseX < 0 || showcaseY < 0 || isRedundant) {
    super.dispatchDraw(canvas);
    return;
  }
  boolean recalculatedCling=mShowcaseDrawer.calculateShowcaseRect(showcaseX,showcaseY);
  boolean recalculateText=recalculatedCling || mAlteredText;
  mAlteredText=false;
  if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB && !mHasNoTarget) {
    Path path=new Path();
    canvas.clipPath(path,Op.DIFFERENCE);
  }
  canvas.drawColor(mBackgroundColor);
  if (!mHasNoTarget) {
    mShowcaseDrawer.drawShowcase(canvas,showcaseX,showcaseY,scaleMultiplier,showcaseRadius);
  }
  if (recalculateText) {
    mTextDrawer.calculateTextPosition(canvas.getWidth(),canvas.getHeight(),this);
  }
  mTextDrawer.draw(canvas,recalculateText);
  super.dispatchDraw(canvas);
}

Fixed version (ground truth):
@Override protected void dispatchDraw(Canvas canvas){
  if (showcaseX < 0 || showcaseY < 0 || isRedundant) {
    super.dispatchDraw(canvas);
    return;
  }
  boolean recalculatedCling=mShowcaseDrawer.calculateShowcaseRect(showcaseX,showcaseY);
  boolean recalculateText=recalculatedCling || mAlteredText;
  mAlteredText=false;
  if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB && !mHasNoTarget) {
    Path path=new Path();
    if (scaleMultiplier > 0f) {
      path.addCircle(showcaseX,showcaseY,showcaseRadius,Path.Direction.CW);
    }
    canvas.clipPath(path,Op.DIFFERENCE);
  }
  canvas.drawColor(mBackgroundColor);
  if (!mHasNoTarget) {
    mShowcaseDrawer.drawShowcase(canvas,showcaseX,showcaseY,scaleMultiplier,showcaseRadius);
  }
  if (recalculateText) {
    mTextDrawer.calculateTextPosition(canvas.getWidth(),canvas.getHeight(),this);
  }
  mTextDrawer.draw(canvas,recalculateText);
  super.dispatchDraw(canvas);
}
Program: 187338
Project: 187338
Buggy source:
@Override protected void dispatchDraw(Canvas canvas){
  if (showcaseX < 0 || showcaseY < 0 || isRedundant) {
    super.dispatchDraw(canvas);
    return;
  }
  boolean recalculatedCling=mShowcaseDrawer.calculateShowcaseRect(showcaseX,showcaseY);
  boolean recalculateText=recalculatedCling || mAlteredText;
  mAlteredText=false;
  if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB && !mHasNoTarget) {
    Path path=new Path();
    path.addCircle(showcaseX,showcaseY,showcaseRadius,Path.Direction.CW);
    canvas.clipPath(path,Op.DIFFERENCE);
  }
  canvas.drawColor(mBackgroundColor);
  if (!mHasNoTarget) {
    mShowcaseDrawer.drawShowcase(canvas,showcaseX,showcaseY,scaleMultiplier,showcaseRadius);
  }
  if (recalculateText) {
    mTextDrawer.calculateTextPosition(canvas.getWidth(),canvas.getHeight(),this);
  }
  mTextDrawer.draw(canvas,recalculateText);
  super.dispatchDraw(canvas);
}

Fixed version (ground truth):
@Override protected void dispatchDraw(Canvas canvas){
  if (showcaseX < 0 || showcaseY < 0 || isRedundant) {
    super.dispatchDraw(canvas);
    return;
  }
  boolean recalculatedCling=mShowcaseDrawer.calculateShowcaseRect(showcaseX,showcaseY);
  boolean recalculateText=recalculatedCling || mAlteredText;
  mAlteredText=false;
  if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB && !mHasNoTarget) {
    Path path=new Path();
    canvas.clipPath(path,Op.DIFFERENCE);
  }
  canvas.drawColor(mBackgroundColor);
  if (!mHasNoTarget) {
    mShowcaseDrawer.drawShowcase(canvas,showcaseX,showcaseY,scaleMultiplier,showcaseRadius);
  }
  if (recalculateText) {
    mTextDrawer.calculateTextPosition(canvas.getWidth(),canvas.getHeight(),this);
  }
  mTextDrawer.draw(canvas,recalculateText);
  super.dispatchDraw(canvas);
}
Program: 187340
Project: 187340
Buggy source:
@Override protected void onResume(){
  MessageService.mNotificationManager.cancel(MessageService.MULTI);
  if (conversations != null || ap != null) {
    updateList(this,false);
  }
  super.onResume();
}

Fixed version (ground truth):
@Override protected void onResume(){
  MessageService.mNotificationManager.cancel(MessageService.MULTI);
  if (conversations != null || ap != null) {
    updateList(this,false);
  }
  super.onResume();
  if (!(Walkthrough.hasShown(Step.INTRO,this) && Walkthrough.hasShown(Step.START_IMPORT,this))) {
    Walkthrough.show(Step.INTRO,this);
    Walkthrough.show(Step.START_IMPORT,this);
  }
 else   if (!Walkthrough.hasShown(Step.START_EXCHANGE,this)) {
    Walkthrough.show(Step.START_EXCHANGE,this);
  }
  DBAccessor dba=new DBAccessor(this);
  if ((!Walkthrough.hasShown(Step.SUCCESS,this)) && dba.anyTrusted()) {
    Walkthrough.show(Step.SUCCESS,this);
    Walkthrough.show(Step.CLOSE,this);
  }
}
Program: 187344
Project: 187344
Buggy source:
@Override protected void onResume(){
  MessageService.mNotificationManager.cancel(MessageService.MULTI);
  if (conversations != null || ap != null) {
    updateList(this,false);
  }
  super.onResume();
  if (!(Walkthrough.hasShown(Step.INTRO,this) && Walkthrough.hasShown(Step.START_IMPORT,this))) {
    Walkthrough.show(Step.INTRO,this);
    Walkthrough.show(Step.START_IMPORT,this);
  }
 else   if (!Walkthrough.hasShown(Step.START_EXCHANGE,this)) {
    Walkthrough.show(Step.START_EXCHANGE,this);
  }
  DBAccessor dba=new DBAccessor(this);
  if ((!Walkthrough.hasShown(Step.SUCCESS,this)) && dba.anyTrusted()) {
    Walkthrough.show(Step.SUCCESS,this);
    Walkthrough.show(Step.CLOSE,this);
  }
}

Fixed version (ground truth):
@Override protected void onResume(){
  MessageService.mNotificationManager.cancel(MessageService.MULTI);
  if (conversations != null || ap != null) {
    updateList(this,false);
  }
  super.onResume();
  if ((Walkthrough.hasShown(Step.INTRO,this) && Walkthrough.hasShown(Step.START_IMPORT,this)) && !Walkthrough.hasShown(Step.START_EXCHANGE,this)) {
    Walkthrough.show(Step.START_EXCHANGE,this);
  }
  PackageInfo versionInfo=getPackageInfo();
  final String eulaKey="String_Node_Str" + versionInfo.versionCode;
  if (sharedPrefs.getBoolean(eulaKey,false)) {
    displayIntro();
  }
  DBAccessor dba=new DBAccessor(this);
  if ((Walkthrough.hasShown(Step.ACCEPT,this) || Walkthrough.hasShown(Step.SET_SECRET,this)) && (!Walkthrough.hasShown(Step.SUCCESS,this)) && dba.anyTrusted()) {
    Walkthrough.show(Step.SUCCESS,this);
    Walkthrough.show(Step.CLOSE,this);
  }
}