nus-yam/ex-repair huggingface dataset:
Program: 60644
Project: 60644
Buggy source:
public Void visitToInstance(T instance){
  InternalFactory<? extends T> factory=new ConstantFactory<T>(instance);
  registerInstanceForInjection(instance);
  InternalFactory<? extends T> scopedFactory=Scopes.scope(key,injector,factory,scope);
  createBinding(source,shouldPreload,new InstanceBindingImpl<T>(injector,key,source,scopedFactory,instance));
  return null;
}

Fixed version (ground truth):
public Void visitToInstance(T instance){
  ConstantFactory<? extends T> factory=new ConstantFactory<T>(instance);
  outstandingInjections.put(instance,null);
  InternalFactory<? extends T> scopedFactory=Scopes.scope(key,injector,factory,scope);
  createBinding(source,shouldPreload,new InstanceBindingImpl<T>(injector,key,source,scopedFactory,instance));
  return null;
}
Program: 60645
Project: 60645
Buggy source:
BindingImpl<T> build(InjectorImpl injector){
  if (this.factory != null) {
    Scope scope=this.scope == null ? Scopes.NO_SCOPE : this.scope;
    InternalFactory<? extends T> scopedFactory=Scopes.scope(this.key,injector,this.factory,scope);
    if (instance != null) {
      return new InstanceBindingImpl<T>(injector,key,source,scopedFactory,instance);
    }
    if (this.targetKey != null) {
      return new LinkedBindingImpl<T>(injector,key,source,scopedFactory,scope,targetKey);
    }
    if (this.providerInstance != null) {
      return new ProviderInstanceBindingImpl<T>(injector,key,source,scopedFactory,scope,providerInstance);
    }
    if (this.providerKey != null) {
      return new LinkedProviderBindingImpl<T>(injector,key,source,scopedFactory,scope,providerKey);
    }
    throw new AssertionError();
  }
 else {
    Type type=key.getTypeLiteral().getType();
    if (key.hasAnnotationType() || !(type instanceof Class<?>)) {
      injector.errorHandler.handle(source,ErrorMessages.MISSING_IMPLEMENTATION);
      return invalidBinding(injector);
    }
    Class<T> clazz=(Class<T>)type;
    BindingImpl<T> binding=injector.createBindingForInjectableType(clazz,scope,source,false);
    if (binding == null) {
      injector.errorHandler.handle(source,ErrorMessages.CANNOT_INJECT_ABSTRACT_TYPE,clazz);
      return invalidBinding(injector);
    }
    return binding;
  }
}

Fixed version (ground truth):
BindingImpl<T> build(InjectorImpl injector){
  if (this.factory != null) {
    Scope scope=this.scope == null ? Scopes.NO_SCOPE : this.scope;
    InternalFactory<? extends T> scopedFactory=Scopes.scope(this.key,injector,this.factory,scope);
    if (instance != null) {
      return new InstanceBindingImpl<T>(injector,key,source,scopedFactory,instance);
    }
    if (this.targetKey != null) {
      return new LinkedBindingImpl<T>(injector,key,source,scopedFactory,scope,targetKey);
    }
    if (this.providerInstance != null) {
      return new ProviderInstanceBindingImpl<T>(injector,key,source,scopedFactory,scope,providerInstance);
    }
    if (this.providerKey != null) {
      return new LinkedProviderBindingImpl<T>(injector,key,source,scopedFactory,scope,providerKey);
    }
    throw new AssertionError();
  }
 else {
    Type type=key.getTypeLiteral().getType();
    if (key.hasAnnotationType() || !(type instanceof Class<?>)) {
      injector.errorHandler.handle(source,ErrorMessages.MISSING_IMPLEMENTATION);
      return invalidBinding(injector);
    }
    Class<T> clazz=(Class<T>)type;
    BindingImpl<T> binding=injector.createBindingForInjectableType(clazz,scope,source);
    if (binding == null) {
      injector.errorHandler.handle(source,ErrorMessages.CANNOT_INJECT_ABSTRACT_TYPE,clazz);
      return invalidBinding(injector);
    }
    return binding;
  }
}
Program: 60646
Project: 60646
Buggy source:
<T>BindingImpl<T> createBindingJustInTime(Key<T> key){
  if (isProvider(key)) {
    return createProviderBindingUnsafely(key);
  }
  BindingImpl<T> boxedOrUnboxed=getBoxedOrUnboxedBinding(key);
  if (boxedOrUnboxed != null) {
    return boxedOrUnboxed;
  }
  BindingImpl<T> convertedBinding=convertConstantStringBinding(key);
  if (convertedBinding != null) {
    return convertedBinding;
  }
  if (key.hasAnnotationType()) {
    return key.hasAttributes() ? getBinding(key.withoutAttributes()) : null;
  }
  Type type=key.getTypeLiteral().getType();
  if (!(type instanceof Class)) {
    return null;
  }
  @SuppressWarnings("String_Node_Str") Class<T> clazz=(Class<T>)type;
  return createBindingFromType(clazz);
}

Fixed version (ground truth):
<T>BindingImpl<T> createBindingJustInTime(Key<T> key){
  if (isProvider(key)) {
    @SuppressWarnings({"String_Node_Str","String_Node_Str"}) BindingImpl<T> binding=(BindingImpl<T>)createProviderBinding((Key)key);
    return binding;
  }
  BindingImpl<T> boxedOrUnboxed=getBoxedOrUnboxedBinding(key);
  if (boxedOrUnboxed != null) {
    return boxedOrUnboxed;
  }
  BindingImpl<T> convertedBinding=convertConstantStringBinding(key);
  if (convertedBinding != null) {
    return convertedBinding;
  }
  if (key.hasAnnotationType()) {
    return key.hasAttributes() ? getBinding(key.withoutAttributes()) : null;
  }
  Type type=key.getTypeLiteral().getType();
  if (!(type instanceof Class)) {
    return null;
  }
  @SuppressWarnings("String_Node_Str") Class<T> clazz=(Class<T>)type;
  return createBindingFromType(clazz);
}
Program: 60647
Project: 60647
Buggy source:
/** 
 * Creates a binding for an injectable type with the given scope. Looks for a scope on the type if none is specified.
 */
