nus-yam/ex-repair huggingface dataset:
Program: 152870
Project: 152870
Buggy source:
@Test public void shouldDownloadFileUsingPublicLink() throws Exception {
  String bucketName="String_Node_Str" + UUID.randomUUID();
  Service service=new WebClientService(credentials);
  service.createBucket(bucketName);
  File file=folder.newFile("String_Node_Str");
  FileUtils.writeStringToFile(file,UUID.randomUUID().toString());
  service.createObject(bucketName,file.getName(),file,new NullProgressListener());
  String publicUrl=service.getPublicUrl(bucketName,file.getName(),new DateTime().plusDays(5));
  System.out.println("String_Node_Str" + publicUrl);
  File saved=folder.newFile("String_Node_Str");
  InputStream input=new URL(publicUrl).openConnection().getInputStream();
  FileOutputStream output=new FileOutputStream(saved);
  IOUtils.copy(input,output);
  output.close();
  assertThat("String_Node_Str",Files.computeMD5(saved),equalTo(Files.computeMD5(file)));
  service.deleteObject(bucketName,file.getName());
  service.deleteBucket(bucketName);
}

Fixed version (ground truth):
@Test public void shouldDownloadFileUsingPublicLink() throws Exception {
  String bucketName="String_Node_Str" + UUID.randomUUID();
  Service service=new WebClientService(credentials);
  service.createBucket(bucketName);
  File file=folder.newFile("String_Node_Str");
  FileUtils.writeStringToFile(file,UUID.randomUUID().toString());
  service.createObject(bucketName,file.getName(),file,new NullProgressListener());
  String publicUrl=service.getPublicUrl(bucketName,file.getName(),new DateTime().plusDays(5));
  File saved=folder.newFile("String_Node_Str");
  InputStream input=new URL(publicUrl).openConnection().getInputStream();
  FileOutputStream output=new FileOutputStream(saved);
  IOUtils.copy(input,output);
  output.close();
  assertThat("String_Node_Str",Files.computeMD5(saved),equalTo(Files.computeMD5(file)));
  service.deleteObject(bucketName,file.getName());
  service.deleteBucket(bucketName);
}
Program: 152872
Project: 152872
Buggy source:
public static void RestoreState(android.content.Context ctx){
  boolean RestoredLib=false;
  for (boolean LoadingLib=false; ; ) {
    final String StateFile=ctx.getFilesDir().getAbsolutePath() + "String_Node_Str" + (LoadingLib ? SavedLibName : SavedStateName);
    if (new java.io.File(StateFile).exists()) {
      try {
        Load(StateFile,LoadingLib,!LoadingLib,Global.Disp,Global.Label,Global.Buttons,Global.Calc);
        if (LoadingLib) {
          RestoredLib=true;
        }
      }
 catch (      DataFormatException Bad) {
        System.err.printf("String_Node_Str",StateFile,Bad.toString());
      }
    }
    if (LoadingLib)     break;
    LoadingLib=true;
  }
  if (!RestoredLib) {
    LoadMasterLibrary(ctx);
  }
}

Fixed version (ground truth):
public static void RestoreState(android.content.Context ctx){
  boolean RestoredLib=false;
  for (boolean LoadingLib=true; ; ) {
    final String StateFile=ctx.getFilesDir().getAbsolutePath() + "String_Node_Str" + (LoadingLib ? SavedLibName : SavedStateName);
    if (new java.io.File(StateFile).exists()) {
      try {
        Load(StateFile,LoadingLib,!LoadingLib,Global.Disp,Global.Label,Global.Buttons,Global.Calc);
        if (LoadingLib) {
          RestoredLib=true;
        }
      }
 catch (      DataFormatException Bad) {
        System.err.printf("String_Node_Str",StateFile,Bad.toString());
      }
    }
    if (!LoadingLib)     break;
    LoadingLib=false;
  }
  if (!RestoredLib) {
    LoadMasterLibrary(ctx);
    SaveState(ctx,true);
  }
}
Program: 152873
Project: 152873
Buggy source:
public static void SaveState(android.content.Context ctx,boolean SaveLib){
  ResetState(ctx);
  java.io.FileOutputStream CurSave;
  try {
    CurSave=ctx.openFileOutput(SaveLib ? SavedLibName : SavedStateName,ctx.MODE_WORLD_READABLE);
  }
 catch (  java.io.FileNotFoundException Eh) {
    throw new RuntimeException("String_Node_Str" + Eh.toString());
  }
  Save(Global.Buttons,Global.Calc,SaveLib,!SaveLib,CurSave);
  try {
    CurSave.flush();
    CurSave.close();
  }
 catch (  java.io.IOException Failed) {
    throw new RuntimeException("String_Node_Str" + Failed.toString());
  }
}

Fixed version (ground truth):
public static void SaveState(android.content.Context ctx,boolean SaveLib){
  java.io.FileOutputStream CurSave;
  try {
    final String StateName=SaveLib ? SavedLibName : SavedStateName;
    ctx.deleteFile(StateName);
    CurSave=ctx.openFileOutput(StateName,ctx.MODE_WORLD_READABLE);
  }
 catch (  java.io.FileNotFoundException Eh) {
    throw new RuntimeException("String_Node_Str" + Eh.toString());
  }
  Save(Global.Buttons,Global.Calc,SaveLib,!SaveLib,CurSave);
  try {
    CurSave.flush();
    CurSave.close();
  }
 catch (  java.io.IOException Failed) {
    throw new RuntimeException("String_Node_Str" + Failed.toString());
  }
}
Program: 152874
Project: 152874
Buggy source:
int GetUnitOp(boolean Executing){
  int Result=-1;
  final int NextByte=GetProg(Executing);
  if (NextByte >= 0) {
    boolean OK;
    if (NextByte < 10) {
      Result=NextByte;
      OK=true;
    }
 else     if (NextByte == 40) {
      final int Reg=GetProg(Executing);
      if (Reg >= 0 && Reg < MaxMemories) {
        Result=(int)Memory[Reg];
        OK=Result >= 0 && Result < 10;
        if (!OK) {
          Result=-1;
        }
      }
 else {
        OK=false;
      }
    }
 else {
      OK=false;
    }
    if (!OK) {
      SetErrorState();
      StopProgram();
    }
  }
  return Result;
}

