nus-yam/ex-repair huggingface dataset:
Program: 52811
Project: 52811
Buggy source:
public static void cherryPickChange(final Project project,final ChangeInfo changeInfo){
  final Git git=ServiceManager.getService(Git.class);
  final GitPlatformFacade platformFacade=ServiceManager.getService(GitPlatformFacade.class);
  FileDocumentManager.getInstance().saveAllDocuments();
  platformFacade.getChangeListManager(project).blockModalNotifications();
  new Task.Backgroundable(project,"String_Node_Str",false){
    public void run(    @NotNull ProgressIndicator indicator){
      try {
        final GitRepository gitRepository=getRepositoryForGerritProject(project,changeInfo.getProject());
        final String notLoaded="String_Node_Str";
        String ref=changeInfo.getCurrentRevision();
        GitCommit gitCommit=new GitCommit(Hash.create(ref),notLoaded,notLoaded,0,notLoaded,notLoaded,0,notLoaded,notLoaded,Collections.<Hash>emptyList(),Collections.<Change>emptyList());
        cherryPick(gitRepository,gitCommit,git,platformFacade,project);
      }
  finally {
        ApplicationManager.getApplication().invokeLater(new Runnable(){
          public void run(){
            VirtualFileManager.getInstance().syncRefresh();
            platformFacade.getChangeListManager(project).unblockModalNotifications();
          }
        }
);
      }
    }
  }
.queue();
}

Fixed version (ground truth):
public static void cherryPickChange(final Project project,final ChangeInfo changeInfo){
  final Git git=ServiceManager.getService(Git.class);
  final GitPlatformFacade platformFacade=ServiceManager.getService(GitPlatformFacade.class);
  FileDocumentManager.getInstance().saveAllDocuments();
  platformFacade.getChangeListManager(project).blockModalNotifications();
  new Task.Backgroundable(project,"String_Node_Str",false){
    public void run(    @NotNull ProgressIndicator indicator){
      try {
        final GitRepository gitRepository=getRepositoryForGerritProject(project,changeInfo.getProject());
        final VirtualFile virtualFile=gitRepository.getGitDir();
        final String notLoaded="String_Node_Str";
        String ref=changeInfo.getCurrentRevision();
        GitHeavyCommit gitCommit=new GitHeavyCommit(virtualFile,AbstractHash.create(ref),new SHAHash(ref),notLoaded,notLoaded,new Date(0),notLoaded,notLoaded,Collections.<String>emptySet(),Collections.<FilePath>emptyList(),notLoaded,notLoaded,Collections.<String>emptyList(),Collections.<String>emptyList(),Collections.<String>emptyList(),Collections.<Change>emptyList(),0);
        cherryPick(gitRepository,gitCommit,git,platformFacade,project);
      }
  finally {
        ApplicationManager.getApplication().invokeLater(new Runnable(){
          public void run(){
            VirtualFileManager.getInstance().syncRefresh();
            platformFacade.getChangeListManager(project).unblockModalNotifications();
          }
        }
);
      }
    }
  }
.queue();
}
Program: 52813
Project: 52813
Buggy source:
@Nullable private static HttpMethod handleCertificateExceptionAndRetry(@NotNull IOException e,@NotNull String host,@NotNull HttpClient client,@NotNull URI uri,@NotNull ThrowableConvertor<String,HttpMethod,IOException> methodCreator) throws IOException {
  if (!isCertificateException(e)) {
    throw e;
  }
  if (isTrusted(host)) {
    HostConfiguration hc=new HostConfiguration();
    String relativeUri=new URI(uri.getPathQuery(),false).getURI();
    HttpMethod method=methodCreator.convert(relativeUri);
    client.executeMethod(hc,method);
    return method;
  }
  throw e;
}

Fixed version (ground truth):
@Nullable private static HttpMethod handleCertificateExceptionAndRetry(@NotNull IOException e,@NotNull String host,@NotNull HttpClient client,@NotNull URI uri,@NotNull ThrowableConvertor<String,HttpMethod,IOException> methodCreator) throws IOException {
  if (!isCertificateException(e)) {
    throw e;
  }
  if (isTrusted(host)) {
    Protocol easyHttps=new Protocol("String_Node_Str",(ProtocolSocketFactory)new EasySSLProtocolSocketFactory(),443);
    HostConfiguration hc=new HostConfiguration();
    hc.setHost(host,443,easyHttps);
    String relativeUri=new URI(uri.getPathQuery(),false).getURI();
    HttpMethod method=methodCreator.convert(relativeUri);
    client.executeMethod(hc,method);
    return method;
  }
  throw e;
}
Program: 52814
Project: 52814
Buggy source:
private static void saveToTrusted(@NotNull String host){
  GerritSettings.getInstance().addTrustedHost(host);
}

Fixed version (ground truth):
private static void saveToTrusted(@NotNull String host){
  try {
    GerritSettings.getInstance().addTrustedHost(new java.net.URI(host).getHost());
  }
 catch (  URISyntaxException e) {
    throw Throwables.propagate(e);
  }
}
Program: 52815
Project: 52815
Buggy source:
@Nullable private static JsonElement request(@NotNull String host,@Nullable String login,@Nullable String password,@NotNull String path,@Nullable String requestBody,boolean post){
  HttpMethod method=null;
  try {
    method=doREST(host,login,password,path,requestBody,post);
    String resp=method.getResponseBodyAsString();
    if (method.getStatusCode() != 200) {
      String message=String.format("String_Node_Str",method.getStatusCode(),method.getStatusText());
      LOG.warn(message);
      throw new RuntimeException(message);
    }
    if (resp == null) {
      String message=String.format("String_Node_Str",resp);
      LOG.warn(message);
      throw new RuntimeException(message);
    }
    return parseResponse(resp);
  }
 catch (  IOException e) {
    LOG.warn(String.format("String_Node_Str",e.getMessage()),e);
    throw Throwables.propagate(e);
  }
 finally {
    if (method != null) {
      method.releaseConnection();
    }
  }
}

