nus-yam/ex-repair huggingface dataset:
Program: 51109
Project: 51109
Buggy source:
public Set<Class<?>> getClasses(){
  return providers;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Set<Class<?>> getClasses(){
  return providers;
}
Program: 51110
Project: 51110
Buggy source:
public boolean getFeature(String featureName){
  final Boolean v=features.get(featureName);
  return (v != null) ? v : false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean getFeature(String featureName){
  final Boolean v=features.get(featureName);
  return (v != null) ? v : false;
}
Program: 51111
Project: 51111
Buggy source:
public OAuthProviderInjectionProvider(@Context ProviderServices ps){
  Iterator<OAuthProvider> providers=ps.getProviders(OAuthProvider.class).iterator();
  if (!providers.hasNext()) {
    throw new RuntimeException("String_Node_Str");
  }
  instance=providers.next();
  if (providers.hasNext()) {
    StringBuilder sb=new StringBuilder("String_Node_Str");
    sb.append(instance.getClass().getName());
    while (providers.hasNext()) {
      sb.append("String_Node_Str").append(providers.next().getClass().getName());
    }
    LOGGER.warning(sb.toString());
  }
}

Fixed version (ground truth):
public OAuthProviderInjectionProvider(@Context ProviderServices ps){
  Iterator<OAuthProvider> providers=ps.getProviders(OAuthProvider.class).iterator();
  if (!providers.hasNext()) {
    instance=null;
  }
 else {
    instance=providers.next();
    if (providers.hasNext()) {
      StringBuilder sb=new StringBuilder("String_Node_Str");
      sb.append(instance.getClass().getName());
      while (providers.hasNext()) {
        sb.append("String_Node_Str").append(providers.next().getClass().getName());
      }
      LOGGER.warning(sb.toString());
    }
  }
}
Program: 51112
Project: 51112
Buggy source:
@Override public Injectable getInjectable(ComponentContext cc,Context a,Type t){
  if (t instanceof Class) {
    Class c=(Class)t;
    if (OAuthProvider.class.isAssignableFrom(c) && c.isInstance(instance)) {
      return this;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Injectable getInjectable(ComponentContext cc,Context a,Type t){
  if ((instance != null) && (t instanceof Class)) {
    Class c=(Class)t;
    if (OAuthProvider.class.isAssignableFrom(c) && c.isInstance(instance)) {
      return this;
    }
  }
  return null;
}
Program: 51113
Project: 51113
Buggy source:
public void testAuthDelete(){
  ResourceConfig rc=new DefaultResourceConfig(AuthResource.class);
  startServer(rc);
  CredentialsProvider credentialsProvider=new org.apache.http.impl.client.BasicCredentialsProvider();
  credentialsProvider.setCredentials(AuthScope.ANY,new UsernamePasswordCredentials("String_Node_Str","String_Node_Str"));
  DefaultApacheHttpClient4Config config=new DefaultApacheHttpClient4Config();
  config.getProperties().put(ApacheHttpClient4Config.PROPERTY_CREDENTIALS_PROVIDER,credentialsProvider);
  ApacheHttpClient4 c=ApacheHttpClient4.create(config);
  WebResource r=c.resource(getUri().path("String_Node_Str").build());
  ClientResponse response=r.delete(ClientResponse.class);
  assertEquals(response.getStatus(),204);
}

Fixed version (ground truth):
public void testAuthDelete(){
  ResourceConfig rc=new DefaultResourceConfig(AuthResource.class);
  rc.getProperties().put(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS,LoggingFilter.class.getName());
  rc.getProperties().put(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS,LoggingFilter.class.getName());
  startServer(rc);
  CredentialsProvider credentialsProvider=new org.apache.http.impl.client.BasicCredentialsProvider();
  credentialsProvider.setCredentials(AuthScope.ANY,new UsernamePasswordCredentials("String_Node_Str","String_Node_Str"));
  DefaultApacheHttpClient4Config config=new DefaultApacheHttpClient4Config();
  config.getProperties().put(ApacheHttpClient4Config.PROPERTY_CREDENTIALS_PROVIDER,credentialsProvider);
  ApacheHttpClient4 c=ApacheHttpClient4.create(config);
  WebResource r=c.resource(getUri().path("String_Node_Str").build());
  ClientResponse response=r.delete(ClientResponse.class);
  assertEquals(response.getStatus(),204);
}
Program: 51114
Project: 51114
Buggy source:
public void testAuthDeleteWithClientFilter(){
  ResourceConfig rc=new DefaultResourceConfig(AuthResource.class);
  startServer(rc);
  ApacheHttpClient4 c=ApacheHttpClient4.create();
  c.addFilter(new HTTPBasicAuthFilter("String_Node_Str","String_Node_Str"));
  WebResource r=c.resource(getUri().path("String_Node_Str").build());
  ClientResponse response=r.delete(ClientResponse.class);
  assertEquals(204,response.getStatus());
}

Fixed version (ground truth):
public void testAuthDeleteWithClientFilter(){
  ResourceConfig rc=new DefaultResourceConfig(AuthResource.class);
  rc.getProperties().put(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS,LoggingFilter.class.getName());
  rc.getProperties().put(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS,LoggingFilter.class.getName());
  startServer(rc);
  ApacheHttpClient4 c=ApacheHttpClient4.create();
  c.addFilter(new HTTPBasicAuthFilter("String_Node_Str","String_Node_Str"));
  WebResource r=c.resource(getUri().path("String_Node_Str").build());
  ClientResponse response=r.delete(ClientResponse.class);
  assertEquals(204,response.getStatus());
}
Program: 51115
Project: 51115
Buggy source:
public AnnotatedParameterImpl(AnnotatedParameter<T> param,Set<Annotation> annotations,AnnotatedCallable<T> declaringCallable){
  this(param.getBaseType(),param.getTypeClosure(),annotations,declaringCallable,param.getPosition());
}

Fixed version (ground truth):
public AnnotatedParameterImpl(AnnotatedParameter<? super T> param,Set<Annotation> annotations,AnnotatedCallable<T> declaringCallable){
  this(param.getBaseType(),param.getTypeClosure(),annotations,declaringCallable,param.getPosition());
}
Program: 51116
Project: 51116
Buggy source:
private <T>void patchAnnotatedCallable(AnnotatedCallable<T> callable,AnnotatedCallableImpl<T> newCallable,Map<AnnotatedParameter<T>,PatchInformation> parameterToPatchInfoMap){
  List<AnnotatedParameter<T>> newParams=new ArrayList<AnnotatedParameter<T>>();
  for (  AnnotatedParameter<T> parameter : callable.getParameters()) {
    PatchInformation patchInfo=parameterToPatchInfoMap.get(parameter);
    if (patchInfo != null) {
      Set<Annotation> annotations=new HashSet<Annotation>();
      if (patchInfo.mustAddInject()) {
        annotations.add(injectAnnotationLiteral);
      }
      if (patchInfo.getSyntheticQualifier() != null) {
        annotations.add(patchInfo.getSyntheticQualifier());
        Annotation skippedQualifier=patchInfo.getParameter().getAnnotation();
        for (        Annotation annotation : parameter.getAnnotations()) {
          if (annotation != skippedQualifier) {
            annotations.add(annotation);
          }
        }
      }
 else {
        annotations.addAll(parameter.getAnnotations());
      }
      if (patchInfo.getAnnotation() != null) {
        annotations.add(patchInfo.getAnnotation());
      }
      newParams.add(new AnnotatedParameterImpl<T>(parameter,annotations,callable));
    }
 else {
      newParams.add(new AnnotatedParameterImpl<T>(parameter,newCallable));
    }
  }
  newCallable.setParameters(newParams);
}

Fixed version (ground truth):
private <T>void patchAnnotatedCallable(AnnotatedCallable<? super T> callable,AnnotatedCallableImpl<T> newCallable,Map<AnnotatedParameter<? super T>,PatchInformation> parameterToPatchInfoMap){
  List<AnnotatedParameter<T>> newParams=new ArrayList<AnnotatedParameter<T>>();
  for (  AnnotatedParameter<? super T> parameter : callable.getParameters()) {
    PatchInformation patchInfo=parameterToPatchInfoMap.get(parameter);
    if (patchInfo != null) {
      Set<Annotation> annotations=new HashSet<Annotation>();
      if (patchInfo.mustAddInject()) {
        annotations.add(injectAnnotationLiteral);
      }
      if (patchInfo.getSyntheticQualifier() != null) {
        annotations.add(patchInfo.getSyntheticQualifier());
        Annotation skippedQualifier=patchInfo.getParameter().getAnnotation();
        for (        Annotation annotation : parameter.getAnnotations()) {
          if (annotation != skippedQualifier) {
            annotations.add(annotation);
          }
        }
      }
 else {
        annotations.addAll(parameter.getAnnotations());
      }
      if (patchInfo.getAnnotation() != null) {
        annotations.add(patchInfo.getAnnotation());
      }
      newParams.add(new AnnotatedParameterImpl<T>(parameter,annotations,newCallable));
    }
 else {
      newParams.add(new AnnotatedParameterImpl<T>(parameter,newCallable));
    }
  }
  newCallable.setParameters(newParams);
}
Program: 51118
Project: 51118
Buggy source:
private <T>boolean processAnnotatedField(AnnotatedField<T> field,boolean classHasEncodedAnnotation,Map<AnnotatedField<T>,PatchInformation> fieldToPatchInfoMap){
  boolean mustPatch=false;
  for (  Annotation annotation : field.getAnnotations()) {
    if (knownParameterQualifiers.contains(annotation.annotationType())) {
      boolean mustAddInjectAnnotation=!field.isAnnotationPresent(Inject.class);
      if (field.isAnnotationPresent(Encoded.class) || classHasEncodedAnnotation || mustAddInjectAnnotation|| field.isAnnotationPresent(DefaultValue.class)) {
        mustPatch=true;
      }
      Set<DiscoveredParameter> discovered=discoveredParameterMap.get(annotation.annotationType());
      if (discovered != null) {
        boolean encoded=field.isAnnotationPresent(Encoded.class) || classHasEncodedAnnotation;
        DefaultValue defaultValue=field.getAnnotation(DefaultValue.class);
        DiscoveredParameter parameter=new DiscoveredParameter(annotation,field.getBaseType(),defaultValue,encoded);
        discovered.add(parameter);
        LOGGER.fine("String_Node_Str" + parameter);
        fieldToPatchInfoMap.put(field,new PatchInformation(parameter,getSyntheticQualifierFor(parameter),mustAddInjectAnnotation));
      }
    }
  }
  return mustPatch;
}

Fixed version (ground truth):
private <T>boolean processAnnotatedField(AnnotatedField<? super T> field,Class<T> token,boolean classHasEncodedAnnotation,Map<AnnotatedField<? super T>,PatchInformation> fieldToPatchInfoMap){
  boolean mustPatch=false;
  for (  Annotation annotation : field.getAnnotations()) {
    if (knownParameterQualifiers.contains(annotation.annotationType())) {
      boolean mustAddInjectAnnotation=!field.isAnnotationPresent(Inject.class);
      if (field.isAnnotationPresent(Encoded.class) || classHasEncodedAnnotation || mustAddInjectAnnotation|| field.isAnnotationPresent(DefaultValue.class)) {
        mustPatch=true;
      }
      Set<DiscoveredParameter> discovered=discoveredParameterMap.get(annotation.annotationType());
      if (discovered != null) {
        boolean encoded=field.isAnnotationPresent(Encoded.class) || classHasEncodedAnnotation;
        DefaultValue defaultValue=field.getAnnotation(DefaultValue.class);
        DiscoveredParameter parameter=new DiscoveredParameter(annotation,field.getBaseType(),defaultValue,encoded);
        discovered.add(parameter);
        LOGGER.fine("String_Node_Str" + parameter);
        fieldToPatchInfoMap.put(field,new PatchInformation(parameter,getSyntheticQualifierFor(parameter),mustAddInjectAnnotation));
      }
    }
  }
  return mustPatch;
}
Program: 51119
Project: 51119
Buggy source:
void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event){
  LOGGER.fine("String_Node_Str");
  initialize();
  for (  Class<? extends Annotation> qualifier : knownParameterQualifiers) {
    event.addQualifier(qualifier);
  }
}

Fixed version (ground truth):
void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event,BeanManager manager){
  LOGGER.fine("String_Node_Str");
  initialize(manager);
  for (  Class<? extends Annotation> qualifier : knownParameterQualifiers) {
    event.addQualifier(qualifier);
  }
}
Program: 51120
Project: 51120
Buggy source:
private <T>void copyParametersOfAnnotatedCallable(AnnotatedCallable<T> callable,AnnotatedCallableImpl<T> newCallable){
  List<AnnotatedParameter<T>> newParams=new ArrayList<AnnotatedParameter<T>>();
  for (  AnnotatedParameter<T> parameter : callable.getParameters()) {
    newParams.add(new AnnotatedParameterImpl<T>(parameter,newCallable));
  }
  newCallable.setParameters(newParams);
}

Fixed version (ground truth):
private <T>void copyParametersOfAnnotatedCallable(AnnotatedCallable<? super T> callable,AnnotatedCallableImpl<T> newCallable){
  List<AnnotatedParameter<T>> newParams=new ArrayList<AnnotatedParameter<T>>();
  for (  AnnotatedParameter<? super T> parameter : callable.getParameters()) {
    newParams.add(new AnnotatedParameterImpl<T>(parameter,newCallable));
  }
  newCallable.setParameters(newParams);
}
Program: 51124
Project: 51124
Buggy source:
public char next(){
  if (!hasNext())   throw new NoSuchElementException();
  return s.charAt(pos++);
}

Fixed version (ground truth):
@Override public char next(){
  if (!hasNext()) {
    throw new NoSuchElementException();
  }
  return s.charAt(pos++);
}
Program: 51126
Project: 51126
Buggy source:
/** 
 * Get the group indexes to capturing groups. <p> Any nested capturing groups will be ignored and the the group index will refer to the top-level capturing groups associated with the templates variables.
 * @return the group indexes to capturing groups.
 */
public final int[] getGroupIndexes(){
  if (names.isEmpty())   return EMPTY_INT_ARRAY;
  int[] indexes=new int[names.size() + 1];
  indexes[0]=1;
  for (int i=1; i < indexes.length; i++) {
    indexes[i]=indexes[i - 1] + groupCounts.get(i - 1);
  }
  for (int i=0; i < indexes.length; i++) {
    if (indexes[i] != i + 1)     return indexes;
  }
  return EMPTY_INT_ARRAY;
}

Fixed version (ground truth):
/** 
 * Get the group indexes to capturing groups. <p> Any nested capturing groups will be ignored and the the group index will refer to the top-level capturing groups associated with the templates variables.
 * @return the group indexes to capturing groups.
 */
public final int[] getGroupIndexes(){
  if (names.isEmpty()) {
    return EMPTY_INT_ARRAY;
  }
  int[] indexes=new int[names.size() + 1];
  indexes[0]=1;
  for (int i=1; i < indexes.length; i++) {
    indexes[i]=indexes[i - 1] + groupCounts.get(i - 1);
  }
  for (int i=0; i < indexes.length; i++) {
    if (indexes[i] != i + 1) {
      return indexes;
    }
  }
  return EMPTY_INT_ARRAY;
}
Program: 51127
Project: 51127
Buggy source:
public boolean hasNext(){
  return pos < s.length();
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  return pos < s.length();
}
Program: 51128
Project: 51128
Buggy source:
private void parse(CharacterIterator ci){
  try {
    while (ci.hasNext()) {
      char c=ci.next();
      if (c == '{') {
        processLiteralCharacters();
        parseName(ci);
      }
 else {
        literalCharactersBuffer.append(c);
      }
    }
    processLiteralCharacters();
  }
 catch (  NoSuchElementException ex) {
    throw new IllegalArgumentException("String_Node_Str" + template + "String_Node_Str",ex);
  }
}

Fixed version (ground truth):
private void parse(final CharacterIterator ci){
  try {
    while (ci.hasNext()) {
      char c=ci.next();
      if (c == '{') {
        processLiteralCharacters();
        parseName(ci);
      }
 else {
        literalCharactersBuffer.append(c);
      }
    }
    processLiteralCharacters();
  }
 catch (  NoSuchElementException ex) {
    throw new IllegalArgumentException("String_Node_Str" + template + "String_Node_Str",ex);
  }
}
Program: 51129
Project: 51129
Buggy source:
public char peek(){
  if (!hasNext())   throw new NoSuchElementException();
  return s.charAt(pos++);
}

Fixed version (ground truth):
@Override public char peek(){
  if (!hasNext()) {
    throw new NoSuchElementException();
  }
  return s.charAt(pos++);
}
Program: 51130
Project: 51130
Buggy source:
/** 
 * Encode literal characters of a template.
 * @param literalCharacters the literal characters
 * @return the encoded literal characters.
 */
protected String encodeLiteralCharacters(String literalCharacters){
  return literalCharacters;
}

Fixed version (ground truth):
/** 
 * Encode literal characters of a template.
 * @param characters the literal characters
 * @return the encoded literal characters.
 */
protected String encodeLiteralCharacters(final String characters){
  return characters;
}
Program: 51131
Project: 51131
Buggy source:
public int pos(){
  if (pos == 0)   return 0;
  return pos - 1;
}

Fixed version (ground truth):
@Override public int pos(){
  if (pos == 0) {
    return 0;
  }
  return pos - 1;
}
Program: 51132
Project: 51132
Buggy source:
private void processLiteralCharacters(){
  if (literalCharactersBuffer.length() > 0) {
    literalCharacters+=literalCharactersBuffer.length();
    String s=encodeLiteralCharacters(literalCharactersBuffer.toString());
    normalizedTemplate.append(s);
    for (int i=0; i < s.length(); i++) {
      char c=s.charAt(i);
      if (RESERVED_REGEX_CHARACTERS.contains(c))       regex.append("String_Node_Str");
      regex.append(c);
    }
    literalCharactersBuffer.setLength(0);
  }
}

Fixed version (ground truth):
private void processLiteralCharacters(){
  if (literalCharactersBuffer.length() > 0) {
    literalCharacters+=literalCharactersBuffer.length();
    String s=encodeLiteralCharacters(literalCharactersBuffer.toString());
    normalizedTemplate.append(s);
    for (int i=0; i < s.length(); i++) {
      char c=s.charAt(i);
      if (RESERVED_REGEX_CHARACTERS.contains(c)) {
        regex.append("String_Node_Str");
      }
      regex.append(c);
    }
    literalCharactersBuffer.setLength(0);
  }
}
Program: 51133
Project: 51133
Buggy source:
private String parseRegex(CharacterIterator ci){
  StringBuffer regexBuffer=new StringBuffer();
  int braceCount=1;
  while (true) {
    char c=ci.next();
    if (c == '{') {
      braceCount++;
    }
 else     if (c == '}') {
      braceCount--;
      if (braceCount == 0)       break;
    }
    regexBuffer.append(c);
  }
  return regexBuffer.toString().trim();
}

Fixed version (ground truth):
private String parseRegex(final CharacterIterator ci){
  StringBuilder regexBuffer=new StringBuilder();
  int braceCount=1;
  while (true) {
    char c=ci.next();
    if (c == '{') {
      braceCount++;
    }
 else     if (c == '}') {
      braceCount--;
      if (braceCount == 0) {
        break;
      }
    }
    regexBuffer.append(c);
  }
  return regexBuffer.toString().trim();
}
Program: 51134
Project: 51134
Buggy source:
/** 
 * Parse a template.
 * @param template the template.
 * @throws IllegalArgumentException if the template is null, an empty stringor does not conform to a JAX-RS URI template.
 */
public UriTemplateParser(String template){
  if (template == null || template.length() == 0)   throw new IllegalArgumentException();
  this.template=template;
  parse(new StringCharacterIterator(template));
  try {
    pattern=Pattern.compile(regex.toString());
  }
 catch (  PatternSyntaxException ex) {
    throw new IllegalArgumentException("String_Node_Str" + regex + "String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Parse a template.
 * @param template the template.
 * @throws IllegalArgumentException if the template is null, an empty stringor does not conform to a JAX-RS URI template.
 */
public UriTemplateParser(final String template) throws IllegalArgumentException {
  if (template == null || template.length() == 0) {
    throw new IllegalArgumentException();
  }
  this.template=template;
  parse(new StringCharacterIterator(template));
  try {
    pattern=Pattern.compile(regex.toString());
  }
 catch (  PatternSyntaxException ex) {
    throw new IllegalArgumentException("String_Node_Str" + regex + "String_Node_Str",ex);
  }
}
Program: 51135
Project: 51135
Buggy source:
@Override public OAuthProvider getValue(){
  return instance.get();
}

Fixed version (ground truth):
@Override public OAuthProvider getValue(){
  return instance;
}
Program: 51136
Project: 51136
Buggy source:
@Override public Injectable getInjectable(ComponentContext cc,Context a,Type t){
  if (t instanceof Class) {
    Class c=(Class)t;
    if (OAuthProvider.class.isAssignableFrom(c) && c.isInstance(instance.get())) {
      return this;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Injectable getInjectable(ComponentContext cc,Context a,Type t){
  if (t instanceof Class) {
    Class c=(Class)t;
    if (OAuthProvider.class.isAssignableFrom(c) && c.isInstance(instance)) {
      return this;
    }
  }
  return null;
}
Program: 51137
Project: 51137
Buggy source:
/** 
 * Geneerates a new non-guessable random string (used for token/customer strings, secrets and verifier.
 * @return Random UUID string.
 */
protected String newUUIDString(){
  String tmp=UUID.randomUUID().toString();
  return tmp.replaceAll("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Generates a new non-guessable random string (used for token/customer strings, secrets and verifier.
 * @return Random UUID string.
 */
protected String newUUIDString(){
  String tmp=UUID.randomUUID().toString();
  return tmp.replaceAll("String_Node_Str","String_Node_Str");
}
Program: 51139
Project: 51139
Buggy source:
/** 
 * Get the mutable property bag.
 * @return the property bag.
 */
public Map<String,Object> getProperties(){
  if (properties == null)   properties=new CopyOnCloneRefCountHashMap<String,Object>();
  return properties;
}

Fixed version (ground truth):
/** 
 * Get the mutable property bag.
 * @return the property bag.
 */
public Map<String,Object> getProperties(){
  if (properties == null)   properties=new CopyOnWriteHashMap<String,Object>();
  return properties;
}
Program: 51140
Project: 51140
Buggy source:
/** 
 * Gets WebResource related properties. <p>Properties are inherited, so setting propeties on "parent" WebResource instance, creating child (for example via WebResource.path("subpath")) will set parents properties on it. However changing child properties won't cause change in parent's properties. <p>Methods entrySet(), keySet() and values() are returning read-only results (via Collection.unmodifiableMap).
 * @return map containg all properties.
 */
public Map<String,Object> getProperties(){
  if (properties == null) {
    properties=new CopyOnCloneRefCountHashMap<String,Object>();
  }
  return properties;
}

Fixed version (ground truth):
/** 
 * Gets WebResource related properties. <p>Properties are inherited, so setting propeties on "parent" WebResource instance, creating child (for example via WebResource.path("subpath")) will set parents properties on it. However changing child properties won't cause change in parent's properties. <p>Methods entrySet(), keySet() and values() are returning read-only results (via Collection.unmodifiableMap).
 * @return map containg all properties.
 */
public Map<String,Object> getProperties(){
  if (properties == null) {
    properties=new CopyOnWriteHashMap<String,Object>();
  }
  return properties;
}
Program: 51141
Project: 51141
Buggy source:
public void testClone(){
  CopyOnCloneRefCountHashMap<String,String> map1=new CopyOnCloneRefCountHashMap<String,String>();
  map1.put("String_Node_Str","String_Node_Str");
  CopyOnCloneRefCountHashMap<String,String> map2=map1.clone();
  map2.put("String_Node_Str","String_Node_Str");
  assertTrue(map1.containsKey("String_Node_Str"));
  assertFalse(map1.containsKey("String_Node_Str"));
  assertTrue(map2.containsKey("String_Node_Str"));
  assertTrue(map2.containsKey("String_Node_Str"));
}

Fixed version (ground truth):
public void testClone(){
  CopyOnWriteHashMap<String,String> map1=new CopyOnWriteHashMap<String,String>();
  map1.put("String_Node_Str","String_Node_Str");
  CopyOnWriteHashMap<String,String> map2=map1.clone();
  map2.put("String_Node_Str","String_Node_Str");
  assertTrue(map1.containsKey("String_Node_Str"));
  assertFalse(map1.containsKey("String_Node_Str"));
  assertTrue(map2.containsKey("String_Node_Str"));
  assertTrue(map2.containsKey("String_Node_Str"));
}
Program: 51142
Project: 51142
Buggy source:
public String name(){
  return NAME;
}

Fixed version (ground truth):
@Override public String name(){
  return NAME;
}
Program: 51145
Project: 51145
Buggy source:
public <T>MessageBodyWriter<T> getMessageBodyWriter(Class<T> c,Type t,Annotation[] as,MediaType mediaType){
  MessageBodyWriter p=null;
  if (!customWriterProviders.isEmpty())   p=_getMessageBodyWriter(c,t,as,mediaType,customWriterProviders);
  if (p != null)   return p;
  p=_getMessageBodyWriter(c,t,as,mediaType,writerProviders);
  return p;
}

Fixed version (ground truth):
public <T>MessageBodyWriter<T> getMessageBodyWriter(Class<T> c,Type t,Annotation[] as,MediaType mediaType){
  MessageBodyWriter p;
  if (!customWriterProviders.isEmpty()) {
    p=_getMessageBodyWriter(c,t,as,mediaType,customWriterProviders);
    if (p != null)     return p;
  }
  p=_getMessageBodyWriter(c,t,as,mediaType,writerProviders);
  return p;
}
Program: 51146
Project: 51146
Buggy source:
public <T>MessageBodyReader<T> getMessageBodyReader(Class<T> c,Type t,Annotation[] as,MediaType mediaType){
  MessageBodyReader reader=null;
  if (!customReaderProviders.isEmpty())   reader=_getMessageBodyReader(c,t,as,mediaType,customReaderProviders);
  if (reader != null)   return reader;
  reader=_getMessageBodyReader(c,t,as,mediaType,readerProviders);
  return reader;
}

Fixed version (ground truth):
public <T>MessageBodyReader<T> getMessageBodyReader(Class<T> c,Type t,Annotation[] as,MediaType mediaType){
  MessageBodyReader reader;
  if (!customReaderProviders.isEmpty()) {
    reader=_getMessageBodyReader(c,t,as,mediaType,customReaderProviders);
    if (reader != null)     return reader;
  }
  reader=_getMessageBodyReader(c,t,as,mediaType,readerProviders);
  return reader;
}
Program: 51148
Project: 51148
Buggy source:
private <T>MessageBodyReader<T> _getMessageBodyReader(Class<T> c,Type t,Annotation[] as,MediaType mediaType,MediaType lookup){
  List<MessageBodyReader> readers=readerProviders.get(lookup);
  if (readers == null)   return null;
  for (  MessageBodyReader p : readers) {
    if (p.isReadable(c,t,as,mediaType))     return p;
  }
  return null;
}

Fixed version (ground truth):
private <T>MessageBodyReader<T> _getMessageBodyReader(Class<T> c,Type t,Annotation[] as,MediaType mediaType,MediaType lookup,Map<MediaType,List<MessageBodyReader>> providers){
  List<MessageBodyReader> readers=providers.get(lookup);
  if (readers == null)   return null;
  for (  MessageBodyReader p : readers) {
    if (p.isReadable(c,t,as,mediaType)) {
      return p;
    }
  }
  return null;
}
Program: 51149
Project: 51149
Buggy source:
public <T>List<MediaType> getMessageBodyWriterMediaTypes(Class<T> c,Type t,Annotation[] as){
  List<MediaType> mtl=new ArrayList<MediaType>();
  for (  MessageBodyWriterPair mbwp : writerListProviders) {
    if (mbwp.mbw.isWriteable(c,t,as,MediaType.APPLICATION_OCTET_STREAM_TYPE)) {
      mtl.addAll(mbwp.types);
    }
  }
  Collections.sort(mtl,MediaTypes.MEDIA_TYPE_COMPARATOR);
  return mtl;
}

Fixed version (ground truth):
public <T>List<MediaType> getMessageBodyWriterMediaTypes(Class<T> c,Type t,Annotation[] as){
  List<MediaType> mtl=new ArrayList<MediaType>();
  for (  MessageBodyWriterPair mbwp : customWriterListProviders) {
    if (mbwp.mbw.isWriteable(c,t,as,MediaType.APPLICATION_OCTET_STREAM_TYPE)) {
      mtl.addAll(mbwp.types);
    }
  }
  for (  MessageBodyWriterPair mbwp : writerListProviders) {
    if (mbwp.mbw.isWriteable(c,t,as,MediaType.APPLICATION_OCTET_STREAM_TYPE)) {
      mtl.addAll(mbwp.types);
    }
  }
  Collections.sort(mtl,MediaTypes.MEDIA_TYPE_COMPARATOR);
  return mtl;
}
Program: 51150
Project: 51150
Buggy source:
private void initWriters(){
  this.writerProviders=new KeyComparatorHashMap<MediaType,List<MessageBodyWriter>>(MEDIA_TYPE_COMPARATOR);
  this.writerListProviders=new ArrayList<MessageBodyWriterPair>();
  for (  MessageBodyWriter provider : providerServices.getProvidersAndServices(MessageBodyWriter.class)) {
    List<MediaType> values=MediaTypes.createMediaTypes(provider.getClass().getAnnotation(Produces.class));
    for (    MediaType type : values)     getClassCapability(writerProviders,provider,type);
    writerListProviders.add(new MessageBodyWriterPair(provider,values));
  }
  final DistanceComparator<MessageBodyWriter> dc=new DistanceComparator<MessageBodyWriter>(MessageBodyWriter.class);
  for (  Map.Entry<MediaType,List<MessageBodyWriter>> e : writerProviders.entrySet()) {
    Collections.sort(e.getValue(),dc);
  }
  Collections.sort(writerListProviders,new Comparator<MessageBodyWriterPair>(){
    public int compare(    MessageBodyWriterPair p1,    MessageBodyWriterPair p2){
      return dc.compare(p1.mbw,p2.mbw);
    }
  }
);
}

Fixed version (ground truth):
private void initWriters(Map<MediaType,List<MessageBodyWriter>> providersMap,List<MessageBodyWriterPair> listProviders,Set<MessageBodyWriter> providersSet){
  for (  MessageBodyWriter provider : providersSet) {
    List<MediaType> values=MediaTypes.createMediaTypes(provider.getClass().getAnnotation(Produces.class));
    for (    MediaType type : values)     getClassCapability(providersMap,provider,type);
    listProviders.add(new MessageBodyWriterPair(provider,values));
  }
  final DistanceComparator<MessageBodyWriter> dc=new DistanceComparator<MessageBodyWriter>(MessageBodyWriter.class);
  for (  Map.Entry<MediaType,List<MessageBodyWriter>> e : providersMap.entrySet()) {
    Collections.sort(e.getValue(),dc);
  }
  Collections.sort(listProviders,new Comparator<MessageBodyWriterPair>(){
    public int compare(    MessageBodyWriterPair p1,    MessageBodyWriterPair p2){
      return dc.compare(p1.mbw,p2.mbw);
    }
  }
);
}
Program: 51151
Project: 51151
Buggy source:
public <T>MediaType getMessageBodyWriterMediaType(Class<T> c,Type t,Annotation[] as,List<MediaType> acceptableMediaTypes){
  for (  MediaType acceptable : acceptableMediaTypes) {
    for (    MessageBodyWriterPair mbwp : writerListProviders) {
      for (      MediaType mt : mbwp.types) {
        if (mt.isCompatible(acceptable) && mbwp.mbw.isWriteable(c,t,as,acceptable)) {
          return MediaTypes.mostSpecific(mt,acceptable);
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public <T>MediaType getMessageBodyWriterMediaType(Class<T> c,Type t,Annotation[] as,List<MediaType> acceptableMediaTypes){
  for (  MediaType acceptable : acceptableMediaTypes) {
    for (    MessageBodyWriterPair mbwp : customWriterListProviders) {
      for (      MediaType mt : mbwp.types) {
        if (mt.isCompatible(acceptable) && mbwp.mbw.isWriteable(c,t,as,acceptable)) {
          return MediaTypes.mostSpecific(mt,acceptable);
        }
      }
    }
    for (    MessageBodyWriterPair mbwp : writerListProviders) {
      for (      MediaType mt : mbwp.types) {
        if (mt.isCompatible(acceptable) && mbwp.mbw.isWriteable(c,t,as,acceptable)) {
          return MediaTypes.mostSpecific(mt,acceptable);
        }
      }
    }
  }
  return null;
}
Program: 51152
Project: 51152
Buggy source:
public MessageBodyFactory(ProviderServices providerServices){
  this.providerServices=providerServices;
}

Fixed version (ground truth):
public MessageBodyFactory(ProviderServices providerServices,boolean deprecatedProviderPrecedence){
  this.providerServices=providerServices;
  this.deprecatedProviderPrecedence=deprecatedProviderPrecedence;
}
Program: 51153
Project: 51153
Buggy source:
private void initReaders(){
  this.readerProviders=new KeyComparatorHashMap<MediaType,List<MessageBodyReader>>(MEDIA_TYPE_COMPARATOR);
  for (  MessageBodyReader provider : providerServices.getProvidersAndServices(MessageBodyReader.class)) {
    List<MediaType> values=MediaTypes.createMediaTypes(provider.getClass().getAnnotation(Consumes.class));
    for (    MediaType type : values)     getClassCapability(readerProviders,provider,type);
  }
  DistanceComparator<MessageBodyReader> dc=new DistanceComparator<MessageBodyReader>(MessageBodyReader.class);
  for (  Map.Entry<MediaType,List<MessageBodyReader>> e : readerProviders.entrySet()) {
    Collections.sort(e.getValue(),dc);
  }
}

Fixed version (ground truth):
private void initReaders(Map<MediaType,List<MessageBodyReader>> providersMap,Set<MessageBodyReader> providersSet){
  for (  MessageBodyReader provider : providersSet) {
    List<MediaType> values=MediaTypes.createMediaTypes(provider.getClass().getAnnotation(Consumes.class));
    for (    MediaType type : values)     getClassCapability(providersMap,provider,type);
  }
  DistanceComparator<MessageBodyReader> dc=new DistanceComparator<MessageBodyReader>(MessageBodyReader.class);
  for (  Map.Entry<MediaType,List<MessageBodyReader>> e : providersMap.entrySet()) {
    Collections.sort(e.getValue(),dc);
  }
}
Program: 51154
Project: 51154
Buggy source:
public <T>MessageBodyWriter<T> getMessageBodyWriter(Class<T> c,Type t,Annotation[] as,MediaType mediaType){
  MessageBodyWriter p=null;
  if (mediaType != null) {
    p=_getMessageBodyWriter(c,t,as,mediaType,mediaType);
    if (p == null)     p=_getMessageBodyWriter(c,t,as,mediaType,new MediaType(mediaType.getType(),MediaType.MEDIA_TYPE_WILDCARD));
  }
  if (p == null)   p=_getMessageBodyWriter(c,t,as,mediaType,MediaTypes.GENERAL_MEDIA_TYPE);
  return p;
}

Fixed version (ground truth):
public <T>MessageBodyWriter<T> getMessageBodyWriter(Class<T> c,Type t,Annotation[] as,MediaType mediaType){
  MessageBodyWriter p;
  p=_getMessageBodyWriter(c,t,as,mediaType,customWriterProviders);
  if (p != null)   return p;
  p=_getMessageBodyWriter(c,t,as,mediaType,writerProviders);
  return p;
}
Program: 51155
Project: 51155
Buggy source:
private <T>MessageBodyWriter<T> _getMessageBodyWriter(Class<T> c,Type t,Annotation[] as,MediaType mediaType,MediaType lookup){
  List<MessageBodyWriter> writers=writerProviders.get(lookup);
  if (writers == null)   return null;
  for (  MessageBodyWriter p : writers) {
    if (p.isWriteable(c,t,as,mediaType))     return p;
  }
  return null;
}

Fixed version (ground truth):
private <T>MessageBodyWriter<T> _getMessageBodyWriter(Class<T> c,Type t,Annotation[] as,MediaType mediaType,MediaType lookup,Map<MediaType,List<MessageBodyWriter>> providers){
  List<MessageBodyWriter> writers=providers.get(lookup);
  if (writers == null)   return null;
  for (  MessageBodyWriter p : writers) {
    if (p.isWriteable(c,t,as,mediaType)) {
      return p;
    }
  }
  return null;
}
Program: 51156
Project: 51156
Buggy source:
public <T>MessageBodyReader<T> getMessageBodyReader(Class<T> c,Type t,Annotation[] as,MediaType mediaType){
  MessageBodyReader p=null;
  if (mediaType != null) {
    p=_getMessageBodyReader(c,t,as,mediaType,mediaType);
    if (p == null)     p=_getMessageBodyReader(c,t,as,mediaType,new MediaType(mediaType.getType(),MediaType.MEDIA_TYPE_WILDCARD));
  }
  if (p == null)   p=_getMessageBodyReader(c,t,as,mediaType,MediaTypes.GENERAL_MEDIA_TYPE);
  return p;
}

Fixed version (ground truth):
public <T>MessageBodyReader<T> getMessageBodyReader(Class<T> c,Type t,Annotation[] as,MediaType mediaType){
  MessageBodyReader reader;
  reader=_getMessageBodyReader(c,t,as,mediaType,customReaderProviders);
  if (reader != null)   return reader;
  reader=_getMessageBodyReader(c,t,as,mediaType,readerProviders);
  return reader;
}
Program: 51157
Project: 51157
Buggy source:
public Map<MediaType,List<MessageBodyReader>> getReaders(MediaType mediaType){
  Map<MediaType,List<MessageBodyReader>> subSet=new KeyComparatorLinkedHashMap<MediaType,List<MessageBodyReader>>(MEDIA_TYPE_COMPARATOR);
  getCompatibleReadersWritersMap(mediaType,readerProviders,subSet);
  return subSet;
}

Fixed version (ground truth):
public Map<MediaType,List<MessageBodyReader>> getReaders(MediaType mediaType){
  Map<MediaType,List<MessageBodyReader>> subSet=new KeyComparatorLinkedHashMap<MediaType,List<MessageBodyReader>>(MEDIA_TYPE_COMPARATOR);
  getCompatibleReadersWritersMap(mediaType,customReaderProviders,subSet);
  getCompatibleReadersWritersMap(mediaType,readerProviders,subSet);
  return subSet;
}
Program: 51158
Project: 51158
Buggy source:
public Map<MediaType,List<MessageBodyWriter>> getWriters(MediaType mediaType){
  Map<MediaType,List<MessageBodyWriter>> subSet=new KeyComparatorLinkedHashMap<MediaType,List<MessageBodyWriter>>(MEDIA_TYPE_COMPARATOR);
  getCompatibleReadersWritersMap(mediaType,writerProviders,subSet);
  return subSet;
}

Fixed version (ground truth):
public Map<MediaType,List<MessageBodyWriter>> getWriters(MediaType mediaType){
  Map<MediaType,List<MessageBodyWriter>> subSet=new KeyComparatorLinkedHashMap<MediaType,List<MessageBodyWriter>>(MEDIA_TYPE_COMPARATOR);
  getCompatibleReadersWritersMap(mediaType,customWriterProviders,subSet);
  getCompatibleReadersWritersMap(mediaType,writerProviders,subSet);
  return subSet;
}
Program: 51159
Project: 51159
Buggy source:
public Map<MediaType,List<MessageBodyReader>> getReaders(MediaType mediaType){
  Map<MediaType,List<MessageBodyReader>> subSet=new KeyComparatorLinkedHashMap<MediaType,List<MessageBodyReader>>(MEDIA_TYPE_COMPARATOR);
  getCompatibleReadersWritersMap(mediaType,customReaderProviders,subSet);
  getCompatibleReadersWritersMap(mediaType,readerProviders,subSet);
  return subSet;
}

Fixed version (ground truth):
public Map<MediaType,List<MessageBodyReader>> getReaders(MediaType mediaType){
  Map<MediaType,List<MessageBodyReader>> subSet=new KeyComparatorLinkedHashMap<MediaType,List<MessageBodyReader>>(MEDIA_TYPE_COMPARATOR);
  if (!customReaderProviders.isEmpty())   getCompatibleReadersWritersMap(mediaType,customReaderProviders,subSet);
  getCompatibleReadersWritersMap(mediaType,readerProviders,subSet);
  return subSet;
}
Program: 51160
Project: 51160
Buggy source:
public Map<MediaType,List<MessageBodyWriter>> getWriters(MediaType mediaType){
  Map<MediaType,List<MessageBodyWriter>> subSet=new KeyComparatorLinkedHashMap<MediaType,List<MessageBodyWriter>>(MEDIA_TYPE_COMPARATOR);
  getCompatibleReadersWritersMap(mediaType,customWriterProviders,subSet);
  getCompatibleReadersWritersMap(mediaType,writerProviders,subSet);
  return subSet;
}

Fixed version (ground truth):
public Map<MediaType,List<MessageBodyWriter>> getWriters(MediaType mediaType){
  Map<MediaType,List<MessageBodyWriter>> subSet=new KeyComparatorLinkedHashMap<MediaType,List<MessageBodyWriter>>(MEDIA_TYPE_COMPARATOR);
  if (!customWriterProviders.isEmpty())   getCompatibleReadersWritersMap(mediaType,customWriterProviders,subSet);
  getCompatibleReadersWritersMap(mediaType,writerProviders,subSet);
  return subSet;
}
Program: 51161
Project: 51161
Buggy source:
public <T>MessageBodyWriter<T> getMessageBodyWriter(Class<T> c,Type t,Annotation[] as,MediaType mediaType){
  MessageBodyWriter p;
  p=_getMessageBodyWriter(c,t,as,mediaType,customWriterProviders);
  if (p != null)   return p;
  p=_getMessageBodyWriter(c,t,as,mediaType,writerProviders);
  return p;
}

Fixed version (ground truth):
public <T>MessageBodyWriter<T> getMessageBodyWriter(Class<T> c,Type t,Annotation[] as,MediaType mediaType){
  MessageBodyWriter p=null;
  if (!customWriterProviders.isEmpty())   p=_getMessageBodyWriter(c,t,as,mediaType,customWriterProviders);
  if (p != null)   return p;
  p=_getMessageBodyWriter(c,t,as,mediaType,writerProviders);
  return p;
}
Program: 51162
Project: 51162
Buggy source:
public <T>MessageBodyReader<T> getMessageBodyReader(Class<T> c,Type t,Annotation[] as,MediaType mediaType){
  MessageBodyReader reader;
  reader=_getMessageBodyReader(c,t,as,mediaType,customReaderProviders);
  if (reader != null)   return reader;
  reader=_getMessageBodyReader(c,t,as,mediaType,readerProviders);
  return reader;
}

Fixed version (ground truth):
public <T>MessageBodyReader<T> getMessageBodyReader(Class<T> c,Type t,Annotation[] as,MediaType mediaType){
  MessageBodyReader reader=null;
  if (!customReaderProviders.isEmpty())   reader=_getMessageBodyReader(c,t,as,mediaType,customReaderProviders);
  if (reader != null)   return reader;
  reader=_getMessageBodyReader(c,t,as,mediaType,readerProviders);
  return reader;
}
Program: 51163
Project: 51163
Buggy source:
private <T>void getCompatibleReadersWritersMap(MediaType mediaType,Map<MediaType,List<T>> set,Map<MediaType,List<T>> subSet){
  if (mediaType.isWildcardType()) {
    getCompatibleReadersWritersList(mediaType,set,subSet);
  }
 else   if (mediaType.isWildcardSubtype()) {
    getCompatibleReadersWritersList(mediaType,set,subSet);
    getCompatibleReadersWritersList(MediaTypes.GENERAL_MEDIA_TYPE,set,subSet);
  }
 else {
    getCompatibleReadersWritersList(mediaType,set,subSet);
    getCompatibleReadersWritersList(new MediaType(mediaType.getType(),MediaType.MEDIA_TYPE_WILDCARD),set,subSet);
    getCompatibleReadersWritersList(MediaTypes.GENERAL_MEDIA_TYPE,set,subSet);
  }
}

Fixed version (ground truth):
private <T>void getCompatibleReadersWritersMap(MediaType mediaType,Map<MediaType,List<T>> set,Map<MediaType,List<T>> subSet){
  if (mediaType.isWildcardType()) {
    getCompatibleReadersWritersList(mediaType,set,subSet);
  }
 else   if (mediaType.isWildcardSubtype()) {
    getCompatibleReadersWritersList(mediaType,set,subSet);
    getCompatibleReadersWritersList(MediaTypes.GENERAL_MEDIA_TYPE,set,subSet);
  }
 else {
    getCompatibleReadersWritersList(mediaType,set,subSet);
    getCompatibleReadersWritersList(MediaTypes.getTypeWildCart(mediaType),set,subSet);
    getCompatibleReadersWritersList(MediaTypes.GENERAL_MEDIA_TYPE,set,subSet);
  }
}
Program: 51164
Project: 51164
Buggy source:
public void testObjectResource2(){
  ResourceConfig rc=new DefaultResourceConfig(ObjectResource.class,ObjectWriter.class);
  initiateWebApplication(rc);
  WebResource r=resource("String_Node_Str");
  assertEquals("String_Node_Str",r.path("String_Node_Str").get(String.class));
  assertNotSame("String_Node_Str",r.path("String_Node_Str").get(String.class));
}

Fixed version (ground truth):
public void testObjectResource2(){
  ResourceConfig rc=new DefaultResourceConfig(ObjectResource.class,ObjectWriter.class);
  rc.getFeatures().put(FeaturesAndProperties.FEATURE_PRE_1_4_PROVIDER_PRECEDENCE,false);
  initiateWebApplication(rc);
  WebResource r=resource("String_Node_Str");
  assertEquals("String_Node_Str",r.path("String_Node_Str").get(String.class));
  assertNotSame("String_Node_Str",r.path("String_Node_Str").get(String.class));
}
Program: 51165
Project: 51165
Buggy source:
public WebApplicationContext createMatchResourceContext(URI u){
  final URI base=request.getBaseUri();
  if (u.isAbsolute()) {
    URI r=base.relativize(u);
    if (r == u) {
      throw new ContainerException("String_Node_Str" + u + "String_Node_Str"+ base);
    }
  }
 else {
    u=UriBuilder.fromUri(base).path(u.getRawPath()).replaceQuery(u.getRawQuery()).fragment(u.getRawFragment()).build();
  }
  final ContainerRequest _request=new ContainerRequest(app,HTTP_METHOD_MATCH_RESOURCE,base,u,new InBoundHeaders(),null);
  final ContainerResponse _response=new ContainerResponse(app,_request,null);
  return new WebApplicationContext(app,_request,_response);
}

Fixed version (ground truth):
public WebApplicationContext createMatchResourceContext(URI u){
  final URI base=request.getBaseUri();
  if (u.isAbsolute()) {
    URI r=base.relativize(u);
    if (r == u) {
      throw new ContainerException("String_Node_Str" + u + "String_Node_Str"+ base);
    }
  }
 else {
    u=UriBuilder.fromUri(base).path(u.getRawPath()).replaceQuery(u.getRawQuery()).fragment(u.getRawFragment()).build();
  }
  final ContainerRequest _request=new ContainerRequest(app,HTTP_METHOD_MATCH_RESOURCE,base,u,new InBoundHeaders(),null);
  _request.setSecurityContext(request);
  final ContainerResponse _response=new ContainerResponse(app,_request,null);
  return new WebApplicationContext(app,_request,_response);
}
Program: 51166
Project: 51166
Buggy source:
public ContainerRequest filter(ContainerRequest request){
  String user=request.getHeaderValue("String_Node_Str");
  request.setSecurityContext(new Authenticator(user));
  return request;
}

Fixed version (ground truth):
public ContainerRequest filter(ContainerRequest request){
  if (!request.getMethod().equals(WebApplicationContext.HTTP_METHOD_MATCH_RESOURCE)) {
    String user=request.getHeaderValue("String_Node_Str");
    request.setSecurityContext(new Authenticator(user));
  }
  return request;
}
Program: 51167
Project: 51167
Buggy source:
@RolesAllowed("String_Node_Str") @GET public String get(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@GET public String get(){
  return "String_Node_Str";
}
Program: 51168
Project: 51168
Buggy source:
private Bundle getJerseyServerBundle(BundleContext bc){
  for (  Bundle b : bc.getBundles()) {
    if (b.getSymbolicName().endsWith("String_Node_Str")) {
      return b;
    }
  }
  return null;
}

Fixed version (ground truth):
private Bundle getJerseyServerBundle(BundleContext bc){
  for (  Bundle b : bc.getBundles()) {
    final String symbolicName=b.getSymbolicName();
    if ((symbolicName != null) && symbolicName.endsWith("String_Node_Str")) {
      return b;
    }
  }
  return null;
}
Program: 51170
Project: 51170
Buggy source:
private JSONConfiguration(JSONConfiguration jsonConf,boolean formatted){
  notation=jsonConf.notation;
  arrays=jsonConf.arrays;
  attrsAsElems=jsonConf.attrsAsElems;
  nonStrings=jsonConf.nonStrings;
  rootUnwrapping=jsonConf.rootUnwrapping;
  humanReadableFormatting=formatted;
  jsonXml2JsonNs=jsonConf.jsonXml2JsonNs;
  usePrefixAtNaturalAttributes=jsonConf.usePrefixAtNaturalAttributes;
}

Fixed version (ground truth):
private JSONConfiguration(JSONConfiguration jsonConf,boolean formatted){
  notation=jsonConf.notation;
  arrays=jsonConf.arrays;
  attrsAsElems=jsonConf.attrsAsElems;
  nonStrings=jsonConf.nonStrings;
  rootUnwrapping=jsonConf.rootUnwrapping;
  humanReadableFormatting=formatted;
  jsonXml2JsonNs=jsonConf.jsonXml2JsonNs;
  usePrefixAtNaturalAttributes=jsonConf.usePrefixAtNaturalAttributes;
  namespaceSeparator=jsonConf.namespaceSeparator;
}
Program: 51171
Project: 51171
Buggy source:
private QName createQName(String name){
  if (revertedXml2JsonNs.isEmpty() || !name.contains("String_Node_Str")) {
    return new QName(name);
  }
 else {
    int dotIndex=name.indexOf("String_Node_Str");
    String prefix=name.substring(0,dotIndex);
    String suffix=name.substring(dotIndex + 1);
    return revertedXml2JsonNs.containsKey(prefix) ? new QName(revertedXml2JsonNs.get(prefix),suffix) : new QName(name);
  }
}

Fixed version (ground truth):
private QName createQName(String name){
  if (revertedXml2JsonNs.isEmpty() || !name.contains(nsSeparatorAsSequence)) {
    return new QName(name);
  }
 else {
    int dotIndex=name.indexOf(nsSeparator);
    String prefix=name.substring(0,dotIndex);
    String suffix=name.substring(dotIndex + 1);
    return revertedXml2JsonNs.containsKey(prefix) ? new QName(revertedXml2JsonNs.get(prefix),suffix) : new QName(name);
  }
}
Program: 51172
Project: 51172
Buggy source:
public JsonXmlStreamReader(Reader reader,String rootElementName,JSONConfiguration config) throws IOException {
  this.jsonRootUnwrapping=(rootElementName != null);
  this.rootElementName=rootElementName;
  if (config.getAttributeAsElements() != null) {
    this.attrAsElemNames.addAll(config.getAttributeAsElements());
  }
  if (config.getXml2JsonNs() != null) {
    for (    String uri : config.getXml2JsonNs().keySet())     revertedXml2JsonNs.put(config.getXml2JsonNs().get(uri),uri);
  }
  lexer=new JsonLexer(reader);
  depth=0;
  processingStack=new ArrayList<ProcessingState>();
  processingStack.add(new ProcessingState());
  readNext();
}

Fixed version (ground truth):
public JsonXmlStreamReader(Reader reader,String rootElementName,JSONConfiguration config) throws IOException {
  this.jsonRootUnwrapping=(rootElementName != null);
  this.rootElementName=rootElementName;
  if (config.getAttributeAsElements() != null) {
    this.attrAsElemNames.addAll(config.getAttributeAsElements());
  }
  if (config.getXml2JsonNs() != null) {
    for (    String uri : config.getXml2JsonNs().keySet())     revertedXml2JsonNs.put(config.getXml2JsonNs().get(uri),uri);
  }
  nsSeparator=config.getNsSeparator();
  nsSeparatorAsSequence=new StringBuffer(1).append(nsSeparator);
  lexer=new JsonLexer(reader);
  depth=0;
  processingStack=new ArrayList<ProcessingState>();
  processingStack.add(new ProcessingState());
  readNext();
}