<T>BindingImpl<T> createBindingForInjectableType(Class<T> type,Scope scope,Object source,boolean isJit){
  if (Modifier.isAbstract(type.getModifiers())) {
    return null;
  }
  if (Classes.isInnerClass(type)) {
    errorHandler.handle(SourceProviders.defaultSource(),ErrorMessages.CANNOT_INJECT_INNER_CLASS,type);
    return invalidBinding(Key.get(type));
  }
  if (scope == null) {
    scope=Scopes.getScopeForType(type,scopes,errorHandler);
  }
  Key<T> key=Key.get(type);
  LateBoundConstructor<T> lateBoundConstructor=new LateBoundConstructor<T>();
  InternalFactory<? extends T> scopedFactory=Scopes.scope(key,this,lateBoundConstructor,scope);
  BindingImpl<T> binding=new ClassBindingImpl<T>(this,key,source,scopedFactory,scope);
  if (isJit) {
    jitBindings.put(key,binding);
  }
  try {
    lateBoundConstructor.bind(this,type);
    return binding;
  }
 catch (  RuntimeException e) {
    if (isJit) {
      jitBindings.remove(key);
    }
    throw e;
  }
catch (  Throwable t) {
    if (isJit) {
      jitBindings.remove(key);
    }
    throw new AssertionError(t);
  }
}

Fixed version (ground truth):
/** 
 * Creates a binding for an injectable type with the given scope. Looks for a scope on the type if none is specified.
 */
<T>BindingImpl<T> createBindingForInjectableType(Class<T> type,Scope scope,Object source){
  if (Modifier.isAbstract(type.getModifiers())) {
    return null;
  }
  if (Classes.isInnerClass(type)) {
    errorHandler.handle(SourceProviders.defaultSource(),ErrorMessages.CANNOT_INJECT_INNER_CLASS,type);
    return invalidBinding(Key.get(type));
  }
  if (scope == null) {
    scope=Scopes.getScopeForType(type,scopes,errorHandler);
  }
  Key<T> key=Key.get(type);
  LateBoundConstructor<T> lateBoundConstructor=new LateBoundConstructor<T>();
  InternalFactory<? extends T> scopedFactory=Scopes.scope(key,this,lateBoundConstructor,scope);
  BindingImpl<T> binding=new ClassBindingImpl<T>(this,key,source,scopedFactory,scope);
  jitBindings.put(key,binding);
  try {
    lateBoundConstructor.bind(this,type);
    return binding;
  }
 catch (  RuntimeException e) {
    jitBindings.remove(key);
    throw e;
  }
catch (  Throwable t) {
    jitBindings.remove(key);
    throw new AssertionError(t);
  }
}
Program: 60648
Project: 60648
Buggy source:
public void toInstance(T instance){
  ensureImplementationIsNotSet();
  this.instance=Objects.nonNull(instance,"String_Node_Str");
  this.factory=new ConstantFactory<T>(instance);
  if (this.scope != null) {
    binder.addError(source,ErrorMessages.SINGLE_INSTANCE_AND_SCOPE);
  }
  this.scope=Scopes.CONTAINER;
}

Fixed version (ground truth):
public void toInstance(T instance){
  ensureImplementationIsNotSet();
  this.instance=Objects.nonNull(instance,"String_Node_Str");
  this.factory=new ConstantFactory<T>(instance);
  if (this.scope != null) {
    binder.addError(source,ErrorMessages.SINGLE_INSTANCE_AND_SCOPE);
  }
}
Program: 60649
Project: 60649
Buggy source:
public void testLinkedBinding() throws CreationException {
  BinderImpl builder=new BinderImpl();
  Bar bar=new Bar();
  builder.bind(Bar.class).toInstance(bar);
  builder.link(Key.get(Foo.class)).to(Key.get(Bar.class));
  Container container=builder.createContainer();
  Binding<Foo> fooBinding=container.getBinding(Key.get(Foo.class));
  assertSame(bar,fooBinding.getLocator().get());
  assertNotNull(fooBinding.getSource());
  assertEquals(Key.get(Foo.class),fooBinding.getKey());
  assertFalse(fooBinding.isConstant());
}

Fixed version (ground truth):
public void testLinkedBinding() throws CreationException {
  BinderImpl builder=new BinderImpl();
  Bar bar=new Bar();
  builder.bind(Bar.class).toInstance(bar);
  builder.link(Key.get(Foo.class)).to(Key.get(Bar.class));
  Container container=builder.createContainer();
  Binding<Foo> fooBinding=container.getBinding(Key.get(Foo.class));
  assertSame(bar,fooBinding.getLocator().get());
  assertNotNull(fooBinding.getSource());
  assertEquals(Key.get(Foo.class),fooBinding.getKey());
  assertTrue(fooBinding.isConstant());
}
Program: 60650
Project: 60650
Buggy source:
public void testNormalBinding() throws CreationException {
  BinderImpl builder=new BinderImpl();
  Foo foo=new Foo();
  builder.bind(Foo.class).toInstance(foo);
  Container container=builder.createContainer();
  Binding<Foo> fooBinding=container.getBinding(Key.get(Foo.class));
  assertSame(foo,fooBinding.getLocator().get());
  assertNotNull(fooBinding.getSource());
  assertEquals(Key.get(Foo.class),fooBinding.getKey());
  assertFalse(fooBinding.isConstant());
}

Fixed version (ground truth):
public void testNormalBinding() throws CreationException {
  BinderImpl builder=new BinderImpl();
  Foo foo=new Foo();
  builder.bind(Foo.class).toInstance(foo);
  Container container=builder.createContainer();
  Binding<Foo> fooBinding=container.getBinding(Key.get(Foo.class));
  assertSame(foo,fooBinding.getLocator().get());
  assertNotNull(fooBinding.getSource());
  assertEquals(Key.get(Foo.class),fooBinding.getKey());
  assertTrue(fooBinding.isConstant());
}
Program: 60651
Project: 60651
Buggy source:
/** 
 * Entry point of Ephyra. Initializes the engine and starts the command line interface.
 * @param args command line arguments are ignored
 */
public static void main(String[] args){
  MsgPrinter.enableStatusMsgs(true);
  MsgPrinter.enableErrorMsgs(true);
  Logger.setLogfile("String_Node_Str");
  Logger.enableLogging(true);
  (new OpenEphyraCorpus()).commandLine();
}

Fixed version (ground truth):
/** 
 * Entry point of Ephyra. Initializes the engine and starts the command line interface.
 * @param args command line arguments are ignored
 */
public static void main(String[] args){
  MsgPrinter.enableStatusMsgs(true);
  MsgPrinter.enableErrorMsgs(true);
  Logger.setLogfile("String_Node_Str");
  Logger.enableLogging(true);
  (new OpenEphyraCorpus()).commandLine("String_Node_Str");
}
Program: 60652
Project: 60652
Buggy source:
/** 
 * 验证创建
 */
public void validateCreate(AppNewForm appNewForm){
  App app=appMgr.getByName(appNewForm.getApp());
  if (app != null) {
    throw new FieldException(AppNewForm.APP,"String_Node_Str",null);
  }
}

