nus-yam/ex-repair huggingface dataset:
Program: 8486
Project: 8486
Buggy source:
@SuppressWarnings({"String_Node_Str"}) @Override public Object resolve(URI baseUri,URI uri){
  URI relativeUri=baseUri.relativize(uri);
  Stack<URI> uris=UriUtils.explode(baseUri,relativeUri);
  if (uris.size() < 1) {
    return null;
  }
  String repoName=UriUtils.path(uris.get(0));
  String sId=UriUtils.path(uris.get(1));
  RepositoryMetadata repoMeta=repositoryMetadataFor(repoName);
  CrudRepository repo;
  if (null == (repo=repoMeta.repository())) {
    return null;
  }
  EntityMetadata entityMeta;
  if (null == (entityMeta=repoMeta.entityMetadata())) {
    return null;
  }
  Class<? extends Serializable> idType=(Class<? extends Serializable>)entityMeta.idAttribute().type();
  Serializable serId;
  if (ClassUtils.isAssignable(idType,String.class)) {
    serId=sId;
  }
 else {
    serId=conversionService.convert(sId,idType);
  }
  return repo.findOne(serId);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) @Override public Object resolve(URI baseUri,URI uri){
  URI relativeUri=baseUri.relativize(uri);
  Stack<URI> uris=UriUtils.explode(baseUri,relativeUri);
  if (uris.size() < 1) {
    return null;
  }
  String repoName=UriUtils.path(uris.get(0));
  String sId=UriUtils.path(uris.get(1));
  RepositoryMetadata repoMeta=repositoryMetadataFor(repoName);
  CrudRepository repo;
  if (null == (repo=repoMeta.repository())) {
    return null;
  }
  EntityMetadata entityMeta;
  if (null == (entityMeta=repoMeta.entityMetadata())) {
    return null;
  }
  Class<? extends Serializable> idType=(Class<? extends Serializable>)entityMeta.idAttribute().type();
  Serializable serId=null;
  if (ClassUtils.isAssignable(idType,String.class)) {
    serId=sId;
  }
 else {
    for (    ConversionService cs : conversionServices) {
      if (cs.canConvert(String.class,idType)) {
        serId=cs.convert(sId,idType);
        break;
      }
    }
  }
  return repo.findOne(serId);
}
Program: 8487
Project: 8487
Buggy source:
@Override public void serialize(Object value,JsonGenerator jgen,SerializerProvider provider) throws IOException, JsonGenerationException {
  if (null == value) {
    provider.defaultSerializeNull(jgen);
    return;
  }
  if (null == repoMeta) {
    provider.defaultSerializeValue(value,jgen);
    return;
  }
  Serializable serId=(Serializable)idAttr.get(value);
  String sId=conversionService.convert(serId,String.class);
  if (null == sId) {
    sId=serId.toString();
  }
  URI href=buildUri(RepositoryRestController.BASE_URI.get(),repoMeta.name(),sId);
  jgen.writeString("String_Node_Str" + href.toString());
}

Fixed version (ground truth):
@Override public void serialize(Object value,JsonGenerator jgen,SerializerProvider provider) throws IOException, JsonGenerationException {
  if (null == value) {
    provider.defaultSerializeNull(jgen);
    return;
  }
  if (null == repoMeta) {
    provider.defaultSerializeValue(value,jgen);
    return;
  }
  Serializable serId=(Serializable)idAttr.get(value);
  String sId=null;
  for (  ConversionService cs : conversionServices) {
    if (cs.canConvert(idAttr.type(),String.class)) {
      sId=cs.convert(serId,String.class);
      break;
    }
  }
  if (null == sId) {
    sId=serId.toString();
  }
  URI href=buildUri(RepositoryRestController.BASE_URI.get(),repoMeta.name(),sId);
  jgen.writeString("String_Node_Str" + href.toString());
}
Program: 8489
Project: 8489
Buggy source:
/** 
 * Get the   {@link ConversionService} in use by the controller.
 * @return The internal {@link ConversionService}.
 */
public ConversionService getConversionService(){
  return conversionService;
}

Fixed version (ground truth):
/** 
 * Get the   {@link ConversionService} in use by the controller.
 * @return The internal {@link ConversionService}s.
 */
public ConversionService getConversionService(){
  return conversionService;
}
Program: 8490
Project: 8490
Buggy source:
/** 
 * @param conversionService
 * @return @this
 * @see RepositoryRestController#setConversionService(org.springframework.core.convert.ConversionService)
 */
public RepositoryRestController conversionService(ConversionService conversionService){
  setConversionService(conversionService);
  return this;
}

Fixed version (ground truth):
/** 
 * @return The internal {@link ConversionService}.
 * @see org.springframework.data.rest.webmvc.RepositoryRestController#getConversionService()
 */
public ConversionService conversionService(){
  return conversionService;
}
Program: 8491
Project: 8491
Buggy source:
@Query("String_Node_Str") @RestResource(path="String_Node_Str") Page<Person> findById(@Param("String_Node_Str") @ConvertWith(StringToListOfLongsConverter.class) List<Long> ids,Pageable pageable);

Fixed version (ground truth):
@Query("String_Node_Str") @RestResource(path="String_Node_Str") Page<Person> findById(@Param("String_Node_Str") List<Long> ids,Pageable pageable);
Program: 8493
Project: 8493
Buggy source:
@Override public final void onApplicationEvent(RepositoryEvent event){
  if (event instanceof BeforeSaveEvent) {
    onBeforeSave(event.getSource());
  }
 else   if (event instanceof AfterSaveEvent) {
    onAfterSave(event.getSource());
  }
 else   if (event instanceof BeforeLinkSaveEvent) {
    onBeforeLinkSave(event.getSource(),((BeforeLinkSaveEvent)event).getLinked());
  }
 else   if (event instanceof AfterLinkSaveEvent) {
    onAfterLinkSave(event.getSource(),((AfterLinkSaveEvent)event).getLinked());
  }
 else   if (event instanceof BeforeDeleteEvent) {
    onBeforeDelete(event.getSource());
  }
 else   if (event instanceof AfterDeleteEvent) {
    onAfterDelete(event.getSource());
  }
}