Fixed version (ground truth):
@Nullable private static JsonElement request(@NotNull String host,@Nullable String login,@Nullable String password,@NotNull String path,@Nullable String requestBody,boolean post){
  HttpMethod method=null;
  try {
    method=doREST(host,login,password,path,requestBody,post);
    String resp=method.getResponseBodyAsString();
    if (method.getStatusCode() != 200) {
      String message=String.format("String_Node_Str",method.getStatusCode(),method.getStatusText());
      LOG.warn(message);
      throw new HttpStatusException(method.getStatusCode(),method.getStatusText(),message);
    }
    if (resp == null) {
      String message=String.format("String_Node_Str",resp);
      LOG.warn(message);
      throw new RuntimeException(message);
    }
    return parseResponse(resp);
  }
 catch (  IOException e) {
    LOG.warn(String.format("String_Node_Str",e.getMessage()),e);
    throw Throwables.propagate(e);
  }
 finally {
    if (method != null) {
      method.releaseConnection();
    }
  }
}
Program: 52816
Project: 52816
Buggy source:
@NotNull private static JsonElement parseResponse(@NotNull String response){
  try {
    return new JsonParser().parse(response);
  }
 catch (  JsonSyntaxException jse) {
    if (response.startsWith("String_Node_Str")) {
      throw new NotFoundException();
    }
    throw new RuntimeException(String.format("String_Node_Str",response),jse);
  }
}

Fixed version (ground truth):
@NotNull private static JsonElement parseResponse(@NotNull String response){
  try {
    return new JsonParser().parse(response);
  }
 catch (  JsonSyntaxException jse) {
    throw new RuntimeException(String.format("String_Node_Str",response),jse);
  }
}
Program: 52817
Project: 52817
Buggy source:
/** 
 * Support starting from Gerrit 2.7.
 */
@NotNull public static TreeMap<String,List<CommentInfo>> getComments(@NotNull String url,@NotNull String login,@NotNull String password,@NotNull String changeId,@NotNull String revision){
  final String request="String_Node_Str" + changeId + "String_Node_Str"+ revision+ "String_Node_Str";
  try {
    JsonElement result=GerritApiUtil.getRequest(url,login,password,request);
    if (result == null) {
      return Maps.newTreeMap();
    }
    return parseCommentInfos(result);
  }
 catch (  NotFoundException e) {
    LOG.warn("String_Node_Str");
    return Maps.newTreeMap();
  }
}

Fixed version (ground truth):
/** 
 * Support starting from Gerrit 2.7.
 */
@NotNull public static TreeMap<String,List<CommentInfo>> getComments(@NotNull String url,@NotNull String login,@NotNull String password,@NotNull String changeId,@NotNull String revision){
  final String request="String_Node_Str" + changeId + "String_Node_Str"+ revision+ "String_Node_Str";
  try {
    JsonElement result=GerritApiUtil.getRequest(url,login,password,request);
    if (result == null) {
      return Maps.newTreeMap();
    }
    return parseCommentInfos(result);
  }
 catch (  HttpStatusException e) {
    if (e.getStatusCode() == 404) {
      LOG.warn("String_Node_Str");
    }
    return Maps.newTreeMap();
  }
}
Program: 52818
Project: 52818
Buggy source:
@Nullable private static JsonElement request(@NotNull String host,@Nullable String login,@Nullable String password,@NotNull String path,@Nullable String requestBody,boolean post){
  HttpMethod method=null;
  try {
    method=doREST(host,login,password,path,requestBody,post);
    String resp=method.getResponseBodyAsString();
    if (method.getStatusCode() != 200) {
      String message=String.format("String_Node_Str",method.getStatusCode(),method.getStatusText());
      LOG.warn(message);
      throw new HttpStatusException(method.getStatusCode(),method.getStatusText(),message);
    }
    if (resp == null) {
      String message=String.format("String_Node_Str",resp);
      LOG.warn(message);
      throw new RuntimeException(message);
    }
    return parseResponse(resp);
  }
 catch (  IOException e) {
    LOG.warn(String.format("String_Node_Str",e.getMessage()),e);
    throw Throwables.propagate(e);
  }
 finally {
    if (method != null) {
      method.releaseConnection();
    }
  }
}

Fixed version (ground truth):
@Nullable private static JsonElement request(@NotNull String host,@Nullable String login,@Nullable String password,@NotNull String path,@Nullable String requestBody,boolean post){
  HttpMethod method=null;
  try {
    method=doREST(host,login,password,path,requestBody,post);
    String resp=method.getResponseBodyAsString();
    if (method.getStatusCode() != 200) {
      String message=String.format("String_Node_Str",method.getStatusText(),method.getStatusCode());
      LOG.warn(message);
      throw new HttpStatusException(method.getStatusCode(),method.getStatusText(),message);
    }
    if (resp == null) {
      String message=String.format("String_Node_Str",resp);
      LOG.warn(message);
      throw new RuntimeException(message);
    }
    return parseResponse(resp);
  }
 catch (  IOException e) {
    LOG.warn(String.format("String_Node_Str",e.getMessage()),e);
    throw Throwables.propagate(e);
  }
 finally {
    if (method != null) {
      method.releaseConnection();
    }
  }
}
Program: 52819
Project: 52819
Buggy source:
@Override public Object invoke(Object proxy,Method method,Object[] parameters) throws Throwable {
  lazyInit();
  List<Interceptor<?>> interceptors=interceptorLookup.lookup(proxy,method);
  if (interceptors != null && !interceptors.isEmpty()) {
    try {
      ManualInvocationContext invocationContext=new ManualInvocationContext(this,interceptors,proxy,method,parameters,null);
      Object returnValue=invocationContext.proceed();
      if (invocationContext.isProceedOriginal()) {
        return invocationContext.getProceedOriginalReturnValue();
      }
      return returnValue;
    }
 catch (    ManualInvocationThrowableWrapperException e) {
      throw e.getCause();
    }
  }
  return proceedOriginal(proxy,method,parameters);
}

