nus-yam/ex-repair huggingface dataset:
Program: 60536
Project: 60536
Buggy source:
/** 
 * Creates a new members injector and attaches injection listeners.
 */
private <T>MembersInjectorImpl<T> createWithListeners(TypeLiteral<T> type,Errors errors) throws ErrorsException {
  int numErrorsBefore=errors.size();
  MembersInjectorImpl<T> membersInjector=createWithoutListeners(type,errors);
  InjectableType<T> injectableType=new InjectableType<T>(null,type,membersInjector.getInjectionPoints());
  EncounterImpl<T> encounter=new EncounterImpl<T>(errors,injector.lookups);
  for (  InjectableTypeListenerBinding typeListener : injectableTypeListenerBindings) {
    if (typeListener.getTypeMatcher().matches(type)) {
      try {
        typeListener.getListener().hear(injectableType,encounter);
      }
 catch (      RuntimeException e) {
        errors.errorNotifyingTypeListener(typeListener,injectableType,e);
      }
    }
  }
  errors.throwIfNewErrors(numErrorsBefore);
  return membersInjector.withListeners(encounter.getInjectionListeners());
}

Fixed version (ground truth):
/** 
 * Creates a new members injector and attaches injection listeners.
 */
private <T>MembersInjectorImpl<T> createWithListeners(TypeLiteral<T> type,Errors errors) throws ErrorsException {
  int numErrorsBefore=errors.size();
  MembersInjectorImpl<T> membersInjector=createWithoutListeners(type,errors);
  InjectableType<T> injectableType=new InjectableType<T>(null,type,membersInjector.getInjectionPoints());
  EncounterImpl<T> encounter=new EncounterImpl<T>(errors,injector.lookups);
  for (  InjectableTypeListenerBinding typeListener : injectableTypeListenerBindings) {
    if (typeListener.getTypeMatcher().matches(type)) {
      try {
        typeListener.getListener().hear(injectableType,encounter);
      }
 catch (      RuntimeException e) {
        errors.errorNotifyingTypeListener(typeListener,injectableType,e);
      }
    }
  }
  encounter.invalidate();
  errors.throwIfNewErrors(numErrorsBefore);
  return membersInjector.withListeners(encounter.getInjectionListeners());
}
Program: 60537
Project: 60537
Buggy source:
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
  return prefix + methodInvocation.proceed();
}

Fixed version (ground truth):
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
  return methodInvocation.proceed();
}
Program: 60538
Project: 60538
Buggy source:
protected void configure(){
  bindListener(any(),new InjectableType.Listener(){
    public <I>void hear(    InjectableType<I> injectableType,    Encounter<I> encounter){
      notificationCount.incrementAndGet();
    }
  }
);
  bind(C.class).toInstance(new C());
}

Fixed version (ground truth):
protected void configure(){
  bindListener(any(),new InjectableType.Listener(){
    public <I>void hear(    InjectableType<I> injectableType,    Encounter<I> encounter){
      encounterReference.set(encounter);
    }
  }
);
  bind(C.class);
}
Program: 60539
Project: 60539
Buggy source:
public void afterInjection(Object injectee){
  assertNotNull(bProviderReference.get().get());
  A a=new A();
  aMembersInjectorReference.get().injectMembers(a);
  assertNotNull(a.injector);
}

Fixed version (ground truth):
public void afterInjection(Object injectee){
}
Program: 60540
Project: 60540
Buggy source:
public <I>void hear(InjectableType<I> injectableType,Encounter<I> encounter){
  notificationCount.incrementAndGet();
}

Fixed version (ground truth):
public <I>void hear(InjectableType<I> injectableType,Encounter<I> encounter){
  encounterReference.set(encounter);
}
Program: 60541
Project: 60541
Buggy source:
public void init(final ServletContext servletContext,Injector injector) throws ServletException {
  if (!isSingletonBinding(injector.getBinding(filterKey))) {
    throw new ServletException("String_Node_Str" + filterKey + "String_Node_Str");
  }
  Filter filter=injector.getInstance(filterKey);
  this.filter.set(filter);
  filter.init(new FilterConfig(){
    public String getFilterName(){
      return filterKey.toString();
    }
    public ServletContext getServletContext(){
      return servletContext;
    }
    public String getInitParameter(    String s){
      return initParams.get(s);
    }
    public Enumeration getInitParameterNames(){
      return Iterators.asEnumeration(initParams.keySet().iterator());
    }
  }
);
}

Fixed version (ground truth):
public void init(final ServletContext servletContext,Injector injector,Set<Filter> initializedSoFar) throws ServletException {
  if (!isSingletonBinding(injector.getBinding(filterKey))) {
    throw new ServletException("String_Node_Str" + filterKey + "String_Node_Str");
  }
  Filter filter=injector.getInstance(filterKey);
  this.filter.set(filter);
  if (initializedSoFar.contains(filter)) {
    return;
  }
  filter.init(new FilterConfig(){
    public String getFilterName(){
      return filterKey.toString();
    }
    public ServletContext getServletContext(){
      return servletContext;
    }
    public String getInitParameter(    String s){
      return initParams.get(s);
    }
    public Enumeration getInitParameterNames(){
      return Iterators.asEnumeration(initParams.keySet().iterator());
    }
  }
);
  initializedSoFar.add(filter);
}
Program: 60542
Project: 60542
Buggy source:
public void destroy(){
  Filter reference=filter.get();
  if (null == reference) {
    return;
  }
  reference.destroy();
}

Fixed version (ground truth):
public void destroy(Set<Filter> destroyedSoFar){
  Filter reference=filter.get();
  if (null == reference || destroyedSoFar.contains(reference)) {
    return;
  }
  try {
    reference.destroy();
  }
  finally {
    destroyedSoFar.add(reference);
  }
}
Program: 60543
Project: 60543
Buggy source:
public synchronized void initPipeline(ServletContext servletContext) throws ServletException {
  if (initialized)   return;
  for (  FilterDefinition filterDefinition : filterDefinitions) {
    filterDefinition.init(servletContext,injector);
  }
  servletPipeline.init(servletContext,injector);
  initialized=true;
}

