nus-yam/ex-repair huggingface dataset:
Program: 29298
Project: 29298
Buggy source:
public boolean skipToNextItem(ObjectInputStream ois) throws IOException {
  if (end > 0) {
    if (itemNumber < positions.size()) {
      int startPosition=positions.get(itemNumber);
      int endPosition=itemNumber + 1 < positions.size() ? positions.get(itemNumber + 1) : -1;
      ContextBootstrap.debug(MessageID.ATTEMPT_TO_SKIP_TO_NEXT_ITEM,itemNumber + 1,startPosition,endPosition);
      ois.reset();
      ois.skipBytes(startPosition);
      return true;
    }
 else {
      ContextBootstrap.debug(MessageID.ERROR_NO_MORE_ITEMS);
      return false;
    }
  }
 else {
    ContextBootstrap.debug(MessageID.NO_CATALOG);
    return false;
  }
}

Fixed version (ground truth):
public boolean skipToNextItem(ObjectInputStream ois) throws IOException {
  if (end > 0) {
    if (itemNumber < positions.size()) {
      int startPosition=positions.get(itemNumber);
      int endPosition=itemNumber + 1 < positions.size() ? positions.get(itemNumber + 1) : -1;
      ContextBootstrap.debug(MessageID.ATTEMPT_TO_SKIP_TO_NEXT_ITEM,itemNumber + 1,startPosition,endPosition);
      ois.reset();
      for (int skipped=0; skipped < startPosition; skipped+=ois.skipBytes(startPosition - skipped))       ;
      return true;
    }
 else {
      ContextBootstrap.debug(MessageID.ERROR_NO_MORE_ITEMS);
      return false;
    }
  }
 else {
    ContextBootstrap.debug(MessageID.NO_CATALOG);
    return false;
  }
}
Program: 29300
Project: 29300
Buggy source:
protected void read(boolean mandatory,ObjectInputStream ois,Catalog catalog) throws IOException {
  if (mandatory) {
    ois.reset();
    ois.skip(catalog.getStart());
    readAscii();
  }
  catalog.read(ois);
}

Fixed version (ground truth):
protected void read(boolean mandatory,ObjectInputStream ois,Catalog catalog) throws IOException {
  if (mandatory) {
    ois.reset();
    int skipAmount=catalog.getStart();
    for (int skipped=0; skipped < skipAmount; skipped+=ois.skip(skipAmount - skipped))     ;
    readAscii();
  }
  catalog.read(ois);
}
Program: 29302
Project: 29302
Buggy source:
@Override protected void read(boolean mandatory,ObjectInputStream ois,Catalog catalog) throws IOException {
  if (mandatory) {
    ois.reset();
    ois.skip(catalog.getStart());
    nextKey();
    Entry catalogEntry=nextEntry();
    catalog.setPosisionsFrom((Catalog)catalogEntry.getValue());
    catalog.upItemNumber(-1);
  }
}

Fixed version (ground truth):
@Override protected void read(boolean mandatory,ObjectInputStream ois,Catalog catalog) throws IOException {
  if (mandatory) {
    ois.reset();
    int amountToSkip=catalog.getStart();
    for (int skipped=0; skipped < amountToSkip; skipped+=ois.skip(amountToSkip - skipped))     ;
    nextKey();
    Entry catalogEntry=nextEntry();
    catalog.setPosisionsFrom((Catalog)catalogEntry.getValue());
    catalog.upItemNumber(-1);
  }
}
Program: 29303
Project: 29303
Buggy source:
public Collection<Sniffer> getSniffers(DeploymentContext context,List<URI> uris,Types types){
  Collection<Sniffer> regularSniffers=getSniffers();
  List<Sniffer> appSniffers=this.getApplicableSniffers(uris,types,regularSniffers,true);
  for (  Sniffer sniffer : regularSniffers) {
    if (!appSniffers.contains(sniffer) && sniffer.handles(context)) {
      appSniffers.add(sniffer);
    }
  }
  return appSniffers;
}

Fixed version (ground truth):
public Collection<Sniffer> getSniffers(DeploymentContext context,List<URI> uris,Types types){
  Collection<Sniffer> regularSniffers=getSniffers();
  ArchiveType archiveType=habitat.getService(ArchiveType.class,context.getArchiveHandler().getArchiveType());
  List<Sniffer> appSniffers=this.getApplicableSniffers(uris,types,regularSniffers,true,archiveType);
  for (  Sniffer sniffer : regularSniffers) {
    if (!appSniffers.contains(sniffer) && sniffer.handles(context)) {
      appSniffers.add(sniffer);
    }
  }
  return appSniffers;
}
Program: 29304
Project: 29304
Buggy source:
private <T extends Sniffer>List<T> getApplicableSniffers(List<URI> uris,Types types,Collection<T> sniffers,boolean checkPath){
  if (sniffers == null || sniffers.isEmpty()) {
    return Collections.emptyList();
  }
  List<T> result=new ArrayList<T>();
  for (  T sniffer : sniffers) {
    Class<? extends Annotation>[] annotations=sniffer.getAnnotationTypes();
    if (annotations == null)     continue;
    for (    Class<? extends Annotation> annotationType : annotations) {
      if (types != null) {
        Type type=types.getBy(annotationType.getName());
        if (type instanceof AnnotationType) {
          Collection<AnnotatedElement> elements=((AnnotationType)type).allAnnotatedTypes();
          for (          AnnotatedElement element : elements) {
            if (checkPath) {
              Type t=(element instanceof Member ? ((Member)element).getDeclaringType() : (Type)element);
              if (t.wasDefinedIn(uris)) {
                result.add(sniffer);
                break;
              }
            }
 else {
              result.add(sniffer);
              break;
            }
          }
        }
      }
    }
  }
  return result;
}