Fixed version (ground truth):
@Override public Object invoke(Object proxy,Method method,Object[] parameters) throws Throwable {
  List<Interceptor<?>> interceptors=interceptorLookup.lookup(proxy,method);
  if (interceptors != null && !interceptors.isEmpty()) {
    try {
      ManualInvocationContext invocationContext=new ManualInvocationContext(this,interceptors,proxy,method,parameters,null);
      Object returnValue=invocationContext.proceed();
      if (invocationContext.isProceedOriginal()) {
        return invocationContext.getProceedOriginalReturnValue();
      }
      return returnValue;
    }
 catch (    ManualInvocationThrowableWrapperException e) {
      throw e.getCause();
    }
  }
  return proceedOriginal(proxy,method,parameters);
}
Program: 52820
Project: 52820
Buggy source:
/** 
 * Calls the original logic after invoking the interceptor chain.
 * @param proxy The current proxy instance.
 * @param method The current invoked method.
 * @param parameters The method parameter.
 * @return The original value from the original method.
 * @throws Throwable 
 */
protected abstract Object proceedOriginal(Object proxy,Method method,Object[] parameters) throws Throwable ;

Fixed version (ground truth):
/** 
 * Calls the original logic after invoking the interceptor chain.
 * @param proxy The current proxy instance.
 * @param method The current invoked method.
 * @param parameters The method parameter.
 * @return The original value from the original method.
 * @throws Throwable
 */
protected abstract Object proceedOriginal(Object proxy,Method method,Object[] parameters) throws Throwable ;
Program: 52821
Project: 52821
Buggy source:
@Override public T getValue(){
  if (cacheTimeMs > 0) {
    long now=System.currentTimeMillis();
    if (now <= reloadAfter) {
      return lastValue;
    }
    reloadAfter=now + cacheTimeMs;
  }
  String valueStr=resolveStringValue();
  T value=convert(valueStr);
  value=fallbackToDefaultIfEmpty(keyResolved,value,defaultValue);
  if (logChanges && (value != null && lastValue == null || !value.equals(lastValue))) {
    LOG.log(Level.INFO,"String_Node_Str",new Object[]{filterConfigValueForLog(keyOriginal,valueStr),keyOriginal});
  }
  if (cacheTimeMs > 0) {
    lastValue=value;
  }
  return value;
}

Fixed version (ground truth):
@Override public T getValue(){
  long now=-1;
  if (cacheTimeMs > 0) {
    now=System.currentTimeMillis();
    if (now <= reloadAfter) {
      return lastValue;
    }
  }
  String valueStr=resolveStringValue();
  T value=convert(valueStr);
  value=fallbackToDefaultIfEmpty(keyResolved,value,defaultValue);
  if (logChanges && (value != null && lastValue == null || !value.equals(lastValue))) {
    LOG.log(Level.INFO,"String_Node_Str",new Object[]{filterConfigValueForLog(keyOriginal,valueStr),keyOriginal});
  }
  if (cacheTimeMs > 0) {
    lastValue=value;
    reloadAfter=now + cacheTimeMs;
  }
  return value;
}
Program: 52824
Project: 52824
Buggy source:
private void destroyExpiredBeans(){
  ContextualStorage storage=viewAccessScopedBeanHolder.getContextualStorage(beanManager,getCurrentWindowId(),false);
  if (storage != null) {
    for (    Map.Entry<Object,ContextualInstanceInfo<?>> storageEntry : storage.getStorage().entrySet()) {
      if (!viewAccessScopedBeanHistory.getAccessedBeans().contains((String)storageEntry.getKey())) {
        Contextual bean=storage.getBean(storageEntry.getKey());
        AbstractContext.destroyBean(bean,storageEntry.getValue());
        storage.getStorage().remove(storageEntry.getKey());
        break;
      }
    }
  }
}

Fixed version (ground truth):
private void destroyExpiredBeans(){
  ContextualStorage storage=viewAccessScopedBeanHolder.getContextualStorage(beanManager,getCurrentWindowId(),false);
  if (storage != null) {
    for (    Map.Entry<Object,ContextualInstanceInfo<?>> storageEntry : storage.getStorage().entrySet()) {
      if (!viewAccessScopedBeanHistory.getAccessedBeans().contains((String)storageEntry.getKey())) {
        Contextual bean=storage.getBean(storageEntry.getKey());
        AbstractContext.destroyBean(bean,storageEntry.getValue());
        storage.getStorage().remove(storageEntry.getKey());
      }
    }
  }
}
Program: 52825
Project: 52825
Buggy source:
@Override public <T>T get(Contextual<T> bean,CreationalContext<T> creationalContext){
  PassivationCapable pc=(PassivationCapable)bean;
  viewAccessScopedBeanHistory.getAccessedBeans().add(pc.getId());
  return super.get(bean,creationalContext);
}

Fixed version (ground truth):
@Override public <T>T get(Contextual<T> bean,CreationalContext<T> creationalContext){
  try {
    return super.get(bean,creationalContext);
  }
  finally {
    if (bean instanceof PassivationCapable) {
      PassivationCapable pc=(PassivationCapable)bean;
      viewAccessScopedBeanHistory.getAccessedBeans().add(pc.getId());
    }
  }
}
Program: 52826
Project: 52826
Buggy source:
public void onRenderingFinished(String view){
  if (!view.equals(viewAccessScopedBeanHistory.getLastView())) {
    viewAccessScopedBeanHistory.setLastView(view);
    destroyExpiredBeans();
    viewAccessScopedBeanHistory.getAccessedBeans().clear();
  }
}

Fixed version (ground truth):
public void onRenderingFinished(String view){
  if (!view.equals(viewAccessScopedBeanHistory.getLastView())) {
    viewAccessScopedBeanHistory.setLastView(view);
    destroyExpiredBeans();
  }
  viewAccessScopedBeanHistory.getAccessedBeans().clear();
}
Program: 52827
Project: 52827
Buggy source:
@Override public <T extends ConstraintValidator<?,?>>T getInstance(Class<T> validatorClass){
  T resolvedInst=null;
  resolvedInst=BeanProvider.getContextualReference(validatorClass);
  if (resolvedInst == null) {
    if (log.isLoggable(Level.CONFIG)) {
      log.config("String_Node_Str" + validatorClass.getCanonicalName() + "String_Node_Str");
    }
    resolvedInst=this.delegate.getInstance(validatorClass);
  }
  return resolvedInst;
}