Fixed version (ground truth):
/** 
 * 验证创建
 */
public void validateCreate(AppNewForm appNewForm){
  if (appNewForm.getApp() != null) {
    appNewForm.setApp(appNewForm.getApp().trim());
  }
  if (appNewForm.getDesc() != null) {
    appNewForm.setDesc(appNewForm.getDesc().trim());
  }
  App app=appMgr.getByName(appNewForm.getApp());
  if (app != null) {
    throw new FieldException(AppNewForm.APP,"String_Node_Str",null);
  }
}
Program: 60653
Project: 60653
Buggy source:
/** 
 * unicode 转换成 utf-8
 */
public static String unicodeToUtf8(String theStr){
  return StringEscapeUtils.unescapeJava(theStr);
}

Fixed version (ground truth):
/** 
 * unicode 转换成 utf-8
 */
public static String unicodeToUtf8(String theString){
  if (theString == null) {
    return null;
  }
  char aChar;
  int len=theString.length();
  StringBuffer outBuffer=new StringBuffer(len);
  for (int x=0; x < len; ) {
    aChar=theString.charAt(x++);
    if (aChar == '\\') {
      aChar=theString.charAt(x++);
      if (aChar == 'u') {
        int value=0;
        for (int i=0; i < 4; i++) {
          aChar=theString.charAt(x++);
switch (aChar) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
            value=(value << 4) + aChar - '0';
          break;
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
        value=(value << 4) + 10 + aChar - 'a';
      break;
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
    value=(value << 4) + 10 + aChar - 'A';
  break;
default :
value=0;
break;
}
}
outBuffer.append((char)value);
}
 else {
if (aChar == 't') {
aChar='\t';
}
 else if (aChar == 'r') {
aChar='\r';
}
 else if (aChar == 'n') {
aChar='\n';
}
 else if (aChar == 'f') {
aChar='\f';
}
outBuffer.append(aChar);
}
}
 else {
outBuffer.append(aChar);
}
}
return outBuffer.toString();
}
Program: 60654
Project: 60654
Buggy source:
/** 
 * utf-8 转换成 unicode
 */
public static String utf8ToUnicode(String theStr){
  return StringEscapeUtils.escapeJava(theStr);
}

Fixed version (ground truth):
/** 
 * utf-8 转换成 unicode
 */
public static String utf8ToUnicode(String inStr){
  char[] myBuffer=inStr.toCharArray();
  StringBuffer sb=new StringBuffer();
  for (int i=0; i < inStr.length(); i++) {
    Character.UnicodeBlock ub=Character.UnicodeBlock.of(myBuffer[i]);
    if (ub == Character.UnicodeBlock.BASIC_LATIN) {
      sb.append(myBuffer[i]);
    }
 else     if (ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS) {
      int j=(int)myBuffer[i] - 65248;
      sb.append((char)j);
    }
 else {
      int chr1=(char)myBuffer[i];
      String hexS=Integer.toHexString(chr1);
      String unicode="String_Node_Str" + hexS;
      sb.append(unicode.toLowerCase());
    }
  }
  return sb.toString();
}
Program: 60655
Project: 60655
Buggy source:
/** 
 * 配置文件的新建(使用上传配置文件)
 * @param confNewForm
 * @param file
 * @return
 */
