nus-yam/ex-repair huggingface dataset:
Program: 160908
Project: 160908
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public <T>T redirectTo(T controller){
  return (T)redirectTo(CDIProxies.extractRawTypeIfPossible(controller.getClass()));
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T>T redirectTo(T controller){
  return (T)redirectTo((Class<T>)extractRawTypeIfPossible(controller.getClass()));
}
Program: 160909
Project: 160909
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public <T>T forwardTo(T controller){
  return (T)forwardTo(CDIProxies.extractRawTypeIfPossible(controller.getClass()));
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T>T forwardTo(T controller){
  return (T)forwardTo((Class<T>)extractRawTypeIfPossible(controller.getClass()));
}
Program: 160910
Project: 160910
Buggy source:
protected String extractControllerFromName(String baseName){
  baseName=lowerFirstCharacter(baseName);
  if (baseName.endsWith("String_Node_Str")) {
    return baseName.substring(0,baseName.lastIndexOf("String_Node_Str"));
  }
  return baseName;
}

Fixed version (ground truth):
protected String extractControllerFromName(String baseName){
  baseName=getFilteredControllerBaseName(lowerFirstCharacter(baseName));
  if (baseName.endsWith("String_Node_Str")) {
    return baseName.substring(0,baseName.lastIndexOf("String_Node_Str"));
  }
  return baseName;
}
Program: 160911
Project: 160911
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public <T>T of(T controller){
  return (T)of(controller.getClass());
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T>T of(T controller){
  return (T)of(CDIProxies.extractRawTypeIfPossible(controller.getClass()));
}
Program: 160912
Project: 160912
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public <T>T redirectTo(T controller){
  return (T)redirectTo(controller.getClass());
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T>T redirectTo(T controller){
  return (T)redirectTo(CDIProxies.extractRawTypeIfPossible(controller.getClass()));
}
Program: 160913
Project: 160913
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public <T>T forwardTo(T controller){
  return (T)forwardTo(controller.getClass());
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T>T forwardTo(T controller){
  return (T)forwardTo(CDIProxies.extractRawTypeIfPossible(controller.getClass()));
}
Program: 160914
Project: 160914
Buggy source:
protected String extractControllerFromName(String baseName){
  baseName=getFilteredControllerBaseName(lowerFirstCharacter(baseName));
  if (baseName.endsWith("String_Node_Str")) {
    return baseName.substring(0,baseName.lastIndexOf("String_Node_Str"));
  }
  return baseName;
}

Fixed version (ground truth):
protected String extractControllerFromName(String baseName){
  baseName=lowerFirstCharacter(baseName);
  if (baseName.endsWith("String_Node_Str")) {
    return baseName.substring(0,baseName.lastIndexOf("String_Node_Str"));
  }
  return baseName;
}
Program: 160915
Project: 160915
Buggy source:
@Inject public MockRequestHandlerObserver(UrlToControllerTranslator translator,ControllerNotFoundHandler controllerNotFoundHandler,MethodNotAllowedHandler methodNotAllowedHandler,Event<ControllerFound> controllerFoundEvent,Event<RequestSucceded> endRequestEvent,InterceptorStack interceptorStack,Result result){
  super(translator,controllerNotFoundHandler,methodNotAllowedHandler,controllerFoundEvent,endRequestEvent,interceptorStack,result);
}

Fixed version (ground truth):
@Inject public MockRequestHandlerObserver(UrlToControllerTranslator translator,ControllerNotFoundHandler controllerNotFoundHandler,MethodNotAllowedHandler methodNotAllowedHandler,Event<ControllerFound> controllerFoundEvent,Event<RequestSucceded> endRequestEvent,InterceptorStack interceptorStack,InvalidInputHandler invalidInputHandler){
  super(translator,controllerNotFoundHandler,methodNotAllowedHandler,controllerFoundEvent,endRequestEvent,interceptorStack,invalidInputHandler);
}
Program: 160916
Project: 160916
Buggy source:
@Test public void shouldHandle400() throws Exception {
  when(translator.translate(webRequest)).thenThrow(new InvalidInputException("String_Node_Str"));
  observer.handle(requestStarted);
  assertTrue(result.used());
  verify(interceptorStack,never()).start();
}

Fixed version (ground truth):
@Test public void shouldHandle400() throws Exception {
  InvalidInputException invalidInputException=new InvalidInputException("String_Node_Str");
  when(translator.translate(webRequest)).thenThrow(invalidInputException);
  observer.handle(requestStarted);
  verify(interceptorStack,never()).start();
  verify(invalidInputHandler).deny(invalidInputException);
}
Program: 160917
Project: 160917
Buggy source:
@Before public void config(){
  MockitoAnnotations.initMocks(this);
  requestStarted=new VRaptorRequestStarted(chain,webRequest,webResponse);
  observer=new RequestHandlerObserver(translator,notFoundHandler,methodNotAllowedHandler,controllerFoundEvent,requestSucceededEvent,interceptorStack,result);
}

Fixed version (ground truth):
@Before public void config(){
  MockitoAnnotations.initMocks(this);
  requestStarted=new VRaptorRequestStarted(chain,webRequest,webResponse);
  observer=new RequestHandlerObserver(translator,notFoundHandler,methodNotAllowedHandler,controllerFoundEvent,requestSucceededEvent,interceptorStack,invalidInputHandler);
}
Program: 160918
Project: 160918
Buggy source:
@Override public <T extends View>T use(Class<T> view){
  responseCommitted=true;
  return container.instanceFor(view);
}

Fixed version (ground truth):
@Override public <T extends View>T use(Class<T> view){
  if (view.isAssignableFrom(Results.json()) && validator.hasErrors()) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  }
  responseCommitted=true;
  return container.instanceFor(view);
}
Program: 160919
Project: 160919
Buggy source:
@Inject public DefaultResult(HttpServletRequest request,Container container,ExceptionMapper exceptions,TypeNameExtractor extractor){
  this.request=request;
  this.container=container;
  this.extractor=extractor;
  this.includedAttributes=new HashMap<>();
  this.exceptions=exceptions;
}

Fixed version (ground truth):
@Inject public DefaultResult(HttpServletRequest request,Container container,ExceptionMapper exceptions,TypeNameExtractor extractor,Validator validator){
  this.request=request;
  this.container=container;
  this.extractor=extractor;
  this.includedAttributes=new HashMap<>();
  this.exceptions=exceptions;
  this.validator=validator;
}
Program: 160920
Project: 160920
Buggy source:
@Before public void setup(){
  MockitoAnnotations.initMocks(this);
  result=new DefaultResult(request,container,null,extractor);
}

Fixed version (ground truth):
@Before public void setup(){
  MockitoAnnotations.initMocks(this);
  validator=new MockValidator();
  result=new DefaultResult(request,container,null,extractor,validator);
}
Program: 160921
Project: 160921
Buggy source:
@Test public void shouldTrimValueWhenEvaluatingSupport() throws Exception {
  DefaultEnvironment defaultEnvironment=new DefaultEnvironment(DEVELOPMENT);
  assertThat(defaultEnvironment.supports("String_Node_Str"),is(true));
}

Fixed version (ground truth):
@Test public void shouldTrimValueWhenEvaluatingSupport() throws Exception {
  DefaultEnvironment defaultEnvironment=new DefaultEnvironment(EnvironmentType.DEVELOPMENT);
  assertThat(defaultEnvironment.supports("String_Node_Str"),is(true));
}
Program: 160922
Project: 160922
Buggy source:
@Test public void shouldGetDefaultValueIfTheValueIsntSet() throws Exception {
  DefaultEnvironment defaultEnvironment=new DefaultEnvironment(development());
  String value=defaultEnvironment.get("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",value);
}

Fixed version (ground truth):
@Test public void shouldGetDefaultValueIfTheValueIsntSet() throws Exception {
  DefaultEnvironment defaultEnvironment=new DefaultEnvironment(EnvironmentType.DEVELOPMENT);
  String value=defaultEnvironment.get("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",value);
}
Program: 160923
Project: 160923
Buggy source:
@Test public void shouldGetValueIfIsSetInProperties() throws Exception {
  DefaultEnvironment defaultEnvironment=new DefaultEnvironment(development());
  String value=defaultEnvironment.get("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",value);
}

Fixed version (ground truth):
@Test public void shouldGetValueIfIsSetInProperties() throws Exception {
  DefaultEnvironment defaultEnvironment=new DefaultEnvironment(EnvironmentType.DEVELOPMENT);
  String value=defaultEnvironment.get("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",value);
}
Program: 160924
Project: 160924
Buggy source:
@Override public Validator check(boolean condition,Message message){
  if (!condition) {
    errors.add(message);
  }
  return this;
}

Fixed version (ground truth):
@Override public Validator check(boolean condition,Message message){
  message.setBundle(bundle);
  if (!condition) {
    errors.add(message);
  }
  return this;
}
Program: 160925
Project: 160925
Buggy source:
@Before public void setup(){
  mimeTypeToFormat=new DefaultAcceptHeaderToFormat();
}

Fixed version (ground truth):
@Before public void setup(){
  CacheStore<String,String> cache=new LRUCacheStore<>(100);
  mimeTypeToFormat=new DefaultAcceptHeaderToFormat(cache);
}
Program: 160926
Project: 160926
Buggy source:
@Override public void intercept(InterceptorStack stack,ControllerMethod method,Object controllerInstance) throws InterceptionException {
  if (session.getAttribute(FLASH_INCLUDED_PARAMETERS) != null) {
    session.removeAttribute(FLASH_INCLUDED_PARAMETERS);
    @SuppressWarnings("String_Node_Str") Map<String,Object> parameters=(Map<String,Object>)session.getAttribute(FLASH_INCLUDED_PARAMETERS);
    for (    Entry<String,Object> parameter : parameters.entrySet()) {
      result.include(parameter.getKey(),parameter.getValue());
    }
  }
  response.addRedirectListener(new RedirectListener(){
    @Override public void beforeRedirect(){
      Map<String,Object> included=result.included();
      if (!included.isEmpty()) {
        try {
          session.setAttribute(FLASH_INCLUDED_PARAMETERS,included);
        }
 catch (        IllegalStateException e) {
          LOGGER.info("String_Node_Str" + "String_Node_Str");
        }
      }
    }
  }
);
  stack.next(method,controllerInstance);
}

Fixed version (ground truth):
@Override public void intercept(InterceptorStack stack,ControllerMethod method,Object controllerInstance) throws InterceptionException {
  if (session.getAttribute(FLASH_INCLUDED_PARAMETERS) != null) {
    @SuppressWarnings("String_Node_Str") Map<String,Object> parameters=(Map<String,Object>)session.getAttribute(FLASH_INCLUDED_PARAMETERS);
    session.removeAttribute(FLASH_INCLUDED_PARAMETERS);
    for (    Entry<String,Object> parameter : parameters.entrySet()) {
      result.include(parameter.getKey(),parameter.getValue());
    }
  }
  response.addRedirectListener(new RedirectListener(){
    @Override public void beforeRedirect(){
      Map<String,Object> included=result.included();
      if (!included.isEmpty()) {
        try {
          session.setAttribute(FLASH_INCLUDED_PARAMETERS,included);
        }
 catch (        IllegalStateException e) {
          LOGGER.info("String_Node_Str" + "String_Node_Str");
        }
      }
    }
  }
);
  stack.next(method,controllerInstance);
}
Program: 160927
Project: 160927
Buggy source:
public void updateHosts(List<Host> hosts){
  ThreadPreconditions.checkOnMainThread();
  mHosts=hosts;
  notifyDataSetChanged();
}

Fixed version (ground truth):
public void updateHosts(List<Host> hosts){
  ThreadPreconditions.checkOnMainThread();
  if (hosts == null) {
    mHosts=Collections.emptyList();
  }
 else {
    mHosts=hosts;
  }
  notifyDataSetChanged();
}
Program: 160928
Project: 160928
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  FragmentManager fragmentMngr=getSupportFragmentManager();
  mFragment=(ListHostsFragment)fragmentMngr.findFragmentByTag(ListHostsFragment.FRAGMENT_TAG);
  if (mFragment == null) {
    mFragment=new ListHostsFragment();
    FragmentTransaction ft=fragmentMngr.beginTransaction();
    ft.add(android.R.id.content,mFragment,ListHostsFragment.FRAGMENT_TAG);
    ft.commit();
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  FragmentManager fragmentMngr=getSupportFragmentManager();
  mFragment=(ListHostsFragment)fragmentMngr.findFragmentByTag(ListHostsFragment.TAG);
  if (mFragment == null) {
    mFragment=new ListHostsFragment();
    FragmentTransaction ft=fragmentMngr.beginTransaction();
    ft.add(android.R.id.content,mFragment,ListHostsFragment.TAG);
    ft.commit();
  }
}
Program: 160929
Project: 160929
Buggy source:
@Subscribe public void onHostAdded(AddedHostEvent event){
  refreshHosts(false);
}

Fixed version (ground truth):
@Subscribe public void onHostAdded(AddedHostEvent event){
  Log.d(TAG,"String_Node_Str");
  refreshHosts(false);
}
Program: 160930
Project: 160930
Buggy source:
@Override public void onPause(){
  mMode=null;
  super.onPause();
}

Fixed version (ground truth):
@Override public void onPause(){
  if (mMode != null) {
    mMode.finish();
  }
  super.onPause();
}
Program: 160931
Project: 160931
Buggy source:
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  updateActionBar();
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  int nbCheckedElements=0;
  SparseBooleanArray checked=mListView.getCheckedItemPositions();
  for (int i=0; i < checked.size(); i++) {
    if (checked.valueAt(i)) {
      nbCheckedElements++;
    }
  }
  if (nbCheckedElements > 0) {
    if (mMode == null) {
      mMode=mActivity.startActionMode(new ModeCallback());
    }
    mMode.setTitle(String.format(Locale.US,getString(R.string.add_host_menu_selected),nbCheckedElements));
  }
 else {
    if (mMode != null) {
      mMode.finish();
    }
  }
}
Program: 160932
Project: 160932
Buggy source:
@Override public void onResume(){
  super.onResume();
  updateActionBar();
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
}
Program: 160933
Project: 160933
Buggy source:
@Subscribe public void onRefreshHosts(RefreshHostsEvent hosts){
  mAdapter.updateHosts(hosts.get());
  mListView.setAdapter(mAdapter);
}

Fixed version (ground truth):
@Subscribe public void onRefreshHosts(RefreshHostsEvent hosts){
  Log.d(TAG,"String_Node_Str");
  mAdapter.updateHosts(hosts.get());
  mListView.setAdapter(mAdapter);
}
Program: 160934
Project: 160934
Buggy source:
@Subscribe public void onHostsRefreshed(RefreshHostsEvent hosts){
  Log.d(TAG,"String_Node_Str");
  mAdapter.updateHosts(hosts.get());
  mListView.setAdapter(mAdapter);
}

Fixed version (ground truth):
@Subscribe public void onHostsRefreshed(RefreshHostsEvent hosts){
  Log.d(TAG,"String_Node_Str");
  finishActionMode();
  mAdapter.updateHosts(hosts.get());
  mListView.setAdapter(mAdapter);
}
Program: 160935
Project: 160935
Buggy source:
@Override public void onPause(){
  if (mMode != null) {
    mMode.finish();
  }
  super.onPause();
}

Fixed version (ground truth):
@Override public void onPause(){
  finishActionMode();
  super.onPause();
}
Program: 160936
Project: 160936
Buggy source:
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  int nbCheckedElements=0;
  SparseBooleanArray checked=mListView.getCheckedItemPositions();
  for (int i=0; i < checked.size(); i++) {
    if (checked.valueAt(i)) {
      nbCheckedElements++;
    }
  }
  if (nbCheckedElements > 0) {
    if (mMode == null) {
      mMode=mActivity.startActionMode(new ModeCallback());
    }
    if (mEditMenuItem != null) {
      mEditMenuItem.setVisible(nbCheckedElements == 1);
    }
    mMode.setTitle(String.format(Locale.US,getString(R.string.list_menu_selected),nbCheckedElements));
  }
 else {
    if (mMode != null) {
      mMode.finish();
    }
  }
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  int nbCheckedElements=0;
  SparseBooleanArray checked=mListView.getCheckedItemPositions();
  for (int i=0; i < checked.size(); i++) {
    if (checked.valueAt(i)) {
      nbCheckedElements++;
    }
  }
  if (nbCheckedElements > 0) {
    if (mMode == null) {
      mMode=mActivity.startActionMode(new ModeCallback());
    }
    if (mEditMenuItem != null) {
      mEditMenuItem.setVisible(nbCheckedElements == 1);
    }
    mMode.setTitle(String.format(Locale.US,getString(R.string.list_menu_selected),nbCheckedElements));
  }
 else {
    finishActionMode();
  }
}
Program: 160937
Project: 160937
Buggy source:
public OAuth2(final OAuthConfig config,final Map<String,String> endpoints){
  oauth=new OAuthConsumer(config);
  this.endpoints=endpoints;
  permission=Permission.DEFAULT;
  providerId=config.getId();
  accessTokenParameterName=Constants.ACCESS_TOKEN_PARAMETER_NAME;
}

Fixed version (ground truth):
public OAuth2(final OAuthConfig config,final Map<String,String> endpoints){
  oauth=new OAuthConsumer(config);
  this.endpoints=endpoints;
  permission=Permission.DEFAULT;
  providerId=config.getId();
  accessTokenParameterName=Constants.ACCESS_TOKEN_PARAMETER_NAME;
  customProperties=config.getCustomProperties();
}
Program: 160939
Project: 160939
Buggy source:
/** 
 * Stores configuration for the provider
 * @param providerConfig It contains the configuration of application like consumer key and consumer secret
 * @throws Exception
 */
public HotmailImpl(final OAuthConfig providerConfig) throws Exception {
  config=providerConfig;
  if (config.getCustomPermissions() != null) {
    this.scope=Permission.CUSTOM;
  }
  if (config.getAuthenticationUrl() != null) {
    ENDPOINTS.put(Constants.OAUTH_AUTHORIZATION_URL,config.getAuthenticationUrl());
  }
 else {
    config.setAuthenticationUrl(ENDPOINTS.get(Constants.OAUTH_AUTHORIZATION_URL));
  }
  if (config.getAccessTokenUrl() != null) {
    ENDPOINTS.put(Constants.OAUTH_ACCESS_TOKEN_URL,config.getAccessTokenUrl());
  }
 else {
    config.setAccessTokenUrl(ENDPOINTS.get(Constants.OAUTH_ACCESS_TOKEN_URL));
  }
  authenticationStrategy=new OAuth2(config,ENDPOINTS);
  authenticationStrategy.setPermission(scope);
  authenticationStrategy.setScope(getScope());
}

Fixed version (ground truth):
/** 
 * Stores configuration for the provider
 * @param providerConfig It contains the configuration of application like consumer key and consumer secret
 * @throws Exception
 */
public HotmailImpl(final OAuthConfig providerConfig) throws Exception {
  config=providerConfig;
  if (config.getCustomPermissions() != null) {
    this.scope=Permission.CUSTOM;
  }
  if (config.getAuthenticationUrl() != null) {
    ENDPOINTS.put(Constants.OAUTH_AUTHORIZATION_URL,config.getAuthenticationUrl());
  }
 else {
    config.setAuthenticationUrl(ENDPOINTS.get(Constants.OAUTH_AUTHORIZATION_URL));
  }
  if (config.getAccessTokenUrl() != null) {
    ENDPOINTS.put(Constants.OAUTH_ACCESS_TOKEN_URL,config.getAccessTokenUrl());
  }
 else {
    config.setAccessTokenUrl(ENDPOINTS.get(Constants.OAUTH_ACCESS_TOKEN_URL));
  }
  Map<String,String> props=new HashMap<String,String>();
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str",getScope());
  config.setCustomProperties(props);
  authenticationStrategy=new OAuth2(config,ENDPOINTS);
  authenticationStrategy.setPermission(scope);
  authenticationStrategy.setScope(getScope());
}
Program: 160942
Project: 160942
Buggy source:
/** 
 * Retrieves the profile info as a string
 * @return String
 */
@Override public String toString(){
  StringBuilder result=new StringBuilder();
  String NEW_LINE=System.getProperty("String_Node_Str");
  result.append(this.getClass().getName() + "String_Node_Str" + NEW_LINE);
  result.append("String_Node_Str" + email + NEW_LINE);
  result.append("String_Node_Str" + firstName + NEW_LINE);
  result.append("String_Node_Str" + lastName + NEW_LINE);
  result.append("String_Node_Str" + displayName + NEW_LINE);
  result.append("String_Node_Str" + id + NEW_LINE);
  result.append("String_Node_Str" + profileUrl + NEW_LINE);
  result.append("String_Node_Str" + emailHash + NEW_LINE);
  result.append("String_Node_Str");
  if (otherEmails != null) {
    StringBuilder estr=new StringBuilder();
    for (    String str : otherEmails) {
      if (estr.length() > 0) {
        estr.append("String_Node_Str");
      }
      estr.append(str);
    }
    result.append(estr.toString());
  }
  result.append(NEW_LINE);
  result.append("String_Node_Str");
  return result.toString();
}

Fixed version (ground truth):
/** 
 * Retrieves the profile info as a string
 * @return String
 */
@Override public String toString(){
  StringBuilder result=new StringBuilder();
  String NEW_LINE=System.getProperty("String_Node_Str");
  result.append(this.getClass().getName() + "String_Node_Str" + NEW_LINE);
  result.append("String_Node_Str" + email + NEW_LINE);
  result.append("String_Node_Str" + firstName + NEW_LINE);
  result.append("String_Node_Str" + lastName + NEW_LINE);
  result.append("String_Node_Str" + displayName + NEW_LINE);
  result.append("String_Node_Str" + id + NEW_LINE);
  result.append("String_Node_Str" + profileUrl + NEW_LINE);
  result.append("String_Node_Str" + profileImageURL + NEW_LINE);
  result.append("String_Node_Str" + emailHash + NEW_LINE);
  result.append("String_Node_Str");
  if (otherEmails != null) {
    StringBuilder estr=new StringBuilder();
    for (    String str : otherEmails) {
      if (estr.length() > 0) {
        estr.append("String_Node_Str");
      }
      estr.append(str);
    }
    result.append(estr.toString());
  }
  result.append(NEW_LINE);
  result.append("String_Node_Str");
  return result.toString();
}
Program: 160944
Project: 160944
Buggy source:
@Override public List<Feed> getFeeds() throws Exception {
  List<Feed> list=new ArrayList<Feed>();
  try {
    Response response=providerSupport.api(FEED_URL);
    String respStr=response.getResponseBodyAsString(Constants.ENCODING);
    JSONObject resp=new JSONObject(respStr);
    JSONArray data=resp.getJSONArray("String_Node_Str");
    LOG.debug("String_Node_Str" + data.length());
    for (int i=0; i < data.length(); i++) {
      Feed feed=new Feed();
      JSONObject obj=data.getJSONObject(i);
      if (obj.has("String_Node_Str")) {
        JSONObject iobj=obj.getJSONObject("String_Node_Str");
        if (iobj.has("String_Node_Str"))         feed.setMessage(iobj.getJSONObject("String_Node_Str").optString("String_Node_Str"));
      }
      if (obj.has("String_Node_Str")) {
        JSONObject iobj=obj.getJSONObject("String_Node_Str");
        if (iobj.has("String_Node_Str")) {
          feed.setFrom(iobj.getString("String_Node_Str"));
        }
        if (iobj.has("String_Node_Str")) {
          feed.setId(iobj.getString("String_Node_Str"));
        }
        if (iobj.has("String_Node_Str")) {
          feed.setScreenName(iobj.getString("String_Node_Str"));
        }
      }
      if (obj.has("String_Node_Str")) {
        feed.setCreatedAt(new Date(Integer.parseInt(obj.getString("String_Node_Str"))));
      }
      list.add(feed);
    }
  }
 catch (  Exception e) {
    throw new SocialAuthException("String_Node_Str" + FEED_URL,e);
  }
  return list;
}

Fixed version (ground truth):
@Override public List<Feed> getFeeds() throws Exception {
  List<Feed> list=new ArrayList<Feed>();
  try {
    Response response=providerSupport.api(FEED_URL);
    String respStr=response.getResponseBodyAsString(Constants.ENCODING);
    LOG.debug("String_Node_Str" + respStr);
    JSONObject resp=new JSONObject(respStr);
    JSONArray data=resp.getJSONArray("String_Node_Str");
    LOG.debug("String_Node_Str" + data.length());
    for (int i=0; i < data.length(); i++) {
      Feed feed=new Feed();
      JSONObject obj=data.getJSONObject(i);
      if (obj.has("String_Node_Str")) {
        JSONObject iobj=obj.getJSONObject("String_Node_Str");
        if (iobj.has("String_Node_Str")) {
          feed.setMessage(iobj.getJSONObject("String_Node_Str").optString("String_Node_Str"));
        }
      }
      if (obj.has("String_Node_Str")) {
        JSONObject iobj=obj.getJSONObject("String_Node_Str");
        if (iobj.has("String_Node_Str")) {
          feed.setFrom(iobj.getString("String_Node_Str"));
        }
        if (iobj.has("String_Node_Str")) {
          feed.setId(iobj.getString("String_Node_Str"));
        }
        if (iobj.has("String_Node_Str")) {
          feed.setScreenName(iobj.getString("String_Node_Str"));
        }
      }
      if (obj.has("String_Node_Str")) {
        feed.setCreatedAt(new Date(Integer.parseInt(obj.getString("String_Node_Str"))));
      }
      list.add(feed);
    }
  }
 catch (  Exception e) {
    throw new SocialAuthException("String_Node_Str" + FEED_URL,e);
  }
  return list;
}
Program: 160945
Project: 160945
Buggy source:
public void setProviderSupport(final ProviderSupport providerSupport){
  this.providerSupport=providerSupport;
}

Fixed version (ground truth):
@Override public void setProviderSupport(final ProviderSupport providerSupport){
  this.providerSupport=providerSupport;
}
Program: 160946
Project: 160946
Buggy source:
public ProviderSupport getProviderSupport(){
  return providerSupport;
}

Fixed version (ground truth):
@Override public ProviderSupport getProviderSupport(){
  return providerSupport;
}
Program: 160947
Project: 160947
Buggy source:
private Profile doVerifyResponse(final Map<String,String> requestParams) throws Exception {
  LOG.info("String_Node_Str");
  if (requestParams.get("String_Node_Str") != null && "String_Node_Str".equals(requestParams.get("String_Node_Str"))) {
    throw new UserDeniedPermissionException();
  }
  accessGrant=authenticationStrategy.verifyResponse(requestParams);
  if (accessGrant != null) {
    LOG.debug("String_Node_Str");
    getProfile();
    return this.userProfile;
  }
 else {
    throw new SocialAuthException("String_Node_Str");
  }
}

Fixed version (ground truth):
private Profile doVerifyResponse(final Map<String,String> requestParams) throws Exception {
  LOG.info("String_Node_Str");
  if (requestParams.get("String_Node_Str") != null && "String_Node_Str".equals(requestParams.get("String_Node_Str"))) {
    throw new UserDeniedPermissionException();
  }
  accessGrant=authenticationStrategy.verifyResponse(requestParams,MethodType.POST.toString());
  if (accessGrant != null) {
    LOG.debug("String_Node_Str");
    getProfile();
    return this.userProfile;
  }
 else {
    throw new SocialAuthException("String_Node_Str");
  }
}
Program: 160948
Project: 160948
Buggy source:
private Profile getProfile() throws Exception {
  LOG.debug("String_Node_Str");
  Response response;
  try {
    response=authenticationStrategy.executeFeed(PROFILE_URL);
  }
 catch (  Exception e) {
    throw new SocialAuthException("String_Node_Str" + PROFILE_URL,e);
  }
  if (response.getStatus() == 200) {
    String respStr=response.getResponseBodyAsString(Constants.ENCODING);
    JSONObject data=new JSONObject(respStr);
    Profile p=new Profile();
    p.setValidatedId(data.optString("String_Node_Str"));
    String full_name=data.optString("String_Node_Str");
    p.setDisplayName(full_name);
    if (full_name != null) {
      String[] names=full_name.split("String_Node_Str");
      if (names.length > 1) {
        p.setFirstName(names[0]);
        p.setLastName(names[1]);
      }
 else {
        p.setFirstName(full_name);
      }
    }
    p.setProfileImageURL(data.optString("String_Node_Str"));
    p.setProviderId(getProviderId());
    return p;
  }
 else {
    throw new SocialAuthException("String_Node_Str" + PROFILE_URL + "String_Node_Str"+ response.getStatus());
  }
}

Fixed version (ground truth):
private Profile getProfile() throws Exception {
  LOG.debug("String_Node_Str");
  Response response;
  try {
    response=authenticationStrategy.executeFeed(PROFILE_URL);
  }
 catch (  Exception e) {
    throw new SocialAuthException("String_Node_Str" + PROFILE_URL,e);
  }
  if (response.getStatus() == 200) {
    String respStr=response.getResponseBodyAsString(Constants.ENCODING);
    LOG.debug("String_Node_Str" + respStr);
    JSONObject obj=new JSONObject(respStr);
    JSONObject data=obj.getJSONObject("String_Node_Str");
    Profile p=new Profile();
    p.setValidatedId(data.optString("String_Node_Str"));
    String full_name=data.optString("String_Node_Str");
    p.setDisplayName(full_name);
    if (full_name != null) {
      String[] names=full_name.split("String_Node_Str");
      if (names.length > 1) {
        p.setFirstName(names[0]);
        p.setLastName(names[1]);
      }
 else {
        p.setFirstName(full_name);
      }
    }
    p.setProfileImageURL(data.optString("String_Node_Str"));
    p.setProviderId(getProviderId());
    return p;
  }
 else {
    throw new SocialAuthException("String_Node_Str" + PROFILE_URL + "String_Node_Str"+ response.getStatus());
  }
}
Program: 160949
Project: 160949
Buggy source:
@Override public void setAccessGrant(AccessGrant accessGrant) throws Exception {
  this.accessGrant=accessGrant;
  authenticationStrategy.setAccessGrant(accessGrant);
}

Fixed version (ground truth):
@Override public void setAccessGrant(final AccessGrant accessGrant) throws AccessTokenExpireException {
  this.accessGrant=accessGrant;
  authenticationStrategy.setAccessGrant(accessGrant);
}
Program: 160950
Project: 160950
Buggy source:
@Override public List<Contact> getContactList() throws Exception {
  LOG.info("String_Node_Str" + CONTACTS_URL);
  Response serviceResponse;
  try {
    serviceResponse=authenticationStrategy.executeFeed(CONTACTS_URL);
  }
 catch (  Exception e) {
    throw new SocialAuthException("String_Node_Str" + e.getMessage() + "String_Node_Str"+ CONTACTS_URL,e);
  }
  if (serviceResponse.getStatus() != 200) {
    throw new SocialAuthException("String_Node_Str" + CONTACTS_URL + "String_Node_Str"+ serviceResponse.getStatus());
  }
  String respStr=serviceResponse.getResponseBodyAsString(Constants.ENCODING);
  List<Contact> plist=new ArrayList<Contact>();
  JSONObject resp=new JSONObject(respStr);
  JSONArray data=resp.optJSONArray("String_Node_Str");
  if (data != null)   for (int i=0; i < data.length(); i++) {
    JSONObject obj=data.getJSONObject(i);
    Contact p=new Contact();
    String id=obj.optString("String_Node_Str");
    p.setId(id);
    String full_name=obj.optString("String_Node_Str");
    p.setDisplayName(full_name);
    if (full_name != null) {
      String[] names=full_name.split("String_Node_Str");
      if (names.length > 1) {
        p.setFirstName(names[0]);
        p.setLastName(names[1]);
      }
 else {
        p.setFirstName(full_name);
      }
    }
    String username=obj.optString("String_Node_Str");
    p.setProfileUrl(VIEW_PROFILE_URL + username);
    plist.add(p);
  }
  return plist;
}

Fixed version (ground truth):
@Override public List<Contact> getContactList() throws Exception {
  LOG.info("String_Node_Str" + CONTACTS_URL);
  Response serviceResponse;
  try {
    serviceResponse=authenticationStrategy.executeFeed(CONTACTS_URL);
  }
 catch (  Exception e) {
    throw new SocialAuthException("String_Node_Str" + e.getMessage() + "String_Node_Str"+ CONTACTS_URL,e);
  }
  if (serviceResponse.getStatus() != 200) {
    throw new SocialAuthException("String_Node_Str" + CONTACTS_URL + "String_Node_Str"+ serviceResponse.getStatus());
  }
  String respStr=serviceResponse.getResponseBodyAsString(Constants.ENCODING);
  LOG.debug("String_Node_Str" + respStr);
  List<Contact> plist=new ArrayList<Contact>();
  JSONObject resp=new JSONObject(respStr);
  JSONArray data=resp.optJSONArray("String_Node_Str");
  if (data != null) {
    for (int i=0; i < data.length(); i++) {
      JSONObject obj=data.getJSONObject(i);
      Contact p=new Contact();
      String id=obj.optString("String_Node_Str");
      p.setId(id);
      String full_name=obj.optString("String_Node_Str");
      p.setDisplayName(full_name);
      if (full_name != null) {
        String[] names=full_name.split("String_Node_Str");
        if (names.length > 1) {
          p.setFirstName(names[0]);
          p.setLastName(names[1]);
        }
 else {
          p.setFirstName(full_name);
        }
      }
      String username=obj.optString("String_Node_Str");
      p.setProfileUrl(VIEW_PROFILE_URL + username);
      p.setProfileImageURL(obj.optString("String_Node_Str"));
      plist.add(p);
    }
  }
  return plist;
}
Program: 160951
Project: 160951
Buggy source:
@Override public Profile getUserProfile() throws Exception {
  if (userProfile == null && accessGrant != null) {
    userProfile=getProfile();
  }
  return (userProfile == null) ? new Profile() : userProfile;
}

Fixed version (ground truth):
@Override public Profile getUserProfile() throws Exception {
  if (userProfile == null && accessGrant != null) {
    userProfile=getProfile();
  }
  return userProfile;
}
Program: 160952
Project: 160952
Buggy source:
@Override public void updateStatus(final String msg) throws Exception {
  LOG.warn("String_Node_Str");
  throw new SocialAuthException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Response updateStatus(final String msg) throws Exception {
  LOG.warn("String_Node_Str");
  throw new SocialAuthException("String_Node_Str");
}
Program: 160953
Project: 160953
Buggy source:
private String getScope(Permission scope){
  StringBuffer result=new StringBuffer();
  String arr[];
  if (Permission.AUTHENTICATE_ONLY.equals(scope)) {
    arr=AuthPerms;
  }
 else   if (Permission.CUSTOM.equals(scope) && config.getCustomPermissions() != null) {
    arr=config.getCustomPermissions().split("String_Node_Str");
  }
 else {
    arr=AllPerms;
  }
  result.append(arr[0]);
  for (int i=1; i < arr.length; i++) {
    result.append("String_Node_Str").append(arr[i]);
  }
  String pluginScopes=getPluginsScope(config);
  if (pluginScopes != null) {
    result.append("String_Node_Str").append(pluginScopes);
  }
  return result.toString();
}

Fixed version (ground truth):
private String getScope(final Permission scope){
  StringBuffer result=new StringBuffer();
  String arr[];
  if (Permission.AUTHENTICATE_ONLY.equals(scope)) {
    arr=AuthPerms;
  }
 else   if (Permission.CUSTOM.equals(scope) && config.getCustomPermissions() != null) {
    arr=config.getCustomPermissions().split("String_Node_Str");
  }
 else {
    arr=AllPerms;
  }
  result.append(arr[0]);
  for (int i=1; i < arr.length; i++) {
    result.append("String_Node_Str").append(arr[i]);
  }
  String pluginScopes=getPluginsScope(config);
  if (pluginScopes != null) {
    result.append("String_Node_Str").append(pluginScopes);
  }
  return result.toString();
}
Program: 160954
Project: 160954
Buggy source:
void redirect(Method method,URL url,RequestInfo info){
  HttpRequest nue;
  if (method.toString().equals(info.req.getMethod().toString())) {
    if (info.req instanceof DefaultFullHttpRequest) {
      FullHttpRequest rq=((DefaultFullHttpRequest)info.req).copy();
      rq.setUri(url.getPathAndQuery());
      nue=rq;
    }
 else {
      nue=new DefaultHttpRequest(info.req.getProtocolVersion(),info.req.getMethod(),url.getPathAndQuery());
    }
  }
 else {
    nue=new DefaultHttpRequest(info.req.getProtocolVersion(),HttpMethod.valueOf(method.name()),url.getPathAndQuery());
  }
  copyHeaders(info.req,nue);
  submit(url,nue,new AtomicBoolean(),info.handle,info.r,info);
}

Fixed version (ground truth):
void redirect(Method method,URL url,RequestInfo info){
  HttpRequest nue;
  if (method.toString().equals(info.req.getMethod().toString())) {
    if (info.req instanceof DefaultFullHttpRequest) {
      DefaultFullHttpRequest dfrq=(DefaultFullHttpRequest)info.req;
      FullHttpRequest rq;
      try {
        rq=dfrq.copy();
      }
 catch (      IllegalReferenceCountException e) {
        rq=dfrq;
      }
      rq.setUri(url.getPathAndQuery());
      nue=rq;
    }
 else {
      nue=new DefaultHttpRequest(info.req.getProtocolVersion(),info.req.getMethod(),url.getPathAndQuery());
    }
  }
 else {
    nue=new DefaultHttpRequest(info.req.getProtocolVersion(),HttpMethod.valueOf(method.name()),url.getPathAndQuery());
  }
  copyHeaders(info.req,nue);
  submit(url,nue,new AtomicBoolean(),info.handle,info.r,info);
}
Program: 160955
Project: 160955
Buggy source:
private synchronized Bootstrap start(){
  if (bootstrap == null) {
    bootstrap=new Bootstrap();
    bootstrap.group(group);
    bootstrap.handler(new Initializer(new MessageHandlerImpl(followRedirects,this),false,maxChunkSize,maxInitialLineLength,maxHeadersSize,compress));
    bootstrap.option(ChannelOption.TCP_NODELAY,true);
    bootstrap.option(ChannelOption.ALLOCATOR,PooledByteBufAllocator.DEFAULT);
    for (    ChannelOptionSetting setting : settings) {
      option(bootstrap,setting);
    }
    bootstrap.channelFactory(new NioChannelFactory());
  }
  return bootstrap;
}

Fixed version (ground truth):
private synchronized Bootstrap start(){
  if (bootstrap == null) {
    bootstrap=new Bootstrap();
    bootstrap.group(group);
    bootstrap.handler(new Initializer(new MessageHandlerImpl(followRedirects,this),false,maxChunkSize,maxInitialLineLength,maxHeadersSize,compress));
    bootstrap.option(ChannelOption.TCP_NODELAY,true);
    bootstrap.option(ChannelOption.ALLOCATOR,PooledByteBufAllocator.DEFAULT);
    bootstrap.option(ChannelOption.SO_REUSEADDR,false);
    for (    ChannelOptionSetting setting : settings) {
      option(bootstrap,setting);
    }
    bootstrap.channelFactory(new NioChannelFactory());
  }
  return bootstrap;
}
Program: 160956
Project: 160956
Buggy source:
private synchronized Bootstrap startSsl(){
  if (bootstrapSsl == null) {
    bootstrapSsl=new Bootstrap();
    bootstrapSsl.group(group);
    bootstrapSsl.handler(new Initializer(new MessageHandlerImpl(followRedirects,this),true,maxChunkSize,maxInitialLineLength,maxHeadersSize,compress));
    bootstrapSsl.option(ChannelOption.TCP_NODELAY,true);
    bootstrapSsl.option(ChannelOption.ALLOCATOR,PooledByteBufAllocator.DEFAULT);
    for (    ChannelOptionSetting setting : settings) {
      option(bootstrapSsl,setting);
    }
    bootstrapSsl.channelFactory(new NioChannelFactory());
  }
  return bootstrapSsl;
}

Fixed version (ground truth):
private synchronized Bootstrap startSsl(){
  if (bootstrapSsl == null) {
    bootstrapSsl=new Bootstrap();
    bootstrapSsl.group(group);
    bootstrapSsl.handler(new Initializer(new MessageHandlerImpl(followRedirects,this),true,maxChunkSize,maxInitialLineLength,maxHeadersSize,compress));
    bootstrapSsl.option(ChannelOption.TCP_NODELAY,true);
    bootstrapSsl.option(ChannelOption.SO_REUSEADDR,false);
    bootstrapSsl.option(ChannelOption.ALLOCATOR,PooledByteBufAllocator.DEFAULT);
    for (    ChannelOptionSetting setting : settings) {
      option(bootstrapSsl,setting);
    }
    bootstrapSsl.channelFactory(new NioChannelFactory());
  }
  return bootstrapSsl;
}
Program: 160957
Project: 160957
Buggy source:
@Override public void content(final ByteBuf data){
  if (data.readableBytes() < frameLength) {
    return;
  }
  if (frameLength > 0) {
    final ByteBuf frame=data.readSlice(frameLength);
    frame.retain();
    part.add(new ZMTPFrame(data));
  }
 else   if (part == tail) {
    part.add(EMPTY_FRAME);
  }
 else {
    delimited=true;
    part=tail;
  }
}

Fixed version (ground truth):
@Override public void content(final ByteBuf data){
  if (data.readableBytes() < frameLength) {
    return;
  }
  if (frameLength > 0) {
    final ByteBuf frame=data.readSlice(frameLength);
    frame.retain();
    part.add(new ZMTPFrame(frame));
  }
 else   if (part == tail) {
    part.add(EMPTY_FRAME);
  }
 else {
    delimited=true;
    part=tail;
  }
}
Program: 160958
Project: 160958
Buggy source:
public static String printBytes(ByteBuf buffer,int start,int length){
  StringBuilder sb=new StringBuilder(length - start);
  for (int i=start; i < start + length; i++) {
    sb.append(String.format("String_Node_Str",buffer.getByte(i)));
  }
  return sb.toString();
}

Fixed version (ground truth):
public static String printBytes(ByteBuf buffer,int start,int length){
  StringBuilder sb=new StringBuilder(length);
  for (int i=start; i < start + length; i++) {
    sb.append(String.format("String_Node_Str",buffer.getByte(i)));
  }
  return sb.toString();
}
Program: 160959
Project: 160959
Buggy source:
/** 
 * Construct a ZMTP20Codec with the speicfied session and optional interoperability behavior.
 * @param session the session that configures this codec
 * @param interop whether this socket should implement the ZMTP/1.0 interoperability handshake
 */
public ZMTP20Codec(ZMTPSession session,boolean interop){
  super(session);
  this.interop=interop;
}

Fixed version (ground truth):
/** 
 * Construct a ZMTP20Codec with the specified session and optional interoperability behavior.
 * @param session the session that configures this codec
 * @param interop whether this socket should implement the ZMTP/1.0 interoperability handshake
 */
public ZMTP20Codec(ZMTPSession session,boolean interop){
  super(session);
  this.interop=interop;
}
Program: 160960
Project: 160960
Buggy source:
@Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buffer,VoidEnum _) throws ZMTPException {
  buffer.markReaderIndex();
  ChannelBuffer toSend=inputOutput(buffer);
  while (toSend != null) {
    ctx.getChannel().write(toSend);
    toSend=inputOutput(buffer);
  }
  if (actualReadableBytes() > 0) {
    return buffer.readBytes(actualReadableBytes());
  }
  return null;
}

Fixed version (ground truth):
@Override protected Object decode(ChannelHandlerContext ctx,Channel channel,ChannelBuffer buffer,VoidEnum _) throws ZMTPException {
  buffer.markReaderIndex();
  ChannelBuffer toSend=inputOutput(buffer);
  if (toSend != null) {
    ctx.getChannel().write(toSend);
    return null;
  }
  if (actualReadableBytes() > 0) {
    return buffer.readBytes(actualReadableBytes());
  }
  return null;
}
Program: 160961
Project: 160961
Buggy source:
/** 
 * Parses as many whole frames from the buffer as possible, until the final frame is encountered. If the message was completed, it returns the frames of the message. Otherwise it returns null to indicate that more data is needed. <p> Oversized messages will be truncated by discarding frames that would make the message size exceeed the specified size limit.
 * @param buffer Buffer with data
 * @return A {@link ZMTPMessage} if it was completely parsed, otherwise null.
 */
public ZMTPParsedMessage parse(final ChannelBuffer buffer) throws ZMTPMessageParsingException {
  if (isOversized(size)) {
    return discardFrames(buffer);
  }
  while (buffer.readableBytes() > 0) {
    buffer.markReaderIndex();
    final boolean parsedHeader=parseFrameHeader(buffer);
    if (!parsedHeader) {
      buffer.resetReaderIndex();
      return null;
    }
    if (isOversized(size + frameSize)) {
      buffer.resetReaderIndex();
      return discardFrames(buffer);
    }
    if (frameSize > buffer.readableBytes()) {
      buffer.resetReaderIndex();
      return null;
    }
    size+=frameSize;
    final ZMTPFrame frame=ZMTPFrame.read(buffer,frameSize);
    if (!frame.hasData() && part == envelope) {
      part=content;
      continue;
    }
    part.add(frame);
    if (!hasMore) {
      return finish(false);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Parses as many whole frames from the buffer as possible, until the final frame is encountered. If the message was completed, it returns the frames of the message. Otherwise it returns null to indicate that more data is needed. <p> Oversized messages will be truncated by discarding frames that would make the message size exceeed the specified size limit.
 * @param buffer Buffer with data
 * @return A {@link ZMTPMessage} if it was completely parsed, otherwise null.
 */
public ZMTPParsedMessage parse(final ChannelBuffer buffer) throws ZMTPMessageParsingException {
  if (isOversized(size)) {
    return discardFrames(buffer);
  }
  while (buffer.readableBytes() > 0) {
    buffer.markReaderIndex();
    final boolean parsedHeader=parseFrameHeader(buffer);
    if (!parsedHeader) {
      buffer.resetReaderIndex();
      return null;
    }
    if (isOversized(size + frameSize)) {
      buffer.resetReaderIndex();
      return discardFrames(buffer);
    }
    if (frameSize > buffer.readableBytes()) {
      buffer.resetReaderIndex();
      return null;
    }
    size+=frameSize;
    final ZMTPFrame frame=ZMTPFrame.read(buffer,frameSize);
    if (!frame.hasData() && part == envelope) {
      part=content;
    }
 else {
      part.add(frame);
    }
    if (!hasMore) {
      return finish(false);
    }
  }
  return null;
}
Program: 160962
Project: 160962
Buggy source:
private void testParse(final boolean enveloped,final Limit limit,final List<String> input,final ZMTPParsedMessage expected) throws Exception {
  out.println(format("String_Node_Str",enveloped,limit,input,expected));
  final ChannelBuffer serialized=serialize(input);
  final ChannelBuffer buffer=ChannelBuffers.dynamicBuffer();
  for (  List<ChannelBuffer> fragments : Fragmenter.generator(serialized.duplicate())) {
    buffer.setIndex(0,0);
    ZMTPParsedMessage parsed=null;
    final ZMTPMessageParser parser=new ZMTPMessageParser(enveloped,limit.value);
    for (int i=0; i < fragments.size(); i++) {
      final ChannelBuffer fragment=fragments.get(i);
      buffer.writeBytes(fragment);
      parsed=parser.parse(buffer);
      if (i < fragments.size() - 1) {
        assertNull(parsed);
      }
    }
    assertEquals(expected,parsed);
    final ZMTPParsedMessage reparsed=parser.parse(serialized.duplicate());
    assertEquals(expected,reparsed);
  }
}

Fixed version (ground truth):
private void testParse(final boolean enveloped,final Limit limit,final List<String> input,final ZMTPParsedMessage expected) throws Exception {
  out.println(format("String_Node_Str",enveloped,limit,input,expected));
  final ChannelBuffer serialized=serialize(input);
  final ChannelBuffer buffer=ChannelBuffers.dynamicBuffer();
{
    final ZMTPMessageParser parser=new ZMTPMessageParser(enveloped,limit.value);
    final ZMTPParsedMessage parsed=parser.parse(serialized.duplicate());
    assertEquals(expected,parsed);
  }
  for (  List<ChannelBuffer> fragments : Fragmenter.generator(serialized.duplicate())) {
    buffer.setIndex(0,0);
    ZMTPParsedMessage parsed=null;
    final ZMTPMessageParser parser=new ZMTPMessageParser(enveloped,limit.value);
    for (int i=0; i < fragments.size(); i++) {
      final ChannelBuffer fragment=fragments.get(i);
      buffer.writeBytes(fragment);
      parsed=parser.parse(buffer);
      if (i < fragments.size() - 1) {
        assertNull(parsed);
      }
    }
    assertEquals(expected,parsed);
    final ZMTPParsedMessage reparsed=parser.parse(serialized.duplicate());
    assertEquals(expected,reparsed);
    final int contentSize=min(limit.value - 1,10);
    final List<String> envelope=asList("String_Node_Str","String_Node_Str");
    final List<String> content=nCopies(contentSize,"String_Node_Str");
    final List<String> frames=newArrayList(concat(envelope,content));
    final ZMTPMessage message=ZMTPMessage.fromStringsUTF8(enveloped,frames);
    final ChannelBuffer trivialSerialized=serialize(frames);
    final ZMTPParsedMessage parsedTrivial=parser.parse(trivialSerialized.duplicate());
    assertFalse(parsedTrivial.isTruncated());
    assertEquals(message,parsedTrivial.getMessage());
  }
}
Program: 160963
Project: 160963
Buggy source:
public static Parameters test(final List<String> input,final Expectation... expectations){
  final List<Verification> verifications=Lists.newArrayList();
  for (  final Expectation expectation : expectations) {
    verifications.add(verification(input,expectation));
  }
  return new Parameters(input,verifications);
}

Fixed version (ground truth):
public static Parameters test(final List<String> input,final Expectation... expectations){
  final List<Verification> verifications=newArrayList();
  for (  final Expectation expectation : expectations) {
    verifications.add(verification(input,expectation));
  }
  return new Parameters(input,verifications);
}