Fixed version (ground truth):
int GetUnitOp(boolean Executing){
  int Result=-1;
  final int NextByte=GetProg(Executing);
  if (NextByte >= 0) {
    boolean OK;
    if (NextByte < 10) {
      Result=NextByte;
      OK=true;
    }
 else     if (NextByte == 40) {
      final int Reg=GetProg(Executing);
      if (Reg >= 0 && Reg < MaxMemories) {
        Result=(int)Memory[Reg];
        OK=Result >= 0 && Result < 10;
        if (!OK) {
          Result=-1;
        }
      }
 else {
        OK=false;
      }
    }
 else {
      OK=false;
    }
    if (Executing && !OK) {
      SetErrorState();
      StopProgram();
    }
  }
  return Result;
}
Program: 152875
Project: 152875
Buggy source:
public void Int(){
  Enter();
  final double IntPart=Math.floor(Math.abs(X));
  if (InvState) {
    SetX((Math.abs(X) - IntPart) * Math.signum(X));
  }
 else {
    SetX(IntPart * Math.signum(X));
  }
}

Fixed version (ground truth):
public void Int(){
  Enter();
  final double RoundFactor=10e+13;
  final double IntPart=Math.floor(Math.abs(Math.rint(X * RoundFactor) / RoundFactor));
  if (InvState) {
    SetX((Math.abs(X) - IntPart) * Math.signum(X));
  }
 else {
    SetX(IntPart * Math.signum(X));
  }
}
Program: 152876
Project: 152876
Buggy source:
private Method findServiceReferenceMethod(Class<?> clazz,String methodName){
  Method method=org.springframework.util.ReflectionUtils.findMethod(clazz,bindMethod,new Class[]{ServiceReference.class});
  if (method != null) {
    org.springframework.util.ReflectionUtils.makeAccessible(method);
  }
  return method;
}

Fixed version (ground truth):
private Method findServiceReferenceMethod(Class<?> clazz,String methodName){
  Method method=org.springframework.util.ReflectionUtils.findMethod(clazz,methodName,new Class[]{ServiceReference.class});
  if (method != null) {
    org.springframework.util.ReflectionUtils.makeAccessible(method);
  }
  return method;
}
Program: 152877
Project: 152877
Buggy source:
@Override protected void onSetUp() throws Exception {
  System.out.println(file.toURI());
  startedBundles.clear();
  failedBundles.clear();
  reg1=bundleContext.registerService(BlueprintListener.class.getName(),listener,null);
  String[] topics=new String[]{"String_Node_Str"};
  Dictionary<String,Object> prop=new Hashtable<String,Object>();
  prop.put(EventConstants.EVENT_TOPIC,topics);
  reg2=bundleContext.registerService(EventHandler.class.getName(),handler,prop);
}

Fixed version (ground truth):
@Override protected void onSetUp() throws Exception {
  startedBundles.clear();
  failedBundles.clear();
  reg1=bundleContext.registerService(BlueprintListener.class.getName(),listener,null);
  String[] topics=new String[]{"String_Node_Str"};
  Dictionary<String,Object> prop=new Hashtable<String,Object>();
  prop.put(EventConstants.EVENT_TOPIC,topics);
  reg2=bundleContext.registerService(EventHandler.class.getName(),handler,prop);
}
Program: 152878
Project: 152878
Buggy source:
/** 
 * Constructs a new <code>SimpleMethodInjectionMetadata</code> instance.
 * @param definition
 */
public SimpleMethodInjectionMetadata(BeanDefinition definition){
  this.name=definition.getFactoryMethodName();
  params=(StringUtils.hasText(definition.getFactoryBeanName()) ? Collections.<ParameterSpecification>emptyList() : MetadataUtils.getParameterList(definition.getConstructorArgumentValues()));
}

Fixed version (ground truth):
/** 
 * Constructs a new <code>SimpleMethodInjectionMetadata</code> instance.
 * @param definition
 */
public SimpleMethodInjectionMetadata(BeanDefinition definition){
  this.name=definition.getFactoryMethodName();
  params=MetadataUtils.getParameterList(definition.getConstructorArgumentValues());
}
Program: 152879
Project: 152879
Buggy source:
public static Object staticMethod(Long arg1,String arg2,Integer arg3){
  return arg3;
}

Fixed version (ground truth):
public static Object staticMethod(){
  return new Object();
}
Program: 152880
Project: 152880
Buggy source:
public void run(){
  if (context.isActive()) {
    preProcessClose(context);
    try {
      context.close();
    }
  finally {
      postProcessClose(context);
    }
  }
}

Fixed version (ground truth):
public void run(){
  closeApplicationContext(context);
}
Program: 152881
Project: 152881
Buggy source:
/** 
 * Closing an application context is a potentially long-running activity, however, we *have* to do it synchronously during the event process as the BundleContext object is not valid once we return from this method.
 * @param bundle
 */
protected void maybeCloseApplicationContextFor(Bundle bundle){
  final ConfigurableOsgiBundleApplicationContext context=(ConfigurableOsgiBundleApplicationContext)managedContexts.remove(new Long(bundle.getBundleId()));
  if (context == null) {
    return;
  }
  RunnableTimedExecution.execute(new Runnable(){
    private final String toString="String_Node_Str" + context.getDisplayName();
    public void run(){
      if (context.isActive()) {
        preProcessClose(context);
        try {
          context.close();
        }
  finally {
          postProcessClose(context);
        }
      }
    }
    public String toString(){
      return toString;
    }
  }
,extenderConfiguration.getShutdownWaitTime(),shutdownTaskExecutor);
}

Fixed version (ground truth):
/** 
 * Closing an application context is a potentially long-running activity, however, we *have* to do it synchronously during the event process as the BundleContext object is not valid once we return from this method.
 * @param bundle
 */
protected void maybeCloseApplicationContextFor(Bundle bundle){
  final ConfigurableOsgiBundleApplicationContext context=(ConfigurableOsgiBundleApplicationContext)managedContexts.remove(new Long(bundle.getBundleId()));
  if (context == null) {
    return;
  }
  RunnableTimedExecution.execute(new Runnable(){
    private final String toString="String_Node_Str" + context.getDisplayName();
    public void run(){
      closeApplicationContext(context);
    }
    public String toString(){
      return toString;
    }
  }
,extenderConfiguration.getShutdownWaitTime(),shutdownTaskExecutor);
}
Program: 152883
Project: 152883
Buggy source:
public void testModuleContextListener() throws Exception {
  final List<Bundle> contexts=new ArrayList<Bundle>();
  ModuleContextListener listener=new ModuleContextListener(){
    public void contextCreated(    Bundle bundle){
      addToList(bundle);
    }
    public void contextCreationFailed(    Bundle bundle,    Throwable ex){
      addToList(bundle);
    }
    private void addToList(    Bundle bundle){
synchronized (contexts) {
        contexts.add(bundle);
        contexts.notify();
      }
    }
  }
;
  installTestBundle();
  bundleContext.registerService(ModuleContextListener.class.getName(),listener,new Hashtable());
  testBundle.start();
synchronized (contexts) {
    contexts.wait(2 * 1000 * 60);
    assertFalse("String_Node_Str",contexts.isEmpty());
  }
}