Fixed version (ground truth):
@Override public <T extends ConstraintValidator<?,?>>T getInstance(Class<T> validatorClass){
  T resolvedInst=null;
  resolvedInst=BeanProvider.getContextualReference(validatorClass,true);
  if (resolvedInst == null) {
    if (log.isLoggable(Level.CONFIG)) {
      log.config("String_Node_Str" + validatorClass.getCanonicalName() + "String_Node_Str");
    }
    resolvedInst=this.delegate.getInstance(validatorClass);
  }
  return resolvedInst;
}
Program: 52829
Project: 52829
Buggy source:
private MBeanNotificationInfo getNotificationInfo(final NotificationInfo n,String sourceInfo){
  return new MBeanNotificationInfo(n.types(),n.notificationClass().getName(),getDescription(n.description(),sourceInfo),new ImmutableDescriptor(n.descriptorFields()));
}

Fixed version (ground truth):
private MBeanNotificationInfo getNotificationInfo(final NotificationInfo notificationInfo,String sourceInfo){
  return new MBeanNotificationInfo(notificationInfo.types(),notificationInfo.notificationClass().getName(),getDescription(notificationInfo.description(),sourceInfo),new ImmutableDescriptor(notificationInfo.descriptorFields()));
}
Program: 52830
Project: 52830
Buggy source:
private boolean isNormalScope(final Annotation[] annotations,final Set<Annotation> annotationSet,final BeanManager bm){
  for (  Annotation annotation : annotations) {
    if (bm.isNormalScope(annotation.annotationType())) {
      return true;
    }
  }
  for (  Annotation annotation : annotationSet) {
    if (bm.isNormalScope(annotation.annotationType())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isNormalScope(final Set<Annotation> annotations,final BeanManager bm){
  for (  Annotation annotation : annotations) {
    if (bm.isNormalScope(annotation.annotationType())) {
      return true;
    }
  }
  return false;
}
Program: 52831
Project: 52831
Buggy source:
protected void processBean(@Observes final ProcessManagedBean<?> bean,final BeanManager bm) throws Exception {
  if (!isActivated) {
    return;
  }
  if (bean.getAnnotated().getAnnotation(MBean.class) != null) {
    final ObjectName name=register(bean,bm);
    objectNames.add(name);
    LOGGER.info("String_Node_Str" + name.getCanonicalName());
  }
}

Fixed version (ground truth):
protected void processBean(@Observes final ProcessManagedBean<?> bean,final BeanManager bm) throws Exception {
  if (!isActivated) {
    return;
  }
  MBean mBeanAnnotation=bean.getAnnotated().getAnnotation(MBean.class);
  if (mBeanAnnotation != null) {
    registerObject(bean,mBeanAnnotation,bm);
  }
}
Program: 52832
Project: 52832
Buggy source:
@Override public String getMessage(MessageContext messageContext,String messageTemplate,String category){
  if (messageTemplate.startsWith("String_Node_Str")) {
    return messageTemplate.substring(1);
  }
  if (messageTemplate.startsWith("String_Node_Str") && messageTemplate.endsWith("String_Node_Str")) {
    String resourceKey=messageTemplate.substring(1,messageTemplate.length() - 1);
    List<String> messageSources=messageContext.getMessageSources();
    if (messageSources == null || messageSources.isEmpty()) {
      return null;
    }
    Iterator<String> messageSourceIterator=messageSources.iterator();
    String currentMessageSource;
    while (messageSourceIterator.hasNext()) {
      currentMessageSource=messageSourceIterator.next();
      try {
        Locale locale=messageContext.getLocale();
        ResourceBundle messageBundle=PropertyFileUtils.getResourceBundle(currentMessageSource,locale);
        if (category != null && category.length() > 0) {
          try {
            return messageBundle.getString(resourceKey + "String_Node_Str" + category);
          }
 catch (          MissingResourceException e) {
            messageBundle.getString(resourceKey);
          }
        }
        return messageBundle.getString(resourceKey);
      }
 catch (      MissingResourceException e) {
        if (!messageSourceIterator.hasNext()) {
          return null;
        }
      }
    }
  }
  return messageTemplate;
}

Fixed version (ground truth):
@Override public String getMessage(MessageContext messageContext,String messageTemplate,String category){
  if (messageTemplate.startsWith("String_Node_Str")) {
    return messageTemplate.substring(1);
  }
  if (messageTemplate.startsWith("String_Node_Str") && messageTemplate.endsWith("String_Node_Str")) {
    String resourceKey=messageTemplate.substring(1,messageTemplate.length() - 1);
    List<String> messageSources=messageContext.getMessageSources();
    if (messageSources == null || messageSources.isEmpty()) {
      return null;
    }
    Iterator<String> messageSourceIterator=messageSources.iterator();
    Locale locale=messageContext.getLocale();
    String currentMessageSource;
    while (messageSourceIterator.hasNext()) {
      currentMessageSource=messageSourceIterator.next();
      try {
        ResourceBundle messageBundle=PropertyFileUtils.getResourceBundle(currentMessageSource,locale);
        if (category != null && category.length() > 0) {
          try {
            return messageBundle.getString(resourceKey + "String_Node_Str" + category);
          }
 catch (          MissingResourceException e) {
            return messageBundle.getString(resourceKey);
          }
        }
        return messageBundle.getString(resourceKey);
      }
 catch (      MissingResourceException e) {
        if (!messageSourceIterator.hasNext()) {
          return null;
        }
      }
    }
  }
  return messageTemplate;
}
Program: 52833
Project: 52833
Buggy source:
@Deployment public static WebArchive deploy(){
  return ShrinkWrap.create(WebArchive.class,"String_Node_Str").addPackage(JsfMessageBackingBean.class.getPackage()).addAsResource("String_Node_Str").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndJsfArchive()).addAsWebInfResource("String_Node_Str","String_Node_Str").addAsWebResource("String_Node_Str","String_Node_Str").addAsWebInfResource(EmptyAsset.INSTANCE,"String_Node_Str");
}

Fixed version (ground truth):
@Deployment public static WebArchive deploy(){
  return ShrinkWrap.create(WebArchive.class,"String_Node_Str").addPackage(JsfMessageBackingBean.class.getPackage()).addAsResource("String_Node_Str").addAsResource("String_Node_Str").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndJsfArchive()).addAsWebInfResource("String_Node_Str","String_Node_Str").addAsWebResource("String_Node_Str","String_Node_Str").addAsWebInfResource(EmptyAsset.INSTANCE,"String_Node_Str");
}
Program: 52834
Project: 52834
Buggy source:
/** 
 * Resolve all values for the given key, from all registered ConfigSources ordered by their ordinal value in ascending ways. If more   {@link ConfigSource}s have the same ordinal, their order is undefined.
 * @param key under which configuration is stored
 * @return List with all found property values, sorted in ascending order of their ordinal.
 * @see org.apache.deltaspike.core.spi.config.ConfigSource#getOrdinal()
 */
public static List<String> getAllPropertyValues(String key){
  List<ConfigSource> appConfigSources=sortAscending(Arrays.asList(getConfigSources()));
  List<String> result=new ArrayList<String>();
  String value;
  for (  ConfigSource configSource : appConfigSources) {
    value=configSource.getPropertyValue(key);
    if (value != null && !result.contains(value)) {
      result.add(value);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Resolve all values for the given key, from all registered ConfigSources ordered by their ordinal value in ascending ways. If more   {@link ConfigSource}s have the same ordinal, their order is undefined.
 * @param key under which configuration is stored
 * @return List with all found property values, sorted in ascending order of their ordinal.
 * @see org.apache.deltaspike.core.spi.config.ConfigSource#getOrdinal()
 */
public static List<String> getAllPropertyValues(String key){
  List<ConfigSource> appConfigSources=sortAscending(new ArrayList<ConfigSource>(Arrays.asList(getConfigSources())));
  List<String> result=new ArrayList<String>();
  String value;
  for (  ConfigSource configSource : appConfigSources) {
    value=configSource.getPropertyValue(key);
    if (value != null && !result.contains(value)) {
      result.add(value);
    }
  }
  return result;
}
Program: 52835
Project: 52835
Buggy source:
/** 
 * Check to see if this event has been unmutted and therefore called again.
 */
boolean isUnmute();

Fixed version (ground truth):
/** 
 * Check to see if this event has been unmuted and therefore called again.
 */
boolean isUnmute();
Program: 52836
Project: 52836
Buggy source:
/** 
 * Constructor.
 */
public AnnotatedFieldImpl(AnnotatedType<X> declaringType,Field field,AnnotationStore annotations,Type overridenType){
  super(declaringType,field,field.getType(),annotations,field.getGenericType(),overridenType);
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public AnnotatedFieldImpl(AnnotatedType<X> declaringType,Field field,AnnotationStore annotations,Type overriddenType){
  super(declaringType,field,field.getType(),annotations,field.getGenericType(),overriddenType);
}
Program: 52837
Project: 52837
Buggy source:
protected AnnotatedImpl(Class<?> type,AnnotationStore annotations,Type genericType,Type overridenType){
  if (overridenType == null) {
    if (genericType != null) {
      typeClosure=new HierarchyDiscovery(genericType).getTypeClosure();
      this.type=genericType;
    }
 else {
      typeClosure=new HierarchyDiscovery(type).getTypeClosure();
      this.type=type;
    }
  }
 else {
    this.type=overridenType;
    typeClosure=Collections.singleton(overridenType);
  }
  if (annotations == null) {
    this.annotations=new AnnotationStore();
  }
 else {
    this.annotations=annotations;
  }
}

Fixed version (ground truth):
protected AnnotatedImpl(Class<?> type,AnnotationStore annotations,Type genericType,Type overriddenType){
  if (overriddenType == null) {
    if (genericType != null) {
      typeClosure=new HierarchyDiscovery(genericType).getTypeClosure();
      this.type=genericType;
    }
 else {
      typeClosure=new HierarchyDiscovery(type).getTypeClosure();
      this.type=type;
    }
  }
 else {
    this.type=overriddenType;
    typeClosure=Collections.singleton(overriddenType);
  }
  if (annotations == null) {
    this.annotations=new AnnotationStore();
  }
 else {
    this.annotations=annotations;
  }
}
Program: 52838
Project: 52838
Buggy source:
protected AnnotatedMemberImpl(AnnotatedType<X> declaringType,M member,Class<?> memberType,AnnotationStore annotations,Type genericType,Type overridenType){
  super(memberType,annotations,genericType,overridenType);
  this.declaringType=declaringType;
  javaMember=member;
}

Fixed version (ground truth):
protected AnnotatedMemberImpl(AnnotatedType<X> declaringType,M member,Class<?> memberType,AnnotationStore annotations,Type genericType,Type overriddenType){
  super(memberType,annotations,genericType,overriddenType);
  this.declaringType=declaringType;
  javaMember=member;
}
Program: 52840
Project: 52840
Buggy source:
/** 
 * {@inheritDoc}
 */
public List<AnnotatedParameter<X>> getParameters(){
  return Collections.unmodifiableList(parameters);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public List<AnnotatedParameter<X>> getParameters(){
  return Collections.unmodifiableList(parameters);
}
Program: 52841
Project: 52841
Buggy source:
private Properties loadProperties(URL url){
  Properties props=new Properties();
  InputStream inputStream=null;
  try {
    inputStream=url.openStream();
    if (inputStream != null) {
      props.load(inputStream);
    }
  }
 catch (  IOException e) {
    return null;
  }
 finally {
    try {
      if (inputStream != null) {
        inputStream.close();
      }
    }
 catch (    IOException e) {
    }
  }
  return props;
}

Fixed version (ground truth):
private Properties loadProperties(URL url){
  Properties props=new Properties();
  InputStream inputStream=null;
  try {
    inputStream=url.openStream();
    if (inputStream != null) {
      props.load(inputStream);
    }
  }
 catch (  IOException e) {
    throw new IllegalStateException(e);
  }
 finally {
    try {
      if (inputStream != null) {
        inputStream.close();
      }
    }
 catch (    IOException e) {
    }
  }
  return props;
}
Program: 52842
Project: 52842
Buggy source:
/** 
 * Access to the   {@link AnnotatedElement} on which this annotation isdefined. If the annotation is defined on a Field, this may be cast to {@link Field}, if defined on a method, this may be cast to   {@link Method}, if defined on a constructor, this may be cast to   {@link Constructor}, if defined on a class, this may be cast to   {@link Class}, or if defined on a parameter, this may be cast to   {@link Parameter}
 */
public AnnotatedElement getAnnotatedElement(){
  return annotatedElement;
}

Fixed version (ground truth):
/** 
 * Access to the   {@link AnnotatedElement} on which this annotation isdefined. If the annotation is defined on a Field, this may be cast to {@link java.lang.reflect.Field}, if defined on a method, this may be cast to   {@link java.lang.reflect.Method}, if defined on a constructor, this may be cast to   {@link java.lang.reflect.Constructor}, if defined on a class, this may be cast to   {@link Class}, or if defined on a parameter, this may be cast to   {@link Parameter}
 */
public AnnotatedElement getAnnotatedElement(){
  return annotatedElement;
}
Program: 52843
Project: 52843
Buggy source:
/** 
 * Set the accessibility flag on the   {@link AccessibleObject} as described in{@link AccessibleObject#setAccessible(boolean)} within the context ofa  {@link PrivilegedAction}.
 * @param < A >    member the accessible object type
 * @param member the accessible object
 * @return the accessible object after the accessible flag has been altered
 */
public static <A extends AccessibleObject>A setAccessible(A member){
  AccessController.doPrivileged(new SetAccessiblePrivilegedAction(member));
  return member;
}

Fixed version (ground truth):
/** 
 * Set the accessibility flag on the   {@link AccessibleObject} as described in{@link AccessibleObject#setAccessible(boolean)} within the context ofa  {@link java.security.PrivilegedAction}.
 * @param < A >    member the accessible object type
 * @param member the accessible object
 * @return the accessible object after the accessible flag has been altered
 */
public static <A extends AccessibleObject>A setAccessible(A member){
  AccessController.doPrivileged(new SetAccessiblePrivilegedAction(member));
  return member;
}
Program: 52844
Project: 52844
Buggy source:
/** 
 * <p> Loads and initializes a class for the given name. </p> <p/> <p> If the Thread Context Class Loader is available, it will be used, otherwise the classloader used to load   {@link Reflections} will be used</p> <p/> <p> It is also possible to specify additional classloaders to attempt to load the class with. If the first attempt fails, then these additional loaders are tried in order. </p>
 * @param name    the name of the class to load
 * @param loaders additional classloaders to use to attempt to load the class
 * @return the class object
 * @throws ClassNotFoundException if the class cannot be found
 */
public static Class<?> classForName(String name,ClassLoader... loaders) throws ClassNotFoundException {
  try {
    if (Thread.currentThread().getContextClassLoader() != null) {
      return Class.forName(name,true,Thread.currentThread().getContextClassLoader());
    }
 else {
      return Class.forName(name);
    }
  }
 catch (  ClassNotFoundException e) {
    for (    ClassLoader l : loaders) {
      try {
        return Class.forName(name,true,l);
      }
 catch (      ClassNotFoundException ex) {
      }
    }
  }
  if (Thread.currentThread().getContextClassLoader() != null) {
    throw new ClassNotFoundException("String_Node_Str" + name + "String_Node_Str"+ Thread.currentThread().getContextClassLoader().toString()+ "String_Node_Str"+ Arrays.toString(loaders));
  }
 else {
    throw new ClassNotFoundException("String_Node_Str" + name + "String_Node_Str"+ Arrays.toString(loaders));
  }
}

Fixed version (ground truth):
/** 
 * <p> Loads and initializes a class for the given name. </p> <p/> <p> If the Thread Context Class Loader is available, it will be used, otherwise the classloader used to load   {@link Reflections} will be used</p> <p/> <p> It is also possible to specify additional classloaders to attempt to load the class with. If the first attempt fails, then these additional loaders are tried in order. </p>
 * @param name    the name of the class to load
 * @param loaders additional classloaders to use to attempt to load the class
 * @return the class object
 * @throws ClassNotFoundException if the class cannot be found
 */
public static Class<?> classForName(String name,ClassLoader... loaders) throws ClassNotFoundException {
  try {
    if (Thread.currentThread().getContextClassLoader() != null) {
      return Class.forName(name,true,Thread.currentThread().getContextClassLoader());
    }
 else {
      return Class.forName(name);
    }
  }
 catch (  ClassNotFoundException e) {
    for (    ClassLoader l : loaders) {
      try {
        return Class.forName(name,true,l);
      }
 catch (      ClassNotFoundException ex) {
      }
    }
  }
  if (Thread.currentThread().getContextClassLoader() != null) {
    throw new ClassNotFoundException(String.format("String_Node_Str",name,Thread.currentThread().getContextClassLoader(),loaders));
  }
 else {
    throw new ClassNotFoundException("String_Node_Str" + name + "String_Node_Str"+ Arrays.toString(loaders));
  }
}
Program: 52845
Project: 52845
Buggy source:
private static String buildInvokeMethodErrorMessage(Method method,Object obj,Object... args){
  StringBuilder message=new StringBuilder(String.format("String_Node_Str",method.getName(),obj));
  if (args != null)   for (int i=0; i < args.length; i++)   message.append((i > 0 ? "String_Node_Str" : "String_Node_Str") + args[i]);
  message.append("String_Node_Str");
  return message.toString();
}

Fixed version (ground truth):
private static String buildInvokeMethodErrorMessage(Method method,Object obj,Object... args){
  StringBuilder message=new StringBuilder(String.format("String_Node_Str",method.getName(),obj));
  if (args != null) {
    for (int i=0; i < args.length; i++) {
      message.append((i > 0 ? "String_Node_Str" : "String_Node_Str") + args[i]);
    }
  }
  message.append("String_Node_Str");
  return message.toString();
}
Program: 52846
Project: 52846
Buggy source:
/** 
 * Access to the   {@link AnnotatedElement} on which this annotation isdefined. If the annotation is defined on a Field, this may be cast to {@link java.lang.reflect.Field}, if defined on a method, this may be cast to   {@link java.lang.reflect.Method}, if defined on a constructor, this may be cast to   {@link java.lang.reflect.Constructor}, if defined on a class, this may be cast to   {@link Class}, or if defined on a parameter, this may be cast to   {@link Parameter}
 */
public AnnotatedElement getAnnotatedElement(){
  return annotatedElement;
}

Fixed version (ground truth):
/** 
 * Access to the   {@link AnnotatedElement} on which this annotation isdefined. If the annotation is defined on a Field, this may be cast to {@link Field}, if defined on a method, this may be cast to   {@link Method}, if defined on a constructor, this may be cast to   {@link Constructor}, if defined on a class, this may be cast to   {@link Class}, or if defined on a parameter, this may be cast to   {@link Parameter}
 */
public AnnotatedElement getAnnotatedElement(){
  return annotatedElement;
}
Program: 52847
Project: 52847
Buggy source:
/** 
 * Set the accessibility flag on the   {@link AccessibleObject} as described in{@link AccessibleObject#setAccessible(boolean)} within the context ofa  {@link java.security.PrivilegedAction}.
 * @param < A >    member the accessible object type
 * @param member the accessible object
 * @return the accessible object after the accessible flag has been altered
 */
public static <A extends AccessibleObject>A setAccessible(A member){
  AccessController.doPrivileged(new SetAccessiblePrivilegedAction(member));
  return member;
}

Fixed version (ground truth):
/** 
 * Set the accessibility flag on the   {@link AccessibleObject} as described in{@link AccessibleObject#setAccessible(boolean)} within the context ofa  {@link PrivilegedAction}.
 * @param < A >    member the accessible object type
 * @param member the accessible object
 * @return the accessible object after the accessible flag has been altered
 */
public static <A extends AccessibleObject>A setAccessible(A member){
  AccessController.doPrivileged(new SetAccessiblePrivilegedAction(member));
  return member;
}
Program: 52848
Project: 52848
Buggy source:
/** 
 * <p> Loads and initializes a class for the given name. </p> <p/> <p> If the Thread Context Class Loader is available, it will be used, otherwise the classloader used to load   {@link Reflections} will be used</p> <p/> <p> It is also possible to specify additional classloaders to attempt to load the class with. If the first attempt fails, then these additional loaders are tried in order. </p>
 * @param name    the name of the class to load
 * @param loaders additional classloaders to use to attempt to load the class
 * @return the class object
 * @throws ClassNotFoundException if the class cannot be found
 */
public static Class<?> classForName(String name,ClassLoader... loaders) throws ClassNotFoundException {
  try {
    if (Thread.currentThread().getContextClassLoader() != null) {
      return Class.forName(name,true,Thread.currentThread().getContextClassLoader());
    }
 else {
      return Class.forName(name);
    }
  }
 catch (  ClassNotFoundException e) {
    for (    ClassLoader l : loaders) {
      try {
        return Class.forName(name,true,l);
      }
 catch (      ClassNotFoundException ex) {
      }
    }
  }
  if (Thread.currentThread().getContextClassLoader() != null) {
    throw new ClassNotFoundException(String.format("String_Node_Str",name,Thread.currentThread().getContextClassLoader(),loaders));
  }
 else {
    throw new ClassNotFoundException("String_Node_Str" + name + "String_Node_Str"+ Arrays.toString(loaders));
  }
}

Fixed version (ground truth):
/** 
 * <p> Loads and initializes a class for the given name. </p> <p/> <p> If the Thread Context Class Loader is available, it will be used, otherwise the classloader used to load   {@link Reflections} will be used</p> <p/> <p> It is also possible to specify additional classloaders to attempt to load the class with. If the first attempt fails, then these additional loaders are tried in order. </p>
 * @param name    the name of the class to load
 * @param loaders additional classloaders to use to attempt to load the class
 * @return the class object
 * @throws ClassNotFoundException if the class cannot be found
 */
public static Class<?> classForName(String name,ClassLoader... loaders) throws ClassNotFoundException {
  try {
    if (Thread.currentThread().getContextClassLoader() != null) {
      return Class.forName(name,true,Thread.currentThread().getContextClassLoader());
    }
 else {
      return Class.forName(name);
    }
  }
 catch (  ClassNotFoundException e) {
    for (    ClassLoader l : loaders) {
      try {
        return Class.forName(name,true,l);
      }
 catch (      ClassNotFoundException ex) {
      }
    }
  }
  if (Thread.currentThread().getContextClassLoader() != null) {
    throw new ClassNotFoundException("String_Node_Str" + name + "String_Node_Str"+ Thread.currentThread().getContextClassLoader().toString()+ "String_Node_Str"+ Arrays.toString(loaders));
  }
 else {
    throw new ClassNotFoundException("String_Node_Str" + name + "String_Node_Str"+ Arrays.toString(loaders));
  }
}
Program: 52849
Project: 52849
Buggy source:
private static String buildInvokeMethodErrorMessage(Method method,Object obj,Object... args){
  StringBuilder message=new StringBuilder(String.format("String_Node_Str",method.getName(),obj));
  if (args != null) {
    for (int i=0; i < args.length; i++) {
      message.append((i > 0 ? "String_Node_Str" : "String_Node_Str") + args[i]);
    }
  }
  message.append("String_Node_Str");
  return message.toString();
}

Fixed version (ground truth):
private static String buildInvokeMethodErrorMessage(Method method,Object obj,Object... args){
  StringBuilder message=new StringBuilder(String.format("String_Node_Str",method.getName(),obj));
  if (args != null)   for (int i=0; i < args.length; i++)   message.append((i > 0 ? "String_Node_Str" : "String_Node_Str") + args[i]);
  message.append("String_Node_Str");
  return message.toString();
}
Program: 52850
Project: 52850
Buggy source:
/** 
 * Access to the   {@link AnnotatedElement} on which this annotation isdefined. If the annotation is defined on a Field, this may be cast to {@link Field}, if defined on a method, this may be cast to   {@link Method}, if defined on a constructor, this may be cast to   {@link Constructor}, if defined on a class, this may be cast to   {@link Class}, or if defined on a parameter, this may be cast to   {@link Parameter}
 */
public AnnotatedElement getAnnotatedElement(){
  return annotatedElement;
}

Fixed version (ground truth):
/** 
 * Access to the   {@link AnnotatedElement} on which this annotation isdefined. If the annotation is defined on a Field, this may be cast to {@link java.lang.reflect.Field}, if defined on a method, this may be cast to   {@link java.lang.reflect.Method}, if defined on a constructor, this may be cast to   {@link java.lang.reflect.Constructor}, if defined on a class, this may be cast to   {@link Class}, or if defined on a parameter, this may be cast to   {@link Parameter}
 */
public AnnotatedElement getAnnotatedElement(){
  return annotatedElement;
}
Program: 52851
Project: 52851
Buggy source:
/** 
 * Set the accessibility flag on the   {@link AccessibleObject} as described in{@link AccessibleObject#setAccessible(boolean)} within the context ofa  {@link PrivilegedAction}.
 * @param < A >    member the accessible object type
 * @param member the accessible object
 * @return the accessible object after the accessible flag has been altered
 */
public static <A extends AccessibleObject>A setAccessible(A member){
  AccessController.doPrivileged(new SetAccessiblePrivilegedAction(member));
  return member;
}

Fixed version (ground truth):
/** 
 * Set the accessibility flag on the   {@link AccessibleObject} as described in{@link AccessibleObject#setAccessible(boolean)} within the context ofa  {@link java.security.PrivilegedAction}.
 * @param < A >    member the accessible object type
 * @param member the accessible object
 * @return the accessible object after the accessible flag has been altered
 */
public static <A extends AccessibleObject>A setAccessible(A member){
  AccessController.doPrivileged(new SetAccessiblePrivilegedAction(member));
  return member;
}
Program: 52852
Project: 52852
Buggy source:
/** 
 * <p> Loads and initializes a class for the given name. </p> <p/> <p> If the Thread Context Class Loader is available, it will be used, otherwise the classloader used to load   {@link Reflections} will be used</p> <p/> <p> It is also possible to specify additional classloaders to attempt to load the class with. If the first attempt fails, then these additional loaders are tried in order. </p>
 * @param name    the name of the class to load
 * @param loaders additional classloaders to use to attempt to load the class
 * @return the class object
 * @throws ClassNotFoundException if the class cannot be found
 */
public static Class<?> classForName(String name,ClassLoader... loaders) throws ClassNotFoundException {
  try {
    if (Thread.currentThread().getContextClassLoader() != null) {
      return Class.forName(name,true,Thread.currentThread().getContextClassLoader());
    }
 else {
      return Class.forName(name);
    }
  }
 catch (  ClassNotFoundException e) {
    for (    ClassLoader l : loaders) {
      try {
        return Class.forName(name,true,l);
      }
 catch (      ClassNotFoundException ex) {
      }
    }
  }
  if (Thread.currentThread().getContextClassLoader() != null) {
    throw new ClassNotFoundException("String_Node_Str" + name + "String_Node_Str"+ Thread.currentThread().getContextClassLoader().toString()+ "String_Node_Str"+ Arrays.toString(loaders));
  }
 else {
    throw new ClassNotFoundException("String_Node_Str" + name + "String_Node_Str"+ Arrays.toString(loaders));
  }
}

Fixed version (ground truth):
/** 
 * <p> Loads and initializes a class for the given name. </p> <p/> <p> If the Thread Context Class Loader is available, it will be used, otherwise the classloader used to load   {@link Reflections} will be used</p> <p/> <p> It is also possible to specify additional classloaders to attempt to load the class with. If the first attempt fails, then these additional loaders are tried in order. </p>
 * @param name    the name of the class to load
 * @param loaders additional classloaders to use to attempt to load the class
 * @return the class object
 * @throws ClassNotFoundException if the class cannot be found
 */
public static Class<?> classForName(String name,ClassLoader... loaders) throws ClassNotFoundException {
  try {
    if (Thread.currentThread().getContextClassLoader() != null) {
      return Class.forName(name,true,Thread.currentThread().getContextClassLoader());
    }
 else {
      return Class.forName(name);
    }
  }
 catch (  ClassNotFoundException e) {
    for (    ClassLoader l : loaders) {
      try {
        return Class.forName(name,true,l);
      }
 catch (      ClassNotFoundException ex) {
      }
    }
  }
  if (Thread.currentThread().getContextClassLoader() != null) {
    throw new ClassNotFoundException(String.format("String_Node_Str",name,Thread.currentThread().getContextClassLoader(),loaders));
  }
 else {
    throw new ClassNotFoundException("String_Node_Str" + name + "String_Node_Str"+ Arrays.toString(loaders));
  }
}
Program: 52853
Project: 52853
Buggy source:
private static String buildInvokeMethodErrorMessage(Method method,Object obj,Object... args){
  StringBuilder message=new StringBuilder(String.format("String_Node_Str",method.getName(),obj));
  if (args != null)   for (int i=0; i < args.length; i++)   message.append((i > 0 ? "String_Node_Str" : "String_Node_Str") + args[i]);
  message.append("String_Node_Str");
  return message.toString();
}

Fixed version (ground truth):
private static String buildInvokeMethodErrorMessage(Method method,Object obj,Object... args){
  StringBuilder message=new StringBuilder(String.format("String_Node_Str",method.getName(),obj));
  if (args != null) {
    for (int i=0; i < args.length; i++) {
      message.append((i > 0 ? "String_Node_Str" : "String_Node_Str") + args[i]);
    }
  }
  message.append("String_Node_Str");
  return message.toString();
}