Fixed version (ground truth):
@Override public final void onApplicationEvent(RepositoryEvent event){
  if (event instanceof BeforeSaveEvent) {
    onBeforeSave(event.getSource());
  }
 else   if (event instanceof AfterSaveEvent) {
    onAfterSave(event.getSource());
  }
 else   if (event instanceof BeforeLinkSaveEvent) {
    onBeforeLinkSave(event.getSource(),((BeforeLinkSaveEvent)event).getLinked());
  }
 else   if (event instanceof AfterLinkSaveEvent) {
    onAfterLinkSave(event.getSource(),((AfterLinkSaveEvent)event).getLinked());
  }
 else   if (event instanceof BeforeLinkDeleteEvent) {
    onBeforeLinkDelete(event.getSource(),((BeforeLinkDeleteEvent)event).getLinked());
  }
 else   if (event instanceof AfterLinkDeleteEvent) {
    onAfterLinkDelete(event.getSource(),((BeforeLinkDeleteEvent)event).getLinked());
  }
 else   if (event instanceof BeforeDeleteEvent) {
    onBeforeDelete(event.getSource());
  }
 else   if (event instanceof AfterDeleteEvent) {
    onAfterDelete(event.getSource());
  }
}
Program: 8494
Project: 8494
Buggy source:
public RepositoryMethod(Method method){
  this.method=method;
  paramTypes=method.getParameterTypes();
  for (  Class<?> type : paramTypes) {
    if (Pageable.class.isAssignableFrom(type)) {
      pageable=true;
    }
    if (Sort.class.isAssignableFrom(type)) {
      sortable=true;
    }
  }
  paramNames=NAME_DISCOVERER.getParameterNames(method);
  if (null == paramNames) {
    paramNames=new String[paramTypes.length];
  }
  Annotation[][] paramAnnos=method.getParameterAnnotations();
  for (int i=0; i < paramAnnos.length; i++) {
    if (paramAnnos[i].length > 0) {
      for (      Annotation anno : paramAnnos[i]) {
        if (Param.class.isAssignableFrom(anno.getClass())) {
          Param p=(Param)anno;
          paramNames[i]=p.value();
          break;
        }
      }
    }
    if (null == paramNames[i]) {
      paramNames[i]="String_Node_Str" + i;
    }
  }
}