Fixed version (ground truth):
public void testModuleContextListener() throws Exception {
  final List<Bundle> contexts=new ArrayList<Bundle>();
  ModuleContextListener listener=new ModuleContextListener(){
    public void contextCreated(    Bundle bundle){
      addToList(bundle);
    }
    public void contextCreationFailed(    Bundle bundle,    Throwable ex){
      addToList(bundle);
    }
    private void addToList(    Bundle bundle){
synchronized (contexts) {
        contexts.add(bundle);
        contexts.notify();
      }
    }
  }
;
  installTestBundle();
  bundleContext.registerService(ModuleContextListener.class.getName(),listener,null);
  testBundle.start();
synchronized (contexts) {
    contexts.wait(2 * 1000 * 60);
    assertFalse("String_Node_Str",contexts.isEmpty());
  }
}
Program: 152884
Project: 152884
Buggy source:
public void stop(BundleContext context) throws Exception {
  for (int i=CHAIN.length - 1; i < 0; i--) {
    CHAIN[i].stop(context);
  }
}

Fixed version (ground truth):
public void stop(BundleContext context) throws Exception {
  for (int i=CHAIN.length - 1; i >= 0; i--) {
    CHAIN[i].stop(context);
  }
}
Program: 152886
Project: 152886
Buggy source:
/** 
 * {@inheritDoc}<p/> Converts the given value to a ServiceReference.
 */