Fixed version (ground truth):
public synchronized void initPipeline(ServletContext servletContext) throws ServletException {
  if (initialized)   return;
  Set<Filter> initializedSoFar=Sets.newIdentityHashSet(ReferenceType.STRONG);
  for (  FilterDefinition filterDefinition : filterDefinitions) {
    filterDefinition.init(servletContext,injector,initializedSoFar);
  }
  servletPipeline.init(servletContext,injector);
  initialized=true;
}
Program: 60544
Project: 60544
Buggy source:
public void destroyPipeline(){
  servletPipeline.destroy();
  for (  FilterDefinition filterDefinition : filterDefinitions) {
    filterDefinition.destroy();
  }
}

Fixed version (ground truth):
public void destroyPipeline(){
  servletPipeline.destroy();
  Set<Filter> destroyedSoFar=Sets.newIdentityHashSet(ReferenceType.STRONG);
  for (  FilterDefinition filterDefinition : filterDefinitions) {
    filterDefinition.destroy(destroyedSoFar);
  }
}
Program: 60545
Project: 60545
Buggy source:
public void init(ServletContext servletContext,Injector injector) throws ServletException {
  for (  ServletDefinition servletDefinition : servletDefinitions) {
    servletDefinition.init(servletContext,injector);
  }
}

Fixed version (ground truth):
public void init(ServletContext servletContext,Injector injector) throws ServletException {
  Set<HttpServlet> initializedSoFar=Sets.newIdentityHashSet(ReferenceType.STRONG);
  for (  ServletDefinition servletDefinition : servletDefinitions) {
    servletDefinition.init(servletContext,injector,initializedSoFar);
  }
}
Program: 60546
Project: 60546
Buggy source:
public void forward(ServletRequest servletRequest,ServletResponse servletResponse) throws ServletException, IOException {
  if (servletResponse.isCommitted()) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  servletResponse.resetBuffer();
  servletDefinition.doService(servletRequest,servletResponse);
}

Fixed version (ground truth):
public void forward(ServletRequest servletRequest,ServletResponse servletResponse) throws ServletException, IOException {
  Preconditions.checkState(!servletResponse.isCommitted(),"String_Node_Str" + "String_Node_Str");
  servletResponse.resetBuffer();
  servletDefinition.doService(servletRequest,servletResponse);
}
Program: 60547
Project: 60547
Buggy source:
/** 
 * @return Returns a request dispatcher wrapped with a servlet mapped tothe given path or null if no mapping was found.
 */