Fixed version (ground truth):
private <T extends Sniffer>List<T> getApplicableSniffers(List<URI> uris,Types types,Collection<T> sniffers,boolean checkPath,ArchiveType archiveType){
  if (sniffers == null || sniffers.isEmpty()) {
    return Collections.emptyList();
  }
  List<T> result=new ArrayList<T>();
  for (  T sniffer : sniffers) {
    if (archiveType != null && !sniffer.supportsArchiveType(archiveType)) {
      continue;
    }
    Class<? extends Annotation>[] annotations=sniffer.getAnnotationTypes();
    if (annotations == null)     continue;
    for (    Class<? extends Annotation> annotationType : annotations) {
      if (types != null) {
        Type type=types.getBy(annotationType.getName());
        if (type instanceof AnnotationType) {
          Collection<AnnotatedElement> elements=((AnnotationType)type).allAnnotatedTypes();
          for (          AnnotatedElement element : elements) {
            if (checkPath) {
              Type t=(element instanceof Member ? ((Member)element).getDeclaringType() : (Type)element);
              if (t.wasDefinedIn(uris)) {
                result.add(sniffer);
                break;
              }
            }
 else {
              result.add(sniffer);
              break;
            }
          }
        }
      }
    }
  }
  return result;
}
Program: 29305
Project: 29305
Buggy source:
@Override public Set<Annotation> getQualifiers(){
  Set<Annotation> qualifiers=new HashSet<Annotation>();
  qualifiers.add(new AnnotationLiteral<Default>(){
  }
);
  qualifiers.add(new AnnotationLiteral<Any>(){
  }
);
  return qualifiers;
}

Fixed version (ground truth):
@Override public Set<Annotation> getQualifiers(){
  Set<Annotation> qualifiers=new HashSet<Annotation>();
  qualifiers.add(new StaticAnnotation<Default>());
  qualifiers.add(new StaticAnnotation<Any>());
  return qualifiers;
}
Program: 29306
Project: 29306
Buggy source:
/** 
 * <p> This method is responsible for copying the data from the given <code>InputStream</code> to the <code>ServletResponse</code>'s <code>OutputStream</code>.  The <code>InputStream</code> should be the from the   {@link DownloadServlet#ContentSource}.</p>
 */
protected void writeContent(DownloadServlet.ContentSource source,DownloadServlet.Context context){
  InputStream in=source.getInputStream(context);
  ServletResponse resp=context.getServletResponse();
  if (in == null) {
    String jspPage=(String)context.getAttribute("String_Node_Str");
    if (jspPage != null && (jspPage.equals("String_Node_Str"))) {
      try {
        ((HttpServletResponse)resp).sendError(404,"String_Node_Str");
      }
 catch (      IOException ex) {
      }
    }
    return;
  }
  try {
    javax.servlet.ServletOutputStream out=resp.getOutputStream();
    InputStream stream=new BufferedInputStream(in);
    writeHeader(source,context);
    byte[] buf=new byte[512];
    int read=stream.read(buf,0,512);
    while (read != -1) {
      out.write(buf,0,read);
      read=stream.read(buf,0,512);
    }
    stream.close();
  }
 catch (  IOException ex) {
    throw new RuntimeException(ex);
  }
}

Fixed version (ground truth):
/** 
 * <p> This method is responsible for copying the data from the given <code>InputStream</code> to the <code>ServletResponse</code>'s <code>OutputStream</code>.  The <code>InputStream</code> should be the from the   {@link DownloadServlet#ContentSource}.</p>
 */
protected void writeContent(DownloadServlet.ContentSource source,DownloadServlet.Context context){
  InputStream in=source.getInputStream(context);
  ServletResponse resp=context.getServletResponse();
  if (in == null) {
    String jspPage=(String)context.getAttribute("String_Node_Str");
    if (jspPage != null && (jspPage.equals("String_Node_Str"))) {
      try {
        ((HttpServletResponse)resp).sendError(404,"String_Node_Str");
      }
 catch (      IOException ex) {
      }
    }
    return;
  }
  InputStream stream=null;
  try {
    javax.servlet.ServletOutputStream out=resp.getOutputStream();
    stream=new BufferedInputStream(in);
    writeHeader(source,context);
    byte[] buf=new byte[512];
    int read=stream.read(buf,0,512);
    while (read != -1) {
      out.write(buf,0,read);
      read=stream.read(buf,0,512);
    }
  }
 catch (  IOException ex) {
    throw new RuntimeException(ex);
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException ex) {
      }
    }
  }
}
Program: 29307
Project: 29307
Buggy source:
/** 
 * <p> This method is responsible for generating the content and returning an InputStream to that content.  It is also responsible for setting any attribute values in the  {@link DownloadServlet#Context}, such as   {@link DownloadServlet#EXTENSION} or{@link DownloadServlet#CONTENT_TYPE}.</p>
 */
public InputStream getInputStream(DownloadServlet.Context ctx){
  ctx.setAttribute(DownloadServlet.EXTENSION,"String_Node_Str");
  HttpServletRequest request=(HttpServletRequest)ctx.getServletRequest();
  String lbName=request.getParameter("String_Node_Str");
  String restUrl=request.getParameter("String_Node_Str");
  InputStream tmpFile=null;
  try {
    String endpoint=restUrl + "String_Node_Str" + lbName+ "String_Node_Str";
    DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
    Date date=new Date();
    Map attrsMap=new HashMap();
    String tempDir=System.getProperty("String_Node_Str");
    String lbFileName="String_Node_Str" + lbName + "String_Node_Str"+ dateFormat.format(date);
    String slbFile=tempDir + System.getProperty("String_Node_Str") + lbFileName;
    File lbFile=new File(slbFile);
    attrsMap.put("String_Node_Str",slbFile);
    RestUtil.postRestRequestFromServlet(request,endpoint,attrsMap,true,true);
    tmpFile=new FileInputStream(lbFile);
    lbFile.delete();
  }
 catch (  Exception ex) {
    throw new RuntimeException(ex);
  }
  ctx.setAttribute("String_Node_Str",tmpFile);
  return tmpFile;
}

Fixed version (ground truth):
/** 
 * <p> This method is responsible for generating the content and returning an InputStream to that content.  It is also responsible for setting any attribute values in the  {@link DownloadServlet#Context}, such as   {@link DownloadServlet#EXTENSION} or{@link DownloadServlet#CONTENT_TYPE}.</p>
 */