Fixed version (ground truth):
public RepositoryMethod(Method method){
  this.method=method;
  paramTypes=method.getParameterTypes();
  for (  Class<?> type : paramTypes) {
    if (Pageable.class.isAssignableFrom(type)) {
      pageable=true;
    }
    if (Sort.class.isAssignableFrom(type)) {
      sortable=true;
    }
  }
  paramNames=Methods.NAME_DISCOVERER.getParameterNames(method);
  if (null == paramNames) {
    paramNames=new String[paramTypes.length];
  }
  Annotation[][] paramAnnos=method.getParameterAnnotations();
  for (int i=0; i < paramAnnos.length; i++) {
    if (paramAnnos[i].length > 0) {
      for (      Annotation anno : paramAnnos[i]) {
        if (Param.class.isAssignableFrom(anno.getClass())) {
          Param p=(Param)anno;
          paramNames[i]=p.value();
          break;
        }
      }
    }
    if (null == paramNames[i]) {
      paramNames[i]="String_Node_Str" + i;
    }
  }
}
Program: 8495
Project: 8495
Buggy source:
@SuppressWarnings({"String_Node_Str"}) public JpaEntityMetadata(Repositories repositories,EntityType<?> entityType){
  type=entityType.getJavaType();
  idAttribute=new JpaAttributeMetadata(entityType,entityType.getId(entityType.getIdType().getJavaType()));
  if (null != entityType.getVersion(Long.class)) {
    versionAttribute=new JpaAttributeMetadata(entityType,entityType.getVersion(Long.class));
  }
  for (  Attribute attr : entityType.getAttributes()) {
    boolean exported=true;
    Field field=ReflectionUtils.findField(type,attr.getJavaMember().getName());
    if (null != field) {
      RestResource fieldResourceAnno=field.getAnnotation(RestResource.class);
      if (null != fieldResourceAnno) {
        exported=fieldResourceAnno.exported();
      }
    }
    if (exported) {
      Class<?> attrType=(attr instanceof PluralAttribute ? ((PluralAttribute)attr).getElementType().getJavaType() : attr.getJavaType());
      if (repositories.hasRepositoryFor(attrType)) {
        linkedAttributes.put(attr.getName(),new JpaAttributeMetadata(entityType,attr));
      }
 else {
        if (!(attr instanceof SingularAttribute && ((SingularAttribute)attr).isId()) && !(attr instanceof SingularAttribute && ((SingularAttribute)attr).isVersion())) {
          embeddedAttributes.put(attr.getName(),new JpaAttributeMetadata(entityType,attr));
        }
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) public JpaEntityMetadata(Repositories repositories,EntityType<?> entityType){
  type=entityType.getJavaType();
  idAttribute=new JpaAttributeMetadata(entityType,entityType.getId(entityType.getIdType().getJavaType()));
  if (null != entityType.getVersion(Long.class)) {
    versionAttribute=new JpaAttributeMetadata(entityType,entityType.getVersion(Long.class));
  }
  for (  Attribute attr : entityType.getAttributes()) {
    boolean exported=true;
    Field field=ReflectionUtils.findField(type,attr.getJavaMember().getName());
    if (null == field) {
      continue;
    }
    RestResource fieldResourceAnno=field.getAnnotation(RestResource.class);
    if (null != fieldResourceAnno) {
      exported=fieldResourceAnno.exported();
    }
    if (exported) {
      String name=attr.getName();
      if (null != fieldResourceAnno && StringUtils.hasText(fieldResourceAnno.path())) {
        name=fieldResourceAnno.path();
      }
      Class<?> attrType=(attr instanceof PluralAttribute ? ((PluralAttribute)attr).getElementType().getJavaType() : attr.getJavaType());
      if (repositories.hasRepositoryFor(attrType)) {
        linkedAttributes.put(name,new JpaAttributeMetadata(entityType,attr));
      }
 else {
        if (!(attr instanceof SingularAttribute && ((SingularAttribute)attr).isId()) && !(attr instanceof SingularAttribute && ((SingularAttribute)attr).isVersion())) {
          embeddedAttributes.put(name,new JpaAttributeMetadata(entityType,attr));
        }
      }
    }
  }
}
Program: 8502
Project: 8502
Buggy source:
/** 
 * Set the List of   {@link RepositoryExporter}s.
 * @param repositoryExporters Export this {@link List} of {@link RepositoryExporter}s.
 * @return @this
 */
@SuppressWarnings({"String_Node_Str"}) public S repositoryExporters(List<RepositoryExporter> repositoryExporters){
  setRepositoryExporters(repositoryExporters);
  return (S)this;
}

Fixed version (ground truth):
/** 
 * Set the   {@link RepositoryExporter}s to use.
 * @param repositoryExporter
 * @return
 */
@SuppressWarnings({"String_Node_Str"}) public S repositoryExporters(RepositoryExporter... repositoryExporter){
  setRepositoryExporters(Arrays.asList(repositoryExporter));
  return (S)this;
}
Program: 8503
Project: 8503
Buggy source:
@Override protected void extendInterceptors(List<Object> interceptors){
  OpenEntityManagerInViewInterceptor omivi=new OpenEntityManagerInViewInterceptor();
  omivi.setEntityManagerFactory(entityManagerFactory);
  interceptors.add(omivi);
}

Fixed version (ground truth):
@Override protected void extendInterceptors(List<Object> interceptors){
  if (null != entityManagerFactory) {
    OpenEntityManagerInViewInterceptor omivi=new OpenEntityManagerInViewInterceptor();
    omivi.setEntityManagerFactory(entityManagerFactory);
    interceptors.add(omivi);
  }
}
Program: 8504
Project: 8504
Buggy source:
public RepositoryExporterHandlerMapping(EntityManagerFactory entityManagerFactory){
  this.entityManagerFactory=entityManagerFactory;
  setOrder(Ordered.HIGHEST_PRECEDENCE);
}

Fixed version (ground truth):
public RepositoryExporterHandlerMapping(){
  setOrder(Ordered.HIGHEST_PRECEDENCE);
}
Program: 8505
Project: 8505
Buggy source:
public RepositoryRestController httpMessageConverters(List<HttpMessageConverter<?>> httpMessageConverters){
  setHttpMessageConverters(httpMessageConverters);
  return this;
}

Fixed version (ground truth):
public RepositoryRestController httpMessageConverters(List<HttpMessageConverter> httpMessageConverters){
  setHttpMessageConverters(httpMessageConverters);
  return this;
}
Program: 8506
Project: 8506
Buggy source:
public void setHttpMessageConverters(List<HttpMessageConverter<?>> httpMessageConverters){
  Assert.notNull(httpMessageConverters);
  this.httpMessageConverters=httpMessageConverters;
}

Fixed version (ground truth):
public void setHttpMessageConverters(List<HttpMessageConverter> httpMessageConverters){
  Assert.notNull(httpMessageConverters);
  this.httpMessageConverters=httpMessageConverters;
}
Program: 8507
Project: 8507
Buggy source:
public List<HttpMessageConverter<?>> getHttpMessageConverters(){
  return httpMessageConverters;
}

Fixed version (ground truth):
public List<HttpMessageConverter> getHttpMessageConverters(){
  return httpMessageConverters;
}
Program: 8508
Project: 8508
Buggy source:
@Bean RepositoryExporterHandlerMapping repositoryExporterHandlerMapping(){
  if (null == repositoryExporterHandlerMapping) {
    repositoryExporterHandlerMapping=new RepositoryExporterHandlerMapping(entityManagerFactory);
  }
  return repositoryExporterHandlerMapping;
}

Fixed version (ground truth):
@Bean RepositoryExporterHandlerMapping repositoryExporterHandlerMapping(){
  return new RepositoryExporterHandlerMapping();
}
Program: 8509
Project: 8509
Buggy source:
@Bean ContentNegotiatingViewResolver contentNegotiatingViewResolver(){
  if (null == viewResolver) {
    viewResolver=new ContentNegotiatingViewResolver();
    viewResolver.setOrder(Ordered.HIGHEST_PRECEDENCE);
    Map<String,String> mediaTypes=new HashMap<String,String>(){
{
        put("String_Node_Str","String_Node_Str");
        put("String_Node_Str","String_Node_Str");
      }
    }
;
    viewResolver.setMediaTypes(mediaTypes);
    RepositoryRestViewResolver jsonvr=new RepositoryRestViewResolver(jsonView());
    RepositoryRestViewResolver urilistvr=new RepositoryRestViewResolver(urilistView());
    viewResolver.setViewResolvers(Arrays.<ViewResolver>asList(jsonvr,urilistvr));
  }
  return viewResolver;
}

Fixed version (ground truth):
@Bean ContentNegotiatingViewResolver contentNegotiatingViewResolver(){
  ContentNegotiatingViewResolver viewResolver=new ContentNegotiatingViewResolver();
  viewResolver.setOrder(Ordered.HIGHEST_PRECEDENCE);
  Map<String,String> mediaTypes=new HashMap<String,String>(){
{
      put("String_Node_Str","String_Node_Str");
      put("String_Node_Str","String_Node_Str");
    }
  }
;
  viewResolver.setMediaTypes(mediaTypes);
  RepositoryRestViewResolver jsonvr=new RepositoryRestViewResolver(jsonView());
  RepositoryRestViewResolver urilistvr=new RepositoryRestViewResolver(urilistView());
  viewResolver.setViewResolvers(Arrays.<ViewResolver>asList(jsonvr,urilistvr));
  return viewResolver;
}
Program: 8510
Project: 8510
Buggy source:
@Bean RepositoryRestController repositoryRestController() throws Exception {
  if (null == repositoryRestController) {
    this.repositoryRestController=new RepositoryRestController().repositoryExporters(Arrays.<RepositoryExporter>asList(jpaRepositoryExporter())).httpMessageConverters(repositoryExporterHandlerAdapter().getMessageConverters()).jsonMediaType("String_Node_Str");
  }
  return repositoryRestController;
}

Fixed version (ground truth):
@Bean RepositoryRestController repositoryRestController() throws Exception {
  return new RepositoryRestController();
}
Program: 8511
Project: 8511
Buggy source:
@Bean RepositoryExporterHandlerAdapter repositoryExporterHandlerAdapter(){
  if (null == repositoryExporterHandlerAdapter) {
    repositoryExporterHandlerAdapter=new RepositoryExporterHandlerAdapter();
  }
  return repositoryExporterHandlerAdapter;
}

Fixed version (ground truth):
@Bean RepositoryExporterHandlerAdapter repositoryExporterHandlerAdapter(){
  return new RepositoryExporterHandlerAdapter();
}
Program: 8512
Project: 8512
Buggy source:
@SuppressWarnings({"String_Node_Str"}) public JpaEntityMetadata(Repositories repositories,EntityType<?> entityType){
  type=entityType.getJavaType();
  idAttribute=new JpaAttributeMetadata(entityType,entityType.getId(entityType.getIdType().getJavaType()));
  if (null != entityType.getVersion(Long.class)) {
    versionAttribute=new JpaAttributeMetadata(entityType,entityType.getVersion(Long.class));
  }
  for (  Attribute attr : entityType.getAttributes()) {
    Class<?> attrType=(attr instanceof PluralAttribute ? ((PluralAttribute)attr).getElementType().getJavaType() : attr.getJavaType());
    if (repositories.hasRepositoryFor(attrType)) {
      linkedAttributes.put(attr.getName(),new JpaAttributeMetadata(entityType,attr));
    }
 else {
      if (attr != idAttribute && attr != versionAttribute) {
        embeddedAttributes.put(attr.getName(),new JpaAttributeMetadata(entityType,attr));
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) public JpaEntityMetadata(Repositories repositories,EntityType<?> entityType){
  type=entityType.getJavaType();
  idAttribute=new JpaAttributeMetadata(entityType,entityType.getId(entityType.getIdType().getJavaType()));
  if (null != entityType.getVersion(Long.class)) {
    versionAttribute=new JpaAttributeMetadata(entityType,entityType.getVersion(Long.class));
  }
  for (  Attribute attr : entityType.getAttributes()) {
    Class<?> attrType=(attr instanceof PluralAttribute ? ((PluralAttribute)attr).getElementType().getJavaType() : attr.getJavaType());
    if (repositories.hasRepositoryFor(attrType)) {
      linkedAttributes.put(attr.getName(),new JpaAttributeMetadata(entityType,attr));
    }
 else {
      if (!(attr instanceof SingularAttribute && ((SingularAttribute)attr).isId()) && !(attr instanceof SingularAttribute && ((SingularAttribute)attr).isVersion())) {
        embeddedAttributes.put(attr.getName(),new JpaAttributeMetadata(entityType,attr));
      }
    }
  }
}
Program: 8514
Project: 8514
Buggy source:
public Principal getUser(final HttpServletRequest request,final HttpServletResponse response){
  final HttpSession session=request.getSession();
  if (session.getAttribute(LOGGED_IN_KEY) != null) {
    LOGGER.debug("String_Node_Str");
    return (Principal)session.getAttribute(LOGGED_IN_KEY);
  }
  final Assertion assertion=(Assertion)session.getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION);
  if (assertion != null) {
    final Principal p=getUser(assertion.getPrincipal().getName());
    if (p == null) {
      LOGGER.error("String_Node_Str",assertion.getPrincipal().getName());
    }
    LOGGER.debug("String_Node_Str",p.getName());
    session.setAttribute(LOGGED_IN_KEY,p);
    session.setAttribute(LOGGED_OUT_KEY,null);
    return p;
  }
  return super.getUser(request,response);
}

Fixed version (ground truth):
public Principal getUser(final HttpServletRequest request,final HttpServletResponse response){
  final HttpSession session=request.getSession();
  if (session.getAttribute(LOGGED_IN_KEY) != null) {
    LOGGER.debug("String_Node_Str");
    return (Principal)session.getAttribute(LOGGED_IN_KEY);
  }
  final Assertion assertion=(Assertion)session.getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION);
  if (assertion != null) {
    final Principal p=getUser(assertion.getPrincipal().getName());
    if (p == null) {
      LOGGER.error("String_Node_Str",assertion.getPrincipal().getName());
      return null;
    }
    LOGGER.debug("String_Node_Str",p.getName());
    session.setAttribute(LOGGED_IN_KEY,p);
    session.setAttribute(LOGGED_OUT_KEY,null);
    return p;
  }
  return super.getUser(request,response);
}
Program: 8516
Project: 8516
Buggy source:
/** 
 * Configures the connection with specific settings for secure http connections If the connection instance is not a   {@link HttpsURLConnection}, no additional changes will be made and the connection itself is simply returned.
 * @param conn the http connection
 */
private URLConnection configureHttpsConnectionIfNeeded(final URLConnection conn){
  if (conn instanceof HttpsURLConnection) {
    final HttpsURLConnection httpsConnection=(HttpsURLConnection)conn;
    final SSLSocketFactory socketFactory=this.createSSLSocketFactory();
    if (socketFactory != null) {
      httpsConnection.setSSLSocketFactory(socketFactory);
    }
    if (this.hostnameVerifier != null) {
      httpsConnection.setHostnameVerifier(this.hostnameVerifier);
    }
  }
  return conn;
}

Fixed version (ground truth):
/** 
 * Configures the connection with specific settings for secure http connections If the connection instance is not a   {@link HttpsURLConnection}, no additional changes will be made and the connection itself is simply returned.
 * @param conn the http connection
 */
private HttpURLConnection configureHttpsConnectionIfNeeded(final URLConnection conn){
  if (conn instanceof HttpsURLConnection) {
    final HttpsURLConnection httpsConnection=(HttpsURLConnection)conn;
    final SSLSocketFactory socketFactory=this.createSSLSocketFactory();
    if (socketFactory != null) {
      httpsConnection.setSSLSocketFactory(socketFactory);
    }
    if (this.hostnameVerifier != null) {
      httpsConnection.setHostnameVerifier(this.hostnameVerifier);
    }
  }
  return (HttpURLConnection)conn;
}
Program: 8517
Project: 8517
Buggy source:
/** 
 * Contacts the remote URL and returns the response.
 * @param url the url to contact.
 * @param encoding the encoding to use.
 * @return the response.
 */
public static String getResponseFromServer(final String url,String encoding){
  try {
    return getResponseFromServer(new URL(url),new HttpsURLConnectionFactory(),encoding);
  }
 catch (  final MalformedURLException e) {
    throw new IllegalArgumentException(e);
  }
}

Fixed version (ground truth):
/** 
 * Contacts the remote URL and returns the response.
 * @param url the url to contact.
 * @param encoding the encoding to use.
 * @return the response.
 */
public static String getResponseFromServer(final String url,String encoding){
  try {
    return getResponseFromServer(new URL(url),HttpsURLConnectionFactory.INSTANCE,encoding);
  }
 catch (  final MalformedURLException e) {
    throw new IllegalArgumentException(e);
  }
}
Program: 8518
Project: 8518
Buggy source:
protected String retrieveResponseFromServer(final URL validationUrl,final String ticket){
  final String MESSAGE_TO_SEND="String_Node_Str" + this.identifierGenerator.generateIdentifier() + "String_Node_Str"+ CommonUtils.formatForUtcTime(new Date())+ "String_Node_Str"+ "String_Node_Str"+ ticket+ "String_Node_Str";
  HttpURLConnection conn=null;
  DataOutputStream out=null;
  BufferedReader in=null;
  try {
    conn=(HttpURLConnection)this.getURLConnectionFactory().getURLConnection(validationUrl.openConnection());
    conn.setRequestMethod("String_Node_Str");
    conn.setRequestProperty("String_Node_Str","String_Node_Str");
    conn.setRequestProperty("String_Node_Str",Integer.toString(MESSAGE_TO_SEND.length()));
    conn.setRequestProperty("String_Node_Str","String_Node_Str");
    conn.setUseCaches(false);
    conn.setDoInput(true);
    conn.setDoOutput(true);
    out=new DataOutputStream(conn.getOutputStream());
    out.writeBytes(MESSAGE_TO_SEND);
    out.flush();
    in=new BufferedReader(CommonUtils.isNotBlank(getEncoding()) ? new InputStreamReader(conn.getInputStream(),Charset.forName(getEncoding())) : new InputStreamReader(conn.getInputStream()));
    final StringBuilder buffer=new StringBuilder(256);
    String line;
    while ((line=in.readLine()) != null) {
      buffer.append(line);
    }
    return buffer.toString();
  }
 catch (  final IOException e) {
    throw new RuntimeException(e);
  }
 finally {
    CommonUtils.closeQuietly(out);
    CommonUtils.closeQuietly(in);
    if (conn != null) {
      conn.disconnect();
    }
  }
}

Fixed version (ground truth):
protected String retrieveResponseFromServer(final URL validationUrl,final String ticket){
  final String MESSAGE_TO_SEND="String_Node_Str" + this.identifierGenerator.generateIdentifier() + "String_Node_Str"+ CommonUtils.formatForUtcTime(new Date())+ "String_Node_Str"+ "String_Node_Str"+ ticket+ "String_Node_Str";
  HttpURLConnection conn=null;
  DataOutputStream out=null;
  BufferedReader in=null;
  try {
    conn=this.getURLConnectionFactory().buildHttpURLConnection(validationUrl.openConnection());
    conn.setRequestMethod("String_Node_Str");
    conn.setRequestProperty("String_Node_Str","String_Node_Str");
    conn.setRequestProperty("String_Node_Str",Integer.toString(MESSAGE_TO_SEND.length()));
    conn.setRequestProperty("String_Node_Str","String_Node_Str");
    conn.setUseCaches(false);
    conn.setDoInput(true);
    conn.setDoOutput(true);
    out=new DataOutputStream(conn.getOutputStream());
    out.writeBytes(MESSAGE_TO_SEND);
    out.flush();
    in=new BufferedReader(CommonUtils.isNotBlank(getEncoding()) ? new InputStreamReader(conn.getInputStream(),Charset.forName(getEncoding())) : new InputStreamReader(conn.getInputStream()));
    final StringBuilder buffer=new StringBuilder(256);
    String line;
    while ((line=in.readLine()) != null) {
      buffer.append(line);
    }
    return buffer.toString();
  }
 catch (  final IOException e) {
    throw new RuntimeException(e);
  }
 finally {
    CommonUtils.closeQuietly(out);
    CommonUtils.closeQuietly(in);
    if (conn != null) {
      conn.disconnect();
    }
  }
}
Program: 8519
Project: 8519
Buggy source:
public String getProxyTicketIdFor(final String proxyGrantingTicketId,final String targetService){
  try {
    final String url=constructUrl(proxyGrantingTicketId,targetService);
    final String response=CommonUtils.getResponseFromServer(new URL(url),this.urlConnectionFactory,this.encoding);
    final String error=XmlUtils.getTextForElement(response,"String_Node_Str");
    if (CommonUtils.isNotEmpty(error)) {
      logger.debug(error);
      return null;
    }
    return XmlUtils.getTextForElement(response,"String_Node_Str");
  }
 catch (  final MalformedURLException ex) {
    throw new RuntimeException(ex);
  }
}

Fixed version (ground truth):
public String getProxyTicketIdFor(final String proxyGrantingTicketId,final String targetService){
  CommonUtils.assertNotNull(proxyGrantingTicketId,"String_Node_Str");
  CommonUtils.assertNotNull(targetService,"String_Node_Str");
  final URL url=constructUrl(proxyGrantingTicketId,targetService);
  final String response=CommonUtils.getResponseFromServer(url,this.urlConnectionFactory,this.encoding);
  final String error=XmlUtils.getTextForElement(response,"String_Node_Str");
  if (CommonUtils.isNotEmpty(error)) {
    logger.debug(error);
    return null;
  }
  return XmlUtils.getTextForElement(response,"String_Node_Str");
}
Program: 8520
Project: 8520
Buggy source:
private String constructUrl(final String proxyGrantingTicketId,final String targetService){
  try {
    return this.casServerUrl + (this.casServerUrl.endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ proxyGrantingTicketId+ "String_Node_Str"+ URLEncoder.encode(targetService,"String_Node_Str");
  }
 catch (  final UnsupportedEncodingException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private URL constructUrl(final String proxyGrantingTicketId,final String targetService){
  try {
    return new URL(this.casServerUrl + (this.casServerUrl.endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ proxyGrantingTicketId+ "String_Node_Str"+ URLEncoder.encode(targetService,"String_Node_Str"));
  }
 catch (  final Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 8521
Project: 8521
Buggy source:
public boolean commitUpdates(){
  throw new SecurityException("String_Node_Str");
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean commitUpdates(){
  throw new SecurityException("String_Node_Str");
}
Program: 8522
Project: 8522
Buggy source:
public boolean deleteRow(){
  throw new SecurityException("String_Node_Str");
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean deleteRow(){
  throw new SecurityException("String_Node_Str");
}
Program: 8523
Project: 8523
Buggy source:
private static String chooseFullPath(Context context,String url,String hint,String contentDisposition,String contentLocation,String mimeType,int destination,long contentLength) throws GenerateSaveFileError {
  File base=locateDestinationDirectory(context,mimeType,destination,contentLength);
  String filename=chooseFilename(url,hint,contentDisposition,contentLocation,destination);
  String extension=null;
  int dotIndex=filename.indexOf('.');
  if (dotIndex < 0) {
    extension=chooseExtensionFromMimeType(mimeType,true);
  }
 else {
    extension=chooseExtensionFromFilename(mimeType,destination,filename,dotIndex);
    filename=filename.substring(0,dotIndex);
  }
  boolean recoveryDir=Constants.RECOVERY_DIRECTORY.equalsIgnoreCase(filename + extension);
  filename=base.getPath() + File.separator + filename;
  if (Constants.LOGVV) {
    Log.v(Constants.TAG,"String_Node_Str" + filename + extension);
  }
  return chooseUniqueFilename(destination,filename,extension,recoveryDir);
}

Fixed version (ground truth):
private static String chooseFullPath(Context context,String url,String hint,String contentDisposition,String contentLocation,String mimeType,int destination,long contentLength) throws GenerateSaveFileError {
  File base=locateDestinationDirectory(context,mimeType,destination,contentLength);
  return generateFilePath(base.getPath(),url,contentDisposition,contentLocation,mimeType,destination,contentLength);
}
Program: 8524
Project: 8524
Buggy source:
private static String getPathForFileUri(String hint,long contentLength) throws GenerateSaveFileError {
  if (!isExternalMediaMounted()) {
    throw new GenerateSaveFileError(Downloads.STATUS_DEVICE_NOT_FOUND_ERROR,"String_Node_Str");
  }
  String path=Uri.parse(hint).getPath();
  if (new File(path).exists()) {
    Log.d(Constants.TAG,"String_Node_Str" + path);
    throw new GenerateSaveFileError(Downloads.STATUS_FILE_ALREADY_EXISTS_ERROR,"String_Node_Str");
  }
  if (getAvailableBytes(getFilesystemRoot(path)) < contentLength) {
    throw new GenerateSaveFileError(Downloads.STATUS_INSUFFICIENT_SPACE_ERROR,"String_Node_Str");
  }
  return path;
}

Fixed version (ground truth):
private static String getPathForFileUri(String url,String hint,String contentDisposition,String contentLocation,String mimeType,int destination,long contentLength) throws GenerateSaveFileError {
  if (!isExternalMediaMounted()) {
    throw new GenerateSaveFileError(Downloads.STATUS_DEVICE_NOT_FOUND_ERROR,"String_Node_Str");
  }
  String path=Uri.parse(hint).getPath();
  if (path.endsWith("String_Node_Str")) {
    String basePath=path.substring(0,path.length() - 1);
    path=generateFilePath(basePath,url,contentDisposition,contentLocation,mimeType,destination,contentLength);
  }
 else   if (new File(path).exists()) {
    Log.d(Constants.TAG,"String_Node_Str" + path);
    throw new GenerateSaveFileError(Downloads.STATUS_FILE_ALREADY_EXISTS_ERROR,"String_Node_Str");
  }
  if (getAvailableBytes(getFilesystemRoot(path)) < contentLength) {
    throw new GenerateSaveFileError(Downloads.STATUS_INSUFFICIENT_SPACE_ERROR,"String_Node_Str");
  }
  return path;
}
Program: 8525
Project: 8525
Buggy source:
/** 
 * Creates a filename (where the file should be saved) from info about a download.
 */
public static String generateSaveFile(Context context,String url,String hint,String contentDisposition,String contentLocation,String mimeType,int destination,long contentLength,boolean isPublicApi) throws GenerateSaveFileError {
  checkCanHandleDownload(context,mimeType,destination,isPublicApi);
  if (destination == Downloads.DESTINATION_FILE_URI && !hint.trim().endsWith("String_Node_Str")) {
    return getPathForFileUri(hint,contentLength);
  }
 else {
    return chooseFullPath(context,url,hint,contentDisposition,contentLocation,mimeType,destination,contentLength);
  }
}

Fixed version (ground truth):
/** 
 * Creates a filename (where the file should be saved) from info about a download.
 */
public static String generateSaveFile(Context context,String url,String hint,String contentDisposition,String contentLocation,String mimeType,int destination,long contentLength,boolean isPublicApi) throws GenerateSaveFileError {
  checkCanHandleDownload(context,mimeType,destination,isPublicApi);
  if (destination == Downloads.DESTINATION_FILE_URI) {
    return getPathForFileUri(url,hint,contentDisposition,contentLocation,mimeType,destination,contentLength);
  }
 else {
    return chooseFullPath(context,url,hint,contentDisposition,contentLocation,mimeType,destination,contentLength);
  }
}
Program: 8527
Project: 8527
Buggy source:
@Test public void testIngoreSignField(){
  ApplicationContext context=mock(ApplicationContext.class);
  when(context.getBeanNamesForType(Object.class)).thenReturn(new String[]{"String_Node_Str"});
  Class serviceClass=IgnoreSignRopRequestService.class;
  when(context.getType("String_Node_Str")).thenReturn(serviceClass);
  RopContext ropContext=new DefaultRopContext(context);
  ServiceMethodHandler method1=ropContext.getServiceMethodHandler("String_Node_Str","String_Node_Str");
  List<String> ignoreSignFieldNames=method1.getIgnoreSignFieldNames();
  assertNotNull(ignoreSignFieldNames);
  assertEquals(ignoreSignFieldNames.size(),3);
  assertTrue(ignoreSignFieldNames.contains("String_Node_Str"));
  assertTrue(ignoreSignFieldNames.contains("String_Node_Str"));
  assertTrue(ignoreSignFieldNames.contains("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testIngoreSignField(){
  ApplicationContext context=mock(ApplicationContext.class);
  when(context.getBeanNamesForType(Object.class)).thenReturn(new String[]{"String_Node_Str"});
  Class serviceClass=IgnoreSignRopRequestService.class;
  when(context.getType("String_Node_Str")).thenReturn(serviceClass);
  RopContext ropContext=new DefaultRopContext(context);
  ServiceMethodHandler method1=ropContext.getServiceMethodHandler("String_Node_Str","String_Node_Str");
  List<String> ignoreSignFieldNames=method1.getIgnoreSignFieldNames();
  assertNotNull(ignoreSignFieldNames);
  assertEquals(ignoreSignFieldNames.size(),4);
  assertTrue(ignoreSignFieldNames.contains("String_Node_Str"));
  assertTrue(ignoreSignFieldNames.contains("String_Node_Str"));
  assertTrue(ignoreSignFieldNames.contains("String_Node_Str"));
}
Program: 8529
Project: 8529
Buggy source:
@Override public void beforeService(RequestContext methodContext){
  System.out.println("String_Node_Str");
  if ("String_Node_Str".equals(methodContext.getParamValue("String_Node_Str"))) {
    InterceptorResponse response=new InterceptorResponse();
    response.setTestField("String_Node_Str");
    methodContext.setRopResponse(response);
  }
}

Fixed version (ground truth):
/** 
 * 在数据绑定后，服务方法调用前执行该拦截方法
 * @param methodContext
 */
@Override public void beforeService(RequestContext methodContext){
  System.out.println("String_Node_Str");
  if ("String_Node_Str".equals(methodContext.getParamValue("String_Node_Str"))) {
    InterceptorResponse response=new InterceptorResponse();
    response.setTestField("String_Node_Str");
    methodContext.setRopResponse(response);
  }
}
Program: 8530
Project: 8530
Buggy source:
@Override public boolean isMatch(RequestContext methodContext){
  return "String_Node_Str".equals(methodContext.getMethod());
}

Fixed version (ground truth):
/** 
 * 对method为user.add的方法进行拦截，你可以通过methodContext中的信息制定拦截方案
 * @param methodContext
 * @return
 */
@Override public boolean isMatch(RequestContext methodContext){
  return "String_Node_Str".equals(methodContext.getMethod());
}
Program: 8531
Project: 8531
Buggy source:
@Override public void beforeResponse(RequestContext methodContext){
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * 在服务执行完成后，响应返回前执行该拦截方法
 * @param methodContext
 */
@Override public void beforeResponse(RequestContext methodContext){
  System.out.println("String_Node_Str");
}
Program: 8532
Project: 8532
Buggy source:
@Override public boolean isGranted(RequestContext methodContext){
  return aclMap.get(methodContext.getSessionId());
}

Fixed version (ground truth):
@Override public boolean isGranted(RequestContext methodContext){
  if (methodContext.getSessionId() != null) {
    return aclMap.get(methodContext.getSessionId());
  }
 else {
    return true;
  }
}
Program: 8533
Project: 8533
Buggy source:
/** 
 * 在进行服务之前调用
 * @param methodContext
 */
void beforeService(RequestContext methodContext);

Fixed version (ground truth):
/** 
 * 在进行服务之前调用,如果在方法中往  {@link RequestContext}设置了  {@link RopResponse}（相当于已经产生了响应了）, 所以服务将直接返回，不往下继续执行，反之服务会继续往下执行直到返回响应
 * @param methodContext
 */
void beforeService(RequestContext methodContext);
Program: 8534
Project: 8534
Buggy source:
private void writeResponse(RopResponse ropResponse,HttpServletResponse httpServletResponse,MessageFormat messageFormat){
  try {
    httpServletResponse.setCharacterEncoding(UTF_8);
    if (messageFormat == MessageFormat.xml) {
      httpServletResponse.setContentType(APPLICATION_XML);
      xmlMarshallerRop.marshaller(ropResponse,httpServletResponse.getOutputStream());
    }
 else {
      httpServletResponse.setContentType(APPLICATION_JSON);
      jsonMarshallerRop.marshaller(ropResponse,httpServletResponse.getOutputStream());
    }
  }
 catch (  IOException e) {
    throw new RopException(e);
  }
}

Fixed version (ground truth):
private void writeResponse(RopResponse ropResponse,HttpServletResponse httpServletResponse,MessageFormat messageFormat){
  try {
    httpServletResponse.setCharacterEncoding(Constants.UTF8);
    if (messageFormat == MessageFormat.xml) {
      httpServletResponse.setContentType(APPLICATION_XML);
      xmlMarshallerRop.marshaller(ropResponse,httpServletResponse.getOutputStream());
    }
 else {
      httpServletResponse.setContentType(APPLICATION_JSON);
      jsonMarshallerRop.marshaller(ropResponse,httpServletResponse.getOutputStream());
    }
  }
 catch (  IOException e) {
    throw new RopException(e);
  }
}
Program: 8535
Project: 8535
Buggy source:
@Override public SimpleRequestContext buildBySysParams(RopContext ropContext,Object request){
  if (!(request instanceof HttpServletRequest)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  HttpServletRequest servletRequest=(HttpServletRequest)request;
  SimpleRequestContext requestContext=new SimpleRequestContext(ropContext);
  requestContext.setRawRequestObject(servletRequest);
  requestContext.setAllParams(getRequestParams(servletRequest));
  requestContext.setIp(servletRequest.getRemoteAddr());
  requestContext.setAppKey(servletRequest.getParameter(SystemParameterNames.getAppKey()));
  requestContext.setSessionId(servletRequest.getParameter(SystemParameterNames.getSessionId()));
  requestContext.setMethod(servletRequest.getParameter(SystemParameterNames.getMethod()));
  requestContext.setVersion(servletRequest.getParameter(SystemParameterNames.getVersion()));
  requestContext.setLocale(getLocale(servletRequest));
  requestContext.setFormat(getFormat(servletRequest));
  requestContext.setMessageFormat(getResponseFormat(servletRequest));
  requestContext.setSign(servletRequest.getParameter(SystemParameterNames.getSign()));
  requestContext.setHttpAction(HttpAction.fromValue(servletRequest.getMethod()));
  ServiceMethodHandler serviceMethodHandler=ropContext.getServiceMethodHandler(requestContext.getMethod(),requestContext.getVersion());
  requestContext.setServiceMethodHandler(serviceMethodHandler);
  return requestContext;
}

Fixed version (ground truth):
@Override public SimpleRequestContext buildBySysParams(RopContext ropContext,Object request){
  if (!(request instanceof HttpServletRequest)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  HttpServletRequest servletRequest=(HttpServletRequest)request;
  SimpleRequestContext requestContext=new SimpleRequestContext(ropContext);
  requestContext.setRawRequestObject(servletRequest);
  requestContext.setAllParams(getRequestParams(servletRequest));
  requestContext.setIp(getRemoteAddr(servletRequest));
  requestContext.setAppKey(servletRequest.getParameter(SystemParameterNames.getAppKey()));
  requestContext.setSessionId(servletRequest.getParameter(SystemParameterNames.getSessionId()));
  requestContext.setMethod(servletRequest.getParameter(SystemParameterNames.getMethod()));
  requestContext.setVersion(servletRequest.getParameter(SystemParameterNames.getVersion()));
  requestContext.setLocale(getLocale(servletRequest));
  requestContext.setFormat(getFormat(servletRequest));
  requestContext.setMessageFormat(getResponseFormat(servletRequest));
  requestContext.setSign(servletRequest.getParameter(SystemParameterNames.getSign()));
  requestContext.setHttpAction(HttpAction.fromValue(servletRequest.getMethod()));
  ServiceMethodHandler serviceMethodHandler=ropContext.getServiceMethodHandler(requestContext.getMethod(),requestContext.getVersion());
  requestContext.setServiceMethodHandler(serviceMethodHandler);
  return requestContext;
}
Program: 8537
Project: 8537
Buggy source:
private Map<String,String> getRequestForm(RopRequest ropRequest,String methodName,String version,String sessionId){
  Map<String,String> form=new LinkedHashMap<String,String>(16);
  form.put(SystemParameterNames.getAppKey(),appKey);
  form.put(SystemParameterNames.getMethod(),methodName);
  form.put(SystemParameterNames.getVersion(),version);
  form.put(SystemParameterNames.getFormat(),format);
  form.put(SystemParameterNames.getLocale(),locale);
  if (sessionId != null) {
    form.put(SystemParameterNames.getSessionId(),sessionId);
  }
  form.putAll(getParamFields(ropRequest));
  String signValue=sign(RopRequest.class,appSecret,form);
  form.put("String_Node_Str",signValue);
  return form;
}

Fixed version (ground truth):
private Map<String,String> getRequestForm(RopRequest ropRequest,String methodName,String version,String sessionId){
  Map<String,String> form=new LinkedHashMap<String,String>(16);
  form.put(SystemParameterNames.getAppKey(),appKey);
  form.put(SystemParameterNames.getMethod(),methodName);
  form.put(SystemParameterNames.getVersion(),version);
  form.put(SystemParameterNames.getFormat(),format);
  form.put(SystemParameterNames.getLocale(),locale);
  if (sessionId != null) {
    form.put(SystemParameterNames.getSessionId(),sessionId);
  }
  form.putAll(getParamFields(ropRequest));
  String signValue=sign(ropRequest.getClass(),appSecret,form);
  form.put("String_Node_Str",signValue);
  return form;
}
Program: 8538
Project: 8538
Buggy source:
private boolean isIgoreSignField(Field field){
  Annotation[] declaredAnnotations=field.getDeclaredAnnotations();
  if (declaredAnnotations != null) {
    for (    Annotation declaredAnnotation : declaredAnnotations) {
      if (declaredAnnotation.equals(IgnoreSign.class)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isIgoreSignField(Field field){
  Annotation[] declaredAnnotations=field.getDeclaredAnnotations();
  if (declaredAnnotations != null) {
    for (    Annotation declaredAnnotation : declaredAnnotations) {
      if (ClassUtils.isAssignableValue(IgnoreSign.class,declaredAnnotation)) {
        return true;
      }
    }
  }
  return false;
}
Program: 8540
Project: 8540
Buggy source:
private String buildGetUrl(Map<String,String> form){
  StringBuilder requestUrl=new StringBuilder();
  requestUrl.append(serverUrl);
  requestUrl.append("String_Node_Str");
  for (  Map.Entry<String,String> entry : form.entrySet()) {
    requestUrl.append(entry.getKey());
    requestUrl.append("String_Node_Str");
    requestUrl.append(entry.getValue());
  }
  return requestUrl.toString();
}

Fixed version (ground truth):
private String buildGetUrl(Map<String,String> form){
  StringBuilder requestUrl=new StringBuilder();
  requestUrl.append(serverUrl);
  requestUrl.append("String_Node_Str");
  String joinChar="String_Node_Str";
  for (  Map.Entry<String,String> entry : form.entrySet()) {
    requestUrl.append(joinChar);
    requestUrl.append(entry.getKey());
    requestUrl.append("String_Node_Str");
    requestUrl.append(entry.getValue());
    joinChar="String_Node_Str";
  }
  return requestUrl.toString();
}
Program: 8541
Project: 8541
Buggy source:
@Override public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
  ReflectionUtils.makeAccessible(field);
  if (!isTemporaryField(field)) {
    allFields.add(field);
  }
  if (isIgoreSignField(field)) {
    ignoreSignFieldNames.add(field.getName());
  }
}

Fixed version (ground truth):
@Override public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
  ReflectionUtils.makeAccessible(field);
  if (!isTemporaryField(field)) {
    allFields.add(field);
    if (isIgoreSignField(field)) {
      ignoreSignFieldNames.add(field.getName());
    }
  }
}
Program: 8542
Project: 8542
Buggy source:
private boolean isValidSession(RequestContext smc){
  if (sessionManager.getSession(smc.getSessionId()) != null) {
    if (logger.isDebugEnabled()) {
      logger.debug(smc.getSessionId() + "String_Node_Str");
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean isValidSession(RequestContext smc){
  if (sessionManager.getSession(smc.getSessionId()) == null) {
    if (logger.isDebugEnabled()) {
      logger.debug(smc.getSessionId() + "String_Node_Str");
    }
    return false;
  }
 else {
    return true;
  }
}
Program: 8543
Project: 8543
Buggy source:
/** 
 * 是否是合法的会话
 * @param sessionId
 * @return
 */
private MainError checkSession(RequestContext smc){
  if (smc.getServiceMethodHandler() != null && smc.getServiceMethodHandler().getServiceMethodDefinition().isNeedInSession()) {
    if (smc.getSessionId() == null) {
      return MainErrors.getError(MainErrorType.MISSING_SESSION,null);
    }
 else {
      if (isValidSession(smc)) {
        return MainErrors.getError(MainErrorType.INVALID_SESSION,null);
      }
 else {
        return null;
      }
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * 是否是合法的会话
 * @param sessionId
 * @return
 */
private MainError checkSession(RequestContext smc){
  if (smc.getServiceMethodHandler() != null && smc.getServiceMethodHandler().getServiceMethodDefinition().isNeedInSession()) {
    if (smc.getSessionId() == null) {
      return MainErrors.getError(MainErrorType.MISSING_SESSION,null);
    }
 else {
      if (!isValidSession(smc)) {
        return MainErrors.getError(MainErrorType.INVALID_SESSION,null);
      }
    }
  }
  return null;
}
Program: 8544
Project: 8544
Buggy source:
private void fireAfterDoServiceEvent(RequestContext requestContext){
  this.ropEventMulticaster.multicastEvent(new PreDoServiceEvent(this,requestContext));
}

Fixed version (ground truth):
private void fireAfterDoServiceEvent(RequestContext requestContext){
  this.ropEventMulticaster.multicastEvent(new AfterDoServiceEvent(this,requestContext));
}
Program: 8545
Project: 8545
Buggy source:
private void firePreDoServiceEvent(RequestContext requestContext){
  this.ropEventMulticaster.multicastEvent(new AfterDoServiceEvent(this,requestContext));
}

Fixed version (ground truth):
private void firePreDoServiceEvent(RequestContext requestContext){
  this.ropEventMulticaster.multicastEvent(new PreDoServiceEvent(this,requestContext));
}