RequestDispatcher getRequestDispatcher(String path){
  for (  final ServletDefinition servletDefinition : servletDefinitions) {
    if (servletDefinition.shouldServe(path)) {
      return new RequestDispatcher(){
        public void forward(        ServletRequest servletRequest,        ServletResponse servletResponse) throws ServletException, IOException {
          if (servletResponse.isCommitted()) {
            throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          }
          servletResponse.resetBuffer();
          servletDefinition.doService(servletRequest,servletResponse);
        }
        public void include(        ServletRequest servletRequest,        ServletResponse servletResponse) throws ServletException, IOException {
          servletDefinition.doService(servletRequest,servletResponse);
        }
      }
;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @return Returns a request dispatcher wrapped with a servlet mapped tothe given path or null if no mapping was found.
 */
RequestDispatcher getRequestDispatcher(String path){
  for (  final ServletDefinition servletDefinition : servletDefinitions) {
    if (servletDefinition.shouldServe(path)) {
      return new RequestDispatcher(){
        public void forward(        ServletRequest servletRequest,        ServletResponse servletResponse) throws ServletException, IOException {
          Preconditions.checkState(!servletResponse.isCommitted(),"String_Node_Str" + "String_Node_Str");
          servletResponse.resetBuffer();
          servletDefinition.doService(servletRequest,servletResponse);
        }
        public void include(        ServletRequest servletRequest,        ServletResponse servletResponse) throws ServletException, IOException {
          servletDefinition.doService(servletRequest,servletResponse);
        }
      }
;
    }
  }
  return null;
}
Program: 60548
Project: 60548
Buggy source:
public void destroy(){
  for (  ServletDefinition servletDefinition : servletDefinitions) {
    servletDefinition.destroy();
  }
}

Fixed version (ground truth):
public void destroy(){
  Set<HttpServlet> destroyedSoFar=Sets.newIdentityHashSet(ReferenceType.STRONG);
  for (  ServletDefinition servletDefinition : servletDefinitions) {
    servletDefinition.destroy(destroyedSoFar);
  }
}
Program: 60549
Project: 60549
Buggy source:
public void init(final ServletContext servletContext,Injector injector) throws ServletException {
  if (!isSingletonBinding(injector.getBinding(servletKey))) {
    throw new ServletException("String_Node_Str" + servletKey + "String_Node_Str");
  }
  HttpServlet httpServlet=injector.getInstance(servletKey);
  this.httpServlet.set(httpServlet);
  httpServlet.init(new ServletConfig(){
    public String getServletName(){
      return servletKey.toString();
    }
    public ServletContext getServletContext(){
      return servletContext;
    }
    public String getInitParameter(    String s){
      return initParams.get(s);
    }
    public Enumeration getInitParameterNames(){
      return Iterators.asEnumeration(initParams.keySet().iterator());
    }
  }
);
}

Fixed version (ground truth):
public void init(final ServletContext servletContext,Injector injector,Set<HttpServlet> initializedSoFar) throws ServletException {
  if (!isSingletonBinding(injector.getBinding(servletKey))) {
    throw new ServletException("String_Node_Str" + servletKey + "String_Node_Str");
  }
  HttpServlet httpServlet=injector.getInstance(servletKey);
  this.httpServlet.set(httpServlet);
  if (initializedSoFar.contains(httpServlet)) {
    return;
  }
  httpServlet.init(new ServletConfig(){
    public String getServletName(){
      return servletKey.toString();
    }
    public ServletContext getServletContext(){
      return servletContext;
    }
    public String getInitParameter(    String s){
      return initParams.get(s);
    }
    public Enumeration getInitParameterNames(){
      return Iterators.asEnumeration(initParams.keySet().iterator());
    }
  }
);
  initializedSoFar.add(httpServlet);
}
Program: 60550
Project: 60550
Buggy source:
public void destroy(){
  HttpServlet reference=httpServlet.get();
  if (null == reference) {
    return;
  }
  reference.destroy();
}

Fixed version (ground truth):
public void destroy(Set<HttpServlet> destroyedSoFar){
  HttpServlet reference=httpServlet.get();
  if (null == reference || destroyedSoFar.contains(reference)) {
    return;
  }
  try {
    reference.destroy();
  }
  finally {
    destroyedSoFar.add(reference);
  }
}
Program: 60552
Project: 60552
Buggy source:
private void servletPath(final String requestPath,String mapping,final String expectedServletPath) throws IOException, ServletException {
  Injector injector=createMock(Injector.class);
  HttpServletRequest request=createMock(HttpServletRequest.class);
  HttpServletResponse response=createMock(HttpServletResponse.class);
  expect(injector.getBinding(Key.get(HttpServlet.class))).andReturn(createMock(Binding.class));
  final boolean[] run=new boolean[1];
  expect(injector.getInstance(Key.get(HttpServlet.class))).andReturn(new HttpServlet(){
    @Override protected void service(    HttpServletRequest servletRequest,    HttpServletResponse httpServletResponse) throws ServletException, IOException {
      final String path=servletRequest.getServletPath();
      assertEquals(String.format("String_Node_Str",expectedServletPath,path),expectedServletPath,path);
      run[0]=true;
    }
  }
);
  expect(request.getServletPath()).andReturn(requestPath);
  replay(injector,request);
  ServletDefinition servletDefinition=new ServletDefinition(mapping,Key.get(HttpServlet.class),UriPatternType.get(UriPatternType.SERVLET,mapping),new HashMap<String,String>());
  servletDefinition.init(null,injector);
  servletDefinition.doService(request,response);
  assertTrue("String_Node_Str",run[0]);
}

Fixed version (ground truth):
private void servletPath(final String requestPath,String mapping,final String expectedServletPath) throws IOException, ServletException {
  Injector injector=createMock(Injector.class);
  HttpServletRequest request=createMock(HttpServletRequest.class);
  HttpServletResponse response=createMock(HttpServletResponse.class);
  expect(injector.getBinding(Key.get(HttpServlet.class))).andReturn(createMock(Binding.class));
  final boolean[] run=new boolean[1];
  expect(injector.getInstance(Key.get(HttpServlet.class))).andReturn(new HttpServlet(){
    @Override protected void service(    HttpServletRequest servletRequest,    HttpServletResponse httpServletResponse) throws ServletException, IOException {
      final String path=servletRequest.getServletPath();
      assertEquals(String.format("String_Node_Str",expectedServletPath,path),expectedServletPath,path);
      run[0]=true;
    }
  }
);
  expect(request.getServletPath()).andReturn(requestPath);
  replay(injector,request);
  ServletDefinition servletDefinition=new ServletDefinition(mapping,Key.get(HttpServlet.class),UriPatternType.get(UriPatternType.SERVLET,mapping),new HashMap<String,String>());
  servletDefinition.init(null,injector,Sets.<HttpServlet>newIdentityHashSet(ReferenceType.STRONG));
  servletDefinition.doService(request,response);
  assertTrue("String_Node_Str",run[0]);
}
Program: 60555
Project: 60555
Buggy source:
public final void testDispatchRequestToManagedPipelineServlets() throws ServletException, IOException {
  final Injector injector=Guice.createInjector(new ServletModule(){
    @Override protected void configureServlets(){
      serve("String_Node_Str").with(TestServlet.class);
      serve("String_Node_Str").with(NeverServlet.class);
      serve("String_Node_Str").with(Key.get(NeverServlet.class));
      serve("String_Node_Str").with(Key.get(NeverServlet.class));
      serve("String_Node_Str").with(Key.get(NeverServlet.class));
    }
  }
);
  final FilterPipeline pipeline=injector.getInstance(FilterPipeline.class);
  pipeline.initPipeline(null);
  HttpServletRequest requestMock=createMock(HttpServletRequest.class);
  expect(requestMock.getServletPath()).andReturn("String_Node_Str").times(1);
  replay(requestMock);
  pipeline.dispatch(requestMock,null,createMock(FilterChain.class));
  pipeline.destroyPipeline();
  verify(requestMock);
  assertTrue("String_Node_Str" + inits + "String_Node_Str"+ services+ "String_Node_Str"+ destroys,inits == 5 && services == 1 && destroys == 5);
}

Fixed version (ground truth):
public final void testDispatchRequestToManagedPipelineServlets() throws ServletException, IOException {
  final Injector injector=Guice.createInjector(new ServletModule(){
    @Override protected void configureServlets(){
      serve("String_Node_Str").with(TestServlet.class);
      serve("String_Node_Str").with(NeverServlet.class);
      serve("String_Node_Str").with(Key.get(NeverServlet.class));
      serve("String_Node_Str").with(Key.get(NeverServlet.class));
      serve("String_Node_Str").with(Key.get(NeverServlet.class));
    }
  }
);
  final FilterPipeline pipeline=injector.getInstance(FilterPipeline.class);
  pipeline.initPipeline(null);
  HttpServletRequest requestMock=createMock(HttpServletRequest.class);
  expect(requestMock.getServletPath()).andReturn("String_Node_Str").times(1);
  replay(requestMock);
  pipeline.dispatch(requestMock,null,createMock(FilterChain.class));
  pipeline.destroyPipeline();
  verify(requestMock);
  assertTrue("String_Node_Str" + inits + "String_Node_Str"+ services+ "String_Node_Str"+ destroys,inits == 2 && services == 1 && destroys == 2);
}
Program: 60556
Project: 60556
Buggy source:
public final void testDispatchRequestToManagedPipelineWithFilter() throws ServletException, IOException {
  final Injector injector=Guice.createInjector(new ServletModule(){
    @Override protected void configureServlets(){
      filter("String_Node_Str").through(TestFilter.class);
      serve("String_Node_Str").with(TestServlet.class);
      serve("String_Node_Str").with(NeverServlet.class);
      serve("String_Node_Str").with(Key.get(NeverServlet.class));
      serve("String_Node_Str").with(Key.get(NeverServlet.class));
      serve("String_Node_Str").with(Key.get(NeverServlet.class));
    }
  }
);
  final FilterPipeline pipeline=injector.getInstance(FilterPipeline.class);
  pipeline.initPipeline(null);
  HttpServletRequest requestMock=createMock(HttpServletRequest.class);
  expect(requestMock.getServletPath()).andReturn("String_Node_Str").times(2);
  replay(requestMock);
  pipeline.dispatch(requestMock,null,createMock(FilterChain.class));
  pipeline.destroyPipeline();
  verify(requestMock);
  assertTrue("String_Node_Str" + inits + "String_Node_Str"+ services+ "String_Node_Str"+ destroys,inits == 6 && services == 1 && destroys == 6 && doFilters == 1);
}

Fixed version (ground truth):
public final void testDispatchRequestToManagedPipelineWithFilter() throws ServletException, IOException {
  final Injector injector=Guice.createInjector(new ServletModule(){
    @Override protected void configureServlets(){
      filter("String_Node_Str").through(TestFilter.class);
      serve("String_Node_Str").with(TestServlet.class);
      serve("String_Node_Str").with(NeverServlet.class);
      serve("String_Node_Str").with(Key.get(NeverServlet.class));
      serve("String_Node_Str").with(Key.get(NeverServlet.class));
      serve("String_Node_Str").with(Key.get(NeverServlet.class));
    }
  }
);
  final FilterPipeline pipeline=injector.getInstance(FilterPipeline.class);
  pipeline.initPipeline(null);
  HttpServletRequest requestMock=createMock(HttpServletRequest.class);
  expect(requestMock.getServletPath()).andReturn("String_Node_Str").times(2);
  replay(requestMock);
  pipeline.dispatch(requestMock,null,createMock(FilterChain.class));
  pipeline.destroyPipeline();
  verify(requestMock);
  assertTrue("String_Node_Str" + inits + "String_Node_Str"+ services+ "String_Node_Str"+ destroys+ "String_Node_Str"+ doFilters,inits == 3 && services == 1 && destroys == 3 && doFilters == 1);
}
Program: 60557
Project: 60557
Buggy source:
public void destroy(){
  filter.get().destroy();
}

Fixed version (ground truth):
public void destroy(){
  Filter reference=filter.get();
  if (null == reference) {
    return;
  }
  reference.destroy();
}
Program: 60558
Project: 60558
Buggy source:
public void destroy(){
  httpServlet.get().destroy();
}

Fixed version (ground truth):
public void destroy(){
  HttpServlet reference=httpServlet.get();
  if (null == reference) {
    return;
  }
  reference.destroy();
}
Program: 60559
Project: 60559
Buggy source:
private static void checkForMisplacedBindingAnnotations(Member member,Errors errors){
  Annotation misplacedBindingAnnotation=Annotations.findBindingAnnotation(errors,member,((AnnotatedElement)member).getAnnotations());
  if (misplacedBindingAnnotation != null) {
    errors.misplacedBindingAnnotation(member,misplacedBindingAnnotation);
  }
}

Fixed version (ground truth):
private static void checkForMisplacedBindingAnnotations(Member member,Errors errors){
  Annotation misplacedBindingAnnotation=Annotations.findBindingAnnotation(errors,member,((AnnotatedElement)member).getAnnotations());
  if (misplacedBindingAnnotation == null) {
    return;
  }
  if (member instanceof Method) {
    try {
      if (member.getDeclaringClass().getDeclaredField(member.getName()) != null) {
        return;
      }
    }
 catch (    NoSuchFieldException ignore) {
    }
  }
  errors.misplacedBindingAnnotation(member,misplacedBindingAnnotation);
}
Program: 60561
Project: 60561
Buggy source:
protected void configure(){
  bind(Runnable.class).toProvider(new Provider<Runnable>(){
    public Runnable get(){
      throw new UnsupportedOperationException();
    }
  }
);
  requestInjection(new NeedsRunnable());
}

Fixed version (ground truth):
protected void configure(){
  requestStaticInjection(BlowsUpOnInject.class);
}
Program: 60562
Project: 60562
Buggy source:
public void toInstance(final T instance){
  checkNotTargetted();
  if (instance == null) {
    binder.addError("String_Node_Str" + "String_Node_Str");
    toProvider(Providers.<T>of(null));
    return;
  }
  List<InjectionPoint> injectionPointsList=Lists.newArrayList();
  try {
    InjectionPoint.addForInstanceMethodsAndFields(instance.getClass(),injectionPointsList);
  }
 catch (  ConfigurationException e) {
    for (    Message message : e.getErrorMessages()) {
      binder.addError(message);
    }
  }
  ImmutableSet<InjectionPoint> injectionPoints=ImmutableSet.copyOf(injectionPointsList);
  target=new InstanceTarget<T>(instance,injectionPoints);
}

Fixed version (ground truth):
public void toInstance(final T instance){
  checkNotTargetted();
  if (instance == null) {
    binder.addError(BINDING_TO_NULL);
    toProvider(Providers.<T>of(null));
    return;
  }
  List<InjectionPoint> injectionPointsList=Lists.newArrayList();
  try {
    InjectionPoint.addForInstanceMethodsAndFields(instance.getClass(),injectionPointsList);
  }
 catch (  ConfigurationException e) {
    for (    Message message : e.getErrorMessages()) {
      binder.addError(message);
    }
  }
  ImmutableSet<InjectionPoint> injectionPoints=ImmutableSet.copyOf(injectionPointsList);
  target=new InstanceTarget<T>(instance,injectionPoints);
}
Program: 60563
Project: 60563
Buggy source:
private void to(Class<?> type,Object instance){
  checkNotNull(instance,"String_Node_Str");
  @SuppressWarnings("String_Node_Str") Class<T> typeAsClassT=(Class<T>)type;
  @SuppressWarnings("String_Node_Str") T instanceAsT=(T)instance;
  if (keyTypeIsSet()) {
    binder.addError(CONSTANT_VALUE_ALREADY_SET);
    return;
  }
  if (key.getAnnotation() != null) {
    key=Key.get(typeAsClassT,key.getAnnotation());
  }
 else   if (key.getAnnotationType() != null) {
    key=Key.get(typeAsClassT,key.getAnnotationType());
  }
 else {
    key=Key.get(typeAsClassT);
  }
  ModuleBinding.this.target=new InstanceTarget<T>(instanceAsT,ImmutableSet.<InjectionPoint>of());
}

Fixed version (ground truth):
private void to(Class<?> type,Object instance){
  @SuppressWarnings("String_Node_Str") Class<T> typeAsClassT=(Class<T>)type;
  @SuppressWarnings("String_Node_Str") T instanceAsT=(T)instance;
  if (keyTypeIsSet()) {
    binder.addError(CONSTANT_VALUE_ALREADY_SET);
    return;
  }
  if (key.getAnnotation() != null) {
    key=Key.get(typeAsClassT,key.getAnnotation());
  }
 else   if (key.getAnnotationType() != null) {
    key=Key.get(typeAsClassT,key.getAnnotationType());
  }
 else {
    key=Key.get(typeAsClassT);
  }
  ModuleBinding.this.target=new InstanceTarget<T>(instanceAsT,ImmutableSet.<InjectionPoint>of());
  if (instanceAsT == null) {
    binder.addError(BINDING_TO_NULL);
  }
}
Program: 60564
Project: 60564
Buggy source:
private void putBinding(BindingImpl<?> binding){
  Key<?> key=binding.getKey();
  Class<?> rawType=key.getRawType();
  if (FORBIDDEN_TYPES.contains(rawType)) {
    errors.cannotBindToGuiceType(rawType.getSimpleName());
    return;
  }
  Binding<?> original=state.getExplicitBinding(key);
  if (original != null && !"String_Node_Str".equals(original.acceptTargetVisitor(GET_BOUND_PROVIDER_CLASS_NAME))) {
    errors.bindingAlreadySet(key,original.getSource());
    return;
  }
  state.parent().blacklist(key);
  state.putBinding(key,binding);
}

Fixed version (ground truth):
private void putBinding(BindingImpl<?> binding){
  Key<?> key=binding.getKey();
  Class<?> rawType=key.getRawType();
  if (FORBIDDEN_TYPES.contains(rawType)) {
    errors.cannotBindToGuiceType(rawType.getSimpleName());
    return;
  }
  Binding<?> original=state.getExplicitBinding(key);
  if (original != null) {
    boolean isOkayDuplicate=original instanceof ProviderInstanceBindingImpl && "String_Node_Str".equals(original.acceptTargetVisitor(GET_BOUND_PROVIDER_CLASS_NAME));
    if (!isOkayDuplicate) {
      errors.bindingAlreadySet(key,original.getSource());
      return;
    }
  }
  state.parent().blacklist(key);
  state.putBinding(key,binding);
}
Program: 60565
Project: 60565
Buggy source:
/** 
 * Creates a binding for a type annotated with @ProvidedBy. 
 */
<T>BindingImpl<T> createProvidedByBinding(final Class<T> type,Scope scope,ProvidedBy providedBy,LoadStrategy loadStrategy,Errors errors) throws ErrorsException {
  final Class<? extends Provider<?>> providerType=providedBy.value();
  if (providerType == type) {
    throw errors.recursiveProviderType().toException();
  }
  @SuppressWarnings("String_Node_Str") Key<? extends Provider<T>> providerKey=(Key<? extends Provider<T>>)Key.get(providerType);
  final BindingImpl<? extends Provider<?>> providerBinding=getBindingOrThrow(providerKey,errors);
  InternalFactory<T> internalFactory=new InternalFactory<T>(){
    public T get(    Errors errors,    InternalContext context,    Dependency dependency) throws ErrorsException {
      Provider<?> provider=providerBinding.internalFactory.get(errors,context,dependency);
      Object o=provider.get();
      if (o != null && !type.isInstance(o)) {
        throw errors.withSource(type).subtypeNotProvided(providerType,type).toException();
      }
      @SuppressWarnings("String_Node_Str") T t=(T)o;
      return t;
    }
  }
;
  Key<T> key=Key.get(type);
  return new LinkedProviderBindingImpl<T>(this,key,type,Scopes.<T>scope(key,this,internalFactory,scope),scope,providerKey,loadStrategy);
}

Fixed version (ground truth):
/** 
 * Creates a binding for a type annotated with @ProvidedBy. 
 */
<T>BindingImpl<T> createProvidedByBinding(final Class<T> type,Scope scope,ProvidedBy providedBy,LoadStrategy loadStrategy,Errors errors) throws ErrorsException {
  final Class<? extends Provider<?>> providerType=providedBy.value();
  if (providerType == type) {
    throw errors.recursiveProviderType().toException();
  }
  @SuppressWarnings("String_Node_Str") Key<? extends Provider<T>> providerKey=(Key<? extends Provider<T>>)Key.get(providerType);
  final BindingImpl<? extends Provider<?>> providerBinding=getBindingOrThrow(providerKey,errors);
  InternalFactory<T> internalFactory=new InternalFactory<T>(){
    public T get(    Errors errors,    InternalContext context,    Dependency dependency) throws ErrorsException {
      Provider<?> provider=providerBinding.internalFactory.get(errors,context,dependency);
      try {
        Object o=provider.get();
        if (o != null && !type.isInstance(o)) {
          throw errors.withSource(type).subtypeNotProvided(providerType,type).toException();
        }
        @SuppressWarnings("String_Node_Str") T t=(T)o;
        return t;
      }
 catch (      RuntimeException e) {
        throw errors.withSource(type).errorInProvider(e,null).toException();
      }
    }
  }
;
  Key<T> key=Key.get(type);
  return new LinkedProviderBindingImpl<T>(this,key,type,Scopes.<T>scope(key,this,internalFactory,scope),scope,providerKey,loadStrategy);
}
Program: 60566
Project: 60566
Buggy source:
private <T>void validateKey(Object source,Key<T> key){
  Class<? super T> rawType=key.getRawType();
  if (!Classes.isConcrete(rawType)) {
    Class<? extends Annotation> scopeAnnotation=Scopes.findScopeAnnotation(errors,rawType);
    if (scopeAnnotation != null) {
      errors.withSource(StackTraceElements.forType(rawType)).scopeAnnotationOnAbstractType(scopeAnnotation,rawType,source);
    }
  }
}

Fixed version (ground truth):
private <T>void validateKey(Object source,Key<T> key){
  Scopes.checkForMisplacedScopeAnnotations(key.getRawType(),source,errors);
}
Program: 60567
Project: 60567
Buggy source:
/** 
 * Creates a binding for a type annotated with @ProvidedBy. 
 */
<T>BindingImpl<T> createProvidedByBinding(final Class<T> type,ProvidedBy providedBy,LoadStrategy loadStrategy,Errors errors) throws ErrorsException {
  final Class<? extends Provider<?>> providerType=providedBy.value();
  if (providerType == type) {
    throw errors.recursiveProviderType().toException();
  }
  @SuppressWarnings("String_Node_Str") Key<? extends Provider<T>> providerKey=(Key<? extends Provider<T>>)Key.get(providerType);
  final BindingImpl<? extends Provider<?>> providerBinding=getBindingOrThrow(providerKey,errors);
  InternalFactory<T> internalFactory=new InternalFactory<T>(){
    public T get(    Errors errors,    InternalContext context,    InjectionPoint injectionPoint) throws ErrorsException {
      Provider<?> provider=providerBinding.internalFactory.get(errors,context,injectionPoint);
      Object o=provider.get();
      if (o != null && !type.isInstance(o)) {
        throw errors.withSource(StackTraceElements.forType(type)).subtypeNotProvided(providerType,type).toException();
      }
      @SuppressWarnings("String_Node_Str") T t=(T)o;
      return t;
    }
  }
;
  return new LinkedProviderBindingImpl<T>(this,Key.get(type),StackTraceElements.forType(type),internalFactory,Scopes.NO_SCOPE,providerKey,loadStrategy);
}

Fixed version (ground truth):
/** 
 * Creates a binding for a type annotated with @ProvidedBy. 
 */
<T>BindingImpl<T> createProvidedByBinding(final Class<T> type,Scope scope,ProvidedBy providedBy,LoadStrategy loadStrategy,Errors errors) throws ErrorsException {
  final Class<? extends Provider<?>> providerType=providedBy.value();
  if (providerType == type) {
    throw errors.recursiveProviderType().toException();
  }
  @SuppressWarnings("String_Node_Str") Key<? extends Provider<T>> providerKey=(Key<? extends Provider<T>>)Key.get(providerType);
  final BindingImpl<? extends Provider<?>> providerBinding=getBindingOrThrow(providerKey,errors);
  InternalFactory<T> internalFactory=new InternalFactory<T>(){
    public T get(    Errors errors,    InternalContext context,    InjectionPoint injectionPoint) throws ErrorsException {
      Provider<?> provider=providerBinding.internalFactory.get(errors,context,injectionPoint);
      Object o=provider.get();
      if (o != null && !type.isInstance(o)) {
        throw errors.withSource(StackTraceElements.forType(type)).subtypeNotProvided(providerType,type).toException();
      }
      @SuppressWarnings("String_Node_Str") T t=(T)o;
      return t;
    }
  }
;
  Key<T> key=Key.get(type);
  return new LinkedProviderBindingImpl<T>(this,key,StackTraceElements.forType(type),Scopes.<T>scope(key,this,internalFactory,scope),scope,providerKey,loadStrategy);
}
Program: 60569
Project: 60569
Buggy source:
/** 
 * Creates a binding for a type annotated with @ImplementedBy. 
 */
<T>BindingImpl<T> createImplementedByBinding(Class<T> type,ImplementedBy implementedBy,LoadStrategy loadStrategy,Errors errors) throws ErrorsException {
  Class<?> implementationType=implementedBy.value();
  if (implementationType == type) {
    throw errors.recursiveImplementationType().toException();
  }
  if (!type.isAssignableFrom(implementationType)) {
    throw errors.notASubtype(implementationType,type).toException();
  }
  @SuppressWarnings("String_Node_Str") Class<? extends T> subclass=(Class<? extends T>)implementationType;
  final BindingImpl<? extends T> targetBinding=getBindingOrThrow(Key.get(subclass),errors);
  InternalFactory<T> internalFactory=new InternalFactory<T>(){
    public T get(    Errors errors,    InternalContext context,    InjectionPoint<?> injectionPoint) throws ErrorsException {
      return targetBinding.internalFactory.get(errors,context,injectionPoint);
    }
  }
;
  return new LinkedBindingImpl<T>(this,Key.get(type),StackTraceElements.forType(type),internalFactory,Scopes.NO_SCOPE,Key.get(subclass),loadStrategy);
}

Fixed version (ground truth):
/** 
 * Creates a binding for a type annotated with @ImplementedBy. 
 */
<T>BindingImpl<T> createImplementedByBinding(Class<T> type,Scope scope,ImplementedBy implementedBy,LoadStrategy loadStrategy,Errors errors) throws ErrorsException {
  Class<?> implementationType=implementedBy.value();
  if (implementationType == type) {
    throw errors.recursiveImplementationType().toException();
  }
  if (!type.isAssignableFrom(implementationType)) {
    throw errors.notASubtype(implementationType,type).toException();
  }
  @SuppressWarnings("String_Node_Str") Class<? extends T> subclass=(Class<? extends T>)implementationType;
  final BindingImpl<? extends T> targetBinding=getBindingOrThrow(Key.get(subclass),errors);
  InternalFactory<T> internalFactory=new InternalFactory<T>(){
    public T get(    Errors errors,    InternalContext context,    InjectionPoint<?> injectionPoint) throws ErrorsException {
      return targetBinding.internalFactory.get(errors,context,injectionPoint);
    }
  }
;
  Key<T> key=Key.get(type);
  return new LinkedBindingImpl<T>(this,key,StackTraceElements.forType(type),Scopes.<T>scope(key,this,internalFactory,scope),scope,Key.get(subclass),loadStrategy);
}
Program: 60570
Project: 60570
Buggy source:
public void testSingletons(){
  Injector injector=Guice.createInjector(singletonsModule);
  assertSame(injector.getInstance(BoundAsSingleton.class),injector.getInstance(BoundAsSingleton.class));
  assertSame(injector.getInstance(AnnotatedSingleton.class),injector.getInstance(AnnotatedSingleton.class));
  assertSame(injector.getInstance(EagerSingleton.class),injector.getInstance(EagerSingleton.class));
  assertSame(injector.getInstance(LinkedSingleton.class),injector.getInstance(LinkedSingleton.class));
  assertSame(injector.getInstance(JustInTimeSingleton.class),injector.getInstance(JustInTimeSingleton.class));
  assertNotSame(injector.getInstance(NotASingleton.class),injector.getInstance(NotASingleton.class));
}

Fixed version (ground truth):
public void testSingletons(){
  Injector injector=Guice.createInjector(singletonsModule);
  assertSame(injector.getInstance(BoundAsSingleton.class),injector.getInstance(BoundAsSingleton.class));
  assertSame(injector.getInstance(AnnotatedSingleton.class),injector.getInstance(AnnotatedSingleton.class));
  assertSame(injector.getInstance(EagerSingleton.class),injector.getInstance(EagerSingleton.class));
  assertSame(injector.getInstance(LinkedSingleton.class),injector.getInstance(LinkedSingleton.class));
  assertSame(injector.getInstance(JustInTimeSingleton.class),injector.getInstance(JustInTimeSingleton.class));
  assertNotSame(injector.getInstance(NotASingleton.class),injector.getInstance(NotASingleton.class));
  assertSame(injector.getInstance(ImplementedBySingleton.class),injector.getInstance(ImplementedBySingleton.class));
  assertSame(injector.getInstance(ProvidedBySingleton.class),injector.getInstance(ProvidedBySingleton.class));
}
Program: 60571
Project: 60571
Buggy source:
public E get(){
  return null;
}

Fixed version (ground truth):
public ProvidedBySingleton get(){
  return new ProvidedBySingleton();
}
Program: 60572
Project: 60572
Buggy source:
@Override protected void setUp() throws Exception {
  AnnotatedSingleton.nextInstanceId=0;
  BoundAsSingleton.nextInstanceId=0;
  EagerSingleton.nextInstanceId=0;
  RealLinkedSingleton.nextInstanceId=0;
  JustInTimeSingleton.nextInstanceId=0;
  NotASingleton.nextInstanceId=0;
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  AnnotatedSingleton.nextInstanceId=0;
  BoundAsSingleton.nextInstanceId=0;
  EagerSingleton.nextInstanceId=0;
  RealLinkedSingleton.nextInstanceId=0;
  JustInTimeSingleton.nextInstanceId=0;
  NotASingleton.nextInstanceId=0;
  Implementation.nextInstanceId=0;
  ProvidedBySingleton.nextInstanceId=0;
}
Program: 60573
Project: 60573
Buggy source:
/** 
 * Returns the canonical form of this key for serialization. The returned instance is always a   {@code Key}, never a subclass. This prevents problems caused by serializing anonymous types.
 */
protected final Object writeReplace(){
  return getClass() == Key.class ? this : new Key<T>(typeLiteral,annotationStrategy);
}

Fixed version (ground truth):
protected final Object writeReplace(){
  return new SerializedForm(this);
}
Program: 60574
Project: 60574
Buggy source:
public void writeBindInterceptor(final Binder binder,final InterceptorBinding element){
  List<MethodInterceptor> interceptors=element.getInterceptors();
  binder.withSource(element.getSource()).bindInterceptor(element.getClassMatcher(),element.getMethodMatcher(),interceptors.toArray(new MethodInterceptor[interceptors.size()]));
}

Fixed version (ground truth):
protected void writeBindInterceptor(final Binder binder,final InterceptorBinding element){
  List<MethodInterceptor> interceptors=element.getInterceptors();
  binder.withSource(element.getSource()).bindInterceptor(element.getClassMatcher(),element.getMethodMatcher(),interceptors.toArray(new MethodInterceptor[interceptors.size()]));
}
Program: 60575
Project: 60575
Buggy source:
public void writeBindScope(final Binder binder,final ScopeBinding element){
  binder.withSource(element.getSource()).bindScope(element.getAnnotationType(),element.getScope());
}

Fixed version (ground truth):
protected void writeBindScope(final Binder binder,final ScopeBinding element){
  binder.withSource(element.getSource()).bindScope(element.getAnnotationType(),element.getScope());
}
Program: 60576
Project: 60576
Buggy source:
public <T>void writeGetProvider(final Binder binder,final ProviderLookup<T> element){
  Provider<T> provider=binder.withSource(element.getSource()).getProvider(element.getKey());
  element.initDelegate(provider);
}

Fixed version (ground truth):
protected <T>void writeGetProvider(final Binder binder,final ProviderLookup<T> element){
  Provider<T> provider=binder.withSource(element.getSource()).getProvider(element.getKey());
  element.initDelegate(provider);
}
Program: 60577
Project: 60577
Buggy source:
public <T>void writeBind(final Binder binder,final Binding<T> element){
  LinkedBindingBuilder<T> lbb=binder.withSource(element.getSource()).bind(element.getKey());
  ScopedBindingBuilder sbb=applyTarget(element,lbb);
  applyScoping(element,sbb);
}

Fixed version (ground truth):
protected <T>void writeBind(final Binder binder,final Binding<T> element){
  LinkedBindingBuilder<T> lbb=binder.withSource(element.getSource()).bind(element.getKey());
  ScopedBindingBuilder sbb=applyTarget(element,lbb);
  applyScoping(element,sbb);
}
Program: 60578
Project: 60578
Buggy source:
public void writeConvertToTypes(final Binder binder,final TypeConverterBinding element){
  binder.withSource(element.getSource()).convertToTypes(element.getTypeMatcher(),element.getTypeConverter());
}

Fixed version (ground truth):
protected void writeConvertToTypes(final Binder binder,final TypeConverterBinding element){
  binder.withSource(element.getSource()).convertToTypes(element.getTypeMatcher(),element.getTypeConverter());
}
Program: 60579
Project: 60579
Buggy source:
public void writeRequestStaticInjection(final Binder binder,final StaticInjectionRequest element){
  Class<?> type=element.getType();
  binder.withSource(element.getSource()).requestStaticInjection(type);
}

Fixed version (ground truth):
protected void writeRequestStaticInjection(final Binder binder,final StaticInjectionRequest element){
  Class<?> type=element.getType();
  binder.withSource(element.getSource()).requestStaticInjection(type);
}
Program: 60580
Project: 60580
Buggy source:
public void writeMessage(final Binder binder,final Message element){
  binder.addError(element);
}

Fixed version (ground truth):
protected void writeMessage(final Binder binder,final Message element){
  binder.addError(element);
}
Program: 60581
Project: 60581
Buggy source:
/** 
 * Execute this target against the linked binding builder.
 */
public <T>ScopedBindingBuilder applyTarget(Binding<T> binding,final LinkedBindingBuilder<T> linkedBindingBuilder){
  return binding.acceptTargetVisitor(new BindingTargetVisitor<T,ScopedBindingBuilder>(){
    public ScopedBindingBuilder visitInstance(    T instance,    Set<InjectionPoint> injectionPoints){
      linkedBindingBuilder.toInstance(instance);
      return null;
    }
    public ScopedBindingBuilder visitProvider(    Provider<? extends T> provider,    Set<InjectionPoint> injectionPoints){
      return linkedBindingBuilder.toProvider(provider);
    }
    public ScopedBindingBuilder visitProviderKey(    Key<? extends Provider<? extends T>> providerKey){
      return linkedBindingBuilder.toProvider(providerKey);
    }
    public ScopedBindingBuilder visitKey(    Key<? extends T> key){
      return linkedBindingBuilder.to(key);
    }
    public ScopedBindingBuilder visitUntargetted(){
      return linkedBindingBuilder;
    }
    public ScopedBindingBuilder visitConvertedConstant(    T value){
      throw new IllegalArgumentException("String_Node_Str");
    }
    public ScopedBindingBuilder visitConstructor(    Constructor<? extends T> constructor,    Set<InjectionPoint> injectionPoints){
      throw new IllegalArgumentException("String_Node_Str");
    }
    public ScopedBindingBuilder visitProviderBinding(    Key<?> provided){
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Execute this target against the linked binding builder.
 */
protected <T>ScopedBindingBuilder applyTarget(Binding<T> binding,final LinkedBindingBuilder<T> linkedBindingBuilder){
  return binding.acceptTargetVisitor(new BindingTargetVisitor<T,ScopedBindingBuilder>(){
    public ScopedBindingBuilder visitInstance(    T instance,    Set<InjectionPoint> injectionPoints){
      linkedBindingBuilder.toInstance(instance);
      return null;
    }
    public ScopedBindingBuilder visitProvider(    Provider<? extends T> provider,    Set<InjectionPoint> injectionPoints){
      return linkedBindingBuilder.toProvider(provider);
    }
    public ScopedBindingBuilder visitProviderKey(    Key<? extends Provider<? extends T>> providerKey){
      return linkedBindingBuilder.toProvider(providerKey);
    }
    public ScopedBindingBuilder visitKey(    Key<? extends T> key){
      return linkedBindingBuilder.to(key);
    }
    public ScopedBindingBuilder visitUntargetted(){
      return linkedBindingBuilder;
    }
    public ScopedBindingBuilder visitConvertedConstant(    T value){
      throw new IllegalArgumentException("String_Node_Str");
    }
    public ScopedBindingBuilder visitConstructor(    Constructor<? extends T> constructor,    Set<InjectionPoint> injectionPoints){
      throw new IllegalArgumentException("String_Node_Str");
    }
    public ScopedBindingBuilder visitProviderBinding(    Key<?> provided){
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
);
}
Program: 60582
Project: 60582
Buggy source:
public void applyScoping(Binding<?> binding,final ScopedBindingBuilder scopedBindingBuilder){
  binding.acceptScopingVisitor(new BindingScopingVisitor<Void>(){
    public Void visitEagerSingleton(){
      scopedBindingBuilder.asEagerSingleton();
      return null;
    }
    public Void visitScope(    Scope scope){
      scopedBindingBuilder.in(scope);
      return null;
    }
    public Void visitScopeAnnotation(    Class<? extends Annotation> scopeAnnotation){
      scopedBindingBuilder.in(scopeAnnotation);
      return null;
    }
    public Void visitNoScoping(){
      return null;
    }
  }
);
}

Fixed version (ground truth):
protected void applyScoping(Binding<?> binding,final ScopedBindingBuilder scopedBindingBuilder){
  binding.acceptScopingVisitor(new BindingScopingVisitor<Void>(){
    public Void visitEagerSingleton(){
      scopedBindingBuilder.asEagerSingleton();
      return null;
    }
    public Void visitScope(    Scope scope){
      scopedBindingBuilder.in(scope);
      return null;
    }
    public Void visitScopeAnnotation(    Class<? extends Annotation> scopeAnnotation){
      scopedBindingBuilder.in(scopeAnnotation);
      return null;
    }
    public Void visitNoScoping(){
      return null;
    }
  }
);
}
Program: 60583
Project: 60583
Buggy source:
public void writeRequestInjection(final Binder binder,final InjectionRequest command){
  binder.withSource(command.getSource()).requestInjection(command.getInstance());
}

Fixed version (ground truth):
protected void writeRequestInjection(final Binder binder,final InjectionRequest command){
  binder.withSource(command.getSource()).requestInjection(command.getInstance());
}
Program: 60584
Project: 60584
Buggy source:
/** 
 * Fails unless   {@code object} doesn't equal itself when reserialized.
 */
public static void assertEqualWhenReserialized(Object object) throws IOException {
  Assert.assertTrue("String_Node_Str",hasSerialVersionUid(object));
  Object reserialized=reserialize(object);
  Assert.assertEquals(object,reserialized);
  Assert.assertEquals(object.hashCode(),reserialized.hashCode());
}

Fixed version (ground truth):
/** 
 * Fails unless   {@code object} doesn't equal itself when reserialized.
 */
public static void assertEqualWhenReserialized(Object object) throws IOException {
  Object reserialized=reserialize(object);
  assertEquals(object,reserialized);
  assertEquals(object.hashCode(),reserialized.hashCode());
}
Program: 60585
Project: 60585
Buggy source:
/** 
 * Fails unless   {@code object} has the same toString value when reserialized.
 */
public static void assertSimilarWhenReserialized(Object object) throws IOException {
  Assert.assertTrue("String_Node_Str",hasSerialVersionUid(object));
  Object reserialized=reserialize(object);
  Assert.assertEquals(object.toString(),reserialized.toString());
}

Fixed version (ground truth):
/** 
 * Fails unless   {@code object} has the same toString value when reserialized.
 */
public static void assertSimilarWhenReserialized(Object object) throws IOException {
  Object reserialized=reserialize(object);
  assertEquals(object.toString(),reserialized.toString());
}
Program: 60586
Project: 60586
Buggy source:
public static void assertNotSerializable(Object object) throws IOException {
  Assert.assertFalse("String_Node_Str",hasSerialVersionUid(object));
  try {
    reserialize(object);
    Assert.fail();
  }
 catch (  NotSerializableException expected) {
  }
}

Fixed version (ground truth):
public static void assertNotSerializable(Object object) throws IOException {
  try {
    reserialize(object);
    Assert.fail();
  }
 catch (  NotSerializableException expected) {
  }
}