@ResponseBody @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public JsonObjectBase updateFile(@Valid ConfNewForm confNewForm,@RequestParam("String_Node_Str") MultipartFile file){
  LOG.info(confNewForm.toString());
  int fileSize=1024 * 1024 * 4;
  String[] allowExtName={"String_Node_Str","String_Node_Str"};
  fileUploadValidator.validateFile(file,fileSize,allowExtName);
  String fileContent="String_Node_Str";
  try {
    fileContent=MyStringUtils.multipartFileToString(file);
    LOG.info("String_Node_Str" + fileContent);
  }
 catch (  Exception e) {
    LOG.error(e.toString());
    throw new FileUploadException("String_Node_Str",e);
  }
  ConfNewItemForm confNewItemForm=new ConfNewItemForm(confNewForm);
  confNewItemForm.setKey(file.getOriginalFilename());
  confNewItemForm.setValue(fileContent);
  configValidator.validateNew(confNewItemForm,DisConfigTypeEnum.FILE);
  configMgr.newConfig(confNewItemForm,DisConfigTypeEnum.FILE);
  return buildSuccess("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * 配置文件的新建(使用上传配置文件)
 * @param confNewForm
 * @param file
 * @return
 */
@ResponseBody @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public JsonObjectBase updateFile(@Valid ConfNewForm confNewForm,@RequestParam("String_Node_Str") MultipartFile file){
  LOG.info(confNewForm.toString());
  int fileSize=1024 * 1024 * 4;
  String[] allowExtName={"String_Node_Str","String_Node_Str"};
  fileUploadValidator.validateFile(file,fileSize,allowExtName);
  String fileContent="String_Node_Str";
  try {
    fileContent=new String(file.getBytes(),"String_Node_Str");
    LOG.info("String_Node_Str" + fileContent);
  }
 catch (  Exception e) {
    LOG.error(e.toString());
    throw new FileUploadException("String_Node_Str",e);
  }
  ConfNewItemForm confNewItemForm=new ConfNewItemForm(confNewForm);
  confNewItemForm.setKey(file.getOriginalFilename());
  confNewItemForm.setValue(fileContent);
  configValidator.validateNew(confNewItemForm,DisConfigTypeEnum.FILE);
  configMgr.newConfig(confNewItemForm,DisConfigTypeEnum.FILE);
  return buildSuccess("String_Node_Str");
}
Program: 60656
Project: 60656
Buggy source:
/** 
 * 配置文件的更新
 * @param configId
 * @param file
 * @return
 */
@ResponseBody @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public JsonObjectBase updateFile(@PathVariable long configId,@RequestParam("String_Node_Str") MultipartFile file){
  int fileSize=1024 * 1024 * 4;
  String[] allowExtName={"String_Node_Str","String_Node_Str"};
  fileUploadValidator.validateFile(file,fileSize,allowExtName);
  configValidator.validateUpdateFile(configId,file.getOriginalFilename());
  String emailNotification="String_Node_Str";
  try {
    String str=MyStringUtils.multipartFileToString(file);
    LOG.info("String_Node_Str" + str);
    emailNotification=configMgr.updateItemValue(configId,str);
    LOG.info("String_Node_Str" + configId + "String_Node_Str");
  }
 catch (  Exception e) {
    LOG.error(e.toString());
    throw new FileUploadException("String_Node_Str",e);
  }
  configMgr.notifyZookeeper(configId);
  return buildSuccess(emailNotification);
}

Fixed version (ground truth):
/** 
 * 配置文件的更新
 * @param configId
 * @param file
 * @return
 */
@ResponseBody @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public JsonObjectBase updateFile(@PathVariable long configId,@RequestParam("String_Node_Str") MultipartFile file){
  int fileSize=1024 * 1024 * 4;
  String[] allowExtName={"String_Node_Str","String_Node_Str"};
  fileUploadValidator.validateFile(file,fileSize,allowExtName);
  configValidator.validateUpdateFile(configId,file.getOriginalFilename());
  String emailNotification="String_Node_Str";
  try {
    String str=new String(file.getBytes(),"String_Node_Str");
    LOG.info("String_Node_Str" + str);
    emailNotification=configMgr.updateItemValue(configId,str);
    LOG.info("String_Node_Str" + configId + "String_Node_Str");
  }
 catch (  Exception e) {
    LOG.error(e.toString());
    throw new FileUploadException("String_Node_Str",e);
  }
  configMgr.notifyZookeeper(configId);
  return buildSuccess(emailNotification);
}
Program: 60657
Project: 60657
Buggy source:
/** 
 * 存储 一个配置文件
 */
public void storeOneFile(DisconfCenterBaseModel disconfCenterBaseModel){
  DisconfCenterFile disconfCenterFile=(DisconfCenterFile)disconfCenterBaseModel;
  String fileName=disconfCenterFile.getFileName();
  if (confFileMap.containsKey(fileName)) {
    LOGGER.error("String_Node_Str" + "String_Node_Str" + confFileMap.get(fileName).toString() + "String_Node_Str"+ disconfCenterFile.toString());
  }
 else {
    confFileMap.put(fileName,disconfCenterFile);
  }
}

Fixed version (ground truth):
/** 
 * 存储 一个配置文件
 */
public void storeOneFile(DisconfCenterBaseModel disconfCenterBaseModel){
  DisconfCenterFile disconfCenterFile=(DisconfCenterFile)disconfCenterBaseModel;
  String fileName=disconfCenterFile.getFileName();
  if (confFileMap.containsKey(fileName)) {
    LOGGER.warn("String_Node_Str" + fileName);
    DisconfCenterFile existCenterFile=confFileMap.get(fileName);
    if (disconfCenterFile.isTaggedWithNonAnnotationFile()) {
      existCenterFile.setIsTaggedWithNonAnnotationFile(true);
    }
  }
 else {
    confFileMap.put(fileName,disconfCenterFile);
  }
}
Program: 60658
Project: 60658
Buggy source:
/** 
 */
@Override public void inject2Store(String fileName,DisconfValue disconfValue){
  DisconfCenterFile disconfCenterFile=getInstance().getConfFileMap().get(fileName);
  if (disconfCenterFile == null) {
    LOGGER.error("String_Node_Str" + fileName + "String_Node_Str");
    return;
  }
  if (disconfValue == null || disconfValue.getFileData() == null) {
    LOGGER.error("String_Node_Str",fileName);
    return;
  }
  Map<String,FileItemValue> keMap=disconfCenterFile.getKeyMaps();
  if (keMap.size() > 0) {
    for (    String fileItem : keMap.keySet()) {
      Object object=disconfValue.getFileData().get(fileItem);
      if (object == null) {
        LOGGER.error("String_Node_Str",fileItem,disconfValue.getFileData().toString());
        continue;
      }
      try {
        Object value=keMap.get(fileItem).getFieldValueByType(object);
        keMap.get(fileItem).setValue(value);
      }
 catch (      Exception e) {
        LOGGER.error("String_Node_Str" + fileName + "String_Node_Str"+ e.toString(),e);
      }
    }
  }
  if (disconfCenterFile.isTaggedWithNonAnnotationFile()) {
    if (disconfCenterFile.getObject() == null && disconfCenterFile.getSupportFileTypeEnum().equals(SupportFileTypeEnum.PROPERTIES)) {
      ReloadConfigurationMonitor.reload();
    }
    disconfCenterFile.setAdditionalKeyMaps(disconfValue.getFileData());
  }
}

Fixed version (ground truth):
/** 
 */
@Override public void inject2Store(String fileName,DisconfValue disconfValue){
  DisconfCenterFile disconfCenterFile=getInstance().getConfFileMap().get(fileName);
  if (disconfCenterFile == null) {
    LOGGER.error("String_Node_Str" + fileName + "String_Node_Str");
    return;
  }
  if (disconfValue == null || disconfValue.getFileData() == null) {
    LOGGER.error("String_Node_Str",fileName);
    return;
  }
  Map<String,FileItemValue> keMap=disconfCenterFile.getKeyMaps();
  if (keMap.size() > 0) {
    for (    String fileItem : keMap.keySet()) {
      Object object=disconfValue.getFileData().get(fileItem);
      if (object == null) {
        LOGGER.error("String_Node_Str",fileItem,disconfValue.getFileData().toString());
        continue;
      }
      try {
        Object value=keMap.get(fileItem).getFieldValueByType(object);
        keMap.get(fileItem).setValue(value);
      }
 catch (      Exception e) {
        LOGGER.error("String_Node_Str" + fileName + "String_Node_Str"+ e.toString(),e);
      }
    }
  }
  if (disconfCenterFile.isTaggedWithNonAnnotationFile()) {
    if (disconfCenterFile.getSupportFileTypeEnum().equals(SupportFileTypeEnum.PROPERTIES)) {
      ReloadConfigurationMonitor.reload();
    }
    disconfCenterFile.setAdditionalKeyMaps(disconfValue.getFileData());
  }
}
Program: 60659
Project: 60659
Buggy source:
/** 
 * copy & paste, just so we can insert our own visitor. 启动时 进行配置的解析
 */
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess,Properties props) throws BeansException {
  BeanDefinitionVisitor visitor=new ReloadingPropertyPlaceholderConfigurer.PlaceholderResolvingBeanDefinitionVisitor(props);
  String[] beanNames=beanFactoryToProcess.getBeanDefinitionNames();
  for (int i=0; i < beanNames.length; i++) {
    if (!(beanNames[i].equals(this.beanName) && beanFactoryToProcess.equals(this.beanFactory))) {
      this.currentBeanName=beanNames[i];
      try {
        BeanDefinition bd=beanFactoryToProcess.getBeanDefinition(beanNames[i]);
        try {
          visitor.visitBeanDefinition(bd);
        }
 catch (        BeanDefinitionStoreException ex) {
          throw new BeanDefinitionStoreException(bd.getResourceDescription(),beanNames[i],ex.getMessage());
        }
      }
  finally {
        currentBeanName=null;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * copy & paste, just so we can insert our own visitor. 启动时 进行配置的解析
 */
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess,Properties props) throws BeansException {
  BeanDefinitionVisitor visitor=new ReloadingPropertyPlaceholderConfigurer.PlaceholderResolvingBeanDefinitionVisitor(props);
  String[] beanNames=beanFactoryToProcess.getBeanDefinitionNames();
  for (int i=0; i < beanNames.length; i++) {
    if (!(beanNames[i].equals(this.beanName) && beanFactoryToProcess.equals(this.beanFactory))) {
      this.currentBeanName=beanNames[i];
      try {
        BeanDefinition bd=beanFactoryToProcess.getBeanDefinition(beanNames[i]);
        try {
          visitor.visitBeanDefinition(bd);
        }
 catch (        BeanDefinitionStoreException ex) {
          throw new BeanDefinitionStoreException(bd.getResourceDescription(),beanNames[i],ex.getMessage());
        }
      }
  finally {
        currentBeanName=null;
      }
    }
  }
  StringValueResolver stringValueResolver=new PlaceholderResolvingStringValueResolver(props);
  beanFactoryToProcess.resolveAliases(stringValueResolver);
  beanFactoryToProcess.addEmbeddedValueResolver(stringValueResolver);
}
Program: 60660
Project: 60660
Buggy source:
protected String resolveStringValue(String strVal) throws BeansException {
  return parseStringValue(strVal,this.props,new HashSet());
}

Fixed version (ground truth):
@Override public String resolveStringValue(String strVal) throws BeansException {
  return parseStringValue(strVal,this.props,new HashSet());
}
Program: 60661
Project: 60661
Buggy source:
@Override public <T>T getFirstByType(Class<T> type,boolean withProxy){
  return getFirstByType(type,withProxy);
}

Fixed version (ground truth):
@Override public <T>T getFirstByType(Class<T> type,boolean withProxy){
  return getFirstByType(type);
}
Program: 60662
Project: 60662
Buggy source:
@Override public int getOrder(){
  return Ordered.HIGHEST_PRECEDENCE;
}

Fixed version (ground truth):
@Override public int getOrder(){
  return Ordered.HIGHEST_PRECEDENCE + 1;
}
Program: 60663
Project: 60663
Buggy source:
/** 
 * 第一次扫描，静态扫描
 * @param scanPackage
 */
public synchronized static void firstScan(String scanPackage){
  if (isFirstInit == true) {
    LOGGER.info("String_Node_Str");
    return;
  }
  try {
    ConfigMgr.init();
    if (DisClientConfig.getInstance().ENABLE_DISCONF == false) {
      LOGGER.info("String_Node_Str");
      return;
    }
    LOGGER.info("String_Node_Str");
    scanMgr=ScanFactory.getScanMgr();
    scanMgr.firstScan(scanPackage);
    disconfCoreMgr=DisconfCoreFactory.getDisconfCoreMgr();
    disconfCoreMgr.process();
    isFirstInit=true;
    LOGGER.info("String_Node_Str");
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
  }
}

Fixed version (ground truth):
/** 
 * 第一次扫描，静态扫描 for annotation config
 */
public synchronized static void firstScan(String scanPackage){
  if (isFirstInit) {
    LOGGER.info("String_Node_Str");
    return;
  }
  try {
    ConfigMgr.init();
    LOGGER.info("String_Node_Str");
    scanMgr=ScanFactory.getScanMgr();
    scanMgr.firstScan(scanPackage);
    disconfCoreMgr=DisconfCoreFactory.getDisconfCoreMgr();
    disconfCoreMgr.process();
    isFirstInit=true;
    LOGGER.info("String_Node_Str");
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
  }
}
Program: 60664
Project: 60664
Buggy source:
/** 
 * 第二次扫描, 动态扫描
 * @param
 */
public synchronized static void secondScan(){
  if (DisClientConfig.getInstance().ENABLE_DISCONF == false) {
    LOGGER.info("String_Node_Str");
    return;
  }
  if (isFirstInit == false) {
    LOGGER.info("String_Node_Str");
    return;
  }
  if (isSecondeInit == true) {
    LOGGER.info("String_Node_Str");
    return;
  }
  LOGGER.info("String_Node_Str");
  try {
    scanMgr.secondScan();
    disconfCoreMgr.inject2DisconfInstance();
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
  }
  isSecondeInit=true;
  startTimer();
  LOGGER.info("String_Node_Str" + DisconfStoreProcessorFactory.getDisconfStoreFileProcessor().confToString());
  LOGGER.info("String_Node_Str" + DisconfStoreProcessorFactory.getDisconfStoreItemProcessor().confToString());
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * 第二次扫描, 动态扫描, for annotation config
 */
public synchronized static void secondScan(){
  if (!isFirstInit) {
    LOGGER.info("String_Node_Str");
    return;
  }
  if (isSecondInit) {
    LOGGER.info("String_Node_Str");
    return;
  }
  LOGGER.info("String_Node_Str");
  try {
    scanMgr.secondScan();
    disconfCoreMgr.inject2DisconfInstance();
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
  }
  isSecondInit=true;
  startTimer();
  LOGGER.info("String_Node_Str" + DisconfStoreProcessorFactory.getDisconfStoreFileProcessor().confToString());
  LOGGER.info("String_Node_Str" + DisconfStoreProcessorFactory.getDisconfStoreItemProcessor().confToString());
  LOGGER.info("String_Node_Str");
}
Program: 60665
Project: 60665
Buggy source:
/** 
 * reloadable config file scan
 */
public synchronized static void reloadableScan(String filename){
  if (DisClientConfig.getInstance().ENABLE_DISCONF == false) {
    return;
  }
  if (!isFirstInit) {
    return;
  }
  try {
    if (scanMgr != null) {
      scanMgr.reloadableScan(filename);
    }
    if (disconfCoreMgr != null) {
      disconfCoreMgr.processFile(filename);
    }
    LOGGER.debug("String_Node_Str" + filename);
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
  }
}

Fixed version (ground truth):
/** 
 * reloadable config file scan, for xml config
 */
public synchronized static void reloadableScan(String filename){
  if (!isFirstInit) {
    return;
  }
  try {
    if (scanMgr != null) {
      scanMgr.reloadableScan(filename);
    }
    if (disconfCoreMgr != null) {
      disconfCoreMgr.processFile(filename);
    }
    LOGGER.debug("String_Node_Str" + filename);
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
  }
}
Program: 60666
Project: 60666
Buggy source:
/** 
 * 总入口
 * @param scanPackage
 */
public synchronized static void start(String scanPackage){
  firstScan(scanPackage);
  secondScan();
}

Fixed version (ground truth):
/** 
 * 总入口
 */
public synchronized static void start(String scanPackage){
  firstScan(scanPackage);
  secondScan();
}
Program: 60667
Project: 60667
Buggy source:
/** 
 * @return void
 * @Description : 总关闭
 * @author liaoqiqi
 * @date 2013-6-14
 */
public synchronized static void close(){
  try {
    LOGGER.info("String_Node_Str");
    if (disconfCoreMgr != null) {
      disconfCoreMgr.release();
    }
    if (timer != null) {
      timer.cancel();
      timer=null;
    }
    isFirstInit=false;
    isSecondeInit=false;
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * @Description : 总关闭
 */
public synchronized static void close(){
  try {
    LOGGER.info("String_Node_Str");
    if (disconfCoreMgr != null) {
      disconfCoreMgr.release();
    }
    if (timer != null) {
      timer.cancel();
      timer=null;
    }
    isFirstInit=false;
    isSecondInit=false;
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 60668
Project: 60668
Buggy source:
public void setFileList(Set<String> fileList){
  this.fileList=fileList;
}

Fixed version (ground truth):
@Deprecated public void setFileList(Set<String> fileList){
  this.fileList=fileList;
}
Program: 60669
Project: 60669
Buggy source:
public Set<String> getFileList(){
  return fileList;
}

Fixed version (ground truth):
@Deprecated public Set<String> getFileList(){
  return fileList;
}
Program: 60670
Project: 60670
Buggy source:
/** 
 * @return
 * @throws IOException
 */
protected Object createInstance() throws IOException {
  if (!isSingleton()) {
    throw new RuntimeException("String_Node_Str");
  }
  reloadableProperties=new ReloadablePropertiesImpl();
  if (preListeners != null) {
    reloadableProperties.setListeners(preListeners);
  }
  reload(true);
  ReloadConfigurationMonitor.addReconfigurableBean((ReconfigurableBean)reloadableProperties);
  return reloadableProperties;
}

Fixed version (ground truth):
/** 
 * @throws IOException
 */
protected Object createInstance() throws IOException {
  if (!isSingleton()) {
    throw new RuntimeException("String_Node_Str");
  }
  reloadableProperties=new ReloadablePropertiesImpl();
  if (preListeners != null) {
    reloadableProperties.setListeners(preListeners);
  }
  reload(true);
  ReloadConfigurationMonitor.addReconfigurableBean((ReconfigurableBean)reloadableProperties);
  return reloadableProperties;
}
Program: 60671
Project: 60671
Buggy source:
/** 
 * @param fileNames
 */
public void setLocations(List<String> fileNames){
  List<Resource> resources=new ArrayList<Resource>();
  for (  String filename : fileNames) {
    filename=filename.trim();
    String realFileName=getFileName(filename);
    DisconfMgr.reloadableScan(realFileName);
    String ext=FilenameUtils.getExtension(filename);
    if (ext.equals("String_Node_Str")) {
      PathMatchingResourcePatternResolver pathMatchingResourcePatternResolver=new PathMatchingResourcePatternResolver();
      try {
        Resource[] resourceList=pathMatchingResourcePatternResolver.getResources(filename);
        for (        Resource resource : resourceList) {
          resources.add(resource);
        }
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  this.locations=resources.toArray(new Resource[resources.size()]);
  lastModified=new long[locations.length];
  super.setLocations(locations);
}

Fixed version (ground truth):
/** 
 */
public void setLocations(List<String> fileNames){
  List<Resource> resources=new ArrayList<Resource>();
  for (  String filename : fileNames) {
    filename=filename.trim();
    String realFileName=getFileName(filename);
    DisconfMgr.reloadableScan(realFileName);
    String ext=FilenameUtils.getExtension(filename);
    if (ext.equals("String_Node_Str")) {
      PathMatchingResourcePatternResolver pathMatchingResourcePatternResolver=new PathMatchingResourcePatternResolver();
      try {
        Resource[] resourceList=pathMatchingResourcePatternResolver.getResources(filename);
        for (        Resource resource : resourceList) {
          resources.add(resource);
        }
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  this.locations=resources.toArray(new Resource[resources.size()]);
  lastModified=new long[locations.length];
  super.setLocations(locations);
}
Program: 60672
Project: 60672
Buggy source:
private DynamicProperty getDynamic(String currentBeanName,String currentPropertyName,String orgStrVal){
  DynamicProperty dynamic=new DynamicProperty(currentBeanName,currentPropertyName,orgStrVal);
  DynamicProperty found=(DynamicProperty)dynamicProperties.get(dynamic);
  if (found != null) {
    return found;
  }
  dynamicProperties.put(dynamic,dynamic);
  return dynamic;
}

Fixed version (ground truth):
private DynamicProperty getDynamic(String currentBeanName,String currentPropertyName,String orgStrVal){
  DynamicProperty dynamic=new DynamicProperty(currentBeanName,currentPropertyName,orgStrVal);
  DynamicProperty found=dynamicProperties.get(dynamic);
  if (found != null) {
    return found;
  }
  dynamicProperties.put(dynamic,dynamic);
  return dynamic;
}
Program: 60673
Project: 60673
Buggy source:
/** 
 * 获取可以表示的KeyMap对
 * @return
 */
public Map<String,Object> getKV(){
  if (keyMaps.size() == 0) {
    return additionalKeyMaps;
  }
  Map<String,Object> map=new HashMap<String,Object>();
  for (  String key : keyMaps.keySet()) {
    map.put(key,keyMaps.get(key).getValue());
  }
  return map;
}

Fixed version (ground truth):
/** 
 * 获取可以表示的KeyMap对
 */
public Map<String,Object> getKV(){
  if (keyMaps.size() == 0) {
    return additionalKeyMaps;
  }
  Map<String,Object> map=new HashMap<String,Object>();
  for (  String key : keyMaps.keySet()) {
    map.put(key,keyMaps.get(key).getValue());
  }
  return map;
}
Program: 60674
Project: 60674
Buggy source:
/** 
 * @param args
 */
public static void main(String[] args){
  try {
    ConfigMgr.init();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 */
public static void main(String[] args){
  try {
    ConfigMgr.init();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 60675
Project: 60675
Buggy source:
/** 
 * @return
 */
public synchronized static boolean isInit(){
  return isInit;
}

Fixed version (ground truth):
/** 
 */
public synchronized static boolean isInit(){
  return isInit;
}
Program: 60676
Project: 60676
Buggy source:
/** 
 * load config normal
 * @param filePath
 * @throws Exception
 */
public synchronized void loadConfig(String filePath) throws Exception {
  if (isLoaded == true) {
    return;
  }
  String filePathInternal=filename;
  if (filePath != null) {
    filePathInternal=filePath;
  }
  DisconfAutowareConfig.autowareConfig(INSTANCE,filePathInternal);
  isLoaded=true;
}

Fixed version (ground truth):
/** 
 * load config normal
 * @throws Exception
 */
public synchronized void loadConfig(String filePath) throws Exception {
  if (isLoaded) {
    return;
  }
  String filePathInternal=filename;
  if (filePath != null) {
    filePathInternal=filePath;
  }
  DisconfAutowareConfig.autowareConfig(INSTANCE,filePathInternal);
  isLoaded=true;
}
Program: 60677
Project: 60677
Buggy source:
/** 
 * 更新 配置项/配置文件 的值
 */
@Override @Transactional(propagation=Propagation.REQUIRED,rollbackFor=RuntimeException.class) public String updateItemValue(Long configId,String value){
  Config config=getConfigById(configId);
  String oldValue=config.getValue();
  configDao.updateValue(configId,value);
  String toEmails=appMgr.getEmails(config.getAppId());
  if (applicationPropertyConfig.isEmailMonitorOn() == true) {
    boolean isSendSuccess=logMailBean.sendHtmlEmail(toEmails,"String_Node_Str",DiffUtils.getDiff(oldValue,value,config.toString(),getConfigUrlHtml(config)));
    if (isSendSuccess) {
      return "String_Node_Str";
    }
 else {
      return "String_Node_Str";
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * 更新 配置项/配置文件 的值
 */
@Override @Transactional(propagation=Propagation.REQUIRED,rollbackFor=RuntimeException.class) public String updateItemValue(Long configId,String value){
  value=CodeUtils.utf8ToUnicode(value);
  Config config=getConfigById(configId);
  String oldValue=config.getValue();
  configDao.updateValue(configId,value);
  String toEmails=appMgr.getEmails(config.getAppId());
  if (applicationPropertyConfig.isEmailMonitorOn() == true) {
    boolean isSendSuccess=logMailBean.sendHtmlEmail(toEmails,"String_Node_Str",DiffUtils.getDiff(oldValue,value,config.toString(),getConfigUrlHtml(config)));
    if (isSendSuccess) {
      return "String_Node_Str";
    }
 else {
      return "String_Node_Str";
    }
  }
  return "String_Node_Str";
}
Program: 60678
Project: 60678
Buggy source:
/** 
 * 新建配置
 */
@Override public void newConfig(ConfNewItemForm confNewForm,DisConfigTypeEnum disConfigTypeEnum){
  Config config=new Config();
  config.setAppId(confNewForm.getAppId());
  config.setEnvId(confNewForm.getEnvId());
  config.setName(confNewForm.getKey());
  config.setType(disConfigTypeEnum.getType());
  config.setVersion(confNewForm.getVersion());
  config.setValue(confNewForm.getValue());
  String curTime=DateUtils.format(new Date(),DataFormatConstants.COMMON_TIME_FORMAT);
  config.setCreateTime(curTime);
  config.setUpdateTime(curTime);
  configDao.create(config);
  String toEmails=appMgr.getEmails(config.getAppId());
  if (applicationPropertyConfig.isEmailMonitorOn() == true) {
    logMailBean.sendHtmlEmail(toEmails,"String_Node_Str",getNewValue(confNewForm.getValue(),config.toString(),getConfigUrlHtml(config)));
  }
}

Fixed version (ground truth):
/** 
 * 新建配置
 */
@Override public void newConfig(ConfNewItemForm confNewForm,DisConfigTypeEnum disConfigTypeEnum){
  Config config=new Config();
  config.setAppId(confNewForm.getAppId());
  config.setEnvId(confNewForm.getEnvId());
  config.setName(confNewForm.getKey());
  config.setType(disConfigTypeEnum.getType());
  config.setVersion(confNewForm.getVersion());
  config.setValue(CodeUtils.utf8ToUnicode(confNewForm.getValue()));
  String curTime=DateUtils.format(new Date(),DataFormatConstants.COMMON_TIME_FORMAT);
  config.setCreateTime(curTime);
  config.setUpdateTime(curTime);
  configDao.create(config);
  String toEmails=appMgr.getEmails(config.getAppId());
  if (applicationPropertyConfig.isEmailMonitorOn() == true) {
    logMailBean.sendHtmlEmail(toEmails,"String_Node_Str",getNewValue(confNewForm.getValue(),config.toString(),getConfigUrlHtml(config)));
  }
}
Program: 60679
Project: 60679
Buggy source:
/** 
 * 更新 一個配置文件, 下载、注入到仓库、Watch 三步骤
 */
private void updateOneConfFile(String fileName,DisconfCenterFile disconfCenterFile) throws Exception {
  if (disconfCenterFile == null) {
    throw new Exception("String_Node_Str" + fileName);
  }
  String filePath="String_Node_Str";
  Map<String,Object> dataMap=null;
  try {
    String url=disconfCenterFile.getRemoteServerUrl();
    filePath=fetcherMgr.downloadFileFromServer(url,fileName);
    dataMap=FileTypeProcessorUtils.getKvMap(filePath);
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
    LOGGER.warn("String_Node_Str" + fileName);
    dataMap=FileTypeProcessorUtils.getKvMap(fileName);
  }
  LOGGER.debug("String_Node_Str");
  disconfStoreProcessor.inject2Store(fileName,new DisconfValue(null,dataMap));
  LOGGER.debug("String_Node_Str");
  DisConfCommonModel disConfCommonModel=disconfStoreProcessor.getCommonModel(fileName);
  if (watchMgr != null) {
    watchMgr.watchPath(this,disConfCommonModel,fileName,DisConfigTypeEnum.FILE,GsonUtils.toJson(disconfCenterFile.getKV()));
    LOGGER.debug("String_Node_Str");
  }
 else {
    LOGGER.warn("String_Node_Str",fileName);
  }
}

Fixed version (ground truth):
/** 
 * 更新 一個配置文件, 下载、注入到仓库、Watch 三步骤
 */
private void updateOneConfFile(String fileName,DisconfCenterFile disconfCenterFile) throws Exception {
  if (disconfCenterFile == null) {
    throw new Exception("String_Node_Str" + fileName);
  }
  String filePath="String_Node_Str";
  Map<String,Object> dataMap=new HashMap<String,Object>();
  try {
    String url=disconfCenterFile.getRemoteServerUrl();
    filePath=fetcherMgr.downloadFileFromServer(url,fileName);
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
    LOGGER.warn("String_Node_Str" + fileName);
    filePath=fileName;
  }
  LOGGER.debug("String_Node_Str");
  try {
    dataMap=FileTypeProcessorUtils.getKvMap(filePath);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
  disconfStoreProcessor.inject2Store(fileName,new DisconfValue(null,dataMap));
  LOGGER.debug("String_Node_Str");
  DisConfCommonModel disConfCommonModel=disconfStoreProcessor.getCommonModel(fileName);
  if (watchMgr != null) {
    watchMgr.watchPath(this,disConfCommonModel,fileName,DisConfigTypeEnum.FILE,GsonUtils.toJson(disconfCenterFile.getKV()));
    LOGGER.debug("String_Node_Str");
  }
 else {
    LOGGER.warn("String_Node_Str",fileName);
  }
}
Program: 60680
Project: 60680
Buggy source:
/** 
 */
private List<String> compareConfig(String zkData,String dbData){
  List<String> errorKeyList=new ArrayList<String>();
  Properties prop=new Properties();
  try {
    prop.load(IOUtils.toInputStream(dbData,"String_Node_Str"));
  }
 catch (  IOException e) {
    LOG.error(e.toString());
    errorKeyList.add(zkData);
    return errorKeyList;
  }
  Map<String,String> zkMap=GsonUtils.parse2Map(zkData);
  for (  String keyInZk : zkMap.keySet()) {
    Object valueInDb=prop.get(keyInZk);
    String zkDataStr=zkMap.get(keyInZk);
    try {
      if ((zkDataStr == null && valueInDb != null) || (zkDataStr != null && valueInDb == null)) {
        errorKeyList.add(keyInZk);
      }
 else {
        boolean isEqual=true;
        if (MyStringUtils.isDouble(zkDataStr) && MyStringUtils.isDouble(valueInDb.toString())) {
          if (Math.abs(Double.parseDouble(zkDataStr) - Double.parseDouble(valueInDb.toString())) > 0.001d) {
            isEqual=false;
          }
        }
 else {
          if (!zkDataStr.equals(valueInDb.toString().trim())) {
            isEqual=false;
          }
        }
        if (!isEqual) {
          errorKeyList.add(keyInZk + "String_Node_Str" + DiffUtils.getDiffSimple(zkDataStr,valueInDb.toString().trim()));
        }
      }
    }
 catch (    Exception e) {
      LOG.warn(e.toString() + "String_Node_Str" + keyInZk+ "String_Node_Str"+ zkMap.get(keyInZk)+ "String_Node_Str"+ valueInDb);
    }
  }
  return errorKeyList;
}

Fixed version (ground truth):
/** 
 */
private List<String> compareConfig(String zkData,String dbData){
  List<String> errorKeyList=new ArrayList<String>();
  Properties prop=new Properties();
  try {
    prop.load(IOUtils.toInputStream(dbData));
  }
 catch (  Exception e) {
    LOG.error(e.toString());
    errorKeyList.add(zkData);
    return errorKeyList;
  }
  Map<String,String> zkMap=GsonUtils.parse2Map(zkData);
  for (  String keyInZk : zkMap.keySet()) {
    Object valueInDb=prop.get(keyInZk);
    String zkDataStr=zkMap.get(keyInZk);
    try {
      if ((zkDataStr == null && valueInDb != null) || (zkDataStr != null && valueInDb == null)) {
        errorKeyList.add(keyInZk);
      }
 else {
        boolean isEqual=true;
        if (MyStringUtils.isDouble(zkDataStr) && MyStringUtils.isDouble(valueInDb.toString())) {
          if (Math.abs(Double.parseDouble(zkDataStr) - Double.parseDouble(valueInDb.toString())) > 0.001d) {
            isEqual=false;
          }
        }
 else {
          if (!zkDataStr.equals(valueInDb.toString().trim())) {
            isEqual=false;
          }
        }
        if (!isEqual) {
          errorKeyList.add(keyInZk + "String_Node_Str" + DiffUtils.getDiffSimple(zkDataStr,valueInDb.toString().trim()));
        }
      }
    }
 catch (    Exception e) {
      LOG.warn(e.toString() + "String_Node_Str" + keyInZk+ "String_Node_Str"+ zkMap.get(keyInZk)+ "String_Node_Str"+ valueInDb);
    }
  }
  return errorKeyList;
}
Program: 60681
Project: 60681
Buggy source:
/** 
 * unicode 转换成 utf-8
 * @param theString
 * @return
 * @author fanhui2007-3-15
 */
public static String unicodeToUtf8(String theString){
  char aChar;
  int len=theString.length();
  StringBuffer outBuffer=new StringBuffer(len);
  for (int x=0; x < len; ) {
    aChar=theString.charAt(x++);
    if (aChar == '\\') {
      aChar=theString.charAt(x++);
      if (aChar == 'u') {
        int value=0;
        for (int i=0; i < 4; i++) {
          aChar=theString.charAt(x++);
switch (aChar) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
            value=(value << 4) + aChar - '0';
          break;
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
        value=(value << 4) + 10 + aChar - 'a';
      break;
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
    value=(value << 4) + 10 + aChar - 'A';
  break;
default :
value=0;
}
}
outBuffer.append((char)value);
}
 else {
if (aChar == 't') {
aChar='\t';
}
 else if (aChar == 'r') {
aChar='\r';
}
 else if (aChar == 'n') {
aChar='\n';
}
 else if (aChar == 'f') {
aChar='\f';
}
outBuffer.append(aChar);
}
}
 else {
outBuffer.append(aChar);
}
}
return outBuffer.toString();
}

Fixed version (ground truth):
/** 
 * unicode 转换成 utf-8
 * @param theString
 * @return
 * @author fanhui2007-3-15
 */
public static String unicodeToUtf8(String theString){
  char aChar;
  int len=theString.length();
  StringBuffer outBuffer=new StringBuffer(len);
  for (int x=0; x < len; ) {
    aChar=theString.charAt(x++);
    if (aChar == '\\') {
      aChar=theString.charAt(x++);
      if (aChar == 'u') {
        int value=0;
        for (int i=0; i < 4; i++) {
          aChar=theString.charAt(x++);
switch (aChar) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
            value=(value << 4) + aChar - '0';
          break;
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
        value=(value << 4) + 10 + aChar - 'a';
      break;
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
    value=(value << 4) + 10 + aChar - 'A';
  break;
default :
value=0;
break;
}
}
outBuffer.append((char)value);
}
 else {
if (aChar == 't') {
aChar='\t';
}
 else if (aChar == 'r') {
aChar='\r';
}
 else if (aChar == 'n') {
aChar='\n';
}
 else if (aChar == 'f') {
aChar='\f';
}
outBuffer.append(aChar);
}
}
 else {
outBuffer.append(aChar);
}
}
return outBuffer.toString();
}