public InputStream getInputStream(DownloadServlet.Context ctx){
  ctx.setAttribute(DownloadServlet.EXTENSION,"String_Node_Str");
  HttpServletRequest request=(HttpServletRequest)ctx.getServletRequest();
  String lbName=request.getParameter("String_Node_Str");
  String restUrl=request.getParameter("String_Node_Str");
  InputStream tmpFile=null;
  try {
    String endpoint=restUrl + "String_Node_Str" + lbName+ "String_Node_Str";
    DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
    Date date=new Date();
    Map attrsMap=new HashMap();
    String tempDir=System.getProperty("String_Node_Str");
    String lbFileName="String_Node_Str" + lbName + "String_Node_Str"+ dateFormat.format(date);
    String slbFile=tempDir + System.getProperty("String_Node_Str") + lbFileName;
    File lbFile=new File(slbFile);
    attrsMap.put("String_Node_Str",slbFile);
    RestUtil.postRestRequestFromServlet(request,endpoint,attrsMap,true,true);
    tmpFile=new FileInputStream(lbFile);
    boolean success=lbFile.delete();
    if (!success) {
      throw new Exception("String_Node_Str");
    }
  }
 catch (  Exception ex) {
    throw new RuntimeException(ex);
  }
  ctx.setAttribute("String_Node_Str",tmpFile);
  return tmpFile;
}
Program: 29309
Project: 29309
Buggy source:
@Override public void postConstruct(){
  LOG.info("String_Node_Str");
  List<ActiveDescriptor<?>> descriptor=habitat.getDescriptors(BuilderHelper.createContractFilter(ConfigInjector.class.getName()));
  Class<?> clz=null;
  for (  ActiveDescriptor desc : descriptor) {
    if (desc.getName() == null) {
      continue;
    }
    ConfigInjector injector=habitat.getService(ConfigInjector.class,desc.getName());
    if (injector != null) {
      String clzName=injector.getClass().getName().substring(0,injector.getClass().getName().length() - 8);
      if (clzName == null) {
        continue;
      }
      try {
        clz=injector.getClass().getClassLoader().loadClass(clzName);
        if (clz == null) {
          LOG.log(Level.FINE,"String_Node_Str" + clzName);
          continue;
        }
      }
 catch (      Throwable e) {
        if (clz == null) {
          LOG.log(Level.FINE,"String_Node_Str",e);
        }
        LOG.log(Level.FINE,"String_Node_Str" + clz.getName(),e);
        continue;
      }
    }
    if (clz.isAnnotationPresent(ActivateOnStartup.class)) {
      LOG.info("String_Node_Str" + clz.getName());
      applyConfig(clz);
    }
  }
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void postConstruct(){
  LOG.info("String_Node_Str");
  List<ActiveDescriptor<?>> descriptor=habitat.getDescriptors(BuilderHelper.createContractFilter(ConfigInjector.class.getName()));
  Class<?> clz=null;
  for (  ActiveDescriptor desc : descriptor) {
    if (desc.getName() == null) {
      continue;
    }
    ConfigInjector injector=habitat.getService(ConfigInjector.class,desc.getName());
    if (injector != null) {
      String clzName=injector.getClass().getName().substring(0,injector.getClass().getName().length() - 8);
      if (clzName == null) {
        continue;
      }
      try {
        clz=injector.getClass().getClassLoader().loadClass(clzName);
        if (clz == null) {
          LOG.log(Level.FINE,"String_Node_Str" + clzName);
        }
      }
 catch (      Throwable e) {
        LOG.log(Level.FINE,"String_Node_Str",e);
      }
      continue;
    }
    if (clz.isAnnotationPresent(ActivateOnStartup.class)) {
      LOG.info("String_Node_Str" + clz.getName());
      applyConfig(clz);
    }
  }
  LOG.info("String_Node_Str");
}
Program: 29310
Project: 29310
Buggy source:
private InjectionResolver<Param> getInjector(AdminCommand command,ParameterMap parameters,MultiMap<String,File> map){
  CommandModel model;
  try {
    CommandModelProvider c=CommandModelProvider.class.cast(command);
    model=c.getModel();
  }
 catch (  ClassCastException e) {
    model=new CommandModelImpl(command.getClass());
  }
  return new MapInjectionResolver(model,parameters,map);
}

Fixed version (ground truth):
private InjectionResolver<Param> getInjector(AdminCommand command,ParameterMap parameters,MultiMap<String,File> map){
  CommandModel model=command instanceof CommandModelProvider ? ((CommandModelProvider)command).getModel() : new CommandModelImpl(command.getClass());
  return new MapInjectionResolver(model,parameters,map);
}
Program: 29311
Project: 29311
Buggy source:
@Override public void postConstruct(){
  LOG.info("String_Node_Str");
  List<ActiveDescriptor<?>> descriptor=habitat.getDescriptors(BuilderHelper.createContractFilter(ConfigInjector.class.getName()));
  Class<?> clz=null;
  for (  ActiveDescriptor desc : descriptor) {
    String name=desc.getName();
    if (desc.getName() == null) {
      continue;
    }
    ConfigInjector injector=habitat.getService(ConfigInjector.class,name);
    if (injector != null) {
      String clzName=injector.getClass().getName().substring(0,injector.getClass().getName().length() - 8);
      try {
        clz=injector.getClass().getClassLoader().loadClass(clzName);
        if (clz == null) {
          LOG.log(Level.INFO,"String_Node_Str" + clzName);
        }
      }
 catch (      Throwable e) {
        LOG.log(Level.INFO,"String_Node_Str" + clz.getName(),e);
      }
    }
    if (clz.isAnnotationPresent(ActivateOnStartup.class)) {
      LOG.info("String_Node_Str" + clz.getName());
      applyConfig(clz);
    }
  }
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void postConstruct(){
  LOG.info("String_Node_Str");
  List<ActiveDescriptor<?>> descriptor=habitat.getDescriptors(BuilderHelper.createContractFilter(ConfigInjector.class.getName()));
  Class<?> clz=null;
  for (  ActiveDescriptor desc : descriptor) {
    String name=desc.getName();
    if (desc.getName() == null) {
      continue;
    }
    ConfigInjector injector=habitat.getService(ConfigInjector.class,name);
    if (injector != null) {
      String clzName=injector.getClass().getName().substring(0,injector.getClass().getName().length() - 8);
      if (clzName == null) {
        continue;
      }
      try {
        clz=injector.getClass().getClassLoader().loadClass(clzName);
        if (clz == null) {
          LOG.log(Level.FINE,"String_Node_Str" + clzName);
          return;
        }
      }
 catch (      Throwable e) {
        if (clz == null) {
          LOG.log(Level.FINE,"String_Node_Str",e);
          continue;
        }
        LOG.log(Level.FINE,"String_Node_Str" + clz.getName(),e);
      }
    }
    if (clz.isAnnotationPresent(ActivateOnStartup.class)) {
      LOG.info("String_Node_Str" + clz.getName());
      applyConfig(clz);
    }
  }
  LOG.info("String_Node_Str");
}
Program: 29314
Project: 29314
Buggy source:
public ValidationResult(final Failures failures){
  mNumTested=failures.getNumTested();
  mNumFailures=failures.getNumFailures();
  mDetails=failures.toString();
  mProblems=failures.getFailures();
}

Fixed version (ground truth):
private ValidationResult(final Failures failures){
  mNumTested=failures.getNumTested();
  mNumFailures=failures.getNumFailures();
  mDetails=failures.toString();
  mProblems=failures.getFailures();
}
Program: 29315
Project: 29315
Buggy source:
public boolean hasProblems(){
  return mProblems.size() != 0;
}

Fixed version (ground truth):
public boolean hasProblems(){
  return !mProblems.isEmpty();
}
Program: 29316
Project: 29316
Buggy source:
/** 
 * "best effort"<p> Attributes that cannot be sent to generic clients are not allowed. More than OpenTypes are allowed eg messy stuff like JSR 77 Stats and Statistics.
 */
private static void checkLegalForRemote(final Object value) throws IllegalClassException {
  if (value == null) {
    return;
  }
  final Class<?> clazz=value.getClass();
  if (isAcceptableRemoteType(clazz)) {
    return;
  }
  if (clazz.isSynthetic() || clazz.isLocalClass() || clazz.isAnonymousClass()|| clazz.isMemberClass()) {
    throw new IllegalClassException(clazz);
  }
  if (clazz.isArray()) {
    if (!isAcceptableRemoteType(clazz.getComponentType())) {
      final Object[] a=(Object[])value;
      for (      final Object o : a) {
        checkLegalForRemote(o);
      }
    }
  }
 else   if (Collection.class.isAssignableFrom(clazz)) {
    final Collection<?> items=(Collection)value;
    for (    final Object o : items) {
      checkLegalForRemote(o);
    }
  }
 else   if (Map.class.isAssignableFrom(clazz)) {
    final Map<?,?> items=(Map)value;
    for (    final Object key : items.keySet()) {
      checkLegalForRemote(key);
      checkLegalForRemote(items.get(key));
    }
  }
 else {
    throw new IllegalClassException(clazz);
  }
}

Fixed version (ground truth):
/** 
 * "best effort"<p> Attributes that cannot be sent to generic clients are not allowed. More than OpenTypes are allowed eg messy stuff like JSR 77 Stats and Statistics.
 */
private static void checkLegalForRemote(final Object value) throws IllegalClassException {
  if (value == null) {
    return;
  }
  final Class<?> clazz=value.getClass();
  if (isAcceptableRemoteType(clazz)) {
    return;
  }
  if (clazz.isSynthetic() || clazz.isLocalClass() || clazz.isAnonymousClass()|| clazz.isMemberClass()) {
    throw new IllegalClassException(clazz);
  }
  if (clazz.isArray()) {
    if (!isAcceptableRemoteType(clazz.getComponentType())) {
      final Object[] a=(Object[])value;
      for (      final Object o : a) {
        checkLegalForRemote(o);
      }
    }
  }
 else   if (Collection.class.isAssignableFrom(clazz)) {
    final Collection<?> items=(Collection)value;
    for (    final Object o : items) {
      checkLegalForRemote(o);
    }
  }
 else   if (Map.class.isAssignableFrom(clazz)) {
    final Map<?,?> items=(Map)value;
    for (    final Map.Entry me : items.entrySet()) {
      checkLegalForRemote(me.getKey());
      checkLegalForRemote(me.getValue());
    }
  }
 else {
    throw new IllegalClassException(clazz);
  }
}
Program: 29317
Project: 29317
Buggy source:
private void validateObjectName(final AMXProxy proxy) throws ValidationFailureException {
  final ObjectName objectName=proxy.objectName();
  final String type=objectName.getKeyProperty("String_Node_Str");
  if (type == null || type.length() == 0) {
    fail(objectName,"String_Node_Str");
  }
  if (!TYPE_PATTERN.matcher(type).matches()) {
    fail(objectName,"String_Node_Str" + type + "String_Node_Str"+ TYPE_PATTERN.pattern());
  }
  final String nameProp=objectName.getKeyProperty("String_Node_Str");
  if (nameProp != null) {
    if (nameProp.length() == 0) {
      fail(objectName,"String_Node_Str");
    }
    if (!NAME_PATTERN.matcher(nameProp).matches()) {
      fail(objectName,"String_Node_Str" + nameProp + "String_Node_Str"+ NAME_PATTERN.pattern());
    }
  }
 else {
    final String name=proxy.getName();
    if (!proxy.extra().singleton()) {
      fail(objectName,"String_Node_Str");
    }
  }
  if (proxy.parent() != null) {
    if (!proxy.parentPath().equals(proxy.parent().path())) {
      fail(objectName,"String_Node_Str" + proxy.parentPath() + "String_Node_Str"+ proxy.parent().objectName());
    }
  }
}

Fixed version (ground truth):
private void validateObjectName(final AMXProxy proxy) throws ValidationFailureException {
  final ObjectName objectName=proxy.objectName();
  final String type=objectName.getKeyProperty("String_Node_Str");
  if (type == null || type.length() == 0) {
    fail(objectName,"String_Node_Str");
  }
  if (!TYPE_PATTERN.matcher(type).matches()) {
    fail(objectName,"String_Node_Str" + type + "String_Node_Str"+ TYPE_PATTERN.pattern());
  }
  final String nameProp=objectName.getKeyProperty("String_Node_Str");
  if (nameProp != null) {
    if (nameProp.length() == 0) {
      fail(objectName,"String_Node_Str");
    }
    if (!NAME_PATTERN.matcher(nameProp).matches()) {
      fail(objectName,"String_Node_Str" + nameProp + "String_Node_Str"+ NAME_PATTERN.pattern());
    }
  }
 else {
    if (!proxy.extra().singleton()) {
      fail(objectName,"String_Node_Str");
    }
  }
  if (proxy.parent() != null) {
    if (!proxy.parentPath().equals(proxy.parent().path())) {
      fail(objectName,"String_Node_Str" + proxy.parentPath() + "String_Node_Str"+ proxy.parent().objectName());
    }
  }
}
Program: 29318
Project: 29318
Buggy source:
private void validateAMXConfig(final AMXProxy proxy,final ProblemList problems) throws InstanceNotFoundException {
  if (!AMXConfigProxy.class.isAssignableFrom(proxy.extra().genericInterface())) {
    return;
  }
  final AMXConfigProxy config=proxy.as(AMXConfigProxy.class);
  if (!config.type().equals("String_Node_Str")) {
    if (!AMXConfigProxy.class.isAssignableFrom(config.parent().extra().genericInterface())) {
      problems.add("String_Node_Str" + config.objectName() + "String_Node_Str"+ config.getParent());
    }
  }
  final Map<String,String> defaultValues=config.getDefaultValues(false);
  final Map<String,String> defaultValuesAMX=config.getDefaultValues(true);
  if (defaultValues.keySet().size() != defaultValuesAMX.keySet().size()) {
    problems.add("String_Node_Str" + defaultValues.keySet().size() + "String_Node_Str"+ defaultValuesAMX.keySet().size());
  }
  for (  final String key : defaultValues.keySet()) {
    final Object value=defaultValues.get(key);
    if (value == null) {
      problems.add("String_Node_Str" + key);
    }
 else     if (!(value instanceof String)) {
      problems.add("String_Node_Str" + key);
    }
  }
  final String[] subTypes=config.extra().subTypes();
  if (subTypes != null) {
    for (    final String subType : subTypes) {
      final Map<String,String> subTypeDefaults=config.getDefaultValues(subType,false);
    }
  }
}

Fixed version (ground truth):
private void validateAMXConfig(final AMXProxy proxy,final ProblemList problems) throws InstanceNotFoundException {
  if (!AMXConfigProxy.class.isAssignableFrom(proxy.extra().genericInterface())) {
    return;
  }
  final AMXConfigProxy config=proxy.as(AMXConfigProxy.class);
  if (!config.type().equals("String_Node_Str")) {
    if (!AMXConfigProxy.class.isAssignableFrom(config.parent().extra().genericInterface())) {
      problems.add("String_Node_Str" + config.objectName() + "String_Node_Str"+ config.getParent());
    }
  }
  final Map<String,String> defaultValues=config.getDefaultValues(false);
  final Map<String,String> defaultValuesAMX=config.getDefaultValues(true);
  if (defaultValues.keySet().size() != defaultValuesAMX.keySet().size()) {
    problems.add("String_Node_Str" + defaultValues.keySet().size() + "String_Node_Str"+ defaultValuesAMX.keySet().size());
  }
  for (  final Map.Entry<String,String> me : defaultValues.entrySet()) {
    final Object value=me.getValue();
    if (value == null) {
      problems.add("String_Node_Str" + me.getKey());
    }
 else     if (!(value instanceof String)) {
      problems.add("String_Node_Str" + me.getKey());
    }
  }
  final String[] subTypes=config.extra().subTypes();
  if (subTypes != null) {
    for (    final String subType : subTypes) {
      config.getDefaultValues(subType,false);
    }
  }
}
Program: 29322
Project: 29322
Buggy source:
public String toString(){
  return details();
}

Fixed version (ground truth):
@Override public String toString(){
  return details();
}
Program: 29323
Project: 29323
Buggy source:
/** 
 * Filter the AMX dynamic proxies to those that implement the specified interface, and return a new Map with the matching items.  The 'desired' interface can be any AMX-defined class, including the mixin ones.
 * @param candidates the Map to be filtered
 * @param desired the interface to filter by
 */
public static <T extends AMXProxy>Map<String,T> filterAMX(final Map<String,T> candidates,final Class<?> desired){
  final Map<String,T> result=new HashMap<String,T>();
  for (  final String key : candidates.keySet()) {
    final T amx=candidates.get(key);
    if (desired.isAssignableFrom(amx.getClass())) {
      result.put(key,amx);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Filter the AMX dynamic proxies to those that implement the specified interface, and return a new Map with the matching items.  The 'desired' interface can be any AMX-defined class, including the mixin ones.
 * @param candidates the Map to be filtered
 * @param desired the interface to filter by
 */
public static <T extends AMXProxy>Map<String,T> filterAMX(final Map<String,T> candidates,final Class<?> desired){
  final Map<String,T> result=new HashMap<String,T>();
  for (  final Map.Entry<String,T> e : candidates.entrySet()) {
    final T amx=e.getValue();
    if (desired.isAssignableFrom(amx.getClass())) {
      result.put(e.getKey(),amx);
    }
  }
  return result;
}
Program: 29324
Project: 29324
Buggy source:
/** 
 * Extract all properties other than type=<type>,name=<name>.
 * @param objectName
 */
public static String getAdditionalProps(final ObjectName objectName){
  final java.util.Hashtable allProps=objectName.getKeyPropertyList();
  allProps.remove(TYPE_KEY);
  allProps.remove(NAME_KEY);
  String props="String_Node_Str";
  for (  final Object key : allProps.keySet()) {
    final String prop=makeProp((String)key,(String)allProps.get(key));
    props=concatenateProps(props,prop);
  }
  return props;
}

Fixed version (ground truth):
/** 
 * Extract all properties other than type=<type>,name=<name>.
 * @param objectName
 */
public static String getAdditionalProps(final ObjectName objectName){
  final java.util.Hashtable<String,String> allProps=objectName.getKeyPropertyList();
  allProps.remove(TYPE_KEY);
  allProps.remove(NAME_KEY);
  String props="String_Node_Str";
  for (  final Map.Entry<String,String> e : allProps.entrySet()) {
    final String prop=makeProp(e.getKey(),e.getValue());
    props=concatenateProps(props,prop);
  }
  return props;
}
Program: 29325
Project: 29325
Buggy source:
/** 
 * @return a Map of ObjectNames from a Map whose values are AMX.
 */
public static Map<String,ObjectName> toObjectNameMap(final Map<String,? extends AMXProxy> amxMap){
  final Map<String,ObjectName> m=new HashMap<String,ObjectName>();
  for (  final String key : amxMap.keySet()) {
    final AMXProxy value=amxMap.get(key);
    m.put(key,value.objectName());
  }
  return (Collections.checkedMap(m,String.class,ObjectName.class));
}

Fixed version (ground truth):
/** 
 * @return a Map of ObjectNames from a Map whose values are AMX.
 */
public static Map<String,ObjectName> toObjectNameMap(final Map<String,? extends AMXProxy> amxMap){
  final Map<String,ObjectName> m=new HashMap<String,ObjectName>();
  for (  final Map.Entry<String,? extends AMXProxy> e : amxMap.entrySet()) {
    final AMXProxy value=e.getValue();
    m.put(e.getKey(),value.objectName());
  }
  return (Collections.checkedMap(m,String.class,ObjectName.class));
}
Program: 29326
Project: 29326
Buggy source:
private static String domConvertName(final String nameIn){
  String name=nameIn;
  for (  final String p : PROPERTY_PREFIX) {
    if (name.startsWith(p)) {
      name=name.substring(p.length());
      break;
    }
  }
  final StringBuilder buf=new StringBuilder(name.length() + 5);
  for (  final String t : TOKENIZER.split(name)) {
    if (buf.length() > 0) {
      buf.append('-');
    }
    buf.append(t.toLowerCase());
  }
  return buf.toString();
}

Fixed version (ground truth):
private static String domConvertName(final String nameIn){
  String name=nameIn;
  for (  final String p : PROPERTY_PREFIX) {
    if (name.startsWith(p)) {
      name=name.substring(p.length());
      break;
    }
  }
  final StringBuilder buf=new StringBuilder(name.length() + 5);
  for (  final String t : TOKENIZER.split(name)) {
    if (buf.length() > 0) {
      buf.append('-');
    }
    buf.append(t.toLowerCase(Locale.ENGLISH));
  }
  return buf.toString();
}
Program: 29327
Project: 29327
Buggy source:
/** 
 */
private ConfigBean getActualParent(final ConfigBean configBean){
  ConfigBean parent=asConfigBean(configBean.parent());
  if (parent != null) {
    final ObjectName parentObjectName=mRegistry.getObjectName(parent);
  }
 else {
    if (!configBean.getProxyType().getName().endsWith("String_Node_Str")) {
      throw new IllegalStateException("String_Node_Str" + configBean.getProxyType().getName() + "String_Node_Str");
    }
  }
  return parent;
}

Fixed version (ground truth):
/** 
 */
private ConfigBean getActualParent(final ConfigBean configBean){
  ConfigBean parent=asConfigBean(configBean.parent());
  if (parent == null) {
    if (!configBean.getProxyType().getName().endsWith("String_Node_Str")) {
      throw new IllegalStateException("String_Node_Str" + configBean.getProxyType().getName() + "String_Node_Str");
    }
  }
  return parent;
}
Program: 29328
Project: 29328
Buggy source:
private void issueAttributeChange(final ConfigBean cb,final String xmlAttrName,final Object oldValue,final Object newValue,final long whenChanged){
  final ObjectName objectName=mRegistry.getObjectName(cb);
  if (objectName == null) {
    throw new IllegalArgumentException("String_Node_Str" + cb.getProxyType().getName());
  }
  boolean changed=false;
  if (oldValue != null) {
    changed=!oldValue.equals(newValue);
  }
 else   if (newValue != null) {
    changed=!newValue.equals(oldValue);
  }
  if (changed) {
    final Object impl=mRegistry.getImpl(cb);
    if (!(impl instanceof AMXConfigImpl)) {
      throw new IllegalStateException("String_Node_Str");
    }
    final AMXConfigImpl amx=(AMXConfigImpl)impl;
    final String message=cb.getProxyType().getName() + "String_Node_Str" + xmlAttrName+ "String_Node_Str"+ oldValue+ "String_Node_Str"+ newValue;
    amx.issueAttributeChangeForXmlAttrName(xmlAttrName,message,oldValue,newValue,whenChanged);
  }
}

Fixed version (ground truth):
private void issueAttributeChange(final ConfigBean cb,final String xmlAttrName,final Object oldValue,final Object newValue,final long whenChanged){
  final ObjectName objectName=mRegistry.getObjectName(cb);
  if (objectName == null) {
    throw new IllegalArgumentException("String_Node_Str" + cb.getProxyType().getName());
  }
  boolean changed=false;
  if (oldValue != null) {
    changed=!oldValue.equals(newValue);
  }
 else   if (newValue != null) {
    changed=true;
  }
  if (changed) {
    final Object impl=mRegistry.getImpl(cb);
    if (!(impl instanceof AMXConfigImpl)) {
      throw new IllegalStateException("String_Node_Str");
    }
    final AMXConfigImpl amx=(AMXConfigImpl)impl;
    final String message=cb.getProxyType().getName() + "String_Node_Str" + xmlAttrName+ "String_Node_Str"+ oldValue+ "String_Node_Str"+ newValue;
    amx.issueAttributeChangeForXmlAttrName(xmlAttrName,message,oldValue,newValue,whenChanged);
  }
}
Program: 29330
Project: 29330
Buggy source:
protected void doRun() throws Exception {
  PendingConfigBeanJob job=mPending.take();
  while ((!mQuit) && job != null) {
    final ObjectName objectName=registerOne(job);
    job=mPending.peek();
    if (job != null) {
      job=mPending.take();
    }
  }
  mInitalQueueLatch.countDown();
  while (!mQuit) {
    job=mPending.take();
    registerOne(job);
  }
}

Fixed version (ground truth):
protected void doRun() throws Exception {
  PendingConfigBeanJob job=mPending.take();
  while ((!mQuit) && job != null) {
    registerOne(job);
    job=mPending.peek();
    if (job != null) {
      job=mPending.take();
    }
  }
  mInitalQueueLatch.countDown();
  while (!mQuit) {
    job=mPending.take();
    registerOne(job);
  }
}
Program: 29331
Project: 29331
Buggy source:
private ObjectName createAndRegister(final ConfigBean cb,final ObjectName objectNameIn){
  ObjectName objectName=objectNameIn;
  final String type=objectNameIn.getKeyProperty(AMX.TYPE_KEY);
  ObjectName parentObjectName=getActualParentObjectName(cb);
  if (parentObjectName == null) {
    parentObjectName=AMXGlassfish.DEFAULT.domainRoot();
  }
  final AMXConfigImpl impl=new AMXConfigImpl(parentObjectName,cb);
  try {
    final ObjectInstance instance=mServer.registerMBean(impl,objectNameIn);
    objectName=instance.getObjectName();
    mRegistry.add(cb,objectName,impl);
  }
 catch (  final JMException e) {
    debug(ExceptionUtil.toString(e));
    objectName=null;
  }
  return objectName;
}

Fixed version (ground truth):
private ObjectName createAndRegister(final ConfigBean cb,final ObjectName objectNameIn){
  ObjectName objectName;
  ObjectName parentObjectName=getActualParentObjectName(cb);
  if (parentObjectName == null) {
    parentObjectName=AMXGlassfish.DEFAULT.domainRoot();
  }
  final AMXConfigImpl impl=new AMXConfigImpl(parentObjectName,cb);
  try {
    final ObjectInstance instance=mServer.registerMBean(impl,objectNameIn);
    objectName=instance.getObjectName();
    mRegistry.add(cb,objectName,impl);
  }
 catch (  final JMException e) {
    debug(ExceptionUtil.toString(e));
    objectName=null;
  }
  return objectName;
}
Program: 29332
Project: 29332
Buggy source:
public synchronized void unloadAMXMBeans(){
  final AMXProxy domainConfigProxy=getDomainConfigProxy();
  if (domainConfigProxy != null) {
    ImplUtil.unregisterAMXMBeans(domainConfigProxy);
  }
  mLoader.stop();
  mLoader=null;
}

Fixed version (ground truth):
public synchronized void unloadAMXMBeans(){
  final AMXProxy domainConfigProxy=getDomainConfigProxy();
  if (domainConfigProxy != null) {
    ImplUtil.unregisterAMXMBeans(domainConfigProxy);
  }
  if (mLoader != null) {
    mLoader.stop();
  }
  mLoader=null;
}
Program: 29333
Project: 29333
Buggy source:
/** 
 * Get an Attribute value, first by looking for a getter method of the correct name and signature, then by looking for a delegate, and finally by calling getAttributeManually(), which a subclass is expected to override.
 * @param name	name of the Attribute
 * @return value of the Attribute
 */
public final Object getAttribute(final String name) throws AttributeNotFoundException {
  Object result=null;
  if (name == null) {
    throw new AttributeNotFoundException("String_Node_Str" + name + "String_Node_Str"+ getObjectName());
  }
  try {
    result=getAttributeInternal(name);
  }
 catch (  AttributeNotFoundException e) {
    throw e;
  }
catch (  Exception e) {
    throw new AttributeNotFoundException(name);
  }
  return (result);
}

Fixed version (ground truth):
/** 
 * Get an Attribute value, first by looking for a getter method of the correct name and signature, then by looking for a delegate, and finally by calling getAttributeManually(), which a subclass is expected to override.
 * @param name	name of the Attribute
 * @return value of the Attribute
 */
public final Object getAttribute(final String name) throws AttributeNotFoundException {
  Object result=null;
  if (name == null) {
    throw new AttributeNotFoundException("String_Node_Str" + getObjectName());
  }
  try {
    result=getAttributeInternal(name);
  }
 catch (  AttributeNotFoundException e) {
    throw e;
  }
catch (  Exception e) {
    throw new AttributeNotFoundException(name);
  }
  return (result);
}
Program: 29334
Project: 29334
Buggy source:
protected void postRegisterHook(final Boolean registrationSucceeded){
  if (registrationSucceeded.booleanValue()) {
  }
}

Fixed version (ground truth):
protected void postRegisterHook(final Boolean registrationSucceeded){
}
Program: 29335
Project: 29335
Buggy source:
protected static String toString(Object o){
  if (o == null) {
    return ("String_Node_Str" + o);
  }
  return (SmartStringifier.toString(o));
}

Fixed version (ground truth):
protected static String toString(Object o){
  if (o == null) {
    return ("String_Node_Str");
  }
  return (SmartStringifier.toString(o));
}
Program: 29336
Project: 29336
Buggy source:
public int compareTo(final ParentChildren rhs){
  int cmp=mParent.type().compareTo(rhs.mParent.type());
  if (cmp == 0) {
    cmp=mParent.nameProp().compareTo(rhs.mParent.nameProp());
  }
  if (cmp == 0) {
    cmp=mChildren.size() - rhs.mChildren.size();
  }
  return cmp;
}

Fixed version (ground truth):
@Override public int compareTo(final ParentChildren rhs){
  int cmp=mParent.type().compareTo(rhs.mParent.type());
  if (cmp == 0) {
    cmp=mParent.nameProp().compareTo(rhs.mParent.nameProp());
  }
  if (cmp == 0) {
    cmp=mChildren.size() - rhs.mChildren.size();
  }
  return cmp;
}
Program: 29337
Project: 29337
Buggy source:
/** 
 * Constructs a coordinator
 * @param work     A work object as submitted by the resource adapter
 * @param timeout  timeout for the work instance
 * @param ec       ExecutionContext object.
 * @param queue    WorkQueue of the threadpool, to which the workwill be submitted
 * @param listener WorkListener object from the resource adapter.
 */
public WorkCoordinator(javax.resource.spi.work.Work work,long timeout,ExecutionContext ec,WorkQueue queue,WorkListener listener,WorkManagementProbeProvider probeProvider,ConnectorRuntime runtime,String raName,WorkContextHandlerImpl handler){
  this.work=work;
  this.timeout=timeout;
  this.ec=ec;
  this.queue=queue;
  this.listener=listener;
synchronized (WorkCoordinator.class) {
    this.id=increaseSeed();
  }
  this.runtime=runtime;
  this.lock=new Object();
  this.probeProvider=probeProvider;
  this.raName=raName;
  this.contextHandler=handler;
}

Fixed version (ground truth):
/** 
 * Constructs a coordinator
 * @param work     A work object as submitted by the resource adapter
 * @param timeout  timeout for the work instance
 * @param ec       ExecutionContext object.
 * @param queue    WorkQueue of the threadpool, to which the workwill be submitted
 * @param listener WorkListener object from the resource adapter.
 */
public WorkCoordinator(javax.resource.spi.work.Work work,long timeout,ExecutionContext ec,WorkQueue queue,WorkListener listener,WorkManagementProbeProvider probeProvider,ConnectorRuntime runtime,String raName,WorkContextHandlerImpl handler){
  this.work=work;
  this.timeout=timeout;
  this.ec=ec;
  this.queue=queue;
  this.listener=listener;
  this.id=increaseSeed();
  this.runtime=runtime;
  this.lock=new Object();
  this.probeProvider=probeProvider;
  this.raName=raName;
  this.contextHandler=handler;
}
Program: 29338
Project: 29338
Buggy source:
public static int increaseSeed(){
  return ++seed;
}

Fixed version (ground truth):
public static synchronized int increaseSeed(){
  return ++seed;
}
Program: 29340
Project: 29340
Buggy source:
/** 
 * Marks the completion of MDB deployment. Unblocks the createEndPoint method call.
 * @throws Exception
 */
public void start() throws Exception {
  logger.logp(Level.FINEST,"String_Node_Str","String_Node_Str","String_Node_Str");
  started_=true;
  myState=UNBLOCKED;
synchronized (this) {
    notifyAll();
  }
}

Fixed version (ground truth):
/** 
 * Marks the completion of MDB deployment. Unblocks the createEndPoint method call.
 * @throws Exception
 */
public void start() throws Exception {
  logger.logp(Level.FINEST,"String_Node_Str","String_Node_Str","String_Node_Str");
  started_=true;
synchronized (this) {
    myState=UNBLOCKED;
    notifyAll();
  }
}
Program: 29341
Project: 29341
Buggy source:
/** 
 * This is the same implementation in com.sun.ejb.container.InvocationHandlerUtil Need to abstract out at some point.
 */
private Object invokeJavaObjectMethod(InvocationHandler handler,Method method,Object[] args) throws RuntimeException {
  Object returnValue=null;
switch (method.getName().charAt(0)) {
case 'e':
    Object other=Proxy.isProxyClass(args[0].getClass()) ? Proxy.getInvocationHandler(args[0]) : args[0];
  returnValue=new Boolean(handler.equals(other));
break;
case 'h':
returnValue=new Integer(handler.hashCode());
break;
case 't':
returnValue=handler.toString();
break;
default :
throw new RuntimeException(method.getName());
}
return returnValue;
}

Fixed version (ground truth):
/** 
 * This is the same implementation in com.sun.ejb.container.InvocationHandlerUtil Need to abstract out at some point.
 */
private Object invokeJavaObjectMethod(InvocationHandler handler,Method method,Object[] args) throws RuntimeException {
  Object returnValue=null;
switch (method.getName().charAt(0)) {
case 'e':
    Object other=Proxy.isProxyClass(args[0].getClass()) ? Proxy.getInvocationHandler(args[0]) : args[0];
  returnValue=Boolean.valueOf(handler.equals(other));
break;
case 'h':
returnValue=Integer.valueOf(handler.hashCode());
break;
case 't':
returnValue=handler.toString();
break;
default :
throw new RuntimeException(method.getName());
}
return returnValue;
}
Program: 29342
Project: 29342
Buggy source:
/** 
 * check whether the jndi Name has connector related suffix and return if any.
 * @param name jndi name
 * @return suffix, if found
 */
public static String getValidSuffix(String name){
  if (name != null) {
    for (    String validSuffix : JNDI_SUFFIX_VALUES) {
      if (name.endsWith(validSuffix)) {
        return validSuffix;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * check whether the jndi Name has connector related suffix and return if any.
 * @param name jndi name
 * @return suffix, if found
 */
public static String getValidSuffix(String name){
  if (name != null) {
    for (    String validSuffix : ConnectorConstants.JNDI_SUFFIX_VALUES) {
      if (name.endsWith(validSuffix)) {
        return validSuffix;
      }
    }
  }
  return null;
}
Program: 29343
Project: 29343
Buggy source:
/** 
 * If the suffix is one of the valid context return true. Return false, if that is not the case.
 * @param suffix __nontx / __pm
 * @return boolean whether the suffix is valid or not
 */
public static boolean isValidJndiSuffix(String suffix){
  if (suffix != null) {
    for (    String validSuffix : JNDI_SUFFIX_VALUES) {
      if (validSuffix.equals(suffix)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * If the suffix is one of the valid context return true. Return false, if that is not the case.
 * @param suffix __nontx / __pm
 * @return boolean whether the suffix is valid or not
 */
public static boolean isValidJndiSuffix(String suffix){
  if (suffix != null) {
    for (    String validSuffix : ConnectorConstants.JNDI_SUFFIX_VALUES) {
      if (validSuffix.equals(suffix)) {
        return true;
      }
    }
  }
  return false;
}
Program: 29344
Project: 29344
Buggy source:
protected void installDeploymentFactory(File installedDM) throws IOException {
  if (sLogger.isLoggable(Level.FINE)) {
    sLogger.fine("String_Node_Str" + installedDM.getAbsolutePath());
  }
  JarFile jarFile=null;
  Manifest m=null;
  try {
    jarFile=new JarFile(installedDM);
    m=jarFile.getManifest();
  }
  finally {
    jarFile.close();
    jarFile=null;
  }
  String className=m.getMainAttributes().getValue(J2EE_DEPLOYMENT_MANAGER);
  URL[] urls=new URL[]{installedDM.toURI().toURL()};
  URLClassLoader urlClassLoader=new java.net.URLClassLoader(urls,getClass().getClassLoader());
  Class factory=null;
  try {
    factory=urlClassLoader.loadClass(className);
  }
 catch (  ClassNotFoundException cnfe) {
    sLogger.log(Level.SEVERE,"String_Node_Str",new Object[]{"String_Node_Str"});
    throw new IllegalArgumentException(className + "String_Node_Str" + installedDM.getName());
  }
  Object df=null;
  try {
    df=factory.newInstance();
  }
 catch (  Exception ie) {
    sLogger.log(Level.SEVERE,"String_Node_Str",new Object[]{className});
    sLogger.log(Level.SEVERE,"String_Node_Str",ie);
    throw new IllegalArgumentException("String_Node_Str" + installedDM.getName());
  }
  if (df instanceof DeploymentFactory) {
    DeploymentFactoryManager.getInstance().registerDeploymentFactory((DeploymentFactory)df);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + className + "String_Node_Str");
  }
}

Fixed version (ground truth):
protected void installDeploymentFactory(final File installedDM) throws IOException {
  if (sLogger.isLoggable(Level.FINE)) {
    sLogger.fine("String_Node_Str" + installedDM.getAbsolutePath());
  }
  Manifest m=null;
  JarFile jarFile=new JarFile(installedDM);
  try {
    m=jarFile.getManifest();
  }
  finally {
    jarFile.close();
  }
  String className=m.getMainAttributes().getValue(J2EE_DEPLOYMENT_MANAGER);
  final URL[] urls=new URL[]{installedDM.toURI().toURL()};
  URLClassLoader urlClassLoader;
  urlClassLoader=AccessController.doPrivileged(new PrivilegedAction<URLClassLoader>(){
    public URLClassLoader run(){
      return new java.net.URLClassLoader(urls,getClass().getClassLoader());
    }
  }
);
  Class factory=null;
  try {
    factory=urlClassLoader.loadClass(className);
  }
 catch (  ClassNotFoundException cnfe) {
    sLogger.log(Level.SEVERE,"String_Node_Str",new Object[]{"String_Node_Str"});
    throw new IllegalArgumentException(className + "String_Node_Str" + installedDM.getName());
  }
  Object df=null;
  try {
    df=factory.newInstance();
  }
 catch (  Exception ie) {
    sLogger.log(Level.SEVERE,"String_Node_Str",new Object[]{className});
    sLogger.log(Level.SEVERE,"String_Node_Str",ie);
    throw new IllegalArgumentException("String_Node_Str" + installedDM.getName());
  }
  if (df instanceof DeploymentFactory) {
    DeploymentFactoryManager.getInstance().registerDeploymentFactory((DeploymentFactory)df);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + className + "String_Node_Str");
  }
}