Program: 153700
Project: 153700
Buggy source:
@Test public void destination(BundleContext context) throws IOException {
  assertThat("String_Node_Str",context,is(notNullValue()));
  setup(context);
  ServiceReference sr=osgi.getServiceReference("String_Node_Str");
  ServicesConfig sc=(ServicesConfig)osgi.getServiceObject(sr);
  ServiceReference sr2=osgi.getServiceReference("String_Node_Str");
  ConfigurationHelper ch=(ConfigurationHelper)osgi.getServiceObject(sr2);
  assertThat("String_Node_Str",sc,is(notNullValue()));
  ComponentInstance destination1, channel1, service1, adapter1, adapter2, factory;
  adapter1=ch.newAdapter("String_Node_Str");
  adapter2=ch.newAdapter("String_Node_Str");
  service1=ch.newGravityService("String_Node_Str");
  channel1=ch.newGravityChannel("String_Node_Str","String_Node_Str");
  destination1=ch.newGravityDestination("String_Node_Str","String_Node_Str");
  Service ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser,is(notNullValue()));
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str"),is(notNullValue()));
  destination1.dispose();
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str"),is(nullValue()));
  destination1=ch.newGravityDestination("String_Node_Str","String_Node_Str");
  service1.dispose();
  ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser,is(nullValue()));
  service1=ch.newGravityService("String_Node_Str","String_Node_Str");
  ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str").getAdapter(),is(notNullValue()));
  assertTrue("String_Node_Str",ser.findDestinationById("String_Node_Str").getAdapter().getId().equals("String_Node_Str"));
  destination1.dispose();
  destination1=ch.newGravityDestination("String_Node_Str","String_Node_Str","String_Node_Str");
  ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str").getAdapter(),is(notNullValue()));
  assertTrue("String_Node_Str",ser.findDestinationById("String_Node_Str").getAdapter().getId().equals("String_Node_Str"));
  adapter2.dispose();
  assertThat("String_Node_Str",sc.findDestinationById("String_Node_Str","String_Node_Str"),is(nullValue()));
  destination1.dispose();
  service1.dispose();
  service1=ch.newGraniteService("String_Node_Str");
  ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser,is(notNullValue()));
  destination1=ch.newGraniteDestination("String_Node_Str","String_Node_Str");
  ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str"),is(notNullValue()));
  destination1.dispose();
  destination1=ch.newGraniteDestination("String_Node_Str","String_Node_Str","String_Node_Str",ConfigurationHelper.SCOPE.SESSION);
  ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str"),is(nullValue()));
  factory=ch.newFactory("String_Node_Str");
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str"),is(notNullValue()));
  destination1.dispose();
  factory.dispose();
  service1.dispose();
  channel1.dispose();
  adapter1.dispose();
}

Fixed version (ground truth):
@Test public void destination(BundleContext context) throws IOException {
  assertThat("String_Node_Str",context,is(notNullValue()));
  setup(context);
  ServiceReference sr=osgi.getServiceReference("String_Node_Str");
  ServicesConfig sc=(ServicesConfig)osgi.getServiceObject(sr);
  ServiceReference sr2=osgi.getServiceReference("String_Node_Str");
  ConfigurationHelper ch=(ConfigurationHelper)osgi.getServiceObject(sr2);
  assertThat("String_Node_Str",sc,is(notNullValue()));
  ComponentInstance destination1, channel1, service1, adapter1, adapter2, factory;
  adapter1=ch.newAdapter("String_Node_Str");
  adapter2=ch.newAdapter("String_Node_Str");
  service1=ch.newGravityService("String_Node_Str");
  channel1=ch.newGravityChannel("String_Node_Str","String_Node_Str","String_Node_Str");
  destination1=ch.newGravityDestination("String_Node_Str","String_Node_Str");
  Service ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser,is(notNullValue()));
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str"),is(notNullValue()));
  destination1.dispose();
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str"),is(nullValue()));
  destination1=ch.newGravityDestination("String_Node_Str","String_Node_Str");
  service1.dispose();
  ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser,is(nullValue()));
  service1=ch.newGravityService("String_Node_Str","String_Node_Str");
  ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str").getAdapter(),is(notNullValue()));
  assertTrue("String_Node_Str",ser.findDestinationById("String_Node_Str").getAdapter().getId().equals("String_Node_Str"));
  destination1.dispose();
  destination1=ch.newGravityDestination("String_Node_Str","String_Node_Str","String_Node_Str");
  ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str").getAdapter(),is(notNullValue()));
  assertTrue("String_Node_Str",ser.findDestinationById("String_Node_Str").getAdapter().getId().equals("String_Node_Str"));
  adapter2.dispose();
  assertThat("String_Node_Str",sc.findDestinationById("String_Node_Str","String_Node_Str"),is(nullValue()));
  destination1.dispose();
  service1.dispose();
  service1=ch.newGraniteService("String_Node_Str");
  ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser,is(notNullValue()));
  destination1=ch.newGraniteDestination("String_Node_Str","String_Node_Str");
  ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str"),is(notNullValue()));
  destination1.dispose();
  destination1=ch.newGraniteDestination("String_Node_Str","String_Node_Str","String_Node_Str",ConfigurationHelper.SCOPE.SESSION);
  ser=sc.findServiceById("String_Node_Str");
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str"),is(nullValue()));
  factory=ch.newFactory("String_Node_Str");
  assertThat("String_Node_Str",ser.findDestinationById("String_Node_Str"),is(notNullValue()));
  destination1.dispose();
  factory.dispose();
  service1.dispose();
  channel1.dispose();
  adapter1.dispose();
}