public void setValue(Object value){
  if (value == null) {
    super.setValue(null);
    return;
  }
  if (value instanceof ImportedOsgiServiceProxy) {
    super.setValue(new ServiceReferenceDelegate((ImportedOsgiServiceProxy)value));
    return;
  }
  if (value instanceof ServiceReference) {
    super.setValue(value);
    return;
  }
  throw new IllegalArgumentException("String_Node_Str" + ImportedOsgiServiceProxy.class.getName() + "String_Node_Str"+ value.getClass());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p/> Converts the given value to a ServiceReference.
 */
public void setValue(Object value){
  if (value == null) {
    super.setValue(null);
    return;
  }
  if (value instanceof ImportedOsgiServiceProxy) {
    ImportedOsgiServiceProxy referenceProxy=(ImportedOsgiServiceProxy)value;
    super.setValue(referenceProxy.getServiceReference().getTargetServiceReference());
    return;
  }
  if (value instanceof ServiceReference) {
    super.setValue(value);
    return;
  }
  throw new IllegalArgumentException("String_Node_Str" + ImportedOsgiServiceProxy.class.getName() + "String_Node_Str"+ value.getClass());
}
Program: 152887
Project: 152887
Buggy source:
/** 
 * Builds a component metadata from the given bean definition.
 * @param name bean name
 * @param beanDefinition
 * @return
 */
ComponentMetadata buildMetadata(String name,BeanDefinition beanDefinition){
  Object metadata=beanDefinition.getAttribute(COMPONENT_METADATA_ATTRIBUTE);
  if (metadata instanceof ComponentMetadata)   return (ComponentMetadata)metadata;
  if (name == null) {
    name=(String)beanDefinition.getAttribute(COMPONENT_NAME);
  }
  if (isServiceExporter(beanDefinition)) {
    return new SpringServiceExportComponentMetadata(name,beanDefinition);
  }
  if (isServiceImporter(beanDefinition)) {
    return new SpringServiceReferenceComponentMetadata(name,beanDefinition);
  }
  return new SpringLocalComponentMetadata(name,beanDefinition);
}

Fixed version (ground truth):
/** 
 * Builds a component metadata from the given bean definition.
 * @param name bean name
 * @param beanDefinition
 * @return
 */
ComponentMetadata buildMetadata(String name,BeanDefinition beanDefinition){
  Object metadata=beanDefinition.getAttribute(COMPONENT_METADATA_ATTRIBUTE);
  if (metadata instanceof ComponentMetadata)   return (ComponentMetadata)metadata;
  if (name == null) {
    name=(String)beanDefinition.getAttribute(COMPONENT_NAME);
  }
  if (isServiceExporter(beanDefinition)) {
    return new SpringServiceExportComponentMetadata(name,beanDefinition);
  }
  if (isSingleServiceImporter(beanDefinition)) {
    return new SpringUnaryServiceReferenceComponentMetadata(name,beanDefinition);
  }
  if (isCollectionImporter(beanDefinition)) {
    return new SpringCollectionBasedServiceReferenceComponentMetadata(name,beanDefinition);
  }
  return new SpringLocalComponentMetadata(name,beanDefinition);
}
Program: 152888
Project: 152888
Buggy source:
/** 
 * Builds a component metadata from the given bean definition.
 * @param name bean name
 * @param beanDefinition
 * @return
 */
ComponentMetadata buildMetadata(String name,BeanDefinition beanDefinition){
  Object metadata=beanDefinition.getAttribute(COMPONENT_METADATA_ATTRIBUTE);
  if (metadata instanceof ComponentMetadata)   return (ComponentMetadata)metadata;
  if (name == null) {
    name=(String)beanDefinition.getAttribute(COMPONENT_NAME);
  }
  if (isServiceExporter(beanDefinition)) {
    return new SpringServiceExportComponentMetadata(beanDefinition);
  }
  if (isServiceImporter(beanDefinition)) {
    return new SpringServiceReferenceComponentMetadata(beanDefinition);
  }
  return new SpringLocalComponentMetadata(name,beanDefinition);
}

Fixed version (ground truth):
/** 
 * Builds a component metadata from the given bean definition.
 * @param name bean name
 * @param beanDefinition
 * @return
 */
ComponentMetadata buildMetadata(String name,BeanDefinition beanDefinition){
  Object metadata=beanDefinition.getAttribute(COMPONENT_METADATA_ATTRIBUTE);
  if (metadata instanceof ComponentMetadata)   return (ComponentMetadata)metadata;
  if (name == null) {
    name=(String)beanDefinition.getAttribute(COMPONENT_NAME);
  }
  if (isServiceExporter(beanDefinition)) {
    return new SpringServiceExportComponentMetadata(name,beanDefinition);
  }
  if (isServiceImporter(beanDefinition)) {
    return new SpringServiceReferenceComponentMetadata(name,beanDefinition);
  }
  return new SpringLocalComponentMetadata(name,beanDefinition);
}
Program: 152889
Project: 152889
Buggy source:
/** 
 * Constructs a new <code>SpringServiceExportComponentMetadata</code> instance.
 * @param definition bean definition
 */
public SpringServiceExportComponentMetadata(BeanDefinition definition){
  super(null,definition);
  MutablePropertyValues propertyValues=definition.getPropertyValues();
}

Fixed version (ground truth):
/** 
 * Constructs a new <code>SpringServiceExportComponentMetadata</code> instance.
 * @param name bean name
 * @param definition bean definition
 */
public SpringServiceExportComponentMetadata(String name,BeanDefinition definition){
  super(name,definition);
  MutablePropertyValues propertyValues=definition.getPropertyValues();
}
Program: 152890
Project: 152890
Buggy source:
/** 
 * Constructs a new <code>SpringServiceReferenceComponentMetadata</code> instance.
 * @param definition bean definition
 */
public SpringServiceReferenceComponentMetadata(BeanDefinition definition){
  super(null,definition);
}

Fixed version (ground truth):
/** 
 * Constructs a new <code>SpringServiceReferenceComponentMetadata</code> instance.
 * @param name bean name
 * @param definition bean definition
 */
public SpringServiceReferenceComponentMetadata(String name,BeanDefinition definition){
  super(name,definition);
  MutablePropertyValues pvs=beanDefinition.getPropertyValues();
  componentName=(String)MetadataUtils.getValue(pvs,SERVICE_NAME_PROP);
  filter=(String)MetadataUtils.getValue(pvs,FILTER_PROP);
  Cardinality cardinality=(Cardinality)MetadataUtils.getValue(pvs,CARDINALITY_PROP);
  availability=(cardinality == null || cardinality.isMandatory() ? ServiceReferenceComponentMetadata.MANDATORY_AVAILABILITY : ServiceReferenceComponentMetadata.OPTIONAL_AVAILABILITY);
  Object value=MetadataUtils.getValue(pvs,INTERFACES_PROP);
  Set<String> intfs=new LinkedHashSet<String>(4);
  if (value instanceof String) {
    intfs.add((String)value);
  }
 else {
    if (value instanceof Collection) {
      Collection values=(Collection)value;
      for (Iterator iterator=values.iterator(); iterator.hasNext(); ) {
        TypedStringValue tsv=(TypedStringValue)iterator.next();
        intfs.add(tsv.getValue());
      }
    }
  }
  interfaces=Collections.unmodifiableSet(intfs);
  List<BindingListenerMetadata> foundListeners=new ArrayList<BindingListenerMetadata>(4);
  List<? extends AbstractBeanDefinition> listenerDefinitions=(List<? extends AbstractBeanDefinition>)MetadataUtils.getValue(pvs,LISTENERS_PROP);
  if (listenerDefinitions != null) {
    for (    AbstractBeanDefinition beanDef : listenerDefinitions) {
      foundListeners.add(new SimpleBindingListenerMetadata(beanDef));
    }
  }
  listeners=Collections.unmodifiableCollection(foundListeners);
}
Program: 152891
Project: 152891
Buggy source:
public String getComponentName(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public String getComponentName(){
  return componentName;
}
Program: 152892
Project: 152892
Buggy source:
public String getFilter(){
  return (String)MetadataUtils.getValue(beanDefinition.getPropertyValues(),FILTER_PROP);
}

Fixed version (ground truth):
public String getFilter(){
  return filter;
}
Program: 152893
Project: 152893
Buggy source:
public Collection<BindingListenerMetadata> getBindingListeners(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public Collection<BindingListenerMetadata> getBindingListeners(){
  return listeners;
}
Program: 152894
Project: 152894
Buggy source:
public Set<String> getInterfaceNames(){
  Class<?>[] classes=(Class<?>[])MetadataUtils.getValue(beanDefinition.getPropertyValues(),INTERFACES_PROP);
  if (ObjectUtils.isEmpty(classes))   return Collections.<String>emptySet();
  Set<String> strings=new LinkedHashSet<String>(classes.length);
  for (int i=0; i < classes.length; i++) {
    strings.add(classes[i].getName());
  }
  return strings;
}

Fixed version (ground truth):
public Set<String> getInterfaceNames(){
  return interfaces;
}
Program: 152895
Project: 152895
Buggy source:
public int getServiceAvailabilitySpecification(){
  Cardinality cardinality=(Cardinality)MetadataUtils.getValue(beanDefinition.getPropertyValues(),CARDINALITY_PROP);
  return (cardinality == null || cardinality.isMandatory() ? ServiceReferenceComponentMetadata.MANDATORY_AVAILABILITY : ServiceReferenceComponentMetadata.OPTIONAL_AVAILABILITY);
}

Fixed version (ground truth):
public int getServiceAvailabilitySpecification(){
  return availability;
}
Program: 152897
Project: 152897
Buggy source:
protected void setUp() throws Exception {
  applicationContext=new GenericApplicationContext();
  applicationContext.setClassLoader(getClass().getClassLoader());
  reader=new XmlBeanDefinitionReader(applicationContext);
  reader.loadBeanDefinitions(new ClassPathResource(getConfig(),getClass()));
  applicationContext.refresh();
  bundleContext=new MockBundleContext();
  moduleContext=new SpringModuleContext(applicationContext,bundleContext);
}

Fixed version (ground truth):
protected void setUp() throws Exception {
  bundleContext=new MockBundleContext();
  applicationContext=new GenericApplicationContext();
  applicationContext.setClassLoader(getClass().getClassLoader());
  applicationContext.getBeanFactory().addBeanPostProcessor(new BundleContextAwareProcessor(bundleContext));
  reader=new XmlBeanDefinitionReader(applicationContext);
  reader.loadBeanDefinitions(new ClassPathResource(getConfig(),getClass()));
  applicationContext.refresh();
  moduleContext=new SpringModuleContext(applicationContext,bundleContext);
}
Program: 152898
Project: 152898
Buggy source:
/** 
 * {@inheritDoc}<p/> Converts the given value to a ServiceReference.
 */
public void setValue(Object value){
  if (value == null) {
    super.setValue(null);
    return;
  }
  if (value instanceof ImportedOsgiServiceProxy) {
    super.setValue(new ServiceReferenceDelegate((ImportedOsgiServiceProxy)value));
    return;
  }
  throw new IllegalArgumentException("String_Node_Str" + ImportedOsgiServiceProxy.class.getName());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p/> Converts the given value to a ServiceReference.
 */
public void setValue(Object value){
  if (value == null) {
    super.setValue(null);
    return;
  }
  if (value instanceof ImportedOsgiServiceProxy) {
    super.setValue(new ServiceReferenceDelegate((ImportedOsgiServiceProxy)value));
    return;
  }
  if (value instanceof ServiceReference) {
    super.setValue(value);
    return;
  }
  throw new IllegalArgumentException("String_Node_Str" + ImportedOsgiServiceProxy.class.getName() + "String_Node_Str"+ value.getClass());
}
Program: 152899
Project: 152899
Buggy source:
/** 
 * Parse a set element.
 */
private Set<?> parseSetElement(Element collectionEle,BeanDefinition bd){
  String defaultTypeClassName=collectionEle.getAttribute(BeanDefinitionParserDelegate.VALUE_TYPE_ATTRIBUTE);
  NodeList nl=collectionEle.getChildNodes();
  ManagedSet set=new TempManagedSet(nl.getLength(),defaultTypeClassName);
  set.setSource(parserContext.extractSource(collectionEle));
  set.setMergeEnabled(parserContext.getDelegate().parseMergeAttribute(collectionEle));
  for (int i=0; i < nl.getLength(); i++) {
    Node node=nl.item(i);
    if (node instanceof Element && !DomUtils.nodeNameEquals(node,BeanDefinitionParserDelegate.DESCRIPTION_ELEMENT)) {
      set.add(parsePropertySubElement((Element)node,bd,defaultTypeClassName));
    }
  }
  return set;
}

Fixed version (ground truth):
/** 
 * Parse a set element.
 */
private Set<?> parseSetElement(Element collectionEle,BeanDefinition bd){
  String defaultTypeClassName=collectionEle.getAttribute(BeanDefinitionParserDelegate.VALUE_TYPE_ATTRIBUTE);
  if (!StringUtils.hasText(defaultTypeClassName)) {
    defaultTypeClassName=null;
  }
  NodeList nl=collectionEle.getChildNodes();
  ManagedSet set=new TempManagedSet(nl.getLength(),defaultTypeClassName);
  set.setSource(parserContext.extractSource(collectionEle));
  set.setMergeEnabled(parserContext.getDelegate().parseMergeAttribute(collectionEle));
  for (int i=0; i < nl.getLength(); i++) {
    Node node=nl.item(i);
    if (node instanceof Element && !DomUtils.nodeNameEquals(node,BeanDefinitionParserDelegate.DESCRIPTION_ELEMENT)) {
      set.add(parsePropertySubElement((Element)node,bd,defaultTypeClassName));
    }
  }
  return set;
}
Program: 152900
Project: 152900
Buggy source:
/** 
 * Parse a list element.
 */
private List<?> parseListElement(Element collectionEle,BeanDefinition bd){
  String defaultTypeClassName=collectionEle.getAttribute(BeanDefinitionParserDelegate.VALUE_TYPE_ATTRIBUTE);
  NodeList nl=collectionEle.getChildNodes();
  ManagedList list=new TempManagedList(nl.getLength(),defaultTypeClassName);
  list.setSource(parserContext.extractSource(collectionEle));
  list.setMergeEnabled(parserContext.getDelegate().parseMergeAttribute(collectionEle));
  for (int i=0; i < nl.getLength(); i++) {
    Node node=nl.item(i);
    if (node instanceof Element && !DomUtils.nodeNameEquals(node,BeanDefinitionParserDelegate.DESCRIPTION_ELEMENT)) {
      list.add(parsePropertySubElement((Element)node,bd,defaultTypeClassName));
    }
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Parse a list element.
 */
private List<?> parseListElement(Element collectionEle,BeanDefinition bd){
  String defaultTypeClassName=collectionEle.getAttribute(BeanDefinitionParserDelegate.VALUE_TYPE_ATTRIBUTE);
  if (!StringUtils.hasText(defaultTypeClassName)) {
    defaultTypeClassName=null;
  }
  NodeList nl=collectionEle.getChildNodes();
  ManagedList list=new TempManagedList(nl.getLength(),defaultTypeClassName);
  list.setSource(parserContext.extractSource(collectionEle));
  list.setMergeEnabled(parserContext.getDelegate().parseMergeAttribute(collectionEle));
  for (int i=0; i < nl.getLength(); i++) {
    Node node=nl.item(i);
    if (node instanceof Element && !DomUtils.nodeNameEquals(node,BeanDefinitionParserDelegate.DESCRIPTION_ELEMENT)) {
      list.add(parsePropertySubElement((Element)node,bd,defaultTypeClassName));
    }
  }
  return list;
}
Program: 152901
Project: 152901
Buggy source:
/** 
 * Build a typed String value Object for the given raw value.
 * @see org.springframework.beans.factory.config.TypedStringValue
 */
private Object buildTypedStringValueForMap(String value,String defaultTypeClassName,Element entryEle){
  try {
    return buildTypedStringValue(value,defaultTypeClassName,entryEle);
  }
 catch (  ClassNotFoundException ex) {
    error("String_Node_Str" + defaultTypeClassName + "String_Node_Str",entryEle,ex);
    return value;
  }
}

Fixed version (ground truth):
/** 
 * Build a typed String value Object for the given raw value.
 * @see org.springframework.beans.factory.config.TypedStringValue
 */
private Object buildTypedStringValueForMap(String value,String defaultTypeClassName,Element entryEle){
  try {
    return buildTypedStringValue(value,defaultTypeClassName,null,entryEle);
  }
 catch (  ClassNotFoundException ex) {
    error("String_Node_Str" + defaultTypeClassName + "String_Node_Str",entryEle,ex);
    return value;
  }
}
Program: 152903
Project: 152903
Buggy source:
/** 
 * Return a typed String value Object for the given value element.
 * @param ele element
 * @param defaultTypeClassName type class name
 * @return typed String value Object
 */
private Object parseValueElement(Element ele,String defaultTypeClassName){
  String value=DomUtils.getTextValue(ele);
  String typeClassName=ele.getAttribute(BeanDefinitionParserDelegate.TYPE_ATTRIBUTE);
  if (!StringUtils.hasText(typeClassName)) {
    typeClassName=defaultTypeClassName;
  }
  try {
    return buildTypedStringValue(value,typeClassName,ele);
  }
 catch (  ClassNotFoundException ex) {
    error("String_Node_Str" + typeClassName + "String_Node_Str",ele,ex);
    return value;
  }
}

Fixed version (ground truth):
/** 
 * Return a typed String value Object for the given value element.
 * @param ele element
 * @param defaultTypeClassName type class name
 * @return typed String value Object
 */
private Object parseValueElement(Element ele,String defaultTypeClassName){
  String value=DomUtils.getTextValue(ele);
  String typeClassName=ele.getAttribute(BeanDefinitionParserDelegate.TYPE_ATTRIBUTE);
  String specifiedType=null;
  if (!StringUtils.hasText(typeClassName)) {
    typeClassName=defaultTypeClassName;
  }
 else {
    specifiedType=typeClassName;
  }
  try {
    return buildTypedStringValue(value,typeClassName,specifiedType,ele);
  }
 catch (  ClassNotFoundException ex) {
    error("String_Node_Str" + typeClassName + "String_Node_Str",ele,ex);
    return value;
  }
}
Program: 152904
Project: 152904
Buggy source:
/** 
 * Build a typed String value Object for the given raw value.
 * @see org.springframework.beans.factory.config.TypedStringValue
 */
private Object buildTypedStringValue(String value,String targetTypeName,Element ele) throws ClassNotFoundException {
  ClassLoader classLoader=parserContext.getReaderContext().getBeanClassLoader();
  TypedStringValue typedValue=null;
  if (!StringUtils.hasText(targetTypeName)) {
    typedValue=new TypedStringValue(value);
  }
 else   if (classLoader != null) {
    Class<?> targetType=ClassUtils.forName(targetTypeName,classLoader);
    typedValue=new TypedStringValue(value,targetType);
  }
 else {
    typedValue=new TypedStringValue(value,targetTypeName);
  }
  typedValue.setSource(parserContext.extractSource(ele));
  return typedValue;
}

Fixed version (ground truth):
/** 
 * Build a typed String value Object for the given raw value.
 * @see org.springframework.beans.factory.config.TypedStringValue
 */
private Object buildTypedStringValue(String value,String targetTypeName,String specifiedValue,Element ele) throws ClassNotFoundException {
  ClassLoader classLoader=parserContext.getReaderContext().getBeanClassLoader();
  TypedStringValue typedValue=null;
  if (!StringUtils.hasText(targetTypeName)) {
    typedValue=new TypedStringValue(value);
  }
 else   if (classLoader != null) {
    Class<?> targetType=ClassUtils.forName(targetTypeName,classLoader);
    typedValue=new SpecifiedTypeStringValue(value,targetType,specifiedValue);
  }
 else {
    typedValue=new SpecifiedTypeStringValue(value,targetTypeName,specifiedValue);
  }
  typedValue.setSource(parserContext.extractSource(ele));
  return typedValue;
}
Program: 152905
Project: 152905
Buggy source:
public SimpleTypedStringValue(org.springframework.beans.factory.config.TypedStringValue typedStringValue){
  this.typeName=typedStringValue.getTargetTypeName();
  this.value=typedStringValue.getValue();
}

Fixed version (ground truth):
public SimpleTypedStringValue(org.springframework.beans.factory.config.TypedStringValue typedStringValue){
  if (typedStringValue instanceof SpecifiedTypeStringValue) {
    SpecifiedTypeStringValue customType=(SpecifiedTypeStringValue)typedStringValue;
    this.typeName=customType.getSpecifiedType();
  }
 else {
    this.typeName=typedStringValue.getTargetTypeName();
  }
  this.value=typedStringValue.getValue();
}
Program: 152907
Project: 152907
Buggy source:
public void testNumberOfBeans() throws Exception {
  System.out.println("String_Node_Str" + ObjectUtils.nullSafeToString(context.getBeanDefinitionNames()));
  assertEquals("String_Node_Str",3,context.getBeanDefinitionCount());
}

Fixed version (ground truth):
public void testNumberOfBeans() throws Exception {
  System.out.println("String_Node_Str" + ObjectUtils.nullSafeToString(context.getBeanDefinitionNames()));
  assertTrue("String_Node_Str",context.getBeanDefinitionCount() >= 3);
}
Program: 152908
Project: 152908
Buggy source:
/** 
 * Parse a set element.
 */
private Set<?> parseSetElement(Element collectionEle,BeanDefinition bd){
  String defaultTypeClassName=collectionEle.getAttribute(BeanDefinitionParserDelegate.VALUE_TYPE_ATTRIBUTE);
  NodeList nl=collectionEle.getChildNodes();
  ManagedSet set=new ManagedSet(nl.getLength());
  set.setSource(parserContext.extractSource(collectionEle));
  set.setMergeEnabled(parserContext.getDelegate().parseMergeAttribute(collectionEle));
  for (int i=0; i < nl.getLength(); i++) {
    Node node=nl.item(i);
    if (node instanceof Element && !DomUtils.nodeNameEquals(node,BeanDefinitionParserDelegate.DESCRIPTION_ELEMENT)) {
      set.add(parsePropertySubElement((Element)node,bd,defaultTypeClassName));
    }
  }
  return set;
}

Fixed version (ground truth):
/** 
 * Parse a set element.
 */
private Set<?> parseSetElement(Element collectionEle,BeanDefinition bd){
  String defaultTypeClassName=collectionEle.getAttribute(BeanDefinitionParserDelegate.VALUE_TYPE_ATTRIBUTE);
  NodeList nl=collectionEle.getChildNodes();
  ManagedSet set=new TempManagedSet(nl.getLength(),defaultTypeClassName);
  set.setSource(parserContext.extractSource(collectionEle));
  set.setMergeEnabled(parserContext.getDelegate().parseMergeAttribute(collectionEle));
  for (int i=0; i < nl.getLength(); i++) {
    Node node=nl.item(i);
    if (node instanceof Element && !DomUtils.nodeNameEquals(node,BeanDefinitionParserDelegate.DESCRIPTION_ELEMENT)) {
      set.add(parsePropertySubElement((Element)node,bd,defaultTypeClassName));
    }
  }
  return set;
}
Program: 152910
Project: 152910
Buggy source:
/** 
 * Parse a list element.
 */
private List<?> parseListElement(Element collectionEle,BeanDefinition bd){
  String defaultTypeClassName=collectionEle.getAttribute(BeanDefinitionParserDelegate.VALUE_TYPE_ATTRIBUTE);
  NodeList nl=collectionEle.getChildNodes();
  ManagedList list=new ManagedList(nl.getLength());
  list.setSource(parserContext.extractSource(collectionEle));
  list.setMergeEnabled(parserContext.getDelegate().parseMergeAttribute(collectionEle));
  for (int i=0; i < nl.getLength(); i++) {
    Node node=nl.item(i);
    if (node instanceof Element && !DomUtils.nodeNameEquals(node,BeanDefinitionParserDelegate.DESCRIPTION_ELEMENT)) {
      list.add(parsePropertySubElement((Element)node,bd,defaultTypeClassName));
    }
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Parse a list element.
 */
private List<?> parseListElement(Element collectionEle,BeanDefinition bd){
  String defaultTypeClassName=collectionEle.getAttribute(BeanDefinitionParserDelegate.VALUE_TYPE_ATTRIBUTE);
  NodeList nl=collectionEle.getChildNodes();
  ManagedList list=new TempManagedList(nl.getLength(),defaultTypeClassName);
  list.setSource(parserContext.extractSource(collectionEle));
  list.setMergeEnabled(parserContext.getDelegate().parseMergeAttribute(collectionEle));
  for (int i=0; i < nl.getLength(); i++) {
    Node node=nl.item(i);
    if (node instanceof Element && !DomUtils.nodeNameEquals(node,BeanDefinitionParserDelegate.DESCRIPTION_ELEMENT)) {
      list.add(parsePropertySubElement((Element)node,bd,defaultTypeClassName));
    }
  }
  return list;
}
Program: 152912
Project: 152912
Buggy source:
public ComponentMetadata getComponentMetadata(String name) throws NoSuchComponentException {
  if (applicationContext.containsBeanDefinition(name)) {
    BeanDefinition beanDefinition=getBeanFactory().getBeanDefinition(name);
    return MetadataFactory.buildComponentMetadataFor(beanDefinition);
  }
 else {
    throw new NoSuchComponentException(name);
  }
}

Fixed version (ground truth):
public ComponentMetadata getComponentMetadata(String name) throws NoSuchComponentException {
  if (applicationContext.containsBeanDefinition(name)) {
    BeanDefinition beanDefinition=getBeanFactory().getBeanDefinition(name);
    return MetadataFactory.buildComponentMetadataFor(name,beanDefinition);
  }
 else {
    throw new NoSuchComponentException(name);
  }
}
Program: 152913
Project: 152913
Buggy source:
private List<ComponentMetadata> getComponentMetadataForAllComponents(){
  List<ComponentMetadata> metadata=new ArrayList<ComponentMetadata>();
  String[] components=applicationContext.getBeanDefinitionNames();
  for (  String beanName : components) {
    metadata.add(MetadataFactory.buildComponentMetadataFor(getBeanFactory().getBeanDefinition(beanName)));
  }
  return metadata;
}

Fixed version (ground truth):
private List<ComponentMetadata> getComponentMetadataForAllComponents(){
  List<ComponentMetadata> metadata=new ArrayList<ComponentMetadata>();
  String[] components=applicationContext.getBeanDefinitionNames();
  for (  String beanName : components) {
    metadata.add(MetadataFactory.buildComponentMetadataFor(beanName,getBeanFactory().getBeanDefinition(beanName)));
  }
  return metadata;
}
Program: 152914
Project: 152914
Buggy source:
public ComponentMetadata getComponentDefinition(String name){
  if (!containsComponentDefinition(name)) {
    return null;
  }
  String nameOfBeanWereLookingFor=name;
  if (!beanRegistry.containsBeanDefinition(name)) {
    for (    String beanName : beanRegistry.getBeanDefinitionNames()) {
      for (      String alias : beanRegistry.getAliases(beanName)) {
        if (alias.equals(name)) {
          nameOfBeanWereLookingFor=beanName;
        }
      }
    }
  }
  return MetadataFactory.buildComponentMetadataFor(this.beanRegistry.getBeanDefinition(nameOfBeanWereLookingFor));
}

Fixed version (ground truth):
public ComponentMetadata getComponentDefinition(String name){
  if (!containsComponentDefinition(name)) {
    return null;
  }
  String nameOfBeanWereLookingFor=name;
  if (!beanRegistry.containsBeanDefinition(name)) {
    for (    String beanName : beanRegistry.getBeanDefinitionNames()) {
      for (      String alias : beanRegistry.getAliases(beanName)) {
        if (alias.equals(name)) {
          nameOfBeanWereLookingFor=beanName;
        }
      }
    }
  }
  return MetadataFactory.buildComponentMetadataFor(name,beanRegistry.getBeanDefinition(nameOfBeanWereLookingFor));
}
Program: 152915
Project: 152915
Buggy source:
public ComponentMetadata getEnclosingComponent(){
  return MetadataFactory.buildComponentMetadataFor(parserContext.getContainingBeanDefinition());
}

Fixed version (ground truth):
public ComponentMetadata getEnclosingComponent(){
  BeanDefinition def=parserContext.getContainingBeanDefinition();
  if (def != null) {
    String beanName=null;
    if (!def.hasAttribute(COMPONENT_NAME_ATTR)) {
      BeanDefinitionRegistry defRegistry=parserContext.getRegistry();
      String[] names=defRegistry.getBeanDefinitionNames();
      for (      String name : names) {
        if (def == defRegistry.getBeanDefinition(name)) {
          beanName=name;
        }
      }
    }
    return MetadataFactory.buildComponentMetadataFor(beanName,def);
  }
 else {
    return null;
  }
}
Program: 152916
Project: 152916
Buggy source:
BeanDefinition buildBeanDefinitionFor(ComponentMetadata metadata){
  if (metadata instanceof SpringComponentMetadata) {
    return ((SpringComponentMetadata)metadata).getBeanDefinition();
  }
  AbstractBeanDefinition definition=buildBeanDefinition(metadata);
  definition.setAttribute(MetadataConstants.COMPONENT_METADATA_ATTRIBUTE,metadata);
  Set<String> dependencies=metadata.getExplicitDependencies();
  definition.setDependsOn(dependencies.toArray(new String[dependencies.size()]));
  return definition;
}

Fixed version (ground truth):
BeanDefinition buildBeanDefinitionFor(ComponentMetadata metadata){
  if (metadata instanceof SpringComponentMetadata) {
    return ((SpringComponentMetadata)metadata).getBeanDefinition();
  }
  AbstractBeanDefinition definition=buildBeanDefinition(metadata);
  definition.setAttribute(MetadataConstants.COMPONENT_METADATA_ATTRIBUTE,metadata);
  definition.setAttribute(MetadataConstants.COMPONENT_NAME,metadata.getName());
  Set<String> dependencies=metadata.getExplicitDependencies();
  definition.setDependsOn(dependencies.toArray(new String[dependencies.size()]));
  return definition;
}
Program: 152918
Project: 152918
Buggy source:
/** 
 * Builds a component metadata from the given bean definition.
 * @param beanDefinition
 * @return
 */
ComponentMetadata buildMetadata(BeanDefinition beanDefinition){
  Object metadata=beanDefinition.getAttribute(COMPONENT_METADATA_ATTRIBUTE);
  if (metadata instanceof ComponentMetadata)   return (ComponentMetadata)metadata;
  if (isServiceExporter(beanDefinition)) {
    return new SpringServiceExportComponentMetadata(beanDefinition);
  }
  if (isServiceImporter(beanDefinition)) {
    return new SpringServiceReferenceComponentMetadata(beanDefinition);
  }
  return new SpringLocalComponentMetadata(beanDefinition);
}

Fixed version (ground truth):
/** 
 * Builds a component metadata from the given bean definition.
 * @param name bean name
 * @param beanDefinition
 * @return
 */
ComponentMetadata buildMetadata(String name,BeanDefinition beanDefinition){
  Object metadata=beanDefinition.getAttribute(COMPONENT_METADATA_ATTRIBUTE);
  if (metadata instanceof ComponentMetadata)   return (ComponentMetadata)metadata;
  if (name == null) {
    name=(String)beanDefinition.getAttribute(COMPONENT_NAME);
  }
  if (isServiceExporter(beanDefinition)) {
    return new SpringServiceExportComponentMetadata(beanDefinition);
  }
  if (isServiceImporter(beanDefinition)) {
    return new SpringServiceReferenceComponentMetadata(beanDefinition);
  }
  return new SpringLocalComponentMetadata(name,beanDefinition);
}
Program: 152919
Project: 152919
Buggy source:
/** 
 * Inspects the given   {@link BeanDefinition beanDefinition} and returns theappropriate  {@link ComponentMetadata metadata} (can be one of{@link LocalComponentMetadata},   {@link ServiceExportComponentMetadata}, or   {@link ServiceReferenceComponentMetadata}).
 * @param beanDefinition Spring bean definition
 * @return an OSGi component metadata.
 */
public static ComponentMetadata buildComponentMetadataFor(BeanDefinition beanDefinition){
  return blueprintFactory.buildMetadata(beanDefinition);
}

Fixed version (ground truth):
/** 
 * Inspects the given   {@link BeanDefinition beanDefinition} and returns theappropriate  {@link ComponentMetadata metadata} (can be one of{@link LocalComponentMetadata},   {@link ServiceExportComponentMetadata}, or   {@link ServiceReferenceComponentMetadata}).
 * @param name bean name
 * @param beanDefinition Spring bean definition
 * @return an OSGi component metadata.
 */
public static ComponentMetadata buildComponentMetadataFor(String name,BeanDefinition beanDefinition){
  return blueprintFactory.buildMetadata(name,beanDefinition);
}
Program: 152920
Project: 152920
Buggy source:
/** 
 * Constructs a new <code>SimpleListValue</code> instance.
 * @param set
 */
public SimpleListValue(Value... values){
  List<Value> vals=new ArrayList<Value>(values.length);
  Collections.addAll(vals,values);
  list=Collections.unmodifiableList(vals);
}

Fixed version (ground truth):
/** 
 * Constructs a new <code>SimpleListValue</code> instance.
 * @param array of values
 * @param valueType value type
 */
public SimpleListValue(Value[] values,String valueType){
  List<Value> vals=new ArrayList<Value>(values.length);
  Collections.addAll(vals,values);
  list=Collections.unmodifiableList(vals);
  this.valueType=valueType;
}
Program: 152921
Project: 152921
Buggy source:
public String getValueType(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public String getValueType(){
  return valueType;
}
Program: 152922
Project: 152922
Buggy source:
public String getKeyType(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public String getKeyType(){
  return keyValueType;
}
Program: 152923
Project: 152923
Buggy source:
/** 
 * Constructs a new <code>SimpleListValue</code> instance.
 * @param set
 */
public SimpleMapValue(Value[] keys,Value[] values){
  Assert.state(keys.length == values.length,"String_Node_Str");
  Map<Value,Value> vals=new LinkedHashMap<Value,Value>(keys.length);
  for (int i=0; i < keys.length; i++) {
    vals.put(keys[i],values[i]);
  }
  map=Collections.unmodifiableMap(vals);
}

Fixed version (ground truth):
/** 
 * Constructs a new <code>SimpleListValue</code> instance.
 * @param set
 */
public SimpleMapValue(Value[] keys,String keyValueType,Value[] values,String valueValueType){
  Assert.state(keys.length == values.length,"String_Node_Str");
  Map<Value,Value> vals=new LinkedHashMap<Value,Value>(keys.length);
  for (int i=0; i < keys.length; i++) {
    vals.put(keys[i],values[i]);
  }
  map=Collections.unmodifiableMap(vals);
  this.keyValueType=keyValueType;
  this.valueValueType=valueValueType;
}
Program: 152924
Project: 152924
Buggy source:
public String getValueType(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public String getValueType(){
  return valueValueType;
}
Program: 152925
Project: 152925
Buggy source:
/** 
 * Constructs a new <code>SimpleSetValue</code> instance.
 * @param set
 */
public SimpleSetValue(Value... values){
  Set<Value> vals=new LinkedHashSet<Value>(values.length);
  Collections.addAll(vals,values);
  set=Collections.unmodifiableSet(vals);
}

Fixed version (ground truth):
/** 
 * Constructs a new <code>SimpleSetValue</code> instance.
 * @param set
 */
public SimpleSetValue(Value[] values,String valueType){
  Set<Value> vals=new LinkedHashSet<Value>(values.length);
  Collections.addAll(vals,values);
  set=Collections.unmodifiableSet(vals);
  this.valueType=valueType;
}
Program: 152926
Project: 152926
Buggy source:
public String getValueType(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public String getValueType(){
  return valueType;
}
Program: 152928
Project: 152928
Buggy source:
protected void preProcessBundleContext(BundleContext context) throws Exception {
  super.preProcessBundleContext(context);
  PermissionManager pm=new PermissionManager(context);
}

Fixed version (ground truth):
protected void preProcessBundleContext(BundleContext context) throws Exception {
  super.preProcessBundleContext(context);
  PermissionManager pm=new PermissionManager(context);
  if (isCloverEnabled()) {
    logger.warn("String_Node_Str");
  }
}
Program: 152929
Project: 152929
Buggy source:
protected ArtifactLocator getLocator(){
  ArtifactLocator defaultLocator=super.getLocator();
  if (isCloverEnabled()) {
    logger.warn("String_Node_Str");
    return new CloverClassifiedArtifactLocator(defaultLocator);
  }
  return defaultLocator;
}

Fixed version (ground truth):
protected ArtifactLocator getLocator(){
  ArtifactLocator defaultLocator=super.getLocator();
  if (isCloverEnabled()) {
    return new CloverClassifiedArtifactLocator(defaultLocator);
  }
  return defaultLocator;
}